/* ============================================================
   GLOBAL TOKENS
   ============================================================ */
:root {
  /* Base — cream/off-white (Game section overrides locally) */
  --color-bg-deep:        #FBF4E6;
  --color-bg-surface:     #F5EAD3;
  --color-bg-elevated:    #EFE0C2;

  /* Primary (Trust/Focus) — deeper teal for legibility on cream */
  --color-primary-100:    #B3DBD6;
  --color-primary-300:    #4FA68F;
  --color-primary-500:    #2D8475;
  --color-primary-700:    #1F5E54;

  /* Accent (Energy/Action) — deeper saturated pastels */
  --color-accent-warm:    #C94B6E;
  --color-accent-amber:   #B8862F;
  --color-accent-rose:    #D6557A;

  /* Text — dark plum on cream */
  --color-text-primary:   #2D2438;
  --color-text-secondary: #6B5878;
  --color-text-accent:    #4FA68F;

  /* Utility */
  --color-border:         rgba(45, 36, 56, 0.14);
  --color-glow:           rgba(45, 132, 117, 0.25);

  /* Type scale */
  --text-hero:        clamp(3rem, 6vw, 5.5rem);
  --text-section:     clamp(2rem, 4vw, 3.5rem);
  --text-subsection:  clamp(1.25rem, 2vw, 1.75rem);
  --text-body:        clamp(1rem, 1.2vw, 1.125rem);
  --text-small:       clamp(0.8rem, 1vw, 0.875rem);
  --text-tiny:        0.75rem;

  /* Layout */
  --nav-height:       72px;
  --max-width:        1240px;
  --gutter:           clamp(1.25rem, 4vw, 3rem);

  /* Motion */
  --ease-out:         cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out:      cubic-bezier(0.65, 0, 0.35, 1);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  scroll-snap-type: none;
  /* No top padding — let the section run under the translucent nav so
     the nav picks up the destination section's color, not the previous one's */
  scroll-padding-top: 0;
}
@media (max-width: 768px) {
  html { scroll-snap-type: none; }
}

body {
  font-family: "General Sans", system-ui, -apple-system, sans-serif;
  font-weight: 400;
  font-size: var(--text-body);
  line-height: 1.6;
  color: var(--color-text-primary);
  background: #FBF4E6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* (Each section paints its own atmosphere — no global fixed gradient) */

img, svg, video, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
ul { list-style: none; margin: 0; padding: 0; }

::selection { background: var(--color-primary-500); color: #FBF4E6; }

/* ============================================================
   SCROLL PROGRESS
   ============================================================ */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--color-primary-500), var(--color-accent-warm));
  z-index: 100;
  transition: width 0.08s linear;
  box-shadow: 0 0 12px var(--color-glow);
}

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  z-index: 50;
  background: rgba(251, 244, 230, 0.15);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: none;
  transition: background 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}
.nav.is-scrolled {
  background: rgba(251, 244, 230, 0.45);
  box-shadow: 0 8px 30px rgba(45, 36, 56, 0.08);
}
/* Dark mode — active when the Game portal is in view */
.nav.is-dark {
  background: rgba(20, 16, 46, 0.25);
  border-bottom-color: transparent;
}
.nav.is-dark.is-scrolled {
  background: rgba(20, 16, 46, 0.5);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}
.nav.is-dark .nav__link {
  color: rgba(232, 236, 241, 0.7);
}
.nav.is-dark .nav__link:hover,
.nav.is-dark .nav__link.is-active {
  color: #E8ECF1;
}
.nav.is-dark .nav__link::after {
  background: #4ADE80;
}
.nav.is-dark .nav__toggle span {
  background: #E8ECF1;
}

.nav__inner {
  height: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: "Clash Display", sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.nav__brand-mark {
  display: inline-grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--color-primary-500), var(--color-primary-700));
  color: var(--color-bg-deep);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0;
  box-shadow: 0 4px 16px rgba(38, 166, 154, 0.35);
}
.nav__brand-name { font-size: 1rem; }

.nav__menu {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav__link {
  position: relative;
  display: inline-block;
  padding: 0.55rem 0.95rem;
  font-family: "Clash Display", sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  border-radius: 8px;
  transition: color 0.2s var(--ease-out), background-color 0.2s var(--ease-out);
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0.95rem; right: 0.95rem;
  bottom: 0.35rem;
  height: 1px;
  background: var(--color-primary-500);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease-out);
}
.nav__link:hover {
  color: var(--color-text-primary);
}
.nav__link.is-active {
  color: var(--color-text-primary);
}
.nav__link.is-active::after { transform: scaleX(1); }

.nav__link--cta {
  margin-left: 0.4rem;
  color: var(--color-bg-deep);
  background: var(--color-accent-warm);
  letter-spacing: 0.08em;
  transition: background 0.2s var(--ease-out), transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
  box-shadow: 0 4px 18px rgba(255, 107, 71, 0.25);
}
.nav__link--cta:hover {
  color: var(--color-bg-deep);
  background: var(--color-accent-rose);
  transform: translateY(-1px);
}
.nav__link--cta::after { display: none; }

/* Hamburger */
.nav__toggle {
  display: none;
  width: 40px; height: 40px;
  border-radius: 8px;
  position: relative;
}
.nav__toggle span {
  position: absolute;
  left: 10px; right: 10px;
  height: 1.5px;
  background: var(--color-text-primary);
  transition: transform 0.3s var(--ease-out), opacity 0.2s var(--ease-out), top 0.3s var(--ease-out);
}
.nav__toggle span:nth-child(1) { top: 14px; }
.nav__toggle span:nth-child(2) { top: 19px; }
.nav__toggle span:nth-child(3) { top: 24px; }
.nav__toggle.is-open span:nth-child(1) { top: 19px; transform: rotate(45deg); }
.nav__toggle.is-open span:nth-child(2) { opacity: 0; }
.nav__toggle.is-open span:nth-child(3) { top: 19px; transform: rotate(-45deg); }

