/* ============================================================
   CUPID MOOLCHANDANI — FIELD NOTES
   Warm paper · deep forest · stippled neural garden
   ============================================================ */

/* ---------- Design tokens (Dark default) ---------- */
:root {
  color-scheme: dark;

  --canvas: #09110e;
  --surface: #0f1c16;
  --surface-2: #14251d;
  --card: #0c1612;
  --ink: #efeade;
  --ink-soft: #d2cebe;
  --muted: #8a9886;
  --line: rgba(239, 234, 222, 0.12);
  --line-strong: rgba(239, 234, 222, 0.28);
  --accent: #86c49c;
  --accent-soft: rgba(134, 196, 156, 0.14);
  --rust: #d98a63;
  --green: #7fb79a;
  --green-ring: rgba(127, 183, 154, 0.28);

  --forest: #0c231a;
  --forest-2: #071711;
  --cream: #f1ebda;
  --cream-dim: #b9c4ac;
  --peach: #e7b394;

  --art-ink: #cfe0c2;
  --art-leaf: #7ea077;
  --art-glow: #d98a63;
  --art-ground: #7d8a7a;

  --header-bg: rgba(9, 17, 14, 0.88);
  --overlay: rgba(9, 17, 14, 0.9);
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.5), 0 24px 60px -36px rgba(0, 0, 0, 0.9);
  --scroll-thumb: rgba(239, 234, 222, 0.2);

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --serif: "Instrument Serif", "Times New Roman", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --header-h: 68px;
  --spine: 1180px;
  --radius: 6px;
  --radius-lg: 14px;
}

[data-theme="light"] {
  color-scheme: light;

  --canvas: #f6f3eb;
  --surface: #ede7dc;
  --surface-2: #e4ddcf;
  --card: #faf7f0;
  --ink: #16221a;
  --ink-soft: #304034;
  --muted: #5e6d60;
  --line: rgba(22, 34, 26, 0.12);
  --line-strong: rgba(22, 34, 26, 0.26);
  --accent: #3a6b4d;
  --accent-soft: rgba(58, 107, 77, 0.12);
  --rust: #bd6944;
  --green: #377553;
  --green-ring: rgba(55, 117, 83, 0.3);

  --forest: #102d23;
  --forest-2: #0a1f18;
  --cream: #f1ebda;
  --cream-dim: #b9c4ac;
  --peach: #e7b394;

  --art-ink: #1d3c2b;
  --art-leaf: #5f8056;
  --art-glow: #bf6b47;
  --art-ground: #7b8577;

  --header-bg: rgba(246, 243, 235, 0.86);
  --overlay: rgba(246, 243, 235, 0.88);
  --shadow: 0 1px 0 rgba(22, 34, 26, 0.03), 0 24px 60px -40px rgba(22, 34, 26, 0.45);
  --scroll-thumb: rgba(22, 34, 26, 0.18);
}

[data-theme="dark"] {
  color-scheme: dark;

  --canvas: #09110e;
  --surface: #0f1c16;
  --surface-2: #14251d;
  --card: #0c1612;
  --ink: #efeade;
  --ink-soft: #d2cebe;
  --muted: #8a9886;
  --line: rgba(239, 234, 222, 0.12);
  --line-strong: rgba(239, 234, 222, 0.28);
  --accent: #86c49c;
  --accent-soft: rgba(134, 196, 156, 0.14);
  --rust: #d98a63;
  --green: #7fb79a;
  --green-ring: rgba(127, 183, 154, 0.28);

  --forest: #0c231a;
  --forest-2: #071711;
  --cream: #f1ebda;
  --cream-dim: #b9c4ac;
  --peach: #e7b394;

  --art-ink: #cfe0c2;
  --art-leaf: #7ea077;
  --art-glow: #d98a63;
  --art-ground: #7d8a7a;

  --header-bg: rgba(9, 17, 14, 0.88);
  --overlay: rgba(9, 17, 14, 0.9);
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.5), 0 24px 60px -36px rgba(0, 0, 0, 0.9);
  --scroll-thumb: rgba(239, 234, 222, 0.2);
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

html,
body {
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15.5px;
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease);
}

body.menu-open {
  overflow: hidden;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

h1,
h2,
h3,
h4 {
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.08;
}

em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.012em;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
}

img,
canvas,
svg {
  max-width: 100%;
}

canvas {
  display: block;
}

::selection {
  background: var(--forest);
  color: var(--cream);
}

:focus-visible {
  outline: 1.5px solid var(--ink);
  outline-offset: 3px;
  border-radius: 4px;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -80px;
  left: 16px;
  z-index: 300;
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--canvas);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: top 0.3s var(--ease);
}

.skip-link:focus {
  top: 12px;
}

.nowrap {
  white-space: nowrap;
}

/* ---------- Paper grain ---------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  mix-blend-mode: multiply;
}

[data-theme="dark"] .grain {
  mix-blend-mode: screen;
  opacity: 0.035;
}

/* ---------- Scroll progress ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.1s linear;
}

/* ---------- Layout spine ---------- */
.spine {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--spine);
  margin-inline: auto;
  padding-inline: clamp(16px, 3vw, 28px);
}

/* ============================================================
   HEADER (removed from page)
   ============================================================ */

.site-header.scrolled,
.site-header.open {
  background: var(--header-bg);
  border-bottom-color: var(--line);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  backdrop-filter: blur(16px) saturate(130%);
}

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  max-width: 1240px;
  height: 100%;
  margin-inline: auto;
  padding-inline: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  color: var(--ink);
  transition: color 0.4s var(--ease);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  font-family: var(--serif);
  font-size: 14px;
  font-style: italic;
  letter-spacing: 0;
  transition: background-color 0.4s var(--ease), border-color 0.4s var(--ease),
    color 0.4s var(--ease);
}

.brand:hover .brand-mark {
  background: var(--forest);
  border-color: var(--forest);
  color: var(--cream);
}

.brand-copy {
  display: grid;
  gap: 0;
  line-height: 1.3;
  min-width: 0;
}

.brand-copy strong {
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: -0.012em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-role {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav-links {
  position: absolute;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 2px;
  transform: translateX(-50%);
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
}

.nav-links a:hover {
  background: var(--surface);
  color: var(--ink);
}

.nav-index {
  font-size: 9px;
  opacity: 0.55;
  font-variant-numeric: tabular-nums;
}

.nav-links a.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.nav-links a.active .nav-index {
  color: var(--accent);
  opacity: 1;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 29px;
  margin-right: 3px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  transition: border-color 0.35s var(--ease), color 0.35s var(--ease);
}

.status-badge:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.pulse-dot {
  position: relative;
  display: inline-block;
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 var(--green-ring);
  animation: pulse 2.6s var(--ease) infinite;
}

.is-muted .pulse-dot {
  background: var(--muted);
  box-shadow: none;
  animation: none;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 var(--green-ring); }
  70% { box-shadow: 0 0 0 6px rgba(0, 0, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); }
}

.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.35s var(--ease), border-color 0.35s var(--ease),
    color 0.35s var(--ease), transform 0.35s var(--ease);
}

.icon-btn:hover {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}

.icon-btn:active {
  transform: scale(0.94);
}

.icon-btn svg {
  width: 14px;
  height: 14px;
}

.theme-toggle .icon-moon {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}

