/* ═══════════════════════════════════════════════
   Ed Tsue — Portfolio
   ═══════════════════════════════════════════════ */

/* ── Tokens ───────────────────────────────────── */
:root {
  --bg:        #0C0C0C;
  --bg-2:      #111111;
  --bg-card:   #171717;
  --text:      #F2F2EE;
  --muted:     #555;
  --muted-2:   #888;
  --accent:    #C8FF00;
  --border:    rgba(255, 255, 255, 0.07);
  --border-2:  rgba(255, 255, 255, 0.14);

  --font-display: 'Space Grotesk', sans-serif;
  --font-body:    'DM Sans', sans-serif;

  --max-w:  1200px;
  --gutter: clamp(24px, 5vw, 80px);
  --radius: 10px;
}

/* ── Reset ────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── Cursor Trail ─────────────────────────────── */
.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  will-change: transform;
  transform: translate(-50%, -50%);
}

/* ── Nav ──────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(12, 12, 12, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.nav-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted-2);
  letter-spacing: 0.02em;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }

.nav-linkedin {
  color: #7DD3FC !important;
}
.nav-linkedin:hover { opacity: 0.75; }

/* ── Hero ─────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  padding: 120px var(--gutter) 80px;
}

.hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
}

.hero-eyebrow {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 28px;
}

.hero-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(76px, 14vw, 200px);
  line-height: 0.88;
  letter-spacing: -0.04em;
  color: var(--text);
  margin-bottom: 48px;
  margin-left: -0.04em;
}

.hero-bottom {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: flex-end;
  gap: 40px;
}

/* ── Typewriter cursor ────────────────────────── */
.type-cursor {
  display: inline-block;
  color: var(--accent);
  font-weight: 300;
  margin-left: 2px;
  animation: blink 0.7s step-end infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.hero-tagline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.35rem, 2.6vw, 2rem);
  line-height: 1.22;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 16px;
  max-width: 38ch;
}

.hero-sub {
  font-size: 0.875rem;
  color: var(--muted-2);
  line-height: 1.75;
  max-width: 600px;
}

.hero-brands {
  color: #7DD3FC;
}
.hero-brands-text {
  color: #7DD3FC;
}

.hero-award-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(200,255,0,0.35);
  transition: text-decoration-color 0.2s;
}
.hero-award-link:hover { text-decoration-color: var(--accent); }

.hero-ctas {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
  flex-shrink: 0;
}

.hero-cta {
  flex-shrink: 0;
  display: block;
  text-align: center;
  padding: 13px 28px;
  border: 1.5px solid #7DD3FC;
  color: #7DD3FC;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 40px;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
  background: none;
  cursor: pointer;
}
.hero-cta:hover {
  background: #7DD3FC;
  color: var(--bg);
}

.hero-cta--chat {
  border-color: var(--accent);
  color: var(--accent);
}
.hero-cta--chat:hover {
  background: var(--accent);
  color: var(--bg);
}

/* ── CV Chat Modal ────────────────────────────── */
.cv-modal {
  max-width: 560px;
  display: flex;
  flex-direction: column;
  height: min(720px, 90dvh);
  padding: 0;
  overflow: hidden;
}

.cv-modal .modal-header {
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
  flex-shrink: 0;
}

.cv-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: none;
}
.cv-chat-messages::-webkit-scrollbar { display: none; }

.cv-msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.875rem;
  line-height: 1.6;
}
.cv-msg p + p {
  margin-top: 10px;
}

.cv-msg--bot {
  background: var(--bg-2);
  border: 1px solid var(--border);
  align-self: flex-start;
  border-radius: 4px 12px 12px 12px;
  color: var(--text);
}
.cv-msg--bot em {
  color: #7DD3FC;
  font-style: normal;
}

.cv-msg--user {
  background: #7DD3FC;
  color: #0C0C0C;
  align-self: flex-end;
  border-radius: 12px 4px 12px 12px;
  font-weight: 500;
}

.cv-msg--typing span {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--muted-2);
  border-radius: 50%;
  animation: typing-dot 1.2s infinite;
  margin: 0 2px;
}
.cv-msg--typing span:nth-child(2) { animation-delay: 0.2s; }
.cv-msg--typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-dot {
  0%, 60%, 100% { opacity: 0.2; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}

.cv-chat-footer {
  padding: 12px 28px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.cv-download {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted-2);
  text-decoration: none;
  transition: color 0.2s;
}
.cv-download:hover { color: var(--text); }

.cv-chat-prompt {
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
}

.cv-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  align-self: flex-start;
  max-width: 100%;
}