@media (max-width: 768px) {
  .nav__toggle { display: block; }
  .nav__menu {
    position: fixed;
    top: var(--nav-height);
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 1rem var(--gutter) 1.5rem;
    background: rgba(251, 244, 230, 0.96);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border);
    transform: translateY(-110%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s var(--ease-out), opacity 0.25s var(--ease-out);
  }
  .nav__menu.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav__link {
    display: block;
    padding: 0.9rem 0.5rem;
    font-size: 0.95rem;
    border-radius: 0;
    border-bottom: 1px solid var(--color-border);
  }
  .nav__link::after { display: none; }
  .nav__link--cta {
    margin: 0.75rem 0 0;
    text-align: center;
    border-radius: 8px;
    border: none;
  }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1.4rem;
  border-radius: 10px;
  font-family: "Clash Display", sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  transition: transform 0.2s var(--ease-out), background 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), color 0.2s var(--ease-out);
  white-space: nowrap;
}
.btn--primary {
  background: var(--color-accent-warm);
  color: #FBF4E6;
  box-shadow: 0 6px 24px rgba(201, 75, 110, 0.3);
}
.btn--primary:hover {
  background: var(--color-accent-rose);
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(255, 107, 71, 0.4);
}
.btn--ghost {
  background: transparent;
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
}
.btn--ghost:hover {
  border-color: var(--color-primary-500);
  color: var(--color-primary-300);
  transform: translateY(-2px);
}

/* ============================================================
   HERO — typographic poster with bubble field
   ============================================================ */
:root {
  --bubble-coral:    rgba(255, 107, 71, 0.15);
  --bubble-gold:     rgba(255, 183, 77, 0.15);
  --bubble-teal:     rgba(128, 203, 196, 0.12);
  --bubble-purple:   rgba(167, 139, 250, 0.12);
  --bubble-rose:     rgba(255, 138, 128, 0.12);
}

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: calc(var(--nav-height) + 14vh) var(--gutter) 6rem;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
  scroll-snap-align: start;
  /* Cream/off-white hero — pastel orbs read as real pastels here */
  background: linear-gradient(180deg, #FBF4E6 0%, #F5EAD3 60%, #EFE0C2 100%);
  color: #2D2438;
}

/* Bubble field — fills hero */
.hero__bubbles {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  /* scroll-pop variables driven by JS */
  --pop-progress: 0;
}

.bubble {
  position: absolute;
  border-radius: 50%;
  filter: blur(0.5px);
  animation: bubble-drift var(--dur, 22s) ease-in-out infinite,
             bubble-breathe 7s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  will-change: transform, opacity;
  /* Normal blend on cream hero — screen would wash to white */
  mix-blend-mode: normal;
}
.bubble--fg { opacity: 0.92; }
.bubble__inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  /* JS-driven cursor repel + scroll-pop translate this child.
     No CSS transition — JS does its own easing each frame. */
  will-change: transform, opacity;
}
@keyframes bubble-drift {
  0%, 100% { transform: translate3d(0, 0, 0); }
  25% { transform: translate3d(var(--dx, 30px), calc(var(--dy, -20px) * 0.6), 0); }
  50% { transform: translate3d(calc(var(--dx, 30px) * 0.4), var(--dy, -20px), 0); }
  75% { transform: translate3d(calc(var(--dx, 30px) * -0.5), calc(var(--dy, -20px) * 0.3), 0); }
}
@keyframes bubble-breathe {
  0%, 100% { scale: 0.95; }
  50% { scale: 1.05; }
}

.hero__glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(700px 500px at 50% 45%, rgba(200, 170, 230, 0.18), transparent 70%),
    radial-gradient(400px 300px at 70% 80%, rgba(255, 182, 193, 0.12), transparent 70%);
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

/* Massive shimmer name */
.hero__name {
  margin: 0;
  font-family: "Clash Display", sans-serif;
  font-weight: 700;
  font-size: clamp(4rem, 18vw, 16rem);
  line-height: 0.85;
  letter-spacing: -3px;
  text-align: center;
  word-spacing: 0.04em;
}
.hero__name-shimmer {
  display: inline-block;
  /* Deeper pastels so the name reads as colorful (not washed out) on cream */
  background: linear-gradient(
    135deg,
    #8E6FB8 0%,
    #D6557A 33%,
    #4FA68F 66%,
    #8E6FB8 100%
  );
  background-size: 240% 100%;
  background-position: 0% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: shimmer 9s linear infinite;
}
@keyframes shimmer {
  to { background-position: 240% 50%; }
}

.hero__tagline {
  margin: 0;
  font-family: "General Sans", sans-serif;
  font-weight: 400;
  font-size: clamp(0.8rem, 1.45vw, 1.25rem);
  line-height: 1.4;
  color: #2D2438;
  white-space: nowrap;
}
.hero__dot {
  display: inline-block;
  margin: 0 0.45em;
  color: #8E6FB8;
  font-weight: 500;
  transform: translateY(-0.05em);
}
.hero__tagline-aside {
  margin: 0;
  font-family: "General Sans", sans-serif;
  font-weight: 500;
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  color: #C94B6E;
  letter-spacing: 0.005em;
  font-style: italic;
}

