/* Fathoms — main.css — full rewrite */

/* ─── Custom properties ─────────────────────────────────────────── */
:root {
  --abyss:    oklch(11% 0.025 240);
  --trench:   oklch(15% 0.03 235);
  --deep:     oklch(20% 0.035 232);
  --hairline: oklch(40% 0.02 230 / 0.28);
  --ink:      oklch(96% 0.008 230);
  --mist:     oklch(70% 0.015 230);
  --murk:     oklch(50% 0.015 230);
  --glow:     oklch(78% 0.11 198);

  --fs-display: clamp(5rem, 14vw, 12rem);
  --fs-h1:      clamp(2.5rem, 5.5vw, 4.5rem);
  --fs-h2:      clamp(1.75rem, 3vw, 2.625rem);
  --fs-h3:      1.375rem;
  --fs-lead:    clamp(1.05rem, 1.4vw, 1.25rem);
  --fs-body:    1rem;
  --fs-small:   0.8125rem;
  --fs-micro:   0.6875rem;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --px: clamp(1.25rem, 4vw, 3rem);
}

/* ─── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--abyss);
  color: var(--ink);
  font-family: 'Geist', sans-serif;
  font-size: var(--fs-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

/* ─── Font faces ────────────────────────────────────────────────── */
@font-face {
  font-family: 'Young Serif';
  src: url('../assets/fonts/YoungSerif-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Geist';
  src: url('../assets/fonts/Geist-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Geist';
  src: url('../assets/fonts/Geist-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Geist';
  src: url('../assets/fonts/Geist-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('../assets/fonts/GeistMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

/* ─── Utilities ─────────────────────────────────────────────────── */
.container {
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: var(--px);
}
.kicker {
  font-family: 'Geist Mono', monospace;
  font-size: var(--fs-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mist);
}
.font-mono {
  font-family: 'Geist Mono', monospace;
}

/* ─── Masthead ──────────────────────────────────────────────────── */
#masthead {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 50;
  height: 56px;
  display: flex;
  align-items: center;
  transition: background 300ms ease, border-color 300ms ease;
  border-bottom: 1px solid transparent;
}
#masthead.scrolled {
  background: oklch(11% 0.025 240 / 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom-color: var(--hairline);
}
#masthead > .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.masthead-wordmark {
  font-family: 'Young Serif', serif;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  line-height: 1;
}
.masthead-wordmark .glow-o { color: var(--glow); }

/* ─── Language dropdown ─────────────────────────────────────────── */
.lang-dropdown { position: relative; }
.lang-trigger {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink);
  padding: 0.25rem 0.375rem;
  border-radius: 4px;
  transition: background 150ms;
}
.lang-trigger:hover { background: var(--deep); }
.lang-trigger:focus-visible { outline: 2px solid var(--glow); outline-offset: 2px; }
.lang-flag {
  width: 22px;
  height: 16px;
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid var(--hairline);
}
.lang-code {
  font-family: 'Geist Mono', monospace;
  font-size: var(--fs-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.lang-chevron {
  color: var(--murk);
  transition: transform 200ms;
}
.lang-dropdown[aria-expanded="true"] .lang-chevron { transform: rotate(180deg); }

.lang-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--trench);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 0.5rem;
  min-width: 160px;
  box-shadow: 0 24px 48px -16px oklch(0% 0 0 / 0.65);
  z-index: 60;
  display: none;
}
.lang-dropdown[aria-expanded="true"] .lang-panel { display: block; }

.lang-option {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.625rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Geist', sans-serif;
  font-weight: 500;
  font-size: var(--fs-small);
  color: var(--ink);
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  transition: background 120ms;
}
.lang-option:hover { background: var(--deep); }
.lang-option:focus-visible { outline: 2px solid var(--glow); outline-offset: 1px; }
.lang-option.active { color: var(--glow); }

/* ─── CTA buttons ───────────────────────────────────────────────── */
.btn-cta,
.btn-dl {
  font-family: 'Geist', sans-serif;
  font-weight: 600;
  background: var(--glow);
  color: var(--abyss);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: transform 120ms, opacity 120ms;
  letter-spacing: -0.01em;
}
.btn-cta { font-size: var(--fs-small); padding: 0.625em 1.5em; }
.btn-dl  { font-size: var(--fs-body);  padding: 0.75em 2em; border-radius: 8px; }
.btn-cta:active, .btn-dl:active { transform: translateY(1px); }
.btn-cta:focus-visible, .btn-dl:focus-visible { outline: 2px solid var(--glow); outline-offset: 3px; }

/* ─── App Store badge link ──────────────────────────────────────── */
.app-store-link {
  display: inline-block;
  height: 54px;
  transition: opacity 200ms;
  text-decoration: none;
}
.app-store-link img {
  height: 100%;
  width: auto;
  object-fit: contain;
  display: block;
}
.app-store-link:hover { opacity: 0.88; }
.app-store-link:active img { transform: translateY(1px); }
.app-store-link:focus-visible { outline: 2px solid var(--glow); outline-offset: 3px; }
@media (max-width: 767px) {
  .app-store-link { height: 48px; }
}

/* ─── Act 1: Hero (full-bleed) ──────────────────────────────────── */
.hero {
  position: relative;
  height: 100dvh;
  overflow: hidden;
}

/* Background image */
.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  opacity: 0;
  will-change: transform, opacity;
}

/* Left-side gradient — dims left where text sits, leaves centre-right clear */
.hero-overlay-left {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    90deg,
    oklch(11% 0.025 240 / 0.92) 0%,
    oklch(11% 0.025 240 / 0.65) 30%,
    oklch(11% 0.025 240 / 0)    65%
  );
}

