/* ===========================================================
   TERRA — interactive world portfolio
   Typography + scroll-story overlay. The 3D world lives behind.
   =========================================================== */

:root {
  --ink: #f4efe6;          /* warm parchment text */
  --ink-dim: rgba(244, 239, 230, 0.62);
  --accent: #ffcf6b;       /* golden wheat */
  --accent-deep: #e09a3e;
  --leaf: #8fc66b;         /* forest green */
  --river: #74c7d6;        /* water */
  --panel-w: min(560px, 86vw);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* Spacing scale — 4 / 8pt rhythm (16px base). Use for all margin/padding/gap. */
  --sp-1: 0.25rem;   /*  4px */
  --sp-2: 0.5rem;    /*  8px */
  --sp-3: 0.75rem;   /* 12px */
  --sp-4: 1rem;      /* 16px */
  --sp-5: 1.25rem;   /* 20px */
  --sp-6: 1.5rem;    /* 24px */
  --sp-7: 2rem;      /* 32px */
  --sp-8: 2.5rem;    /* 40px */
  --sp-9: 3rem;      /* 48px */
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: auto; }

body {
  font-family: "Inter", system-ui, sans-serif;
  color: var(--ink);
  background: #0b0d0a;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  cursor: default;
}

/* The world canvas: fixed, full-bleed, behind everything */
#scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  z-index: 0;
}