/* Scroll indicator */
.hero__scroll {
  position: absolute;
  left: 50%;
  bottom: 2rem;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-family: "JetBrains Mono", monospace;
  font-size: var(--text-tiny);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #6B5878;
  transition: color 0.2s var(--ease-out);
  z-index: 2;
}
.hero__scroll:hover { color: #8E6FB8; }
.hero__scroll-line {
  width: 1px; height: 36px;
  background: linear-gradient(to bottom, transparent, #8E6FB8);
  animation: scroll-line 2s ease-in-out infinite;
}
.hero__scroll svg { animation: chevron-bounce 2s ease-in-out infinite; }

/* Reveal-on-load */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  animation: reveal 1s var(--ease-out) forwards;
  animation-delay: calc(var(--d, 0) * 1ms);
}

@keyframes reveal {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scroll-line {
  0%, 100% { transform: scaleY(1); transform-origin: top; opacity: 0.6; }
  50% { transform: scaleY(0.4); transform-origin: bottom; opacity: 1; }
}
@keyframes chevron-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

@media (max-width: 900px) {
  .hero__tagline {
    white-space: normal;
    text-wrap: balance;
    max-width: 36em;
    font-size: clamp(0.9rem, 2.2vw, 1.05rem);
  }
}

@media (max-width: 768px) {
  .hero { padding-top: calc(var(--nav-height) + 8vh); padding-bottom: 5rem; }
  .hero__name { font-size: clamp(3.5rem, 22vw, 8rem); }
  .hero__tagline { font-size: 0.95rem; }
  .hero__dot { margin: 0 0.3em; }
}

/* Short viewports: tighten hero so tagline + scroll indicator don't collide */
@media (max-height: 700px) {
  .hero { padding-top: calc(var(--nav-height) + 6vh); padding-bottom: 4.5rem; }
  .hero__name { font-size: clamp(3rem, 14vw, 9rem); }
  .hero__content { gap: 1.25rem; }
  .hero__tagline { font-size: 1rem; }
  .hero__tagline-aside { font-size: 0.95rem; }
}
@media (max-height: 560px) {
  .hero__scroll { display: none; } /* not enough room — drop it cleanly */
  .hero { padding-bottom: 2.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .bubble { animation: none !important; }
  .hero__name-shimmer { animation: none; background-position: 50% 50%; }
}

/* ============================================================
   SHARED SECTION SHELL — full-bleed atmospheric tint per section.
   Each section locks to viewport (scroll-snap) and is bathed in its
   own soft accent color so it feels distinct AND cohesive. The
   section IS the orb now — no inner shell.
   ============================================================ */
.section {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: clamp(96px, 12vh, 140px) var(--gutter) clamp(60px, 8vh, 120px);
  overflow: hidden;
  isolation: isolate;
  scroll-snap-align: start;
  background: var(--section-base, var(--color-bg-deep));
  /* Top edge shadow — incoming section casts onto the outgoing one
     beneath as it slides up via sticky stacking */
  box-shadow:
    0 -18px 40px -8px rgba(45, 36, 56, 0.18),
    0 -2px 0 rgba(45, 36, 56, 0.06);
}
/* Sticky stacking order — later sections layer over earlier ones */
.section--bio       { z-index: 10; }
.section--writing   { z-index: 20; }
.section--portfolio { z-index: 30; }
.section--game      { z-index: 40; }
.section--contact   { z-index: 50; }

/* The Game portal sliding over the light Portfolio gets a heavier,
   colder shadow so the transition feels especially dramatic */
.section--game {
  box-shadow:
    0 -28px 60px -8px rgba(20, 16, 46, 0.55),
    0 -2px 0 rgba(74, 222, 128, 0.25);
}
.section::before {
  content: "";
  position: absolute;
  inset: -10% -15%;
  z-index: 0;
  pointer-events: none;
  background: var(--section-atmosphere, transparent);
  filter: blur(60px);
}
.section::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  /* Light edge fade for light sections */
  background: linear-gradient(180deg, rgba(251,244,230,0.45) 0%, transparent 12%, transparent 88%, rgba(251,244,230,0.45) 100%);
}
/* Game keeps a dark edge fade so its portal feels enclosed */
.section--game::after {
  background: linear-gradient(180deg, rgba(11,17,32,0.6) 0%, transparent 12%, transparent 88%, rgba(11,17,32,0.6) 100%);
}

.section__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--max-width);
  padding: clamp(2rem, 4vw, 3rem) clamp(0.5rem, 2vw, 1.5rem);
}

/* Per-section base + atmosphere — pastel palette, high-opacity
   so each section reads as a distinct colored atmosphere */