/* Bottom fade into next section */
.hero-overlay-bottom {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    transparent              50%,
    oklch(11% 0.025 240 / 0.6) 100%
  );
}

/* Content wrapper — full grid, content anchored bottom-left */
.hero-content-wrap {
  position: relative;
  z-index: 2;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr;
  max-width: 1280px;
  margin-inline: auto;
  padding: clamp(6rem, 10vw, 9rem) clamp(1.5rem, 4vw, 3rem);
  align-items: end;
}

.hero-content {
  max-width: 640px;
  justify-self: start;
  align-self: end;
}

/* Wordmark */
.act1-wordmark {
  font-family: 'Young Serif', serif;
  font-size: clamp(4rem, 11vw, 10rem);
  letter-spacing: -0.02em;
  line-height: 0.9;
  color: var(--ink);
  display: flex;
  flex-wrap: nowrap;
}
.act1-letter {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  will-change: transform, opacity;
}
.act1-letter.glow-o { color: var(--glow); }
@keyframes glowPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.82; }
}
.act1-letter.pulse { animation: glowPulse 3s ease-in-out infinite; }

/* Tagline */
.act1-tagline {
  margin-top: 1.25rem;
  font-family: 'Young Serif', serif;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  color: var(--mist);
  line-height: 1.4;
  max-width: 40ch;
  opacity: 0;
  transform: translateY(16px);
  will-change: transform, opacity;
}

/* CTA row */
.act1-cta-row {
  margin-top: 2.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(16px);
  will-change: transform, opacity;
}
.price-pill {
  font-family: 'Geist Mono', monospace;
  font-size: var(--fs-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mist);
  border: 1px solid var(--hairline);
  padding: 0.3em 0.8em;
  border-radius: 100px;
}

/* Mobile overrides */
@media (max-width: 767px) {
  .hero-overlay-left {
    background: linear-gradient(
      180deg,
      transparent                  30%,
      oklch(11% 0.025 240 / 0.9)   80%
    );
  }
  .hero-bg {
    object-position: center 35%;
  }
  .act1-wordmark {
    font-size: clamp(3rem, 11vw, 10rem);
  }
  .act1-tagline {
    font-size: clamp(1.1rem, 2vw, 1.75rem);
  }
  .hero-content-wrap {
    padding-bottom: max(clamp(6rem, 10vw, 9rem), calc(env(safe-area-inset-bottom) + 4rem));
  }
}

/* ─── Act 2: Premise ────────────────────────────────────────────── */
#act2 {
  background: var(--trench);
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding-block: 0;
}
.premise-text {
  font-family: 'Young Serif', serif;
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  letter-spacing: -0.025em;
  line-height: 1.0;
  color: var(--ink);
  max-width: 20ch;
}
.premise-word {
  display: inline-block;
  margin-right: 0.22em;
  will-change: transform, opacity;
  /* Initial hidden state set by gsap.set() in setupPremiseAnimation */
}

/* ─── Act 3 & 4: shared snap carousel ──────────────────────────── */
#act3 { background: var(--abyss); }
#act4 { background: var(--abyss); }