/* ---------------- Loader ---------------- */
#loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000;
  display: grid;
  place-items: center;
  transition: opacity 1.1s var(--ease), visibility 1.1s;
}
#loader.done { opacity: 0; visibility: hidden; }
.loader-inner { text-align: center; }
.loader-word {
  font-family: "Fraunces", serif;
  font-weight: 900;
  font-size: clamp(1.7rem, 6.2vw, 4rem);
  letter-spacing: 0.1em;
  max-width: 92vw;
  line-height: 1.1;
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.loader-bar {
  width: min(260px, 60vw);
  height: 2px;
  background: rgba(255, 255, 255, 0.12);
  margin: var(--sp-6) auto var(--sp-3);
  overflow: hidden;
}
#loader-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.3s linear;
}
.loader-sub {
  font-size: 0.72rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

/* ---------------- Top bar ----------------
   No wrapping .topbar element on purpose — it used to apply
   mix-blend-mode:difference, which forced a stacking context and flattened
   every child into one unit before differencing against the scene. A
   child's own mix-blend-mode:normal can't opt back out of that, so solid
   opaque fills (white pills, white logo) never rendered as true white.
   Each control below is its own fixed-position element instead. */
.brand {
  position: fixed;
  top: var(--sp-6);
  left: clamp(var(--sp-5), 4vw, 3rem);
  z-index: 20;
  font-family: "Fraunces", serif;
  font-weight: 600;
  letter-spacing: 0.18em;
  font-size: 0.95rem;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  padding: var(--sp-2) var(--sp-3);
  border-radius: 999px;
  /* full-opacity solid white */
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 8px 30px rgba(0, 0, 0, 0.25);
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}
.brand:hover {
  transform: translateY(-1px);
}
.brand span { opacity: 0.5; margin: 0 0.2em; color: #14120f; }
.brand-logo {
  /* matches .resume-btn's text-line height (16.5px) so the two pills,
     sharing the same padding, come out the same overall height */
  height: 16.5px;
  width: auto;
  display: block;
  /* the source file is white-on-transparent artwork; force it dark so it
     reads against the solid white pill */
  filter: brightness(0);
}

/* ---------------- Animated hamburger (top-center) ---------------- */
.menu-toggle {
  position: fixed;
  left: 50%; top: calc(var(--sp-6) + 1px);
  transform: translateX(-50%);
  pointer-events: auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; padding: 0;
  border-radius: 999px; cursor: pointer;
  /* full-opacity solid white */
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 8px 30px rgba(0, 0, 0, 0.25);
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
  z-index: 21; /* stay above the overlay so it can toggle it closed */
}
.menu-toggle:hover {
  transform: translateX(-50%) translateY(-1px);
}
.menu-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.menu-toggle .bars { position: relative; width: 20px; height: 14px; }
.menu-toggle .bars i {
  position: absolute; left: 0; right: 0; height: 2px; border-radius: 2px;
  background: #14120f;
  transition: transform 0.4s var(--ease), opacity 0.25s var(--ease), background 0.3s ease;
}
.menu-toggle .bars i:nth-child(1) { top: 0; }
.menu-toggle .bars i:nth-child(2) { top: 6px; }
.menu-toggle .bars i:nth-child(3) { top: 12px; }
.menu-toggle:hover .bars i { background: var(--accent); }
/* three lines morph into an X */
.menu-toggle.open .bars i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle.open .bars i:nth-child(2) { opacity: 0; transform: scaleX(0.3); }
.menu-toggle.open .bars i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------------- Fullscreen chapter overlay ---------------- */
.nav-overlay {
  position: fixed; inset: 0;
  z-index: 15; /* above story content (10), below the topbar (20) */
  display: flex; align-items: center; justify-content: center;
  padding: 6rem 1.5rem;
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(22, 30, 52, 0.72) 0%, rgba(3, 5, 13, 0.9) 70%);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.5s var(--ease), visibility 0.5s var(--ease);
}
body.menu-open .nav-overlay { opacity: 1; visibility: visible; pointer-events: auto; }
body.menu-open { overflow: hidden; }

.nav-list {
  list-style: none; margin: 0; padding: 0; text-align: center;
  display: flex; flex-direction: column; gap: clamp(0.15rem, 1.2vh, 0.7rem);
}
.nav-list a {
  display: inline-flex; align-items: baseline; gap: 0.9rem;
  font-family: "Fraunces", serif; font-weight: 400;
  font-size: clamp(1.35rem, 4.4vw, 2.5rem); line-height: 1.15;
  color: var(--ink); text-decoration: none; letter-spacing: 0.01em;
  opacity: 0; transform: translateY(20px);
  transition: color 0.3s ease, transform 0.5s var(--ease), opacity 0.5s var(--ease);
}
.nav-list a:hover, .nav-list a:focus-visible { color: var(--accent); outline: none; }
.nav-num {
  font-family: "Inter", sans-serif; font-weight: 500;
  font-size: 0.68rem; letter-spacing: 0.2em; color: var(--accent);
  opacity: 0.7; min-width: 2.4ch; text-align: right;
}
/* staggered rise once the menu opens */
body.menu-open .nav-list a { opacity: 1; transform: none; transition-delay: calc(var(--i) * 0.045s + 0.1s); }

@media (prefers-reduced-motion: reduce) {
  .menu-toggle .bars i, .nav-overlay, .nav-list a { transition-duration: 0.001s; }
  .nav-list a { transform: none; }
}

/* ---------------- Phase tag ---------------- */
.phase-tag {
  position: fixed;
  left: clamp(1.2rem, 4vw, 3rem);
  bottom: 2rem;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.72rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--ink);
  pointer-events: none;
}
.phase-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent);
  transition: background 0.8s, box-shadow 0.8s;
}

/* ---------------- Progress rail ---------------- */
#progress-rail {
  position: fixed;
  right: clamp(0.85rem, 2vw, 1.6rem);
  left: auto;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 38vh;
  background: rgba(255, 255, 255, 0.14);
  z-index: 20;
  border-radius: 2px;
  overflow: hidden;
  pointer-events: none;
}
#progress-fill {
  display: block;
  width: 100%;
  height: 0%;
  background: linear-gradient(180deg, var(--accent), var(--leaf), var(--river));
}

/* ---------------- Story panels ---------------- */
#story {
  position: relative;
  z-index: 10;
  /* total scroll length = number of panels; each ~full viewport */
}
.panel {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8vh clamp(var(--sp-6), 6vw, 6rem);
  position: relative;
}
.panel--right { align-items: flex-end; text-align: right; }
.panel--left { align-items: flex-start; }
.panel--center, .panel--hero, .panel--end { align-items: center; text-align: center; }