.cv-suggestion {
  font-size: 0.75rem;
  padding: 6px 12px;
  border: 1px solid #7DD3FC;
  color: #7DD3FC;
  border-radius: 20px;
  cursor: pointer;
  background: none;
  font-family: var(--font-body);
  transition: background 0.2s, color 0.2s;
  text-align: left;
  line-height: 1.3;
}
.cv-suggestion:hover {
  background: #7DD3FC;
  color: var(--bg);
}

.cv-suggestion--download {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}
.cv-suggestion--download:hover {
  background: var(--accent);
  color: var(--bg);
}

/* ── Shared ───────────────────────────────────── */
section { padding: 100px var(--gutter); }

.section-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

.section-label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.8rem, 3.5vw, 3rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 52px;
}

.section-intro {
  font-size: 0.95rem;
  color: var(--muted-2);
  margin-top: -36px;
  margin-bottom: 52px;
  max-width: 480px;
  line-height: 1.7;
}

/* ── Work / Carousel ──────────────────────────── */
.work {
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.carousel-wrap {
  position: relative;
  padding: 0 28px;
}

/* Right-edge fade hint */
.carousel-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  bottom: 72px; /* above controls */
  background: linear-gradient(to right, transparent, var(--bg));
  pointer-events: none;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.carousel {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  cursor: grab;
}
.carousel.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.carousel::-webkit-scrollbar { display: none; }
.carousel { -ms-overflow-style: none; scrollbar-width: none; }

/* ── Work Card Stagger (disabled – cards preloaded in carousel) */

/* ── Work Card ────────────────────────────────── */
.work-card {
  flex: 0 0 calc(33.333% - 14px);
  min-width: 280px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
}
.work-card {
  transition: border-color 0.25s, transform 0.25s;
}
.work-card:hover {
  border-color: var(--border-2);
  transform: translateY(-5px);
}

/* Thumbnail */
.work-thumb {
  aspect-ratio: 16 / 9;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Gradient themes per card */
[data-thumb="1"] .work-thumb { background-image: url(https://img.youtube.com/vi/8xInkzf3ISs/maxresdefault.jpg); background-size: cover; background-position: center; }
[data-thumb="2"] .work-thumb { background: linear-gradient(145deg, #1c0800 0%, #5c2200 60%, #8a3800 100%); }
[data-thumb="3"] .work-thumb { background-image: url(https://img.youtube.com/vi/cEQB2LAG4Hg/maxresdefault.jpg); background-size: cover; background-position: center; }
[data-thumb="3b"] .work-thumb { background-image: url(https://img.youtube.com/vi/VsNbVS98nTU/hqdefault.jpg); background-size: cover; background-position: center; }
[data-thumb="4"] .work-thumb { background-image: url(https://img.youtube.com/vi/-J7y78CHd4g/maxresdefault.jpg); background-size: cover; background-position: center; }
[data-thumb="5"] .work-thumb { background-image: url(https://img.youtube.com/vi/_ajONMjOC9s/maxresdefault.jpg); background-size: cover; background-position: center; }
[data-thumb="6"] .work-thumb { background-image: url(https://img.youtube.com/vi/P3dudEBe3E8/maxresdefault.jpg); background-size: cover; background-position: center; }
[data-thumb="7"] .work-thumb { background-image: url(https://img.youtube.com/vi/r2RfuOvKAU0/maxresdefault.jpg); background-size: cover; background-position: center; }
[data-thumb="8"] .work-thumb { background-image: url(https://img.youtube.com/vi/Rey1sjHYhIA/maxresdefault.jpg); background-size: cover; background-position: center; }

/* Subtle noise texture overlay */
.work-thumb::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

.thumb-type {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(0,0,0,0.55);
  color: rgba(255,255,255,0.7);
}

.thumb-type--award {
  background: rgba(180, 130, 0, 0.35);
  color: #ffd060;
}

.thumb-play {
  font-size: 1.4rem;
  color: rgba(255,255,255,0.25);
  transition: color 0.2s;
  line-height: 1;
}
.work-card:hover .thumb-play { color: rgba(255,255,255,0.55); }

.thumb-award-icon { font-size: 2.2rem; }

/* Card body */
.work-body {
  padding: 20px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.work-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.work-desc {
  font-size: 0.82rem;
  color: var(--muted-2);
  line-height: 1.65;
  flex: 1;
}

/* Carousel controls — left/right arrows */
.carousel-btn {
  position: absolute;
  top: calc(50% - 36px); /* center on thumb area, above card text */
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1.5px solid var(--border-2);
  background: rgba(12,12,12,0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  line-height: 1;
  z-index: 10;
}
.carousel-btn--prev { left: -21px; }
.carousel-btn--next { right: -21px; }
.carousel-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(12,12,12,0.95);
}
.carousel-btn:disabled {
  opacity: 0.2;
  cursor: default;
}

/* ── Blog ─────────────────────────────────────── */
.blog {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  padding-bottom: 60px;
}

.blog-carousel-wrap {
  position: relative;
  padding: 0 28px;
}

.blog-grid {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  cursor: grab;
}
.blog-grid.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.blog-grid::-webkit-scrollbar { display: none; }
.blog-grid { -ms-overflow-style: none; scrollbar-width: none; }

.blog-card {
  flex: 0 0 calc(33.333% - 14px);
  min-width: 280px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: background 0.2s, border-color 0.25s;
  overflow: hidden;
  scroll-snap-align: start;
}
.blog-card:hover { border-color: var(--border-2); }
.blog-card:hover { background: #1e1e1e; }

.blog-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  flex-shrink: 0;
}
.blog-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.blog-card:hover .blog-thumb img { transform: scale(1.04); }

.blog-body {
  padding: 22px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.blog-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.blog-desc {
  font-size: 0.83rem;
  color: var(--muted-2);
  line-height: 1.65;
  flex: 1;
}

.blog-read {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.03em;
  margin-top: 4px;
  transition: opacity 0.2s;
}
.blog-card:hover .blog-read { opacity: 0.75; }

/* Newsletter card */
.blog-thumb--newsletter {
  background: linear-gradient(145deg, #0d1a0d 0%, #1a3a1a 60%, #0f2a0f 100%);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 20px 22px;
  position: relative;
}
.newsletter-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.newsletter-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.6rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* ── Contact ──────────────────────────────────── */
.contact {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding-top: 80px;
  padding-bottom: 80px;
}

.contact-email-btn {
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 40px;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  padding: 15px 36px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
}
.contact-email-btn:hover { opacity: 0.88; transform: translateY(-2px); }
.contact-email-btn:active { transform: none; }

/* ── Modal ────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}
.modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-2);
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  padding: 32px;
  transform: translateY(16px);
  transition: transform 0.28s ease;
}
.modal-overlay.is-open .modal { transform: none; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.modal-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.modal-close {
  background: none;
  border: none;
  color: var(--muted-2);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  line-height: 1;
}
.modal-close:hover { color: var(--text); background: rgba(255,255,255,0.06); }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 14px;
}
.form-row .form-group { margin-bottom: 0; }

.form-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.form-input {
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 11px 14px;
  width: 100%;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}
.form-input::placeholder { color: var(--muted); }
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200,255,0,0.07);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

.modal-footer { margin-top: 20px; }

.form-submit {
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 40px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 12px 28px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
  width: 100%;
}
.form-submit:hover { opacity: 0.88; transform: translateY(-1px); }
.form-submit:active { transform: none; }

/* Modal success state */
.modal-success {
  text-align: center;
  padding: 24px 0 8px;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.modal-success:not([hidden]) {
  display: flex;
}
.modal-success-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(200,255,0,0.1);
  color: var(--accent);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-success-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
}
.modal-success-sub {
  font-size: 0.85rem;
  color: var(--muted-2);
  max-width: 280px;
  line-height: 1.5;
}

@media (max-width: 480px) {
  .form-row { grid-template-columns: 1fr; }
  .modal { padding: 24px 20px; }
}

/* ── Footer ───────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 64px var(--gutter) 56px;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 20px 40px;
  align-items: end;
}

.footer-tagline {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.4rem, 3vw, 2.4rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
  max-width: 480px;
}

.footer-linkedin {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 10px 20px;
  border: 1.5px solid var(--accent);
  border-radius: 40px;
  transition: background 0.2s, color 0.2s;
  align-self: start;
  white-space: nowrap;
}
.footer-linkedin:hover {
  background: var(--accent);
  color: var(--bg);
}

.footer-copy {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.footer-email {
  grid-column: 2;
  grid-row: 2;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 10px 24px;
  border-radius: 40px;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
  justify-self: end;
}
.footer-email:hover {
  background: var(--accent);
  color: var(--bg);
}

/* ── Scroll Reveal ────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.75s ease, transform 0.75s ease;
}
.reveal.revealed {
  opacity: 1;
  transform: none;
}

/* Cards inside carousels: always visible, skip reveal */
.blog-grid .blog-card.reveal {
  opacity: 1;
  transform: none;
}

/* ── Responsive ───────────────────────────────── */
@media (max-width: 900px) {
  .work-card { flex: 0 0 calc(50% - 10px); }
  .blog-card { flex: 0 0 calc(50% - 10px); }
}

@media (max-width: 680px) {
  /* Hero */
  .hero-bottom {
    grid-template-columns: 1fr;
    gap: 28px;
    align-items: flex-start;
  }
  .hero-ctas {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .hero-cta {
    flex: 1 1 auto;
    min-width: 0;
    align-self: flex-start;
    white-space: normal;
    text-align: center;
  }

  /* Sections */
  section { padding: 64px var(--gutter); }
  .hero { padding-bottom: 56px; }

  /* Cards */
  .work-card { flex: 0 0 82vw; }
  .blog-card { flex: 0 0 82vw; }

  /* Carousel: hide arrow buttons on touch, rely on swipe */
  .carousel-btn { display: none; }
  .carousel-wrap { padding: 0; }
  .carousel-wrap::after { display: none; }
  .blog-carousel-wrap { padding: 0; }

  /* CV modal: full-screen on mobile */
  .cv-modal {
    height: 100%;
    max-height: 90dvh;
    border-radius: 16px 16px 0 0;
  }
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .modal-overlay .cv-modal {
    width: 100%;
    max-width: 100%;
    border-radius: 16px 16px 0 0;
  }

  /* Footer */
  .footer-inner { grid-template-columns: 1fr; }
  .footer-linkedin { justify-self: start; }
}

@media (max-width: 400px) {
  .hero-ctas { flex-direction: column; }
  .nav-links { gap: 18px; }
}

/* Hide cursor trail on touch devices */
@media (hover: none) and (pointer: coarse) {
  .cursor-dot { display: none; }
}

/* ── Space Invaders Easter Egg ────────────────── */
.alien-trigger {
  display: inline-block;
  cursor: pointer;
  vertical-align: baseline;
  width:  0.14em;
  height: 0.14em;
  margin-left: 0.04em;
  position: relative;
  border-radius: 50%;
  background: var(--accent);
  overflow: hidden;
  transition: transform 0.3s ease, border-radius 0.3s ease, width 0.3s ease, height 0.3s ease, background 0.3s ease;
}
.alien-trigger:hover {
  width:  0.28em;
  height: 0.28em;
  border-radius: 4px;
  background: transparent;
  transform: translateY(-0.06em);
  filter: drop-shadow(0 0 12px rgba(200,255,0,0.5));
}
.alien-trigger svg {
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.alien-trigger:hover svg {
  opacity: 1;
}

#game-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.93);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
#game-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
#game-close-btn {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--muted-2);
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: color 0.2s, border-color 0.2s;
  letter-spacing: 0.04em;
  z-index: 1001;
}
#game-close-btn:hover { color: var(--text); border-color: rgba(255,255,255,0.3); }
#game-canvas {
  display: block;
  background: var(--bg);
  border: 1px solid rgba(200,255,0,0.15);
  border-radius: 4px;
  max-width: min(900px, 96vw);
  max-height: min(560px, 88vh);
  width: min(900px, 96vw);
  height: min(560px, 88vh);
  image-rendering: pixelated;
}
#touch-controls {
  display: none;
  position: absolute;
  bottom: 24px;
  left: 0; right: 0;
  justify-content: center;
  gap: 16px;
  padding: 0 24px;
}
@media (hover: none) and (pointer: coarse) {
  #touch-controls { display: flex; }
  #game-canvas { max-height: min(420px, 68vh); height: min(420px, 68vh); }
}
.touch-btn, .touch-fire {
  flex: 1; height: 56px;
  border: 1px solid rgba(200,255,0,0.25); border-radius: 8px;
  background: rgba(200,255,0,0.08); color: var(--accent); font-size: 1.4rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.touch-btn:active { background: rgba(200,255,0,0.18); }
.touch-fire {
  background: rgba(125,211,252,0.08); border-color: rgba(125,211,252,0.25);
  color: #7DD3FC; font-size: 1.2rem; font-weight: 700;
}
.touch-fire:active { background: rgba(125,211,252,0.18); }