@media (min-width: 768px) {
  #act3,
  #act4 {
    position: relative;
  }
}
/* Kicker inside carousel panels needs bottom margin */
.snap-text > .kicker { margin-bottom: 1rem; }

/* Heading row above the rail */
.act-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1rem 0.75rem;
}

/* Act 4 heading has extra structure (kicker + title stacked) */
.act-heading-text { display: flex; flex-direction: column; gap: 0.375rem; }
.act4-worlds-title {
  font-family: 'Young Serif', serif;
  font-size: var(--fs-h2);
  letter-spacing: -0.015em;
  color: var(--ink);
  line-height: 0.92;
}

/* Prev/Next arrow buttons */
.snap-nav {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem clamp(1.5rem, 4vw, 3rem) 0;
}
.snap-nav--inline {
  justify-content: flex-start;
  gap: 0.75rem;
  margin-top: 1.75rem;
  padding: 0;
  max-width: none;
}
.snap-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  height: 44px;
  padding: 0 1rem;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 200ms, color 200ms;
  font-family: 'Geist Mono', monospace;
  font-size: var(--fs-micro);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.snap-btn:hover { border-color: var(--glow); color: var(--glow); }
.snap-btn:disabled { opacity: 0.3; pointer-events: none; }

/* The scroll rail */
.snap-rail {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  outline: none;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.snap-rail::-webkit-scrollbar { display: none; }

/* Individual panel */
.snap-panel {
  flex: 0 0 100vw;
  min-height: 100dvh;
  display: flex;
  align-items: flex-start;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

/* Two-column layout inside each panel */
.snap-panel-inner {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: clamp(4rem, 6vw, 6rem) clamp(1.5rem, 4vw, 3rem) clamp(2rem, 4vw, 4rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 4vw, 4rem);
  align-items: start;
}

/* Text column */
.snap-text { align-self: start; }

.rule-label {
  font-family: 'Geist Mono', monospace;
  font-size: var(--fs-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mist);
  margin-bottom: 1rem;
}
.rule-title {
  font-family: 'Young Serif', serif;
  font-size: var(--fs-h1);
  letter-spacing: -0.015em;
  color: var(--ink);
  line-height: 1.05;
  margin-bottom: 1.75rem;
}
.rule-body {
  font-size: var(--fs-body);
  color: var(--mist);
  line-height: 1.7;
  max-width: 56ch;
  margin-top: 1.25rem;
}
.rule-body:first-of-type { margin-top: 0; }

/* Figure column */
.snap-figure {
  margin: 0;
  width: 100%;
  max-width: 480px;
  justify-self: center;
}
.snap-figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  box-shadow: 0 60px 120px -40px oklch(0% 0 0 / 0.7);
}

/* World-specific text */
.world-counter {
  font-family: 'Geist Mono', monospace;
  font-size: var(--fs-micro);
  letter-spacing: 0.12em;
  color: var(--mist);
  margin-bottom: 0.875rem;
}
.world-name {
  font-family: 'Young Serif', serif;
  font-size: var(--fs-h1);
  letter-spacing: -0.015em;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 1rem;
}
.world-desc {
  font-size: var(--fs-lead);
  color: var(--mist);
  line-height: 1.6;
  max-width: 44ch;
}

/* Progress dots */
.snap-progress {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding-block: 0.75rem 1.5rem;
}
@media (min-width: 768px) {
  .snap-progress { display: none; }
}
.snap-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: background 200ms, border-color 200ms;
}
.snap-dot--active,
.snap-dot:hover {
  background: var(--glow);
  border-color: var(--glow);
}