.sound-toggle .sound-wave {
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.sound-toggle[aria-pressed="true"] .sound-wave {
  opacity: 1;
}

.sound-toggle::after {
  content: "";
  position: absolute;
  width: 17px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
  transform: rotate(-45deg);
  transition: opacity 0.3s var(--ease);
}

.sound-toggle[aria-pressed="true"]::after {
  opacity: 0;
}

.burger {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 33px;
  height: 33px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background-color 0.35s var(--ease), border-color 0.35s var(--ease);
}

.burger:hover {
  background: var(--surface);
  border-color: var(--line-strong);
}

.burger span {
  display: block;
  width: 12px;
  height: 1px;
  background: var(--ink);
  transition: transform 0.4s var(--ease), opacity 0.3s var(--ease),
    background-color 0.4s var(--ease);
}

.site-header.open .burger span:first-child {
  transform: translateY(3px) rotate(45deg);
}

.site-header.open .burger span:last-child {
  transform: translateY(-3px) rotate(-45deg);
}

.nav-scrim {
  position: fixed;
  inset: var(--header-h) 0 0;
  z-index: 98;
  background: var(--overlay);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s var(--ease), visibility 0.4s var(--ease);
}

.nav-scrim.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  padding-top: clamp(36px, 5vw, 64px);
  padding-bottom: clamp(18px, 2.4vw, 30px);
  background: linear-gradient(180deg, #050806 0%, #09110e 100%);
  overflow: hidden;
}

.hero-field {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.hero-greeting {
  position: absolute;
  z-index: 2;
  top: 10%;
  left: 50%;
  margin: 0;
  transform: translate(-50%, -100%);
  color: var(--accent);
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.3vw, 1.8rem);
  font-style: italic;
  line-height: 1;
  letter-spacing: -0.025em;
  white-space: nowrap;
  text-shadow: 0 2px 16px var(--canvas);
}

.hero-grid-lines {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--line) 1px, transparent 1.15px);
  background-size: 27px 27px;
  opacity: 0.55;
  -webkit-mask-image: radial-gradient(120% 100% at 50% 26%, #000 0%, rgba(0, 0, 0, 0.35) 50%, transparent 78%);
  mask-image: radial-gradient(120% 100% at 50% 26%, #000 0%, rgba(0, 0, 0, 0.35) 50%, transparent 78%);
}

.hero-disc {
  position: absolute;
  top: 8%;
  left: 50%;
  transform: translateX(-50%);
  width: min(46vw, 560px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(231, 179, 148, 0.22), rgba(231, 179, 148, 0.05) 54%, transparent 72%);
  pointer-events: none;
}

[data-theme="dark"] .hero-disc {
  background: radial-gradient(circle at 50% 50%, rgba(92, 122, 82, 0.16), rgba(92, 122, 82, 0.03) 54%, transparent 72%);
}

#gardenCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-inner {
  display: flex;
  flex: 1;
  align-items: center;
  width: 100%;
}

.hero-inner--centered {
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  text-align: center;
}

.hero-inner--centered .hero-copy {
  max-width: 500px;
  margin-top: 24px;
}

.hero-inner--centered .hero-actions {
  justify-content: center;
}

.hero-inner--centered .hero-contact {
  justify-content: center;
}

.hero-copy {
  max-width: 380px;
}

.hero-title {
  margin-top: 0;
  font-size: clamp(2.2rem, 4.2vw, 3.4rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.hero-title span {
  display: block;
}

.hero-tag {
  display: none;
  font-family: var(--serif);
  font-size: clamp(1.22rem, 2.1vw, 1.65rem);
  font-weight: 400;
  line-height: 1.38;
  letter-spacing: -0.012em;
  color: var(--ink-soft);
}

.hero-tag em {
  font-size: 1.02em;
  line-height: 1.1;
  color: var(--ink);
}

.hero-role {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-height: 1.7em;
  margin-top: 20px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.role-mark {
  color: var(--rust);
}

.caret {
  display: inline-block;
  width: 1px;
  height: 12px;
  margin-left: 3px;
  background: var(--ink);
  vertical-align: -1px;
  animation: blink 1.15s steps(1) infinite;
}

@keyframes blink {
  0%, 48% { opacity: 1; }
  49%, 100% { opacity: 0; }
}

/* Bio section (in background, below tree) */
.hero-with-bio .bio-spine {
  margin-top: 60px;
  text-align: center;
}

.hero-with-bio .notes-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

.hero-with-bio .bio-copy {
  max-width: 420px;
  margin: 0 auto;
}

.hero-with-bio .bio-title span {
  display: block;
}

.hero-with-bio .bio-role {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-height: 1.7em;
  margin-top: 20px;
}

/* Bio after tree section */
.hero-with-bio .bio-after-tree {
  margin-top: 60px;
  padding-top: 48px;
  border-top: 1px solid var(--line-strong);
}

.hero-with-bio .bio-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 18px;
  margin-top: 30px;
}

.hero-with-bio .bio-contact {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.hero-with-bio .bio-social {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: visible;
  text-align: center;
}

/* Mobile tweaks for bio section */
@media (max-width: 900px) {
  .hero-with-bio .bio-spine {
    margin-top: 48px;
  }
  
  .hero-with-bio .bio-contact {
    flex-direction: column;
    gap: 16px;
  }
}

@media (max-width: 600px) {
  .hero-with-bio .bio-spine {
    margin-top: 40px;
  }
  
  .hero-with-bio .bio-copy {
    max-width: none;
    padding: 0 24px;
  }
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  margin-top: 30px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 43px;
  padding: 0 21px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.45s var(--ease), border-color 0.45s var(--ease),
    color 0.45s var(--ease), transform 0.45s var(--ease);
}

.btn .arrow {
  font-size: 13px;
  transition: transform 0.45s var(--ease);
}

.btn:hover .arrow {
  transform: translate(2px, -2px);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--forest);
  border-color: var(--forest);
  color: var(--cream);
}

.btn-primary:hover {
  background: var(--rust);
  border-color: var(--rust);
  color: var(--cream);
}

.btn-quiet {
  height: auto;
  padding: 4px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  color: var(--ink);
  transition: border-color 0.4s var(--ease), color 0.4s var(--ease);
}

.btn-quiet:hover {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}

.btn-quiet .arrow {
  transition: transform 0.45s var(--ease);
}

.btn-quiet:hover .arrow {
  transform: translateX(4px);
}

.hero-contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  max-width: 580px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.email-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding-bottom: 2px;
  background-image: linear-gradient(var(--line-strong), var(--line-strong));
  background-size: 100% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
  transition: background-image 0.45s var(--ease);
}

.email-link:hover {
  background-image: linear-gradient(var(--ink), var(--ink));
}

.email-link .arrow {
  color: var(--muted);
  font-family: var(--sans);
  transition: transform 0.45s var(--ease), color 0.45s var(--ease);
}

.email-link:hover .arrow {
  color: var(--ink);
  transform: translate(2px, -2px);
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.35s var(--ease), border-color 0.35s var(--ease),
    color 0.35s var(--ease);
}

.copy-btn svg {
  width: 11px;
  height: 11px;
}

.copy-btn:hover {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}

.copy-btn.is-copied {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--ink);
}

.contact-divider {
  width: 1px;
  height: 12px;
  background: var(--line-strong);
}

.hero-social {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.35s var(--ease);
}

.social-link .arrow {
  transition: transform 0.4s var(--ease);
}

.social-link:hover {
  color: var(--ink);
}

.social-link:hover .arrow {
  transform: translate(1px, -1px);
}

.hero-foot {
  position: relative;
  z-index: 2;
}