/* Reveal-on-scroll */
.panel > * {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
.panel.in > * { opacity: 1; transform: translateY(0); }
.panel.in > *:nth-child(2) { transition-delay: 0.12s; }
.panel.in > *:nth-child(3) { transition-delay: 0.24s; }

/* Typography */
.kicker {
  font-size: 0.74rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  /* warm ivory — same look as the lede below */
  color: #f5ecd8;
  -webkit-text-stroke: 0;
  text-shadow: 0 1px 3px rgba(0,0,0,0.45), 0 2px 14px rgba(0,0,0,0.30);
  margin-bottom: var(--sp-6);
}
.mega {
  font-family: "Fraunces", serif;
  font-weight: 900;
  font-size: clamp(3.2rem, 16vw, 13rem);
  line-height: 0.86;
  letter-spacing: -0.01em;
  /* Soft light halo lifts the dark text off the green scene + gentle depth */
  text-shadow:
    0 1px 0 rgba(255,255,255,0.45),
    0 2px 22px rgba(255,255,255,0.30),
    0 12px 44px rgba(0,0,0,0.22);
}
.mega .line {
  display: block;
  color: #16280f;                         /* deep forest green */
  -webkit-text-stroke: 0;
}
.mega--mid { font-size: clamp(2.6rem, 11vw, 8.5rem); }
.line--accent {
  /* deepened amber — readable warm accent against the green scene */
  background: linear-gradient(120deg, #e29a32, #b5651d);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 0;   /* keep the gradient clean, no dark contour */
}
.lede {
  max-width: 30ch;
  margin-top: var(--sp-7);
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  line-height: 1.6;
  /* warm ivory — solid and readable, distinct from the glass heading */
  color: #f5ecd8;
  -webkit-text-stroke: 0;
  text-shadow: 0 1px 3px rgba(0,0,0,0.45), 0 2px 14px rgba(0,0,0,0.30);
}
.lede.center { margin-left: auto; margin-right: auto; }

/* Topbar — download résumé (Apple liquid glass, matches the brand chip) */
.resume-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-5);
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: #14120f;
  text-decoration: none;
  border-radius: 999px;
  /* fixed-position element, same reasoning as .brand / .menu-toggle above */
  position: fixed;
  top: var(--sp-6);
  right: clamp(var(--sp-5), 4vw, 3rem);
  z-index: 20;
  pointer-events: auto;
  /* full-opacity solid white */
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 8px 30px rgba(0, 0, 0, 0.25);
  transition: transform 0.3s var(--ease), background 0.3s ease, border-color 0.3s ease;
}
.resume-btn svg { width: 15px; height: 15px; color: #14120f; }
.resume-btn:hover {
  transform: translateY(-1px);
  background: #fff;
  border-color: rgba(255, 255, 255, 1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 10px 34px rgba(0, 0, 0, 0.3);
}

/* End / contact panel sits over the dark horizon — flip supporting text to light */
.panel--end .kicker { color: var(--accent); -webkit-text-stroke: 0; text-shadow: 0 2px 16px rgba(0,0,0,0.55); }
.panel--end .lede { color: var(--ink); -webkit-text-stroke: 0; text-shadow: 0 2px 16px rgba(0,0,0,0.55); }
.panel--end .mega { text-shadow: 0 2px 22px rgba(0,0,0,0.5), 0 12px 50px rgba(0,0,0,0.4); }
.panel--end .line { color: #f4efe6; }

/* Hero description sits over the BRIGHT golden field — keep it white, with a soft
   dark halo underneath so it still reads against the light background. */
.panel--hero .lede {
  color: #fff;
  text-shadow:
    0 1px 3px rgba(0, 0, 0, 0.55),
    0 2px 14px rgba(0, 0, 0, 0.40);
}

/* Apple-style "liquid glass" LETTERS — the glyphs themselves read as glass */
.mega.glass .line {
  /* see-through frosted fill: the scene shows through the letters */
  color: rgba(255, 255, 255, 0.22);
  /* bright rim — the defining glass-edge highlight */
  -webkit-text-stroke: 1.4px rgba(255, 255, 255, 0.88);
  /* bevel: light sheen on top, dark depth below = refraction + legibility */
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.55),
    0 -1px 1px rgba(255, 255, 255, 0.32),
    0 3px 7px rgba(0, 0, 0, 0.38),
    0 18px 50px rgba(0, 0, 0, 0.30);
}
.mega.glass .line--accent {
  /* warm-tinted glass keeps IDEAS / INTO THE WILD distinct */
  background: none;
  color: rgba(255, 226, 184, 0.24);
  -webkit-text-stroke: 1.4px rgba(255, 234, 200, 0.9);
  text-shadow:
    0 1px 0 rgba(255, 240, 210, 0.55),
    0 -1px 1px rgba(255, 235, 200, 0.32),
    0 3px 7px rgba(80, 45, 10, 0.40),
    0 18px 50px rgba(0, 0, 0, 0.30);
}

.big {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.02;
  margin-bottom: var(--sp-4);
}

/* Landmark cards */
.landmark-card {
  max-width: var(--panel-w);
  background: rgba(18, 20, 14, 0.34);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: clamp(var(--sp-6), 3vw, var(--sp-8));
  text-align: left;
}
.landmark-card--dark { background: rgba(8, 10, 7, 0.5); }
.landmark-card p { color: var(--ink-dim); line-height: 1.6; }
.lm-index {
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--sp-4);
}
.lm-link {
  display: inline-block;
  margin-top: var(--sp-6);
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
  transition: gap 0.3s, color 0.3s;
}
.lm-link:hover { color: var(--accent); }

/* "Coming soon" status — farming flavour (a sprouting seed) */
.lm-status {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-6);
  padding: var(--sp-1) var(--sp-3);
  border-radius: 999px;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--leaf);
  background: rgba(143, 198, 107, 0.12);
  border: 1px solid rgba(143, 198, 107, 0.32);
}
.lm-status .seed {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--leaf);
  box-shadow: 0 0 10px var(--leaf);
  animation: seed-pulse 1.8s ease-in-out infinite;
}
@keyframes seed-pulse {
  0%, 100% { transform: scale(1);    opacity: 0.7; }
  50%      { transform: scale(1.35); opacity: 1; }
}