/* ─── Act 5: Daily Descent ──────────────────────────────────────── */
#act5 {
  position: relative;
  overflow: hidden;
}
.act5-bg {
  position: absolute;
  inset: 0;
  background-image: url('../assets/images/gen/fathomed-hero.webp');
  background-size: cover;
  background-position: center;
  z-index: 0;
}
.act5-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    160deg,
    oklch(11% 0.025 240 / 0.55) 0%,
    oklch(11% 0.025 240 / 0.82) 100%
  );
  z-index: 1;
}
.act5-inner {
  position: relative;
  z-index: 2;
  text-align: center;
  padding-block: clamp(6rem, 12vw, 10rem);
  width: 100%;
}
.act5-inner .kicker { margin-bottom: 1.5rem; }
.act5-title {
  font-family: 'Young Serif', serif;
  font-size: var(--fs-h2);
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 3rem;
}
.act5-stats {
  display: flex;
  gap: clamp(2rem, 5vw, 5rem);
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
  padding-block: 2.5rem;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 3rem;
}
.stat-item {
  text-align: center;
  /* Initial hidden state is set by gsap.set() in setupAct5 */
}
.stat-number {
  font-family: 'Geist Mono', monospace;
  font-size: clamp(3rem, 6vw, 5rem);
  color: var(--ink);
  line-height: 1;
  letter-spacing: -0.02em;
  display: block;
}
.stat-label {
  font-family: 'Geist Mono', monospace;
  font-size: var(--fs-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mist);
  margin-top: 0.5rem;
  display: block;
}
.act5-body {
  font-size: var(--fs-lead);
  color: var(--mist);
  line-height: 1.65;
  max-width: 52ch;
  margin-inline: auto;
  /* Initial hidden state is set by gsap.set() in setupAct5 */
}

/* ─── Act 6: Languages ──────────────────────────────────────────── */
#act6 {
  background: var(--trench);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  padding-block: clamp(4rem, 8vw, 7rem);
}
.act6-inner {
  max-width: 720px;
  text-align: center;
  margin-inline: auto;
}
.act6-inner .kicker { margin-bottom: 1.25rem; }
.act6-title {
  font-family: 'Young Serif', serif;
  font-size: var(--fs-h2);
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 2rem;
}
.act6-body {
  font-size: var(--fs-body);
  color: var(--mist);
  max-width: 65ch;
  line-height: 1.65;
  margin-inline: auto;
  margin-bottom: 1.25rem;
}
.act6-flag-row {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  margin-top: 3rem;
  flex-wrap: wrap;
}
.act6-flag-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.act6-flag {
  width: 44px;
  height: 28px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid var(--hairline);
  display: block;
}
.act6-flag-name {
  font-family: 'Geist', sans-serif;
  font-weight: 500;
  font-size: var(--fs-small);
  color: var(--mist);
}

/* ─── Act 7: Download ───────────────────────────────────────────── */
#act7 {
  background: var(--abyss);
  padding-block: clamp(4rem, 8vw, 7rem);
}
.dl-card {
  background: var(--trench);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: clamp(2.5rem, 6vw, 4.5rem);
  max-width: 640px;
  margin-inline: auto;
  /* Initial hidden state is set by gsap.set() in setupAct7 */
}
.dl-card .kicker { margin-bottom: 1rem; }
.dl-title {
  font-family: 'Young Serif', serif;
  font-size: var(--fs-h2);
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 1rem;
}
.dl-body {
  font-size: var(--fs-lead);
  color: var(--mist);
  max-width: 55ch;
  line-height: 1.65;
  margin-bottom: 2rem;
}

/* ─── Footer ────────────────────────────────────────────────────── */
#footer {
  border-top: 1px solid var(--hairline);
  padding-block: 1.875rem;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.footer-left {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}
.footer-mark {
  width: 24px;
  height: 24px;
  object-fit: contain;
  border-radius: 4px;
}
.footer-brand {
  font-size: var(--fs-small);
  color: var(--mist);
}
.footer-brand strong { font-weight: 500; color: var(--ink); }
.footer-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.footer-right a {
  font-size: var(--fs-small);
  color: var(--mist);
  text-decoration: none;
  transition: color 150ms;
}
.footer-right a:hover { color: var(--ink); }
.footer-right a:focus-visible { outline: 2px solid var(--glow); outline-offset: 2px; }