/* Full-bleed paper shelf: the garden stops cleanly at the ledger line. */
.hero-foot::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: calc(-1 * clamp(18px, 2.4vw, 30px));
  left: -40px;
  right: -40px;
  background: var(--canvas);
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: clamp(30px, 4vw, 48px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.hero-meta li {
  display: grid;
  gap: 5px;
  padding: 14px 20px;
  border-left: 1px solid var(--line);
}

.hero-meta li:first-child {
  padding-left: 0;
  border-left: 0;
}

.hero-meta li:last-child {
  padding-right: 0;
}

.hero-meta span {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-meta strong {
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: -0.008em;
  color: var(--ink);
}

/* ---------- Tree annotations ---------- */
.tree-notes {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.tree-note {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  pointer-events: auto;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(11, 20, 16, 0.85);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  color: var(--ink-soft);
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease),
    background-color 0.3s var(--ease), transform 0.3s var(--ease);
}

.tree-note::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 1px;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
  transition: background-color 0.3s var(--ease);
}

.tree-note:hover {
  color: var(--ink);
  border-color: var(--accent);
  background: rgba(16, 32, 24, 0.95);
  transform: translateY(-2px);
}

.tree-note:hover::before {
  background: var(--rust);
  box-shadow: 0 0 8px var(--rust);
}

.tree-note-index {
  color: var(--accent);
  font-weight: 500;
}

.tree-note--a {
  top: 25%;
  left: 56%;
}

.tree-note--b {
  top: 62%;
  right: 5%;
}

.tree-note--c {
  top: 45%;
  left: 57%;
}

@media (max-width: 1120px) {
  .tree-notes {
    display: block;
  }

  .tree-note {
    position: absolute;
    padding: 3px 6px;
    gap: 4px;
    font-size: clamp(7px, 2vw, 9px);
    letter-spacing: 0.045em;
  }
}

/* ============================================================
   SECTIONS
   ============================================================ */
.section {
  position: relative;
  padding-block: clamp(78px, 10vw, 128px);
}

.section-head {
  margin-bottom: clamp(38px, 5vw, 58px);
}

.section-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-index {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--ink);
}

.kicker-line {
  width: 28px;
  height: 1px;
  background: var(--line-strong);
}

.kicker-reference {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-title {
  max-width: 15ch;
  margin-top: 22px;
  font-family: var(--serif);
  font-size: clamp(2.5rem, 4.7vw, 3.9rem);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.022em;
}

.section-title em {
  font-size: 1.03em;
}

.section-note {
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.rail-note-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
}

.rail-note-row .section-note {
  white-space: nowrap;
  margin-top: 0;
}

/* ============================================================
   BACKGROUND — FIELD NOTES
   ============================================================ */
.notes {
  --canvas: #15110d;
  --surface: #201910;
  --surface-2: #2c2116;
  --card: #1b1510;
  --ink: #f0e4d0;
  --ink-soft: #d7c3a6;
  --muted: #ae9877;
  --line: rgba(220, 187, 139, 0.15);
  --line-strong: rgba(220, 187, 139, 0.3);
  --accent: #c9995e;
  --accent-soft: rgba(201, 153, 94, 0.16);
  --rust: #c2764b;
  --green: #ae9877;
  --forest: #38291b;
  --forest-2: #21180f;
  --peach: #c18c52;
  padding: clamp(36px, 4.5vw, 56px) 0;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(93, 105, 59, 0.14), transparent 48%),
    linear-gradient(180deg, #211a11 0%, #1d1911 8%, #17120d 58%, #111311 100%);
  isolation: isolate;
}

.notes::before,
.section--arcade::before,
.section--arcade::after,
.contact::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
  background-repeat: repeat;
  animation: strata-drift 24s linear infinite alternate;
}

.notes::before {
  top: 0;
  height: 88px;
  opacity: 0.52;
  background-image:
    linear-gradient(180deg, rgba(110, 88, 53, 0.52), rgba(49, 45, 29, 0.34) 45%, transparent),
    repeating-linear-gradient(90deg, transparent 0 16px, rgba(124, 96, 57, 0.54) 16px 23px, transparent 23px 44px, rgba(49, 47, 31, 0.65) 44px 58px, transparent 58px 78px),
    repeating-linear-gradient(0deg, transparent 0 7px, rgba(65, 58, 37, 0.8) 7px 14px, transparent 14px 23px),
    radial-gradient(ellipse at 18% 62%, rgba(171, 137, 83, 0.5) 0 2px, transparent 3px),
    radial-gradient(ellipse at 72% 30%, rgba(125, 111, 72, 0.44) 0 2px, transparent 3px);
  background-size: auto, 156px 88px, 100% 31px, 47px 33px, 61px 41px;
}

@keyframes strata-drift {
  from { background-position: 0 0, 0 0, 0 0; }
  to { background-position: 0 0, 52px 0, 0 15px; }
}

.notes-grid {
  display: grid;
  grid-template-columns: minmax(0, min(520px, 46%)) minmax(0, 1fr);
  gap: clamp(24px, 3.5vw, 44px);
  align-items: start;
}

.rail-sticky {
  position: sticky;
  top: calc(var(--header-h) + 24px);
}

.notes-rail .section-title {
  max-width: none;
  white-space: nowrap;
  text-shadow: 0 3px 16px rgba(8, 6, 4, 0.82), 0 0 32px rgba(8, 6, 4, 0.48);
}

.rail-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
}

.rail-title-row .section-title {
  margin-top: 0;
}

.rail-fig {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 0;
  color: var(--ink);
}

.rail-fig .sprig {
  width: 58px;
  height: 86px;
  flex: 0 0 auto;
  transform: rotate(-3deg);
  overflow: visible;
}