.section--bio {
  --section-base: linear-gradient(170deg, #F4ECF8 0%, #EBE0F2 55%, #E0D2EC 100%);
  --section-atmosphere:
    radial-gradient(950px 750px at 82% 24%, rgba(200, 170, 230, 0.55), transparent 58%),
    radial-gradient(800px 650px at 12% 80%, rgba(232, 213, 245, 0.50), transparent 60%);
}
.section--writing {
  --section-base: linear-gradient(165deg, #FCE9D6 0%, #FADEC4 60%, #F5D0B0 100%);
  --section-atmosphere:
    radial-gradient(950px 750px at 18% 28%, rgba(255, 182, 193, 0.55), transparent 58%),
    radial-gradient(800px 650px at 90% 82%, rgba(255, 218, 185, 0.50), transparent 60%);
}
.section--portfolio {
  --section-base: linear-gradient(170deg, #E2F0EC 0%, #D2E8E1 55%, #BFDDD3 100%);
  --section-atmosphere:
    radial-gradient(950px 750px at 18% 28%, rgba(176, 224, 210, 0.6), transparent 58%),
    radial-gradient(800px 650px at 90% 80%, rgba(173, 216, 230, 0.45), transparent 60%);
}
/* GAME — stays a dramatic dark portal */
.section--game {
  --section-base: linear-gradient(170deg, #281C50 0%, #1B1440 55%, #14102E 100%);
  --section-atmosphere:
    radial-gradient(950px 750px at 80% 24%, rgba(167, 139, 250, 0.58), transparent 58%),
    radial-gradient(800px 650px at 14% 80%, rgba(74, 222, 128, 0.40), transparent 60%);
}
.section--contact {
  --section-base: linear-gradient(170deg, #DCEAF6 0%, #C8DCEE 55%, #B3CCE3 100%);
  --section-atmosphere:
    radial-gradient(950px 750px at 50% 28%, rgba(173, 216, 230, 0.65), transparent 58%),
    radial-gradient(800px 650px at 50% 92%, rgba(135, 180, 220, 0.50), transparent 60%);
}

.section__inner--center { text-align: center; }

/* Per-section header accent colors — deeper shades of each section's hue */
.section--bio .section__num { color: #6A4FA8; }
.section--bio .section__title { color: #3D2A6B; }
.section--writing .section__num { color: #B8862F; }
.section--writing .section__title { color: #5C3B26; }
.section--portfolio .section__num { color: #2D8475; }
.section--portfolio .section__title { color: #1F5E54; }
.section--contact .section__num { color: #2A5A8C; }
.section--contact .section__title { color: #143A66; }

@media (max-width: 768px) {
  /* Let sections grow to their natural content height on mobile.
     The desktop layout pins each section to 100vh with overflow:hidden,
     which crops Bio/Writing/Portfolio/Game on small screens. */
  .section {
    position: relative;
    height: auto;
    min-height: 100vh;
    overflow: visible;
    scroll-snap-align: none;
    padding: 4rem 1rem;
  }
  .section__inner { padding: 1.75rem 0.5rem; }
  .section::before { inset: -5% -10%; }
}

.section__header { margin-bottom: 3rem; max-width: 62rem; }
.section__title { max-width: none; }
.section__sub { max-width: 42em; }
.section__header--center { margin-left: auto; margin-right: auto; }
.section__header--center .section__sub { margin-left: auto; margin-right: auto; }

.section__num {
  display: inline-block;
  margin-bottom: 1rem;
  font-family: "JetBrains Mono", monospace;
  font-size: var(--text-tiny);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-text-accent);
}
.section__title {
  margin: 0 0 1rem;
  font-family: "Clash Display", sans-serif;
  font-weight: 600;
  font-size: var(--text-section);
  letter-spacing: -0.025em;
  line-height: 1.05;
  text-wrap: balance;
}
.section__sub {
  margin: 0;
  font-size: var(--text-body);
  color: var(--color-text-secondary);
  text-wrap: pretty;
  max-width: 36em;
}

/* ============================================================
   PLACEHOLDER BOX (used until real assets land)
   ============================================================ */
.placeholder-box {
  position: relative;
  min-height: 240px;
  border-radius: 12px;
  border: 1px dashed rgba(45, 36, 56, 0.22);
  background:
    repeating-linear-gradient(
      135deg,
      rgba(45, 36, 56, 0.05) 0 8px,
      transparent 8px 16px
    ),
    rgba(255, 255, 255, 0.4);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.placeholder-box::after {
  content: attr(data-label);
  font-family: "JetBrains Mono", monospace;
  font-size: var(--text-small);
  color: var(--color-text-secondary);
  letter-spacing: 0.05em;
  padding: 0 1rem;
  text-align: center;
}
.placeholder-box--portrait { aspect-ratio: 4 / 5; min-height: 0; }
.placeholder-box--video,
.placeholder-box--doc { aspect-ratio: 16 / 10; min-height: 0; }

/* Shared badge component */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  background: rgba(45, 132, 117, 0.1);
  border: 1px solid rgba(45, 132, 117, 0.4);
  border-radius: 100px;
  font-family: "JetBrains Mono", monospace;
  font-size: var(--text-tiny);
  color: var(--color-primary-300);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.badge__dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--color-primary-500);
  box-shadow: 0 0 8px var(--color-primary-500);
}

/* ============================================================
   SECTION 01 — BIO
   ============================================================ */
.bio {
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
  margin-bottom: 0;
}

.bio__portrait {
  position: relative;
  width: 100%;
  max-width: 360px;
}
.bio__portrait-frame {
  border: 1px solid rgba(45, 132, 117, 0.35);
  box-shadow: 0 0 0 1px rgba(45, 132, 117, 0.15) inset, 0 24px 60px rgba(45, 36, 56, 0.18);
  border-radius: 18px;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: #1a1422;
}
.bio__portrait-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.bio__portrait-glow {
  position: absolute;
  inset: -20%;
  background: radial-gradient(closest-side, rgba(38, 166, 154, 0.25), transparent 70%);
  filter: blur(24px);
  z-index: -1;
}

.bio__lede {
  margin: 0 0 1rem;
  font-family: "Clash Display", sans-serif;
  font-weight: 600;
  font-size: var(--text-subsection);
  line-height: 1.3;
  color: var(--color-text-primary);
  letter-spacing: -0.01em;
  text-wrap: pretty;
}
.bio__lede em {
  font-style: normal;
  background: linear-gradient(90deg, var(--color-primary-500), var(--color-primary-700));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.bio__lede strong {
  color: var(--color-accent-amber);
  font-weight: 600;
}
.bio__body-text {
  margin: 0 0 1.75rem;
  color: var(--color-text-secondary);
  text-wrap: pretty;
  max-width: 36em;
}

.bio__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.bio__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0;
}

/* Career timeline — horizontal, alternating above/below */
.timeline {
  position: relative;
  padding: 0;
  margin-top: -1rem;
}
.timeline__track {
  position: absolute;
  inset: 50% 0 auto 0;
  height: 1px;
  pointer-events: none;
}
.timeline__line {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-primary-500) 10%, var(--color-primary-500) 90%, transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.6s var(--ease-out);
}
.timeline.is-revealed .timeline__line { transform: scaleX(1); }

.timeline__list {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.5rem;
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline__node {
  position: relative;
  height: 18rem;
  padding: 0 0.4rem;
  text-align: center;
  cursor: default;
  outline: none;
}
.timeline__dot {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #FBF4E6;
  border: 1.5px solid var(--color-primary-500);
  box-shadow: 0 0 0 4px rgba(251, 244, 230, 0.9);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), background 0.3s var(--ease-out);
  z-index: 1;
}
.timeline__node--accent .timeline__dot {
  background: var(--color-accent-amber);
  border-color: var(--color-accent-amber);
}
.timeline__node:hover .timeline__dot,
.timeline__node:focus .timeline__dot {
  transform: translate(-50%, -50%) scale(1.4);
  box-shadow: 0 0 0 4px rgba(251, 244, 230, 0.9), 0 0 16px var(--color-primary-500);
  background: var(--color-primary-500);
}

.timeline__year {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: var(--text-tiny);
  letter-spacing: 0.15em;
  color: var(--color-text-secondary);
  margin: 0;
}

.timeline__card {
  padding: 0.75rem 0.85rem;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(45, 36, 56, 0.08);
  text-align: left;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}
.timeline__node:hover,
.timeline__node:focus,
.timeline__node:focus-within {
  z-index: 10;
}
.timeline__node:hover .timeline__card,
.timeline__node:focus .timeline__card,
.timeline__node:focus-within .timeline__card {
  opacity: 1;
  transform: translateY(0);
  border-color: var(--color-primary-500);
  left: -1.6rem;
  right: -1.6rem;
}

/* Above/below positioning — year sits closest to the dot, card grows outward. */
.timeline__node--above .timeline__card,
.timeline__node--above .timeline__year,
.timeline__node--below .timeline__card,
.timeline__node--below .timeline__year {
  position: absolute;
  left: 0.4rem;
  right: 0.4rem;
}

.timeline__node--above .timeline__year { bottom: calc(50% + 14px); }
.timeline__node--above .timeline__card { bottom: calc(50% + 14px + 1.4rem); top: auto; }

.timeline__node--below .timeline__year { top: calc(50% + 14px); }
.timeline__node--below .timeline__card { top: calc(50% + 14px + 1.4rem); bottom: auto; }
.timeline__role {
  display: block;
  font-family: "Clash Display", sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text-primary);
  margin-bottom: 0.15rem;
}
.timeline__company {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: var(--text-tiny);
  color: var(--color-text-accent);
  margin-bottom: 0.35rem;
}
.timeline__detail {
  margin: 0;
  font-size: var(--text-small);
  color: var(--color-text-secondary);
  line-height: 1.45;
}

@media (max-width: 900px) {
  .bio { grid-template-columns: 1fr; max-width: 540px; }
  .bio__portrait { max-width: 240px; }
  /* Vertical timeline on mobile */
  .timeline__track { inset: 0 auto 0 18px; width: 1px; height: auto; }
  .timeline__line {
    height: 100%; width: 1px;
    background: linear-gradient(180deg, transparent, var(--color-primary-500) 10%, var(--color-primary-500) 90%, transparent);
    transform: scaleY(0);
    transform-origin: top;
  }
  .timeline.is-revealed .timeline__line { transform: scaleY(1); }
  .timeline__list { grid-template-columns: 1fr; gap: 1.25rem; }
  .timeline__node,
  .timeline__node--above,
  .timeline__node--below {
    height: auto;
    padding: 0 0 0 3rem;
    text-align: left;
  }
  .timeline__dot,
  .timeline__node:hover .timeline__dot,
  .timeline__node:focus .timeline__dot {
    top: 8px;
    left: 18px;
    transform: none;
  }
  .timeline__node:hover .timeline__dot,
  .timeline__node:focus .timeline__dot {
    transform: scale(1.4);
  }
  .timeline__node--above .timeline__year,
  .timeline__node--below .timeline__year,
  .timeline__node--above .timeline__card,
  .timeline__node--below .timeline__card {
    position: static;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    overflow: visible;
  }
  .timeline__year { margin: 0 0 0.5rem 0; }
  .timeline__card { opacity: 1; transform: none; }
}

/* ============================================================
   SECTION 02 — WRITING
   ============================================================ */
/* (section--writing positioning handled by base .section rule) */
.section__paper {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(
      0deg,
      rgba(45, 36, 56, 0.06) 0 1px,
      transparent 1px 32px
    );
}

.writing {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 1.5rem;
  align-items: stretch;
}

.doc-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(45, 36, 56, 0.08);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
  transform-style: preserve-3d;
  will-change: transform;
}
.doc-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 48px rgba(45, 36, 56, 0.18), 0 0 0 1px rgba(184, 134, 47, 0.25);
  border-color: rgba(184, 134, 47, 0.5);
}

.doc-card--featured { grid-row: span 2; }

.doc-card__preview {
  position: relative;
  padding: 1rem 1rem 0;
  overflow: hidden;
}
.doc-card__preview .placeholder-box {
  border-radius: 8px;
  border-color: rgba(255, 183, 77, 0.25);
}
.doc-card--featured .doc-card__preview .placeholder-box { aspect-ratio: 4 / 3; }
.doc-card__thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top center;
  border-radius: 8px;
  border: 1px solid rgba(255, 183, 77, 0.25);
}
.doc-card--featured .doc-card__thumb { aspect-ratio: 4 / 3; }
.doc-card__shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.5) 50%, transparent 70%);
  pointer-events: none;
  opacity: 0.3;
}

.doc-card__body {
  padding: 1.25rem 1.4rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
}
.doc-card__type {
  display: inline-block;
  font-family: "JetBrains Mono", monospace;
  font-size: var(--text-tiny);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--color-accent-amber);
  border-bottom: 1px solid rgba(255, 183, 77, 0.35);
  padding-bottom: 0.25rem;
  align-self: flex-start;
}
.doc-card__title {
  margin: 0;
  font-family: "Clash Display", sans-serif;
  font-weight: 600;
  font-size: 1.2rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--color-text-primary);
}
.doc-card--featured .doc-card__title { font-size: 1.5rem; }
.doc-card__desc {
  margin: 0;
  font-size: var(--text-small);
  color: var(--color-text-secondary);
  line-height: 1.55;
  text-wrap: pretty;
}
.doc-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--color-border);
  margin-top: auto;
}
.doc-card__stat {
  display: flex;
  flex-direction: column;
  font-family: "JetBrains Mono", monospace;
  font-size: var(--text-tiny);
  color: var(--color-text-secondary);
  letter-spacing: 0.05em;
}
.doc-card__stat strong {
  font-family: "Clash Display", sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--color-primary-300);
  letter-spacing: -0.01em;
  margin-bottom: 0.1rem;
}
.doc-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: "Clash Display", sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--color-accent-warm);
  align-self: flex-start;
  padding: 0.5rem 0;
  transition: gap 0.2s var(--ease-out), color 0.2s var(--ease-out);
}
.doc-card__cta:hover { gap: 0.7rem; color: var(--color-accent-rose); }
.doc-card__cta--muted { color: var(--color-text-secondary); cursor: default; }