/* About Me card */
.about-card { max-width: var(--panel-w); }   /* match every other card */
.about-top { display: flex; gap: var(--sp-6); align-items: flex-start; }
.about-photo {
  flex: 0 0 132px;
  width: 132px;
  aspect-ratio: 1;
  margin: 0;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 10px 30px rgba(0, 0, 0, 0.35);
}
.about-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.about-intro .big { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }  /* inherits --sp-4 gap */
@media (max-width: 600px) {
  .about-top { flex-direction: column; align-items: center; text-align: center; }
  .about-photo { flex-basis: auto; width: 116px; aspect-ratio: 1; border-radius: 50%; }
  .about-intro { text-align: center; }
}
.about-facts { list-style: none; margin: var(--sp-6) 0 var(--sp-1); display: grid; gap: var(--sp-2); }
.about-facts li { display: flex; gap: var(--sp-4); }
.af-k {
  flex: 0 0 72px;
  color: var(--accent);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding-top: var(--sp-1);
}
.af-v { color: var(--ink-dim); font-size: 0.92rem; line-height: 1.5; }
.exp { margin-top: var(--sp-6); border-top: 1px solid rgba(255, 255, 255, 0.1); padding-top: var(--sp-5); }
.exp-head {
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--sp-4);
}
.exp-list { list-style: none; display: grid; gap: var(--sp-5); }
.exp-row { display: grid; grid-template-columns: 104px 1fr; gap: var(--sp-4); }
.exp-when { font-size: 0.74rem; letter-spacing: 0.05em; color: var(--ink-dim); padding-top: var(--sp-1); }
.exp-what strong { display: block; font-weight: 600; color: var(--ink); font-size: 1rem; }
.exp-what span { display: block; font-size: 0.82rem; color: var(--accent); margin-top: 1px; }
.exp-what p { margin-top: var(--sp-1); font-size: 0.86rem; color: var(--ink-dim); line-height: 1.5; }
@media (max-width: 600px) {
  .exp-row { grid-template-columns: 1fr; gap: var(--sp-1); }
  .af-k { flex-basis: 64px; }
}