/* ─── Act 2b: Etymology ────────────────────────────────────────── */
#act2b {
  background: var(--trench);
  display: flex;
  align-items: center;
  padding-block: clamp(5rem, 10vw, 8rem);
}
.etym-grid {
  display: grid;
  grid-template-columns: 6fr 4fr;
  gap: clamp(3rem, 6vw, 6rem);
  align-items: stretch;
}
.etym-text .kicker { margin-bottom: 1.5rem; }
.etym-word {
  font-family: 'Young Serif', serif;
  font-size: clamp(3.5rem, 8vw, 7rem);
  letter-spacing: -0.035em;
  line-height: 0.85;
  color: var(--ink);
}
.etym-phonetic {
  font-family: 'Geist Mono', monospace;
  font-size: clamp(1.25rem, 1.6vw, 1.5rem);
  color: var(--mist);
  margin-top: 0.5rem;
}
.etym-rule {
  border: none;
  border-top: 1px solid var(--hairline);
  margin: 2rem 0 1.5rem;
}
.etym-defs { display: flex; flex-direction: column; gap: 0; }
.etym-def { margin-bottom: 1rem; }
.etym-def dt {
  font-family: 'Geist Mono', monospace;
  font-size: var(--fs-micro);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--murk);
}
.etym-def dd {
  font-size: var(--fs-lead);
  color: var(--mist);
  margin: 0.5rem 0 0;
  line-height: 1.6;
}
.etym-figure {
  margin: 0;
  overflow: hidden;
  border-radius: 4px;
}
.etym-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  display: block;
  box-shadow: 0 40px 80px -30px oklch(0% 0 0 / 0.65);
}
@media (max-width: 767px) {
  .etym-grid {
    grid-template-columns: 1fr;
  }
  .etym-figure {
    order: -1;
    height: 70vw;
    max-height: 380px;
  }
  .etym-word { font-size: clamp(2.5rem, 10vw, 4rem); }
}

/* ─── Act 4b: Scoring ───────────────────────────────────────────── */
#act4b {
  background: var(--trench);
  padding-block: clamp(4rem, 8vw, 7rem);
}
.scoring-kicker { margin-bottom: 1.25rem; }
.scoring-title {
  font-family: 'Young Serif', serif;
  font-size: var(--fs-h2);
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 2rem;
}
.scoring-intro {
  font-size: var(--fs-lead);
  color: var(--mist);
  max-width: 72ch;
  line-height: 1.65;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}
.scoring-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.scoring-block {
  padding-inline: clamp(1.25rem, 2.5vw, 2rem);
  padding-block: 0.5rem;
  border-right: 1px solid var(--hairline);
}
.scoring-block:first-child { padding-inline-start: 0; }
.scoring-block:last-child { border-right: none; }
.scoring-block-label {
  font-family: 'Geist Mono', monospace;
  font-size: clamp(1.125rem, 2vw, 1.5rem);
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}
.scoring-block-body {
  font-size: var(--fs-small);
  color: var(--mist);
  line-height: 1.65;
}

/* ─── Act 6b: FAQ ───────────────────────────────────────────────── */
#act6b {
  background: var(--abyss);
  padding-block: clamp(4rem, 8vw, 7rem);
}
.faq-title {
  font-family: 'Young Serif', serif;
  font-size: var(--fs-h2);
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
}
.faq-list {
  max-width: 72ch;
}
.faq-item {
  border-top: 1px solid var(--hairline);
  list-style: none;
}
.faq-item:last-child { border-bottom: 1px solid var(--hairline); }
.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.25rem;
  cursor: pointer;
  font-size: var(--fs-body);
  font-weight: 500;
  color: var(--ink);
  list-style: none;
  user-select: none;
}
.faq-question::-webkit-details-marker { display: none; }
.faq-chevron {
  color: var(--murk);
  flex-shrink: 0;
  transition: transform 300ms var(--ease-out);
}
.faq-chevron.open { transform: rotate(180deg); }
.faq-item[open] .faq-chevron { transform: rotate(180deg); }
.faq-body-wrap {
  overflow: hidden;
}
.faq-answer {
  font-size: var(--fs-body);
  color: var(--mist);
  line-height: 1.65;
  padding-bottom: 1.25rem;
  max-width: 60ch;
}

/* ─── Footer (expanded) ─────────────────────────────────────────── */
#footer {
  border-top: 1px solid var(--hairline);
  padding-block: 0;
}
.footer-row {
  padding-block: 1.75rem;
  border-bottom: 1px solid var(--hairline);
}
.footer-row:last-child { border-bottom: none; }

/* Row 1 */
.footer-row-1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.footer-brand-block {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}
.footer-mark {
  width: 24px;
  height: 24px;
  object-fit: contain;
  border-radius: 4px;
  flex-shrink: 0;
}
.footer-wordmark {
  font-family: 'Young Serif', serif;
  font-size: var(--fs-small);
  color: var(--ink);
  letter-spacing: -0.01em;
}
.footer-tagline {
  font-size: var(--fs-small);
  color: var(--mist);
}
.footer-lang-strip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.footer-lang-link {
  font-family: 'Geist Mono', monospace;
  font-size: var(--fs-micro);
  letter-spacing: 0.1em;
  color: var(--murk);
  text-decoration: none;
  transition: color 150ms;
}
.footer-lang-link:hover { color: var(--ink); }
.footer-lang-dot {
  font-family: 'Geist Mono', monospace;
  font-size: var(--fs-micro);
  color: var(--murk);
}