.rail-fig figcaption {
  padding-bottom: 4px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Botanical sprig ---------- */
.sprig {
  color: var(--ink);
  opacity: 0.92;
}

.sprig-leaf {
  fill: var(--accent);
  fill-opacity: 0.2;
}

.sprig-flower ellipse {
  fill: var(--peach);
  fill-opacity: 0.72;
  stroke: var(--ink);
  stroke-width: 0.8;
}

.sprig-center {
  fill: var(--rust);
  stroke: none;
}

/* ---------- 2-Column CV Layout ---------- */
.cv-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

@media (max-width: 860px) {
  .cv-columns {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.cv-group + .cv-group {
  margin-top: 0;
}

.cv-group--skills {
  margin-top: 22px !important;
}

.micro-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line-strong);
}

.micro-head h3 {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}

.micro-count {
  font-family: var(--mono);
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* ---------- Expandable entries ---------- */
.entry {
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius);
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.entry[open] {
  background: var(--card);
  border: 1px solid var(--line-strong);
  margin-block: 5px;
  padding-inline: 10px;
}

[data-theme="dark"] .entry[open] {
  box-shadow: 0 4px 16px -6px rgba(0, 0, 0, 0.45);
}

.entry-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 14px;
  align-items: start;
  gap: 10px;
  padding: 10px 4px;
  border-radius: var(--radius);
  cursor: pointer;
  list-style: none;
  transition: background-color 0.3s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.entry-summary::-webkit-details-marker {
  display: none;
}

.entry-summary:hover .entry-title {
  color: var(--accent);
}

.entry[open] .entry-summary {
  background: transparent;
  border-bottom: 1px dashed var(--line);
}

.entry-main {
  min-width: 0;
}

.entry-title {
  display: block;
  font-family: var(--serif);
  font-size: clamp(1.12rem, 1.4vw, 1.25rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.012em;
  color: var(--ink);
}

.entry-org {
  display: block;
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1.4;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.entry-dot {
  opacity: 0.5;
}

.entry-year {
  padding-top: 2px;
  font-family: var(--mono);
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
  text-align: right;
  white-space: nowrap;
  color: var(--muted);
}

.entry-plus {
  position: relative;
  width: 14px;
  height: 14px;
  margin-top: 3px;
}

.entry-plus::before,
.entry-plus::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  background: var(--muted);
  transition: transform 0.4s var(--ease), opacity 0.3s var(--ease);
}

.entry-plus::before {
  width: 9px;
  height: 1px;
  transform: translate(-50%, -50%);
}

.entry-plus::after {
  width: 1px;
  height: 9px;
  transform: translate(-50%, -50%);
}

.entry-summary:hover .entry-plus::before,
.entry-summary:hover .entry-plus::after {
  background: var(--ink);
}

.entry[open] .entry-plus::after {
  opacity: 0;
  transform: translate(-50%, -50%) scaleY(0);
}

.entry-body {
  height: auto;
  overflow: hidden;
  transition: height 0.4s var(--ease);
}

.entry-inner {
  padding: 12px 4px 14px;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
  padding-top: 2px;
}

.experience-details {
  display: grid;
  gap: 7px;
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.meta-pair dt {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.meta-pair dd {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink);
}

.chip-set {
  margin-top: 14px;
}

.meta-label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.01em;
  color: var(--muted);
  transition: border-color 0.35s var(--ease), color 0.35s var(--ease),
    background-color 0.35s var(--ease);
}

.chip:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
  color: var(--ink);
}

/* ---------- Condensed Toolkit Grid ---------- */
.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.skill-row {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 10px;
  margin: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}

.skill-row:hover {
  background: var(--surface);
  border-color: var(--line-strong);
}

.skill-index,
.skill-count {
  display: none;
}

.skill-name {
  display: inline;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.1;
  color: var(--ink);
  white-space: nowrap;
}

.skill-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.skill-items-text {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.02em;
  color: var(--muted);
  line-height: 1.5;
}

.skill-body {
  display: inline;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.01em;
  color: var(--muted);
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}

.tag:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
  color: var(--ink);
}

/* ============================================================
   ARCADE — DEEP FOREST CONSOLE
   ============================================================ */
.section--arcade {
  --canvas: #090b0a;
  --surface: #131615;
  --surface-2: #1c1f1d;
  --card: #0e100f;
  --ink: #e5e4de;
  --ink-soft: #c8c8c1;
  --muted: #a0a19a;
  --line: rgba(210, 211, 203, 0.14);
  --line-strong: rgba(210, 211, 203, 0.28);
  --accent: #b9bbb4;
  --accent-soft: rgba(185, 187, 180, 0.14);
  --rust: #c08054;
  --green: #aeb0a8;
  --forest: #292c2a;
  --forest-2: #1a1c1b;
  --cream: #e5e4de;
  --cream-dim: #bdbeb7;
  --peach: #b0b2ab;
  padding-top: clamp(16px, 2.2vw, 28px);
  padding-bottom: clamp(20px, 2.8vw, 34px);
  overflow: clip;
  border-block: 1px solid rgba(241, 235, 218, 0.12);
  background:
    radial-gradient(ellipse at 76% 48%, rgba(47, 51, 49, 0.24), transparent 44%),
    repeating-linear-gradient(180deg, transparent 0 74px, rgba(103, 106, 101, 0.08) 74px 77px, transparent 77px 124px),
    linear-gradient(180deg, #111311 0%, #0b0d0c 18%, #070808 58%, #0b0d0c 100%);
  color: var(--cream);
  isolation: isolate;
}

.section--arcade::before,
.section--arcade::after {
  height: 92px;
  opacity: 0.76;
  background-size: 100% 100%, 152px 72px, 100% 28px, 82px 61px;
}

.section--arcade::before {
  top: 0;
  clip-path: polygon(0 0, 100% 0, 100% 58%, 96% 58%, 94% 73%, 89% 73%, 87% 62%, 80% 62%, 78% 82%, 72% 82%, 69% 68%, 62% 68%, 60% 87%, 53% 87%, 50% 68%, 44% 68%, 42% 76%, 35% 76%, 32% 60%, 26% 60%, 23% 80%, 17% 80%, 14% 63%, 8% 63%, 6% 74%, 0 74%);
  background-image:
    linear-gradient(180deg, rgba(96, 100, 94, 0.48), rgba(29, 32, 30, 0.92)),
    repeating-linear-gradient(90deg, transparent 0 24px, rgba(117, 120, 113, 0.6) 24px 36px, transparent 36px 56px, rgba(46, 49, 46, 0.8) 56px 78px),
    repeating-linear-gradient(0deg, transparent 0 9px, rgba(72, 75, 71, 0.8) 9px 18px, transparent 18px 27px),
    radial-gradient(ellipse at 25% 45%, rgba(153, 157, 147, 0.54) 0 2px, transparent 4px);
}

.section--arcade::after {
  bottom: 0;
  height: 112px;
  clip-path: polygon(0 38%, 6% 38%, 8% 24%, 15% 24%, 18% 43%, 25% 43%, 28% 18%, 34% 18%, 38% 40%, 44% 40%, 48% 22%, 55% 22%, 58% 44%, 64% 44%, 68% 17%, 75% 17%, 78% 39%, 84% 39%, 88% 20%, 94% 20%, 97% 38%, 100% 38%, 100% 100%, 0 100%);
  background-image:
    linear-gradient(180deg, rgba(38, 41, 39, 0.86), #090b0a),
    repeating-linear-gradient(90deg, transparent 0 22px, rgba(93, 98, 91, 0.56) 22px 33px, transparent 33px 54px, rgba(39, 43, 40, 0.88) 54px 76px),
    repeating-linear-gradient(0deg, transparent 0 8px, rgba(73, 77, 72, 0.72) 8px 17px, transparent 17px 26px),
    radial-gradient(ellipse at 58% 35%, rgba(140, 145, 135, 0.42) 0 2px, transparent 4px);
}

.section--arcade .section-head {
  margin-bottom: clamp(12px, 1.8vw, 20px);
}

.arcade-stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(rgba(241, 235, 218, 0.5) 1px, transparent 1.1px),
    radial-gradient(rgba(231, 179, 148, 0.35) 1px, transparent 1.1px);
  background-size: 86px 86px, 137px 137px;
  background-position: 0 0, 43px 51px;
  opacity: 0.3;
  -webkit-mask-image: radial-gradient(110% 80% at 70% 20%, #000, transparent 76%);
  mask-image: radial-gradient(110% 80% at 70% 20%, #000, transparent 76%);
}

.section-head--light .section-kicker {
  color: var(--cream-dim);
}

.section-head--light .section-index {
  border-color: rgba(241, 235, 218, 0.34);
  color: var(--cream);
}

.section-head--light .kicker-line {
  background: rgba(241, 235, 218, 0.3);
}

.section-head--light .section-title {
  color: var(--cream);
}

.section-head--light .section-note {
  color: var(--cream-dim);
}

.arcade-frame {
  display: grid;
  grid-template-columns: minmax(0, 222px) minmax(0, 1fr);
  gap: 0 14px;
  width: min(100%, 1080px);
  min-height: 620px;
  min-width: 0;
  margin-inline: auto;
  padding: 8px;
  border: 1px solid rgba(241, 235, 218, 0.2);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.14);
  box-shadow: 0 40px 90px -60px rgba(0, 0, 0, 0.9);
}

.arcade-bar {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 18px;
  padding: 4px 8px 9px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(241, 235, 218, 0.55);
}

.game-tabs {
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  gap: 5px;
  min-width: 0;
  padding: 2px 14px 2px 0;
  border-right: 1px solid rgba(241, 235, 218, 0.14);
  border-bottom: 0;
}

.game-tab {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  padding: 12px 13px;
  border: 1px solid rgba(241, 235, 218, 0.18);
  border-radius: 8px;
  background: transparent;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(241, 235, 218, 0.68);
  cursor: pointer;
  transition: background-color 0.35s var(--ease), border-color 0.35s var(--ease),
    color 0.35s var(--ease);
}

.game-tab:hover {
  background: rgba(241, 235, 218, 0.08);
  border-color: rgba(241, 235, 218, 0.34);
  color: var(--cream);
}

.game-tab[aria-selected="true"] {
  background: var(--cream);
  border-color: var(--cream);
  color: var(--forest);
}

.tab-index {
  font-size: 8.5px;
  opacity: 0.6;
  font-variant-numeric: tabular-nums;
}

.game-tab[aria-selected="true"] .tab-index {
  opacity: 0.65;
}

.arcade-screen {
  position: relative;
  grid-column: 2;
  width: 100%;
  min-height: 520px;
  min-width: 0;
  margin-top: 0;
  padding: clamp(14px, 2vw, 22px);
  border-radius: 11px;
  background: var(--card);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}

.pixel-corner {
  position: absolute;
  width: 10px;
  height: 10px;
  pointer-events: none;
  z-index: 5;
}

.pixel-corner--tl {
  top: 8px;
  left: 8px;
  border-top: 2px solid var(--accent);
  border-left: 2px solid var(--accent);
}

.pixel-corner--tr {
  top: 8px;
  right: 8px;
  border-top: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
}

.pixel-corner--bl {
  bottom: 8px;
  left: 8px;
  border-bottom: 2px solid var(--accent);
  border-left: 2px solid var(--accent);
}

.pixel-corner--br {
  bottom: 8px;
  right: 8px;
  border-bottom: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
}

.game-stage {
  position: relative;
  width: 100%;
  max-width: none;
  min-width: 0;
  min-height: clamp(24rem, 58vh, 34rem);
  margin-inline: auto;
}

.game-stage > * {
  max-width: 100%;
}

.game-stage .game-canvas {
  width: min(100%, 380px);
}

.game-stage .memory-grid,
.game-stage .ttt-grid,
.game-stage .game-canvas,
.game-stage .reaction-box {
  width: 100%;
  max-width: 58rem;
  margin-inline: auto;
}

.game-stage > h3,
.game-stage > .game-info,
.game-stage > .game-row,
.game-stage > .rps-choices {
  width: 100%;
  margin-inline: auto;
}

.game-stage .canvas-wrap {
  width: 100%;
}

.game-stage .canvas-wrap canvas {
  display: block;
  max-width: 100%;
}

.game-stage.is-lab {
  width: 100%;
  max-width: min(100%, 58rem);
}

.game-stage.is-lab .lab-panel,
.game-stage.is-lab .lab-body,
.game-stage.is-lab .canvas-wrap {
  width: 100%;
}

.game-stage h3 {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 2.8vw, 2.1rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.018em;
}

.game-stage h3 span {
  margin-left: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.game-info {
  margin: 8px 0;
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.7;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.game-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
}

.snake-score {
  font-family: var(--mono);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.game-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.35s var(--ease), border-color 0.35s var(--ease),
    color 0.35s var(--ease), transform 0.35s var(--ease);
}

.game-btn:hover {
  background: var(--surface);
  border-color: var(--ink);
}

.game-btn:active {
  transform: translateY(1px);
}

.game-btn.primary {
  background: var(--forest);
  border-color: var(--forest);
  color: var(--cream);
}

.game-btn.primary:hover {
  background: var(--rust);
  border-color: var(--rust);
  color: var(--cream);
}

.game-canvas {
  display: block;
  width: 100%;
  max-width: 380px;
  margin: 20px auto;
  aspect-ratio: 1;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--canvas);
  touch-action: none;
}

.dpad {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  grid-auto-rows: 44px;
  gap: 6px;
  justify-content: center;
  margin-top: 12px;
}

.dpad-btn {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--canvas);
  font-size: 10px;
  color: var(--muted);
  cursor: pointer;
  touch-action: none;
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease),
    color 0.3s var(--ease);
}

.dpad-btn:hover {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}

.dpad-btn:active {
  background: var(--accent-soft);
  border-color: var(--accent);
}

@media (hover: hover) and (pointer: fine) {
  .dpad {
    display: none;
  }
}

/* ---------- Lab ---------- */
.lab-body {
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(0, 0.62fr);
  gap: clamp(20px, 3vw, 36px);
  align-items: start;
}

.lab-body .controls,
.lab-body .controls--three,
.lab-body .controls--pair {
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 0;
  align-content: start;
  align-self: center;
}

.lab-body .readout {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 9px;
  padding-top: 13px;
}

.lab-body .game-btn {
  width: 100%;
}

.lab-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.lab-tag {
  display: block;
  margin-bottom: 7px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

.live-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.live-tag i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2.6s var(--ease) infinite;
}

.canvas-wrap {
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--canvas);
  line-height: 0;
}