/* THE TOOLS — hover/focus-reveal capability rows */
.tool-list { list-style: none; margin-top: var(--sp-4); }
.tool {
  position: relative;
  padding: var(--sp-3) 0 var(--sp-3) var(--sp-4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  cursor: default;
  outline: none;
  /* staggered reveal as the panel scrolls in */
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.7s var(--ease),
    transform 0.7s var(--ease),
    padding-left 0.35s var(--ease);
}
.panel.in .tool { opacity: 1; transform: translateY(0); }
.panel.in .tool:nth-child(1) { transition-delay: 0.05s; }
.panel.in .tool:nth-child(2) { transition-delay: 0.12s; }
.panel.in .tool:nth-child(3) { transition-delay: 0.19s; }
.panel.in .tool:nth-child(4) { transition-delay: 0.26s; }
.panel.in .tool:nth-child(5) { transition-delay: 0.33s; }
.panel.in .tool:nth-child(6) { transition-delay: 0.40s; }

/* growing gold bar on the left edge */
.tool::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 0;
  background: var(--accent);
  border-radius: 2px;
  transition: height 0.35s var(--ease);
}
.tool:hover, .tool:focus-visible { padding-left: var(--sp-6); }
.tool:hover::before, .tool:focus-visible::before { height: 64%; }

.tool-name {
  display: block;
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: clamp(1.15rem, 2.4vw, 1.6rem);
  color: var(--ink);
  transition: color 0.3s var(--ease);
}
.tool:hover .tool-name, .tool:focus-visible .tool-name { color: var(--accent); }

/* the detail line: collapsed height -> expands smoothly, no reserved gap */
.tool-note-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s var(--ease);
}
.tool:hover .tool-note-wrap, .tool:focus-visible .tool-note-wrap { grid-template-rows: 1fr; }
.tool-note {
  min-height: 0;
  overflow: hidden;
  font-family: "Inter", sans-serif;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--ink-dim);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.tool:hover .tool-note, .tool:focus-visible .tool-note {
  opacity: 1;
  transform: translateY(0);
  margin-top: var(--sp-2);
}

/* THE TOOLS — Design + AI logo wall */
.tool-wall {
  margin-top: var(--sp-7);
}
.tw-group + .tw-group { margin-top: var(--sp-5); }
.tw-label {
  display: block;
  font-size: 0.64rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--sp-3);
}
.logo-row { list-style: none; display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.logo {
  position: relative;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.92);  /* light chip keeps dark logos legible */
  border: 1px solid rgba(255, 255, 255, 0.18);
  cursor: default;
  outline: none;
  transition: transform 0.32s var(--ease), box-shadow 0.32s var(--ease);
}
.logo img {
  width: 27px;
  height: 27px;
  object-fit: contain;
  display: block;
  filter: grayscale(1);
  opacity: 0.7;
  transition: filter 0.32s var(--ease), opacity 0.32s var(--ease);
}
.logo:hover, .logo:focus-visible {
  transform: translateY(-5px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.30);
}
.logo:hover img, .logo:focus-visible img { filter: grayscale(0); opacity: 1; }