.doc-card__status {
  display: block;
  margin-top: auto;
  padding: 0.5rem 0;
  font-family: "Clash Display", sans-serif;
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--color-text-secondary);
  font-style: italic;
}

.doc-card--upcoming { opacity: 0.7; }
.doc-card--upcoming .doc-card__title { color: var(--color-text-secondary); }

@media (max-width: 900px) {
  .writing { grid-template-columns: 1fr; }
  .doc-card--featured { grid-row: auto; }
}

/* ============================================================
   SECTION 03 — PORTFOLIO
   ============================================================ */
.section__iso {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
  background-image:
    linear-gradient(30deg, rgba(45, 132, 117, 0.12) 1px, transparent 1px),
    linear-gradient(150deg, rgba(45, 132, 117, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45, 132, 117, 0.08) 1px, transparent 1px);
  background-size: 56px 32px, 56px 32px, 56px 32px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

.projects {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-primary-500);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(45, 36, 56, 0.08);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}
.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 48px rgba(45, 36, 56, 0.16), 0 0 0 1px rgba(45, 132, 117, 0.3);
}
.project-card::before,
.project-card::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  border: 1px solid var(--color-primary-500);
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
}
.project-card::before { top: 8px; right: 8px; border-bottom: 0; border-left: 0; }
.project-card::after { bottom: 8px; left: 8px; border-top: 0; border-right: 0; }
.project-card:hover::before,
.project-card:hover::after { opacity: 1; }