.canvas-wrap canvas {
  width: 100%;
  height: auto;
}

.controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 26px;
  margin-top: 22px;
}

.controls--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.controls--pair {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ctl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  align-items: center;
}

.ctl-name {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.ctl-val {
  font-family: var(--mono);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.ctl input[type="range"] {
  grid-column: 1 / -1;
  width: 100%;
  height: 18px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.ctl input[type="range"]::-webkit-slider-runnable-track {
  height: 1px;
  background: var(--line-strong);
}

.ctl input[type="range"]::-webkit-slider-thumb {
  width: 11px;
  height: 11px;
  margin-top: -5px;
  border: 2px solid var(--canvas);
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 1px var(--line-strong);
  -webkit-appearance: none;
  appearance: none;
  transition: transform 0.3s var(--ease), background-color 0.3s var(--ease);
}

.ctl input[type="range"]:hover::-webkit-slider-thumb {
  background: var(--rust);
  transform: scale(1.15);
}

.ctl input[type="range"]::-moz-range-track {
  height: 1px;
  background: var(--line-strong);
}

.ctl input[type="range"]::-moz-range-thumb {
  width: 9px;
  height: 9px;
  border: 2px solid var(--canvas);
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 1px var(--line-strong);
}

.ctl input[type="range"]:hover::-moz-range-thumb {
  background: var(--rust);
}

.readout {
  display: flex;
  flex-wrap: wrap;
  grid-column: 1 / -1;
  gap: 8px 24px;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.readout > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.readout span {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.readout b {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

/* ---------- Game pieces ---------- */
.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  max-width: min(100%, 38rem);
  margin: 20px auto;
}

.memory-card {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  font-size: clamp(18px, 5vw, 26px);
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.4s var(--ease), border-color 0.4s var(--ease),
    transform 0.4s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.memory-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.memory-card:not(.flipped):not(.matched) {
  background-image: radial-gradient(var(--line) 1px, transparent 1px);
  background-size: 12px 12px;
  background-position: center;
}

.memory-card.flipped {
  background: var(--canvas);
  border-color: var(--line-strong);
}

.memory-card.matched {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.ttt-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  max-width: min(100%, 28rem);
  margin: 20px auto;
}

.ttt-cell {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--canvas);
  font-family: var(--serif);
  font-size: clamp(1.8rem, 7vw, 2.4rem);
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.35s var(--ease), border-color 0.35s var(--ease);
}

.ttt-cell:hover {
  background: var(--surface);
  border-color: var(--line-strong);
}

.ttt-cell.win {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.reaction-box {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 190px;
  margin: 18px 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
  transition: none;
  touch-action: manipulation;
}

.reaction-box:hover {
  border-color: var(--line-strong);
}

.reaction-box.wait {
  background: var(--surface-2);
}

.reaction-box.go {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.rps-choices {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 22px 0;
}

.rps-choice {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--canvas);
  font-size: 27px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease),
    background-color 0.4s var(--ease);
}

.rps-choice:hover {
  background: var(--surface);
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.game-input {
  width: 150px;
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--canvas);
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink);
}

.game-input::placeholder {
  color: var(--muted);
}

.arcade-foot {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 10px 8px 2px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: rgba(241, 235, 218, 0.58);
}
/* ============================================================
   CONTACT & FOOTER
   ============================================================ */
.contact {
  position: relative;
  padding-top: clamp(28px, 3.5vw, 46px);
  overflow: clip;
  --accent: #ef9a58;
  --accent-soft: rgba(239, 154, 88, 0.16);
  --muted: #c0a18e;
  --line: rgba(244, 190, 153, 0.15);
  --line-strong: rgba(244, 190, 153, 0.3);
  background:
    radial-gradient(ellipse at 50% 105%, rgba(190, 44, 12, 0.2), transparent 44%),
    linear-gradient(180deg, #0b0d0c 0%, #100b09 55%, #160906 100%);
  isolation: isolate;
}

.contact::before {
  bottom: 0;
  height: 176px;
  opacity: 0.78;
  clip-path: polygon(0 44%, 7% 44%, 10% 34%, 17% 34%, 21% 49%, 29% 49%, 33% 31%, 40% 31%, 44% 52%, 51% 52%, 55% 29%, 63% 29%, 67% 48%, 75% 48%, 79% 32%, 86% 32%, 90% 50%, 96% 50%, 100% 39%, 100% 100%, 0 100%);
  background-image:
    radial-gradient(ellipse at 50% 96%, rgba(255, 76, 20, 0.64), transparent 52%),
    linear-gradient(0deg, rgba(97, 22, 11, 0.96), rgba(38, 15, 12, 0.92) 55%, transparent),
    repeating-linear-gradient(90deg, transparent 0 14px, rgba(215, 65, 24, 0.72) 14px 21px, transparent 21px 38px, rgba(94, 34, 20, 0.88) 38px 52px),
    repeating-linear-gradient(0deg, transparent 0 8px, rgba(120, 35, 16, 0.82) 8px 16px, transparent 16px 27px),
    repeating-linear-gradient(168deg, transparent 0 24px, rgba(255, 100, 30, 0.78) 24px 27px, transparent 27px 42px);
  background-size: 100% 100%, 100% 100%, 138px 100%, 100% 54px, 188px 80px;
  animation: magma-pulse 5s ease-in-out infinite alternate, strata-drift 19s linear infinite alternate;
}

/* Custom pixel illustrations replace the rough repeating texture layers. */
.notes::before,
.section--arcade::before,
.section--arcade::after,
.contact::before {
  display: none;
}

.earth-art {
  position: absolute;
  z-index: 0;
  left: 0;
  display: block;
  width: 100%;
  pointer-events: none;
  shape-rendering: crispEdges;
}

.earth-art--soil {
  top: 0;
  height: 205px;
  opacity: 0.74;
  animation: soil-shift 18s ease-in-out infinite alternate;
}

.earth-art--rock {
  top: 0;
  height: 170px;
  opacity: 0.52;
  animation: rock-shift 24s ease-in-out infinite alternate;
}

.earth-art--water {
  bottom: 0;
  left: 50%;
  width: 100vw;
  height: 150px;
  opacity: 0.7;
  transform: translateX(-50%);
  animation: water-drift 8s ease-in-out infinite alternate;
}

.earth-critter--worm { animation: critter-wiggle 3.6s ease-in-out infinite alternate; transform-origin: 570px 82px; }
.earth-critter--bat { animation: critter-flit 2.8s ease-in-out infinite alternate; }
.earth-critter--angler { animation: critter-wiggle 4s ease-in-out infinite alternate; transform-origin: 700px 120px; }
.earth-critter--salamander { animation: critter-wiggle 2.4s ease-in-out infinite alternate; }
.earth-critter--moth { animation: critter-flit 2s ease-in-out infinite alternate; }

.earth-art--magma {
  bottom: 160px;
  height: 270px;
  opacity: 0.66;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 24%, #000 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 24%, #000 100%);
  animation: magma-glow 4s ease-in-out infinite alternate;
}

@keyframes soil-shift { to { transform: translateY(5px); } }
@keyframes rock-shift { to { transform: translateY(-4px); } }
@keyframes water-drift { to { translate: 0 -4px; } }
@keyframes critter-wiggle { to { translate: 0 -3px; } }
@keyframes critter-flit { to { translate: 0 -5px; } }
@keyframes fish-drift { to { translate: 10px 0; } }
@keyframes magma-glow { from { filter: brightness(.82); } to { filter: brightness(1.16); } }

@keyframes magma-pulse {
  from { filter: brightness(0.82); }
  to { filter: brightness(1.14); }
}

.contact-dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--line) 1px, transparent 1.1px);
  background-size: 26px 26px;
  opacity: 0.5;
  -webkit-mask-image: radial-gradient(90% 90% at 80% 10%, #000, transparent 70%);
  mask-image: radial-gradient(90% 90% at 80% 10%, #000, transparent 70%);
}

.contact-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
}

.contact-title {
  max-width: 17ch;
  margin-top: 24px;
  font-family: var(--serif);
  font-size: clamp(2.7rem, 6vw, 4.7rem);
  font-weight: 400;
  line-height: 0.97;
  letter-spacing: -0.028em;
}

.contact-title em {
  font-size: 1.02em;
}

.seal {
  width: 132px;
  height: 132px;
  flex: 0 0 auto;
  margin-top: 6px;
  color: var(--ink);
  opacity: 0.9;
}

.seal svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.seal-ring {
  transform-origin: 70px 70px;
  animation: seal-spin 44s linear infinite;
}

.seal-text {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 1.4px;
  fill: currentColor;
  opacity: 0.72;
}

.seal-inner {
  fill: none;
  stroke: currentColor;
  stroke-width: 0.8;
  opacity: 0.22;
}

.seal-mark {
  font-family: var(--serif);
  font-size: 22px;
  font-style: italic;
  fill: currentColor;
}

@keyframes seal-spin {
  to { transform: rotate(360deg); }
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 350px);
  gap: clamp(40px, 6vw, 84px);
  align-items: start;
  margin-top: clamp(44px, 6vw, 68px);
  padding-top: clamp(32px, 4vw, 44px);
  border-top: 1px solid var(--line-strong);
}

.contact-lede {
  max-width: 44ch;
  font-family: var(--serif);
  font-size: clamp(1.3rem, 2.2vw, 1.55rem);
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.email-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.email-link--lg {
  font-family: var(--sans);
  font-size: clamp(1.02rem, 2.2vw, 1.4rem);
  font-weight: 500;
  letter-spacing: -0.022em;
}

.copy-btn--lg {
  height: 36px;
  padding: 0 14px;
  font-size: 10px;
}

.copy-btn--lg svg {
  width: 12px;
  height: 12px;
}

.contact-links {
  margin-top: 34px;
}

.contact-links-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 11px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.contact-link {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto 16px;
  align-items: center;
  gap: 12px;
  padding: 16px 14px;
  margin-inline: -14px;
  border-top: 1px solid var(--line);
  border-radius: var(--radius);
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}

.contact-link:hover {
  background: #3b1b11;
  color: var(--cream);
}

.contact-index {
  font-family: var(--mono);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  transition: color 0.4s var(--ease);
}

.contact-label {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.contact-host {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.02em;
  color: var(--muted);
  transition: color 0.4s var(--ease);
}

.contact-link .arrow {
  color: var(--muted);
  font-size: 12px;
  transition: transform 0.45s var(--ease), color 0.4s var(--ease);
}

.contact-link:hover .contact-index,
.contact-link:hover .contact-host,
.contact-link:hover .arrow {
  color: var(--cream-dim);
}

.contact-link:hover .arrow {
  color: var(--cream);
  transform: translate(2px, -2px);
}

.contact-card {
  position: relative;
  overflow: hidden;
  min-height: 300px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, #241710, #130d0a 68%);
}

.contact-card-art {
  position: absolute;
  right: -22px;
  bottom: -56px;
  width: 190px;
  color: #d58c55;
  opacity: 0.68;
  pointer-events: none;
}

.contact-card-art .sprig {
  width: 100%;
  transform: rotate(6deg);
}

.contact-card-label {
  position: relative;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

.contact-card-note {
  position: relative;
  max-width: 24ch;
  margin-top: 76px;
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1.3;
  letter-spacing: -0.008em;
  color: var(--ink);
}

.contact-location {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.contact-location .sep {
  color: var(--line-strong);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  margin-top: clamp(64px, 9vw, 110px);
  padding-block: 26px 32px;
  border-top: 1px solid var(--line);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.footer-brand .brand-mark {
  width: 30px;
  height: 30px;
  font-size: 12px;
}

.footer-brand p {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.footer-note {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.footer-meta {
  display: flex;
  flex-basis: 100%;
  width: 100%;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.footer-meta a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.3s var(--ease);
}

.footer-meta a:hover {
  color: var(--ink);
}

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--ink);
  font-size: 12px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease),
    visibility 0.4s var(--ease), background-color 0.4s var(--ease),
    border-color 0.4s var(--ease), color 0.4s var(--ease);
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.back-to-top.at-footer {
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  pointer-events: none;
}

.back-to-top:hover {
  background: var(--forest);
  border-color: var(--forest);
  color: var(--cream);
}

/* ---------- Konami / matrix ---------- */
#matrixCanvas {
  position: fixed;
  inset: 0;
  z-index: 8500;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}

#matrixCanvas.show {
  opacity: 0.85;
}

.konami-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--overlay);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s var(--ease), visibility 0.45s var(--ease);
}

.konami-overlay.show {
  opacity: 1;
  visibility: visible;
}

.konami-card {
  width: 100%;
  max-width: 400px;
  padding: clamp(24px, 6vw, 36px);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: center;
  transform: translateY(8px);
  transition: transform 0.5s var(--ease);
}

.konami-overlay.show .konami-card {
  transform: none;
}

.konami-kicker {
  margin-bottom: 14px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.konami-card h2 {
  font-family: var(--serif);
  font-size: 2.1rem;
  font-weight: 400;
  line-height: 1.05;
}

.konami-card h2 em {
  font-size: 1.04em;
}

.konami-card p:not(.konami-kicker) {
  margin: 12px 0 22px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

/* ---------- Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s var(--ease) var(--delay, 0s),
    transform 0.7s var(--ease) var(--delay, 0s);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1080px) {
  .status-badge {
    display: none;
  }
}

@media (max-width: 980px) {
  .notes-grid {
    grid-template-columns: 1fr;
    gap: 44px;
  }

  .rail-sticky {
    position: static;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 40px;
    align-items: end;
  }

  .rail-sticky .section-kicker,
  .rail-sticky .section-title {
    grid-column: 1;
  }

  .rail-note-row {
    grid-column: 1;
    justify-content: flex-start;
    gap: 18px;
  }

  .rail-fig {
    align-self: end;
  }

  .rail-fig .sprig {
    width: 38px;
    height: 57px;
  }

  .rail-fig figcaption {
    display: none;
  }
}

@media (max-width: 900px) {
  .earth-art--soil {
    height: clamp(76px, 22vw, 125px);
    opacity: 0.68;
    -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 48%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 0%, #000 48%, transparent 100%);
  }

  .earth-art--rock {
    height: clamp(92px, 20vw, 150px);
  }

  .earth-art--water {
    height: clamp(76px, 18vw, 132px);
  }

  .earth-art--magma {
    bottom: clamp(80px, 16vw, 145px);
    height: clamp(145px, 34vw, 230px);
  }

  .hero {
    height: 100svh;
    min-height: 100svh;
    background: linear-gradient(180deg, #050806 0%, #09110e 72%, #14150f 88%, #211a11 100%);
  }

  .notes {
    background:
      radial-gradient(ellipse at 50% 0%, rgba(93, 105, 59, 0.14), transparent 48%),
      linear-gradient(180deg, #211a11 0%, #1d1911 8%, #17120d 58%, #111311 100%);
  }

  :root {
    --header-h: 62px;
  }

  .brand-role {
    display: none;
  }

  .burger {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    max-height: none;
    padding: 18px 24px 32px;
    border-bottom: 0;
    background: var(--forest);
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.4s var(--ease), transform 0.4s var(--ease),
      visibility 0.4s var(--ease);
  }

  .site-header.open .nav-links {
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
  }

  .site-header.open {
    background: var(--forest);
    border-bottom-color: rgba(241, 235, 218, 0.12);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .site-header.open .brand,
  .site-header.open .brand-copy strong,
  .site-header.open .icon-btn {
    color: var(--cream);
  }

  .site-header.open .brand-role {
    color: var(--cream-dim);
  }

  .site-header.open .brand-mark {
    border-color: rgba(241, 235, 218, 0.36);
    color: var(--cream);
  }

  .site-header.open .icon-btn {
    border-color: rgba(241, 235, 218, 0.24);
  }

  .site-header.open .icon-btn:hover {
    background: rgba(241, 235, 218, 0.08);
    color: var(--cream);
  }

  .site-header.open .burger {
    border-color: rgba(241, 235, 218, 0.24);
    background: transparent;
  }

  .site-header.open .burger span {
    background: var(--cream);
  }

  .nav-links a {
    justify-content: flex-start;
    gap: 16px;
    padding: 20px 2px;
    border-bottom: 1px solid rgba(241, 235, 218, 0.13);
    border-radius: 0;
    font-family: var(--serif);
    font-size: 2rem;
    letter-spacing: -0.01em;
    text-transform: none;
    color: var(--cream);
  }

  .nav-links a:hover {
    background: transparent;
    color: var(--peach);
  }

  .nav-links a .nav-index {
    order: 0;
    font-size: 10px;
    color: var(--cream-dim);
    opacity: 0.8;
  }

  .nav-links::after {
    content: "India · 28.61° N / 77.20° E · Open to work";
    margin-top: auto;
    padding-top: 24px;
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--cream-dim);
  }

  .nav-scrim {
    display: none;
  }

  .hero {
    min-height: 94svh;
  }

  .hero-copy {
    max-width: 560px;
  }

  .hero-field {
    opacity: 0.32;
  }

  .hero-disc {
    opacity: 0.55;
  }

  .hero-disc {
    top: 16%;
    right: -14%;
    width: 74vw;
  }

  .hero-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-meta li:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }

  .hero-meta li:nth-child(3),
  .hero-meta li:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .contact-head {
    gap: 24px;
  }

  .arcade-frame {
    display: block;
    min-height: 0;
  }

  .game-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 0 0 14px;
    border-right: 0;
    border-bottom: 1px solid rgba(241, 235, 218, 0.14);
    margin-bottom: 14px;
  }

  .game-tab {
    justify-content: center;
    padding: 10px 9px;
  }

  .arcade-screen {
    min-height: 0;
  }

  .game-stage {
    min-height: clamp(22rem, 58vh, 34rem);
  }

  .lab-body {
    grid-template-columns: 1fr;
  }

  .seal {
    width: 104px;
    height: 104px;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .contact-card {
    max-width: 460px;
  }

  .contact-card-note {
    margin-top: 60px;
  }
}

@media (max-width: 760px) {
  .game-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section--arcade .spine {
    padding-inline: clamp(12px, 4vw, 16px);
  }

  .arcade-frame {
    padding: clamp(6px, 1.5vw, 8px);
  }
}

@media (max-width: 640px) {
  body {
    font-size: 15px;
    line-height: 1.62;
  }

  .spine {
    padding-inline: clamp(14px, 5vw, 20px);
  }

  .header-inner {
    padding-inline: 16px;
    gap: 12px;
  }

  .brand-copy strong {
    font-size: 12px;
  }

  .brand-mark {
    width: 31px;
    height: 31px;
    font-size: 13px;
  }

  .hero {
    padding-top: calc(var(--header-h) + 64px);
    padding-bottom: 20px;
  }

  .hero-eyebrow {
    gap: 7px 9px;
    font-size: 9.5px;
  }

  .hero-eyebrow .eyebrow-pair {
    gap: 9px;
  }

  .hero-title {
    font-size: clamp(2.9rem, 13.2vw, 4.2rem);
    line-height: 0.87;
  }

  .hero-tag {
    max-width: 27ch;
    font-size: 1.22rem;
  }

  .hero-role {
    font-size: 10px;
  }

  .hero-actions {
    gap: 12px 16px;
    margin-top: 26px;
  }

  .btn {
    height: 40px;
    padding: 0 17px;
    font-size: 10px;
  }

  .hero-contact {
    gap: 10px 13px;
    margin-top: 26px;
    padding-top: 17px;
  }

  .email-link {
    font-size: 11px;
  }

  .contact-divider {
    display: none;
  }

  .hero-meta {
    grid-template-columns: 1fr;
    margin-top: 26px;
  }

  .hero-meta li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .hero-meta li:first-child {
    border-top: 0;
  }

  .hero-meta li:nth-child(2),
  .hero-meta li:nth-child(3),
  .hero-meta li:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .section {
    padding-block: 72px;
  }

  .notes {
    padding-block: clamp(28px, 6vw, 40px);
  }

  .notes-grid {
    gap: 24px;
  }

  .section-title {
    font-size: clamp(2.2rem, 9vw, 2.9rem);
  }

  .notes-rail .section-title {
    font-size: clamp(1.4rem, 7.1vw, 2.7rem);
    letter-spacing: -0.04em;
    white-space: normal;
    text-wrap: balance;
  }

  .rail-sticky {
    display: block;
  }

  .rail-note-row {
    justify-content: space-between;
    gap: 6px;
  }

  .rail-note-row .section-note {
    font-size: clamp(7.5px, 2.25vw, 9px);
    letter-spacing: 0.035em;
    white-space: normal;
    line-height: 1.35;
  }

  .rail-note-row .rail-fig .sprig {
    width: 38px;
    height: 57px;
  }

  .rail-fig {
    display: flex;
  }

  .entry-summary {
    grid-template-columns: minmax(0, 1fr) auto 16px;
    gap: 10px;
    padding: 12px 4px;
    margin-inline: 0;
  }

  .entry-title {
    font-size: 1.3rem;
  }

  .entry-year {
    font-size: 9px;
  }

  .entry-inner {
    padding: 18px 2px 24px;
  }

  .meta-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .skill-row {
    grid-template-columns: 24px minmax(0, 1fr) auto;
    gap: 11px;
    padding: 16px 11px;
    margin-inline: -11px;
  }

  .cv-group--skills {
    margin-top: 12px !important;
  }

  .cv-group--skills .skills-list {
    gap: 5px;
    margin-top: 8px;
  }

  .cv-group--skills .skill-row {
    display: block;
    width: fit-content;
    max-width: 100%;
    padding: 5px 8px;
    margin: 0;
    border-radius: 12px;
    line-height: 1.35;
  }

  .cv-group--skills .skill-name,
  .cv-group--skills .skill-items-text {
    font-size: 9px;
  }

  .arcade-screen {
    padding: 17px;
    min-height: 0;
  }

  .arcade-frame {
    min-height: 0;
  }

  .game-stage {
    min-height: 0;
  }

  .controls,
  .controls--three,
  .controls--pair {
    grid-template-columns: 1fr;
  }

  .arcade-bar {
    font-size: 8.5px;
  }

  .contact-title {
    font-size: clamp(2.3rem, 10vw, 3rem);
  }

  .contact-head {
    position: relative;
  }

  .seal {
    position: absolute;
    top: -6px;
    right: 0;
    width: 84px;
    height: 84px;
    opacity: 0.65;
  }

  .contact-heading {
    max-width: calc(100% - 66px);
  }

  .email-link--lg {
    font-size: 1rem;
  }

  .contact-link {
    grid-template-columns: 22px minmax(0, 1fr) 14px;
    gap: 11px;
    padding: 15px 11px;
    margin-inline: -11px;
  }

  .contact-host {
    display: none;
  }

  .contact-label {
    font-size: 1.2rem;
  }

  .contact-card {
    min-height: 270px;
    padding: 22px;
  }

  .contact-card-note {
    margin-top: 54px;
    font-size: 1.2rem;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding-bottom: 36px;
  }

  .back-to-top {
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 420px) {
  .tree-note {
    gap: 3px;
    padding: 2px 4px;
    font-size: clamp(6.5px, 1.9vw, 8px);
    letter-spacing: 0.025em;
  }

  .tree-note::before {
    width: 4px;
    height: 4px;
  }

  .hero-title {
    font-size: 2.72rem;
  }

  .hero-eyebrow {
    font-size: 9px;
  }

  .game-tab {
    padding: 9px 7px;
    font-size: 9px;
  }

  .seal {
    display: none;
  }

  .contact-heading {
    max-width: 100%;
  }

  .readout {
    gap: 6px 14px;
  }

  .memory-grid {
    gap: 6px;
  }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0s !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .marquee-track {
    animation: none;
  }
}

/* Peripheral geological illustrations preserve a quiet area behind the content. */
.depth-vignette {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  shape-rendering: crispEdges;
  opacity: .65;
  -webkit-mask-image: linear-gradient(90deg, #000, transparent 24%, transparent 76%, #000);
  mask-image: linear-gradient(90deg, #000, transparent 24%, transparent 76%, #000);
}
.depth-vignette--magma { opacity: .55; }
@media (max-width: 640px) {
  .depth-vignette { opacity: .35; }
}

/* The board only owns touch gestures during a running game. */
.game-stage #snakeCanvas {
  width: min(100%, 360px);
  max-width: 360px;
  touch-action: pan-y;
  border: 1px solid #42494b;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
}
.game-stage #snakeCanvas.is-playing { touch-action: none; }
.cupid-logo { display: block; flex: 0 0 auto; width: 40px; height: 40px; }

#snakeDpad .dpad-btn { touch-action: pan-y; }
.game-stage:has(#snakeCanvas.is-playing) #snakeDpad .dpad-btn { touch-action: none; }

.game-stage .memory-grid { max-width: min(100%, 38rem); }
.game-stage .ttt-grid { max-width: min(100%, 28rem); }

.sky-toggle {
  position: absolute;
  left: 82%;
  top: 16%;
  z-index: 4;
  transform: translate(-50%, -50%);
  width: clamp(44px, 7vw, 58px);
  aspect-ratio: 1;
  padding: 6px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
}
.sky-toggle svg { display: block; width: 100%; height: 100%; }
.sky-toggle .moon-icon, .hero[data-sky="day"] .sun-icon { display: none; }
.hero[data-sky="day"] .moon-icon { display: inline; }
.hero[data-sky="day"] {
  background: linear-gradient(#96c9df, #cce4df 58%, #efe4bd 84%, #a6b186 94%, #30291c);
}
.hero[data-sky="day"] .hero-greeting { color: #274c3b; text-shadow: 0 1px 8px #e4eed6; }
.hero[data-sky="day"] .hero-disc { opacity: 0; }
.hero[data-sky="day"] .hero-grid-lines { opacity: .12; }
.sky-hint {
  position: absolute;
  top: 100%;
  right: 10%;
  color: #c2d5bd;
  font: italic clamp(.8rem, 1.6vw, 1rem)/1.15 var(--serif);
  white-space: nowrap;
}
.day-hint, .hero[data-sky="day"] .night-hint { display: none; }
.hero[data-sky="day"] .day-hint { display: inline; }
.hero[data-sky="day"] .sky-hint { color: #304c3f; }

.sky-hint { line-height: 1.35; text-align: center; }

.hero[data-sky="day"] .tree-note {
  color: #20372d;
  background: #fff8de;
  border-color: #67765a;
  --accent: #496044;
  font-size: clamp(.625rem, 1vw, .75rem);
  font-weight: 600;
}
.hero[data-sky="day"] .tree-note:is(:hover, :focus-visible) {
  background: #fffdf4;
  outline: 2px solid #32533c;
  outline-offset: 1px;
}
@media (max-width: 360px) {
  .hero[data-sky="day"] .tree-note-index { display: none; }
}