/* tooltip name above the chip */
.logo-name {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  white-space: nowrap;
  font-family: "Inter", sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  background: rgba(10, 12, 8, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: var(--sp-1) var(--sp-2);
  border-radius: 7px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.logo:hover .logo-name, .logo:focus-visible .logo-name {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.center-card { text-align: center; margin: 0 auto; }
.stat-row {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: clamp(var(--sp-6), 6vw, 4rem);
  margin-top: var(--sp-6);
}
.stat-row li { display: flex; flex-direction: column; }
.stat-row strong {
  font-family: "Fraunces", serif;
  font-weight: 900;
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  color: var(--accent);
  line-height: 1;
}
.stat-row span {
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-top: var(--sp-2);
}

/* CTA */
.cta {
  display: inline-block;
  margin-top: var(--sp-7);
  padding: var(--sp-4) var(--sp-8);
  background: var(--accent);
  color: #1a1206;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  border-radius: 999px;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
  box-shadow: 0 10px 40px rgba(255, 207, 107, 0.3);
}
.cta:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 16px 50px rgba(255, 207, 107, 0.45); }
.foot {
  margin-top: var(--sp-9);
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.panel--end { min-height: 120vh; padding-bottom: 16vh; }

/* ---------------- Sound toggle ---------------- */
#sound-toggle {
  position: fixed;
  right: clamp(1.2rem, 4vw, 3rem);
  bottom: 2rem;
  z-index: 20;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(10,12,8,0.4);
  backdrop-filter: blur(8px);
  display: grid; place-items: center;
  cursor: pointer;
  transition: border-color 0.3s, transform 0.3s;
}
#sound-toggle:hover { transform: scale(1.08); border-color: var(--accent); }
.sound-bars { display: flex; align-items: center; gap: 2px; height: 14px; }
.sound-bars i {
  width: 2px; height: 4px;
  background: var(--ink);
  border-radius: 2px;
}
#sound-toggle.playing .sound-bars i { animation: eq 0.9s ease-in-out infinite; }
.sound-bars i:nth-child(2){ animation-delay: 0.15s; }
.sound-bars i:nth-child(3){ animation-delay: 0.3s; }
.sound-bars i:nth-child(4){ animation-delay: 0.45s; }
@keyframes eq { 0%,100%{height:4px} 50%{height:14px} }

/* ---------------- Scroll hint (hero, bottom-center) ---------------- */
.scroll-hint {
  position: fixed;
  left: 50%;
  bottom: 2rem;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  pointer-events: none;
  /* gentle entrance; `backwards` (not `both`) so the finished animation
     doesn't pin opacity/transform and block the .gone fade-out */
  animation: sh-rise 0.9s var(--ease) backwards;
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.scroll-hint.gone {
  opacity: 0;
  transform: translateX(-50%) translateY(12px);
}
@keyframes sh-rise {
  from { opacity: 0; transform: translateX(-50%) translateY(14px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.sh-mouse {
  position: relative;
  width: 24px;
  height: 38px;
  border: 1.5px solid rgba(244, 239, 230, 0.7);
  border-radius: 13px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.sh-wheel {
  position: absolute;
  top: 7px;
  left: 50%;
  width: 3px;
  height: 7px;
  border-radius: 2px;
  background: var(--ink);
  transform: translateX(-50%);
  animation: sh-wheel 1.6s var(--ease) infinite;
}
@keyframes sh-wheel {
  0%   { opacity: 0; transform: translate(-50%, 0); }
  20%  { opacity: 1; }
  70%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, 12px); }
}

/* ---------------- Reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  .panel > * { transition: opacity 0.4s; transform: none; }
  .scroll-hint { animation: none; }
  .sh-wheel { animation: none; }
  .lm-status .seed { animation: none; }
}

@media (max-width: 720px) {
  #progress-rail { height: 28vh; }
  .stat-row { gap: var(--sp-5); }
}

/* ── Chapter navigator (removed from markup; rules kept harmless) ──── */
.chapter-rail {
  position: fixed;
  right: clamp(0.85rem, 2vw, 1.7rem);
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 11px;
  align-items: flex-end;
}
.chapter-rail a {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  text-decoration: none;
  cursor: pointer;
}
.chapter-rail .cr-label {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(244, 239, 230, 0.55);
  white-space: nowrap;
  opacity: 0;
  transform: translateX(6px);
  transition: opacity 0.25s var(--ease, ease), transform 0.25s var(--ease, ease), color 0.25s ease;
  pointer-events: none;
}
.chapter-rail .cr-dot {
  display: block;
  width: 9px;
  height: 3px;
  border-radius: 999px;
  background: rgba(244, 239, 230, 0.3);
  transition: width 0.3s var(--ease, ease), background 0.3s var(--ease, ease);
}
.chapter-rail a:hover .cr-dot { background: rgba(244, 239, 230, 0.7); }
.chapter-rail a:hover .cr-label { opacity: 1; transform: none; }
.chapter-rail a.active .cr-dot { width: 22px; background: var(--accent); }
.chapter-rail a.active .cr-label { opacity: 1; transform: none; color: var(--accent); }
@media (max-width: 1024px) { .chapter-rail { display: none; } }