.project-card__media {
  position: relative;
  margin: 1rem 1rem 0;
  border-radius: 10px;
  overflow: hidden;
}
.project-card__media .placeholder-box { border-radius: 10px; }
.project-card__video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #0a0a0a;
  border-radius: 10px;
}
.project-card__play {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--color-accent-warm);
  color: #FBF4E6;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 24px rgba(201, 75, 110, 0.4);
  animation: play-pulse 2.4s ease-in-out infinite;
  transition: transform 0.2s var(--ease-out);
}
.project-card__play:hover { transform: translate(-50%, -50%) scale(1.1); }
.project-card__play svg { transform: translateX(2px); }

@keyframes play-pulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(201, 75, 110, 0.4), 0 0 0 0 rgba(201, 75, 110, 0.5); }
  50% { box-shadow: 0 8px 24px rgba(201, 75, 110, 0.4), 0 0 0 16px rgba(201, 75, 110, 0); }
}

.project-card__body {
  padding: 1.25rem 1.4rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}
.project-card__head { display: flex; flex-direction: column; gap: 0.4rem; }
.project-card__tag {
  font-family: "JetBrains Mono", monospace;
  font-size: var(--text-tiny);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-accent);
}
.project-card__title {
  margin: 0;
  font-family: "Clash Display", sans-serif;
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--color-text-primary);
}
.project-card__desc {
  margin: 0;
  font-size: var(--text-small);
  color: var(--color-text-secondary);
  line-height: 1.55;
  text-wrap: pretty;
}
.project-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: "Clash Display", sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-primary-300);
  align-self: flex-start;
  margin-top: auto;
  transition: gap 0.2s var(--ease-out), color 0.2s var(--ease-out);
}
.project-card__cta:hover { gap: 0.7rem; color: var(--color-primary-100); }
.project-card__cta--muted { color: var(--color-text-secondary); cursor: default; }
.project-card--upcoming { opacity: 0.7; border-left-color: var(--color-text-secondary); }
.project-card--upcoming .project-card__play { display: none; }

@media (max-width: 768px) {
  .projects { grid-template-columns: 1fr; }
}

/* ============================================================
   SECTION 04 — THE GAME
   ============================================================ */
.section--game {
  font-family: "Press Start 2P", monospace;
}
.section__scanlines {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.18) 0 2px,
    transparent 2px 4px
  );
  mix-blend-mode: multiply;
  opacity: 0.6;
}
.section__pixels {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    radial-gradient(circle, rgba(74, 222, 128, 0.4) 1px, transparent 1.5px),
    radial-gradient(circle, rgba(255, 183, 77, 0.3) 1px, transparent 1.5px);
  background-size: 80px 80px, 120px 120px;
  background-position: 0 0, 40px 40px;
  opacity: 0.35;
  animation: pixel-drift 18s linear infinite;
}
@keyframes pixel-drift {
  to { background-position: 80px 80px, 120px 120px; }
}

.game {
  position: relative;
  z-index: 2;
}
.game__frame {
  position: relative;
  padding: clamp(2rem, 5vw, 3.5rem);
  background: rgba(15, 8, 30, 0.7);
  border: 2px solid #4ADE80;
  border-radius: 0;
  box-shadow:
    0 0 0 2px #1A0F2E,
    0 0 0 4px #4ADE80,
    0 0 60px rgba(74, 222, 128, 0.25),
    inset 0 0 80px rgba(74, 222, 128, 0.08);
}

/* Pixel corner decorations */
.game__corner {
  position: absolute;
  width: 12px; height: 12px;
  background: #FFB74D;
}
.game__corner--tl { top: -7px; left: -7px; }
.game__corner--tr { top: -7px; right: -7px; }
.game__corner--bl { bottom: -7px; left: -7px; }
.game__corner--br { bottom: -7px; right: -7px; }

.game__num {
  display: inline-block;
  margin-bottom: 1.25rem;
  font-family: "Press Start 2P", monospace;
  font-size: 0.55rem;
  letter-spacing: 0.15em;
  color: #FFB74D;
  text-transform: uppercase;
}
.game__title {
  margin: 0 0 1.5rem;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(1.4rem, 3.4vw, 2.6rem);
  line-height: 1.4;
  color: #4ADE80;
  letter-spacing: 0;
  text-shadow:
    3px 3px 0 #1A0F2E,
    6px 6px 0 rgba(74, 222, 128, 0.2);
}
.game__desc {
  max-width: 36em;
  margin: 0 0 2rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--color-text-secondary);
}
.game__credit {
  margin: 1.5rem 0 0;
  font-family: "JetBrains Mono", monospace;
  font-style: italic;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  opacity: 0.8;
}