/* Row 2 */
.footer-row-2 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
}
.footer-link-group { display: flex; flex-direction: column; gap: 0.625rem; }
.footer-group-heading {
  font-family: 'Geist Mono', monospace;
  font-size: var(--fs-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--murk);
  margin-bottom: 0.25rem;
}
.footer-link {
  font-size: var(--fs-small);
  color: var(--mist);
  text-decoration: none;
  transition: color 150ms;
  width: fit-content;
}
.footer-link:hover { color: var(--ink); }
.footer-link:focus-visible { outline: 2px solid var(--glow); outline-offset: 2px; }

/* Row 3 */
.footer-row-3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-block: 1.25rem;
}
.footer-copyright {
  font-size: var(--fs-small);
  color: var(--murk);
}
.footer-version {
  font-family: 'Geist Mono', monospace;
  font-size: var(--fs-micro);
  color: var(--murk);
  letter-spacing: 0.04em;
}

/* Keep legacy selectors working on legal pages that use old footer markup */
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.footer-brand {
  font-size: var(--fs-small);
  color: var(--mist);
}
.footer-brand strong { font-weight: 500; color: var(--ink); }
.footer-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.footer-right a {
  font-size: var(--fs-small);
  color: var(--mist);
  text-decoration: none;
  transition: color 150ms;
}
.footer-right a:hover { color: var(--ink); }
.footer-right a:focus-visible { outline: 2px solid var(--glow); outline-offset: 2px; }

/* ─── Swipe hint (mobile) ───────────────────────────────────────── */
.swipe-hint {
  font-family: 'Geist Mono', monospace;
  font-size: var(--fs-micro);
  letter-spacing: 0.1em;
  text-transform: lowercase;
  color: var(--murk);
  text-align: center;
  padding-block: 0.75rem;
  opacity: 1;
  transition: opacity 400ms;
}
.swipe-hint.dismissed { opacity: 0; pointer-events: none; }

/* ─── Legal pages (shared) ──────────────────────────────────────── */
.legal-main {
  padding-top: 100px;
  padding-bottom: clamp(5rem, 10vw, 9rem);
}
.legal-content {
  max-width: 70ch;
  margin-inline: auto;
}
.legal-back {
  font-size: var(--fs-small);
  color: var(--mist);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-bottom: 3rem;
  transition: color 150ms;
}
.legal-back:hover { color: var(--ink); }
.legal-h1 {
  font-family: 'Young Serif', serif;
  font-size: var(--fs-h1);
  letter-spacing: -0.015em;
  line-height: 0.92;
  color: var(--ink);
  margin-bottom: 1.25rem;
}
.legal-subtitle {
  font-size: var(--fs-lead);
  color: var(--mist);
  line-height: 1.65;
  margin-bottom: 0.75rem;
}
.legal-updated {
  font-family: 'Geist Mono', monospace;
  font-size: var(--fs-micro);
  letter-spacing: 0.08em;
  color: var(--murk);
  margin-bottom: 3rem;
  display: block;
}
.legal-section { margin-bottom: 2.5rem; }
.legal-section h2 {
  font-family: 'Young Serif', serif;
  font-size: var(--fs-h3);
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 0.875rem;
  line-height: 1.25;
}
.legal-section p {
  font-size: var(--fs-body);
  color: var(--mist);
  line-height: 1.65;
  margin-bottom: 0.875rem;
}
.legal-section p:last-child { margin-bottom: 0; }
.legal-section ul,
.legal-section ol {
  margin: 0.75rem 0 0.875rem 1.5rem;
}
.legal-section li {
  font-size: var(--fs-body);
  color: var(--mist);
  line-height: 1.65;
  margin-bottom: 0.375rem;
}
.legal-section a {
  color: var(--glow);
  text-decoration: none;
}
.legal-section a:hover { text-decoration: underline; }