.game__cta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}
.game__hint {
  font-family: "Press Start 2P", monospace;
  font-size: 0.55rem;
  color: var(--color-text-secondary);
  letter-spacing: 0.1em;
}

/* Retro PLAY button */
.game__play {
  position: relative;
  display: inline-block;
  font-family: "Press Start 2P", monospace;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-decoration: none;
  cursor: pointer;
}
.game__play-shadow {
  position: absolute;
  inset: 4px -4px -4px 4px;
  background: #1A0F2E;
  z-index: 0;
}
.game__play-face {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.95rem 1.4rem;
  background: #4ADE80;
  color: #0B1120;
  border: 2px solid #0B1120;
  z-index: 1;
  transition: transform 0.1s steps(2);
  animation: play-blink 1.6s ease-in-out infinite;
}
.game__play:hover .game__play-face { transform: translate(-2px, -2px); }
.game__play:active .game__play-face { transform: translate(2px, 2px); }
@keyframes play-blink {
  0%, 90%, 100% { box-shadow: 0 0 0 rgba(74, 222, 128, 0.5); }
  95% { box-shadow: 0 0 24px rgba(74, 222, 128, 0.8); }
}

/* Game screenshots row */
.game__shots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.game__shot {
  aspect-ratio: 4 / 3;
  min-height: 0;
  border-radius: 0;
  border: 2px solid #4ADE80;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(74, 222, 128, 0.05) 0 8px,
      transparent 8px 16px
    ),
    rgba(15, 8, 30, 0.5);
  overflow: hidden;
  position: relative;
}
.game__shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.game__shot::after {
  font-family: "Press Start 2P", monospace;
  font-size: 0.55rem;
  color: #4ADE80;
  letter-spacing: 0.1em;
}

/* Walking sprite */
.game__sprite {
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 16px; height: 16px;
  animation: sprite-walk 14s linear infinite;
}
.game__sprite-pixel {
  width: 16px; height: 16px;
  background:
    linear-gradient(#4ADE80 0 0) 4px 0/8px 4px no-repeat,
    linear-gradient(#FFB74D 0 0) 2px 4px/12px 4px no-repeat,
    linear-gradient(#4ADE80 0 0) 0 8px/16px 4px no-repeat,
    linear-gradient(#FFB74D 0 0) 4px 12px/8px 4px no-repeat;
  animation: sprite-bob 0.4s steps(2) infinite;
}
@keyframes sprite-walk {
  0% { transform: translateX(-20px); }
  50% { transform: translateX(calc(100% - 16px)) scaleX(1); }
  51% { transform: translateX(calc(100% - 16px)) scaleX(-1); }
  100% { transform: translateX(-20px) scaleX(-1); }
}
@keyframes sprite-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

@media (max-width: 768px) {
  .game__shots { grid-template-columns: 1fr; }
}

/* ============================================================
   SECTION 05 — CONTACT
   ============================================================ */
.section__contact-glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(600px 400px at 50% 40%, rgba(42, 90, 140, 0.20), transparent 70%);
  pointer-events: none;
}

.section--contact .section__inner { z-index: 1; }

.contact {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 560px;
  margin: 0 auto 3rem;
  text-align: left;
}
.contact__row { width: 100%; }
.contact__link {
  display: grid;
  grid-template-columns: auto 90px 1fr auto;
  align-items: center;
  gap: 1.25rem;
  padding: 1.1rem 1.4rem;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(45, 36, 56, 0.08);
  transition: transform 0.25s var(--ease-out), border-color 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), background 0.25s var(--ease-out);
}
.contact__link:hover {
  transform: translateY(-2px);
  border-color: var(--color-primary-500);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 36px rgba(45, 132, 117, 0.22);
}

.contact__icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(45, 132, 117, 0.12);
  color: var(--color-primary-500);
  border: 1px solid rgba(45, 132, 117, 0.3);
  transition: background 0.25s var(--ease-out), color 0.25s var(--ease-out);
}
.contact__link:hover .contact__icon {
  background: var(--color-primary-500);
  color: #FBF4E6;
}
.contact__label {
  font-family: "JetBrains Mono", monospace;
  font-size: var(--text-tiny);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--color-text-secondary);
}
.contact__value {
  font-family: "Clash Display", sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--color-text-primary);
  letter-spacing: -0.01em;
  word-break: break-all;
}
.contact__arrow {
  font-family: "JetBrains Mono", monospace;
  color: var(--color-text-secondary);
  transition: transform 0.25s var(--ease-out), color 0.25s var(--ease-out);
}
.contact__link:hover .contact__arrow { transform: translateX(4px); color: var(--color-primary-300); }

.contact__sign {
  margin: 0;
  font-family: "Clash Display", sans-serif;
  font-size: 1.5rem;
  color: var(--color-text-secondary);
  letter-spacing: -0.01em;
}
.contact__sign-mark { color: var(--color-accent-warm); }

@media (max-width: 600px) {
  .contact__link { grid-template-columns: auto 1fr auto; gap: 0.85rem; }
  .contact__label { display: none; }
}

/* ============================================================
   REVEAL ON SCROLL (sections 1–5)
   ============================================================ */
.section [data-reveal],
.section .section__header,
.section .bio,
.section .timeline,
.section .doc-card,
.section .project-card,
.section .game__frame,
.section .contact,
.section .contact__sign {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.section.is-revealed [data-reveal],
.section.is-revealed .section__header,
.section.is-revealed .bio,
.section.is-revealed .timeline,
.section.is-revealed .doc-card,
.section.is-revealed .project-card,
.section.is-revealed .game__frame,
.section.is-revealed .contact,
.section.is-revealed .contact__sign {
  opacity: 1;
  transform: translateY(0);
}
/* Stagger writing & portfolio cards */
.section.is-revealed .doc-card:nth-child(1) { transition-delay: 0.05s; }
.section.is-revealed .doc-card:nth-child(2) { transition-delay: 0.18s; }
.section.is-revealed .doc-card:nth-child(3) { transition-delay: 0.3s; }
.section.is-revealed .project-card:nth-child(1) { transition-delay: 0.05s; }
.section.is-revealed .project-card:nth-child(2) { transition-delay: 0.18s; }

/* ============================================================
   ENTRANCE ANIMATIONS — writing/portfolio/game
   ============================================================ */

/* Writing — papers landing on a desk (random rotation overshoot) */
.section--writing .doc-card {
  transform: translateY(40px) rotate(var(--enter-rot, -2deg));
  transition:
    opacity 0.7s var(--ease-out),
    transform 0.85s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.section--writing.is-revealed .doc-card { transform: translateY(0) rotate(0); }
.section--writing.is-revealed .doc-card:nth-child(1) { transition-delay: 0s, 0s; }
.section--writing.is-revealed .doc-card:nth-child(2) { transition-delay: 0.2s, 0.2s; }
.section--writing.is-revealed .doc-card:nth-child(3) { transition-delay: 0.4s, 0.4s; }

/* Folded corner — featured Javits card */
.doc-card--featured { position: relative; }
.doc-card--featured .doc-card__fold {
  position: absolute;
  top: 0; right: 0;
  width: 36px; height: 36px;
  z-index: 4;
  pointer-events: none;
  background:
    linear-gradient(225deg,
      transparent 0,
      transparent 49%,
      rgba(45, 36, 56, 0.18) 50%,
      transparent 51%),
    linear-gradient(225deg,
      rgba(255, 255, 255, 0.95) 0%,
      rgba(245, 234, 211, 0.95) 50%,
      transparent 50%);
  filter: drop-shadow(-2px 2px 3px rgba(45, 36, 56, 0.15));
  transition: width 0.35s var(--ease-out), height 0.35s var(--ease-out), filter 0.35s var(--ease-out);
}
.doc-card--featured:hover .doc-card__fold {
  width: 52px; height: 52px;
  filter: drop-shadow(-4px 4px 6px rgba(45, 36, 56, 0.25));
}

/* Portfolio — directional assembly (odd from left, even from right) */
.section--portfolio .project-card {
  transform: translateY(28px) translateX(-60px);
  transition: opacity 0.75s var(--ease-out), transform 0.85s var(--ease-out);
}
.section--portfolio .project-card:nth-child(even) {
  transform: translateY(28px) translateX(60px);
}
.section--portfolio.is-revealed .project-card,
.section--portfolio.is-revealed .project-card:nth-child(even) {
  transform: translateY(0) translateX(0);
}

@media (max-width: 768px) {
  .section--portfolio .project-card,
  .section--portfolio .project-card:nth-child(even) {
    transform: none;
    transition: none;
  }
}

/* Game — CRT boot flicker overlay */
.game__boot {
  position: absolute;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  background: #000;
  opacity: 0;
  border-radius: inherit;
}
.section--game.is-booting .game__boot {
  animation: crt-boot 0.6s steps(1) forwards;
}
.section--game.is-booting .game__frame { opacity: 0; }
.section--game.is-booted .game__frame {
  animation: boot-jitter 0.4s ease-out;
}

@keyframes crt-boot {
  0%   { opacity: 1; background: #000; }
  16%  { opacity: 1; background: #000; }
  17%  { opacity: 0.3; background: #fff; }
  33%  { opacity: 0.3; background: #fff; }
  34%  { opacity: 0.5;
         background: repeating-linear-gradient(0deg, #1A0F2E 0 1px, #4ADE80 1px 2px, #1A0F2E 2px 3px); }
  66%  { opacity: 0.5; }
  67%  { opacity: 0; }
  100% { opacity: 0; }
}
@keyframes boot-jitter {
  0%   { transform: translateY(0); }
  20%  { transform: translateY(-3px); }
  40%  { transform: translateY(2px); }
  60%  { transform: translateY(-1px); }
  100% { transform: translateY(0); }
}

/* Game — pixel cursor */
.section--game,
.section--game * {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' shape-rendering='crispEdges'><rect x='1' y='1' width='2' height='2' fill='%230B1120'/><rect x='3' y='1' width='2' height='2' fill='%234ADE80'/><rect x='1' y='3' width='2' height='2' fill='%234ADE80'/><rect x='3' y='3' width='2' height='2' fill='%234ADE80'/><rect x='5' y='3' width='2' height='2' fill='%234ADE80'/><rect x='3' y='5' width='2' height='2' fill='%234ADE80'/><rect x='5' y='5' width='2' height='2' fill='%234ADE80'/><rect x='7' y='5' width='2' height='2' fill='%234ADE80'/><rect x='5' y='7' width='2' height='2' fill='%234ADE80'/><rect x='7' y='7' width='2' height='2' fill='%234ADE80'/><rect x='9' y='7' width='2' height='2' fill='%234ADE80'/><rect x='5' y='9' width='2' height='2' fill='%23FFB74D'/><rect x='7' y='9' width='2' height='2' fill='%23FFB74D'/><rect x='9' y='9' width='2' height='2' fill='%23FFB74D'/><rect x='11' y='9' width='2' height='2' fill='%23FFB74D'/><rect x='1' y='1' width='2' height='2' fill='none' stroke='%230B1120'/></svg>") 0 0, pointer;
}

/* Parallax targets — JS sets --py */
.section__paper,
.section__iso,
.section__pixels {
  transform: translateY(var(--py, 0px));
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .section--game.is-booting .game__boot { animation: none; opacity: 0; }
  .section--game.is-booting .game__frame { opacity: 1; }
  .section--game.is-booted .game__frame { animation: none; }
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  position: relative;
  z-index: 60;
  padding: 2rem var(--gutter);
  border-top: 1px solid var(--color-border);
  background: #F5EAD3;
}
.footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font-family: "JetBrains Mono", monospace;
  font-size: var(--text-small);
  color: var(--color-text-secondary);
}
.footer__brand {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s var(--ease-out);
}
.footer__brand:hover,
.footer__brand:focus {
  color: var(--color-primary-500);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