/* ─── Privacy page (legacy class support) ──────────────────────── */
.privacy-main {
  padding-top: 120px;
  padding-bottom: clamp(5rem, 10vw, 9rem);
}
.privacy-content { max-width: 65ch; margin-inline: auto; }
.privacy-back {
  font-size: var(--fs-small);
  color: var(--mist);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-bottom: 3rem;
  transition: color 150ms;
}
.privacy-back:hover { color: var(--ink); }
.privacy-h1 {
  font-family: 'Young Serif', serif;
  font-size: var(--fs-h1);
  letter-spacing: -0.015em;
  line-height: 0.92;
  color: var(--ink);
  margin-bottom: 1.5rem;
}
.privacy-intro {
  font-size: var(--fs-lead);
  color: var(--mist);
  line-height: 1.65;
  margin-bottom: 3rem;
}
.privacy-section { margin-bottom: 2.5rem; }
.privacy-section h2 {
  font-family: 'Young Serif', serif;
  font-size: var(--fs-h3);
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 0.75rem;
}
.privacy-section p {
  font-size: var(--fs-body);
  color: var(--mist);
  line-height: 1.65;
}

/* ─── CTA hover state (polish) ──────────────────────────────────── */
.btn-cta:hover,
.btn-dl:hover {
  background: oklch(82% 0.11 198);
}
.btn-cta:active,
.btn-dl:active {
  transform: translateY(1px);
}

/* ─── Lang option: selected dot + hover brightness ──────────────── */
.lang-option.active::after {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--glow);
  margin-left: auto;
  flex-shrink: 0;
  display: block;
}
.lang-option:hover .lang-flag {
  filter: brightness(1.04);
}

/* ─── Mobile ────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .snap-nav { display: none; }
  .act1-inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding-top: 90px;
  }
  .act1-img-wrap {
    justify-content: center;
    order: -1;
  }

  /* Act 2b is handled inline in the etym-grid definition */

  /* Act 3 & 4: snap carousel — stack to single column on mobile */
  .snap-panel { height: auto; min-height: 100dvh; }
  .snap-panel-inner {
    grid-template-columns: 1fr;
    padding-block: clamp(3rem, 8vw, 5rem);
  }
  .snap-figure { order: -1; max-width: 100%; }
  .snap-nav { display: none; }

  /* Act 4b: scoring grid stacks 2x2 */
  .scoring-grid {
    grid-template-columns: 1fr 1fr;
  }
  .scoring-block {
    padding-inline: clamp(0.75rem, 2vw, 1.25rem);
    padding-block: 1.25rem;
  }
  .scoring-block:nth-child(2) { border-right: none; }
  .scoring-block:nth-child(3) { border-right: 1px solid var(--hairline); }
  .scoring-block:nth-child(3),
  .scoring-block:nth-child(4) {
    border-top: 1px solid var(--hairline);
  }

  .act5-stats { gap: 1.75rem; }

  /* Footer */
  .footer-row-1 { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .footer-brand-block { flex-wrap: wrap; }
  .footer-row-2 { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .footer-row-3 { flex-direction: column; align-items: flex-start; gap: 0.5rem; }

  .footer-inner { flex-direction: column; align-items: flex-start; gap: 1rem; }
}

/* ─── js-loaded: initial hidden states for GSAP reveal targets ─── */
/*     Only applied when JS confirms GSAP is running.              */
/*     Without js-loaded, elements stay fully visible (no JS).     */

body.js-loaded .etym-rule {
  /* scaleX 0 set by GSAP — needs transform-origin in CSS too */
  transform-origin: left center;
}

/* Initial-state hiding disabled — elements now rely on gsap.set() in their
   setup functions to hide before reveal. If GSAP fails, everything stays
   visible. No more invisible void. */

/* ─── Reduced motion ────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .act1-letter,
  .act1-tagline,
  .act1-cta-row,
  .act1-img-wrap,
  .premise-word,
  .rule-block,
  .stat-item,
  .act5-body,
  .act5-title,
  .act5-title-word,
  .act6-title,
  .act6-body,
  .act6-flag-tile,
  .act6-flag-name,
  .dl-card,
  .dl-title,
  .dl-body,
  .app-store-link,
  .etym-word,
  .etym-phonetic,
  .etym-rule,
  .etym-def,
  .etym-figure,
  .scoring-kicker,
  .scoring-title,
  .scoring-intro,
  .scoring-block,
  .faq-title,
  .faq-item,
  .footer-link-group {
    opacity: 1 !important;
    transform: none !important;
  }
  .act1-letter.pulse { animation: none !important; }
  body.js-loaded .footer-link-group {
    opacity: 1 !important;
    transform: none !important;
  }
}
