/* ==========================================================================
   Synapse — synapseko.com
   Dark theme, brand colors, mobile-first responsive
   ========================================================================== */

/* ---------- Synapse midnight-gold brand tokens — see ../Synapse/DESIGN.md (authoritative) ---------- */
:root {
  --gold: #C9A96E;          /* Brand Gold — primary accent, headlines, monogram */
  --gold-warm: #FFB347;     /* Warm Gold Light — interactive accents, highlights */
  --lavender: #8B7FB5;      /* Neural Lavender — secondary accent */
  --lavender-light: #A99BD0;
  --deep: #1A1A1A;          /* secondary surface on near-black */
  --deep-darker: #0A0A0B;   /* near-black primary background */
  --white: #F5F0E6;         /* warm off-white ink */
  --pure-white: #FFFFFF;
  --black: #000000;
  --error-soft: #FCA5A5;
  --success: #4CAF50;
  --success-soft: #6EE7B7;

  /* Back-compat aliases: the stylesheet still names --royal/--pink from the
     pre-brand blue palette; map them onto the midnight-gold system. */
  --royal: var(--lavender);
  --royal-light: var(--lavender-light);
  --pink: var(--lavender);

  /* rgb triples for rgba() alpha compositing */
  --gold-rgb: 201, 169, 110;
  --gold-warm-rgb: 255, 179, 71;
  --lavender-rgb: 139, 127, 181;
  --royal-rgb: 139, 127, 181;   /* alias → lavender */
  --deep-rgb: 26, 26, 26;
  --deep-darker-rgb: 10, 10, 11;
  --pink-rgb: 139, 127, 181;    /* alias → lavender */
  --white-rgb: 245, 240, 230;
  --black-rgb: 0, 0, 0;

  /* Typography — DESIGN.md font spec */
  /* Brand faces (DESIGN.md; app repo font spec 2026-08-08, site adopted
     2026-08-28): every face must cover Vietnamese — the DM pair didn't, so
     the brand type silently vanished on launch-market pages. Playfair ships
     the 600 cut only; --font-display-weight keeps its rules off synthetic
     weights. */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-display-weight: 600;
  --font-body: 'Be Vietnam Pro', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}


/* ---------- Reset & Base ---------- */

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

/* The standard reset: an author `display` rule must never keep a `hidden`
   element visible. */
[hidden] {
  display: none !important;
}

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

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--white);
  background-color: var(--deep-darker);
  min-height: 100vh;
}

a {
  color: var(--royal);
  text-decoration: none;
}

a:hover {
  color: var(--royal-light);
}

/* ---------- Typography ---------- */

h1, h2, h3, h4 {
  font-family: var(--font-body);
  font-weight: 700;
  line-height: 1.2;
}

.section-title {
  font-size: 1.75rem;
  text-align: center;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  text-align: center;
  color: rgba(var(--white-rgb), 0.65);
  font-size: 1rem;
  margin-bottom: 2rem;
}

/* ---------- Hero ---------- */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 3rem 2rem 2rem;
  position: relative;
  overflow: hidden;
}

.hero-content {
  max-width: 640px;
  margin-bottom: 2rem;
  position: relative;
  z-index: 2;
}

/* ---------- Recall hero: drifting multilingual word-field ---------- */

.hero-wordfield {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  /* Words are placed at random, so some land behind the headline; fade the
     field to nothing over the text block and keep it ambient at the edges. */
  -webkit-mask-image: radial-gradient(ellipse 55% 60% at 50% 45%, transparent 38%, black 78%);
  mask-image: radial-gradient(ellipse 55% 60% at 50% 45%, transparent 38%, black 78%);
}

.hero-word {
  position: absolute;
  font-family: var(--font-body);
  font-weight: 700;
  color: rgba(var(--white-rgb), 0.08);
  white-space: nowrap;
  will-change: transform, opacity;
  opacity: 0;
  animation: hero-drift ease-in-out infinite;
}

.hero-word.fire {
  color: rgba(var(--gold-rgb), 0.38);
  text-shadow: 0 0 10px rgba(var(--gold-rgb), 0.3);
}

@keyframes hero-drift {
  0%   { transform: translateY(26px); opacity: 0; }
  18%  { opacity: 1; }
  82%  { opacity: 1; }
  100% { transform: translateY(-48px); opacity: 0; }
}

.hero-kick {
  position: relative;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  color: rgba(var(--white-rgb), 0.55);
  margin-bottom: 1.25rem;
}

.hero-kick b { color: var(--gold); font-weight: 600; }
.hero-kick .found { color: var(--success); }

@media (prefers-reduced-motion: reduce) {
  .hero-word { animation: none; opacity: 0.09; transform: none; }
}

.hero-title {
  font-size: clamp(2.25rem, 6vw, 3.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin-bottom: 1rem;
  color: var(--white);
}

.hero-hl-b {
  display: block;
  color: var(--gold);
}

.hero-verb {
  transition: opacity 0.25s ease;
}

.hero-tagline {
  font-size: 1.25rem;
  color: rgba(var(--white-rgb), 0.85);
  line-height: 1.5;
}

/* ---------- Top-bar globe button ---------- */

.hero-bar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(var(--white-rgb), 0.08);
  border: 1px solid rgba(var(--white-rgb), 0.12);
  border-radius: 50%;
  color: var(--white);
  cursor: pointer;
  transition: background 0.2s;
}

.hero-bar-btn:hover {
  background: rgba(var(--white-rgb), 0.15);
}

.hero-bar-icon {
  width: 20px;
  height: 20px;
}

/* ---------- Map Modal ---------- */

.map-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}


.map-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(var(--black-rgb), 0.85);
}

.map-modal-content {
  position: relative;
  width: 100%;
  max-width: 1000px;
  background: var(--deep-darker);
  border-radius: 16px;
  padding: 2rem;
  max-height: 90vh;
  overflow-y: auto;
}

.map-modal-title {
  text-align: center;
  margin-bottom: 0.5rem;
}

.map-modal-subtitle {
  text-align: center;
  color: rgba(var(--white-rgb), 0.6);
  margin-bottom: 1.5rem;
}

.map-container {
  position: relative;
  width: 100%;
  max-width: 960px;
  margin: 0 auto 2rem;
}

.map-container svg {
  width: 100%;
  height: auto;
  touch-action: none;
}

/* ---------- Map Zoom Reset Button ---------- */

.map-zoom-reset {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  z-index: 5;
  padding: 0.375rem 0.75rem;
  background: rgba(var(--deep-darker-rgb), 0.9);
  border: 1px solid rgba(var(--royal-rgb), 0.3);
  border-radius: 8px;
  color: rgba(var(--white-rgb), 0.8);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.map-zoom-reset:hover {
  background: rgba(var(--deep-rgb), 0.9);
  color: var(--white);
}


/* ---------- Map Tooltip ---------- */

.map-tooltip {
  position: fixed;
  z-index: 1100;
  pointer-events: none;
  background: rgba(var(--deep-darker-rgb), 0.95);
  border: 1px solid rgba(var(--royal-rgb), 0.3);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--white);
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(var(--black-rgb), 0.4);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}


.map-tooltip-lang {
  color: rgba(var(--white-rgb), 0.7);
  font-size: 0.75rem;
}

.map-tooltip-dim {
  color: rgba(var(--white-rgb), 0.4);
}

.map-tooltip-unsupported {
  border-color: rgba(var(--white-rgb), 0.1);
}

/* Country styling via JS — base styles */
.map-container .country {
  stroke: rgba(var(--white-rgb), 0.08);
  stroke-width: 0.5;
  transition: fill 0.15s, stroke 0.15s;
  cursor: default;
}

.map-container .country.supported {
  cursor: pointer;
}

.map-container .country.supported:hover {
  filter: brightness(1.3);
}

.map-container .country.selected {
  stroke: var(--gold);
  stroke-width: 2;
  filter: drop-shadow(0 0 6px rgba(var(--gold-rgb), 0.4));
}

/* ---------- Flag Grid (Mobile) ---------- */

.flag-grid {
  display: none;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  max-width: 400px;
  margin: 0 auto 2rem;
  padding: 0 1rem;
}

.flag-grid .flag-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 12px;
  transition: background 0.15s;
}

.flag-grid .flag-item:hover {
  background: rgba(var(--royal-rgb), 0.15);
}

.flag-grid .flag-item.selected {
  background: rgba(var(--gold-rgb), 0.15);
  box-shadow: 0 0 0 2px rgba(var(--gold-rgb), 0.4);
}

.flag-grid .flag-emoji {
  font-size: 2rem;
  line-height: 1;
}

.flag-grid .flag-label {
  font-size: 0.6875rem;
  color: rgba(var(--white-rgb), 0.7);
  text-align: center;
}

/* ---------- Selected Language ---------- */

.selected-language {
  text-align: center;
  padding: 1rem;
  background: rgba(var(--royal-rgb), 0.1);
  border: 1px solid rgba(var(--royal-rgb), 0.2);
  border-radius: 12px;
  max-width: 400px;
  margin: 0 auto;
}

.selected-language-label {
  color: rgba(var(--white-rgb), 0.6);
  margin-right: 0.5rem;
}

/* ---------- Lessons ---------- */

.lessons-section {
  padding: 4rem 2rem;
  max-width: 1140px;
  margin: 0 auto;
}

.lessons-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  position: relative;
  padding-left: 2.25rem;
}

/* The synapse learning-path rail runs down the left gutter, behind the nodes. */
.lessons-grid::before {
  content: '';
  position: absolute;
  left: 0.8rem;
  top: 1.75rem;
  bottom: 1.75rem;
  width: 2px;
  background: linear-gradient(180deg, var(--gold), var(--royal) 45%, rgba(var(--royal-rgb), 0.2));
  border-radius: 2px;
}

/* ---------- Firing-axon lessons: bare nodes on a central canvas-drawn path ---------- */
.lessons-grid.lessons-axon {
  display: block;
  padding-left: 0;
  max-width: 1040px;
  margin: 0 auto;
}
.lessons-grid.lessons-axon::before { display: none; }

.axon-canvas { position: absolute; inset: 0; z-index: 0; pointer-events: none; }

.axon-node {
  position: absolute;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 300px;
  padding: 6px;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.axon-node.left { flex-direction: row-reverse; text-align: right; }
.axon-node.soon { cursor: default; }
.axon-node:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 10px; }

.axon-dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  flex-shrink: 0;
  background: radial-gradient(circle at 40% 35%, var(--pure-white), var(--gold));
  box-shadow: 0 0 16px 3px rgba(var(--gold-rgb), 0.6);
  transition: transform 0.2s;
}
.axon-node.soon .axon-dot { background: #3a3733; box-shadow: none; }
.axon-node:hover .axon-dot { transform: scale(1.25); }
.axon-node.recommended .axon-dot { box-shadow: 0 0 0 3px rgba(var(--gold-rgb), 0.3), 0 0 22px 4px rgba(var(--gold-rgb), 0.9); }

.axon-label { display: flex; flex-direction: column; min-width: 0; }
.axon-node.left .axon-label { align-items: flex-end; }
.axon-title { font-family: var(--font-display);
  font-weight: var(--font-display-weight); font-size: 1.2rem; line-height: 1.12; color: var(--white); }
.axon-node.soon .axon-title { color: rgba(var(--white-rgb), 0.5); }
.axon-meta { font-size: 0.78rem; color: rgba(var(--white-rgb), 0.55); margin-top: 3px; }

@media (max-width: 640px) {
  .lessons-grid.lessons-axon { max-width: 100%; }
  .axon-node { max-width: 76vw; }
}

/* ---------- Sound-courses doorway (pronunciation) — reuses the firing axon ---------- */
.sound-courses {
  max-width: 1040px;
  margin: 2.25rem auto 0.5rem;
  padding: 1.25rem 1rem 0.5rem;
  text-align: center;
}
.sound-courses-head { margin-bottom: 1.25rem; }
.sound-courses-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(var(--gold-rgb), 0.85);
  margin-bottom: 0.55rem;
}
.sound-courses-title {
  font-family: var(--font-display);
  font-weight: var(--font-display-weight);
  font-size: 1.75rem;
  line-height: 1.12;
  margin: 0 0 0.35rem;
  color: var(--white);
}
.sound-courses-sub {
  color: rgba(var(--white-rgb), 0.65);
  font-size: 1rem;
  margin: 0;
}
/* Ready course nodes are anchors — drop the default underline/link color. */
.sound-courses-grid .axon-node,
#hub-sound-grid .axon-node { text-decoration: none; color: inherit; }

.sound-courses-empty {
  max-width: 34rem;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 1.5rem;
  border: 1px solid rgba(var(--gold-rgb), 0.18);
  border-radius: 16px;
  background: rgba(var(--deep-rgb), 0.4);
}
.sound-courses-empty-body {
  color: rgba(var(--white-rgb), 0.78);
  font-size: 0.98rem;
  line-height: 1.5;
  margin: 0 0 1rem;
}
.sound-courses-cta {
  display: inline-block;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--black);
  background: var(--gold-warm);
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 6px 20px -6px rgba(var(--gold-warm-rgb), 0.6);
  transition: transform 0.15s;
}
.sound-courses-cta:hover { transform: translateY(-2px); }

.learn-sound-courses #hub-sound-grid { margin-top: 0.5rem; }

/* ---------- Pronunciation teaser (shown until a target is chosen) ---------- */
.pron-teaser {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 auto;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  border: 1px solid rgba(var(--gold-rgb), 0.18);
  background: rgba(var(--deep-rgb), 0.4);
  color: inherit;
  font: inherit;
  cursor: pointer;
  max-width: 100%;
  transition: border-color 0.18s, transform 0.18s;
}
.pron-teaser:hover { border-color: rgba(var(--gold-rgb), 0.45); transform: translateY(-1px); }
.pron-teaser-eyebrow {
  color: rgba(var(--gold-rgb), 0.85);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.pron-teaser-text { font-size: 0.9rem; color: rgba(var(--white-rgb), 0.75); text-align: left; }
.pron-teaser-arrow { color: var(--gold); font-weight: 700; }
@media (max-width: 560px) {
  .pron-teaser { flex-direction: column; gap: 0.25rem; border-radius: 16px; text-align: center; }
  .pron-teaser-text { text-align: center; }
  .pron-teaser-arrow { display: none; }
}

/* ---------- Target Language Tabs ---------- */

.target-lang-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  max-width: 600px;
  margin: 0 auto 2rem;
}

.target-lang-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem 1.25rem;
  background: rgba(var(--deep-rgb), 0.4);
  border: 1px solid rgba(var(--royal-rgb), 0.15);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 1rem;
}

.target-lang-item:hover {
  background: rgba(var(--deep-rgb), 0.7);
  border-color: rgba(var(--royal-rgb), 0.35);
  transform: translateY(-2px);
}

.target-lang-item.selected {
  background: rgba(var(--gold-rgb), 0.12);
  border-color: rgba(var(--gold-rgb), 0.4);
  box-shadow: 0 0 0 1px rgba(var(--gold-rgb), 0.2);
}

.target-lang-item .flag-emoji {
  font-size: 1.5rem;
  line-height: 1;
}

/* ---------- Target Lessons Sub-section ---------- */

#target-lessons {
  margin-top: 1.5rem;
}

.target-lessons-heading {
  font-family: var(--font-body);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-align: center;
}

/* ---------- Video Modal ---------- */

.video-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
}


.video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(var(--black-rgb), 0.85);
}

.video-modal-content {
  position: relative;
  width: 100%;
  max-width: 900px;
  background: var(--deep-darker);
  border-radius: 16px;
  overflow: hidden;
}

.video-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 10;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(var(--black-rgb), 0.5);
  color: var(--white);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.video-modal-close:hover {
  background: rgba(var(--black-rgb), 0.7);
}

.video-modal video {
  width: 100%;
  display: block;
}

/* Custom video controls (replaces native <video controls>) --------------- */
.video-stage {
  position: relative;
  background: #000;
  line-height: 0;
}
.video-stage:fullscreen,
.video-stage:-webkit-full-screen {
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-stage:fullscreen #video-player,
.video-stage:-webkit-full-screen #video-player {
  width: auto;
  max-width: 100vw;
  max-height: 100vh;
}

.video-bigplay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 76px;
  height: 76px;
  border: none;
  border-radius: 50%;
  background: rgba(var(--gold-rgb), 0.92);
  color: var(--deep-darker);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 30px rgba(var(--black-rgb), 0.5);
  transition: transform 0.15s, background 0.15s;
}
.video-bigplay:hover {
  transform: translate(-50%, -50%) scale(1.06);
}

.video-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.9rem 0.8rem 0.6rem;
  background: linear-gradient(to top, rgba(var(--black-rgb), 0.88), rgba(var(--black-rgb), 0));
  line-height: normal;
}

.vc-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 0.25rem;
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.vc-btn:hover {
  color: var(--gold);
}
.vc-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.vc-time {
  flex-shrink: 0;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  color: rgba(var(--white-rgb), 0.85);
  min-width: 2.6rem;
  text-align: center;
}

.vc-scrub {
  flex: 1;
  height: 6px;
  margin: 0 0.15rem;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(var(--white-rgb), 0.22);
  border-radius: 999px;
  cursor: pointer;
}
.vc-scrub::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gold);
  border: none;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(var(--gold-rgb), 0.6);
}
.vc-scrub::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gold);
  border: none;
  cursor: pointer;
}
.vc-scrub:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.vc-vol {
  flex-shrink: 0;
  width: 68px;
  height: 5px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(var(--white-rgb), 0.22);
  border-radius: 999px;
  cursor: pointer;
}
.vc-vol::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--white);
  border: none;
  cursor: pointer;
}
.vc-vol::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--white);
  border: none;
  cursor: pointer;
}

.vc-speed {
  position: relative;
  flex-shrink: 0;
}
.vc-speed-btn {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  min-width: 2.5rem;
  padding: 0.25rem 0.45rem;
  border-radius: 7px;
  background: rgba(var(--white-rgb), 0.1);
}
.vc-speed-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px;
  border-radius: 10px;
  background: rgba(var(--deep-darker-rgb), 0.98);
  border: 1px solid rgba(var(--white-rgb), 0.12);
  box-shadow: 0 8px 24px rgba(var(--black-rgb), 0.5);
  z-index: 5;
}
.vc-speed-opt {
  background: none;
  border: none;
  color: rgba(var(--white-rgb), 0.85);
  font-size: 0.8rem;
  padding: 0.35rem 0.95rem;
  border-radius: 6px;
  cursor: pointer;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.vc-speed-opt:hover {
  background: rgba(var(--white-rgb), 0.1);
  color: var(--white);
}
.vc-speed-opt.active {
  color: var(--gold);
  font-weight: 700;
}

@media (max-width: 560px) {
  .vc-vol {
    display: none;
  }
  .vc-time.vc-dur {
    display: none;
  }
}

.video-modal-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.video-modal-title {
  padding: 1rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  color: rgba(var(--white-rgb), 0.85);
  flex: 1;
}

.video-share-btn {
  flex-shrink: 0;
  background: rgba(var(--white-rgb), 0.1);
  border: none;
  border-radius: 8px;
  padding: 0.5rem 0.625rem;
  margin-right: 1rem;
  color: rgba(var(--white-rgb), 0.6);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
}

.video-share-btn:hover {
  background: rgba(var(--white-rgb), 0.18);
  color: rgba(var(--white-rgb), 0.9);
}

.video-share-btn.copied {
  color: var(--success);
  background: rgba(74, 222, 128, 0.15);
}


/* ---------- App Download Card (between lessons) ---------- */

.app-download-card {
  background: linear-gradient(135deg, rgba(var(--royal-rgb), 0.15) 0%, rgba(var(--pink-rgb), 0.1) 100%);
  border: 1px solid rgba(var(--royal-rgb), 0.25);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
}

.app-download-card-title {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.app-download-card-features {
  color: rgba(var(--white-rgb), 0.7);
  font-size: 0.9375rem;
  margin-bottom: 1.25rem;
}

.app-download-card-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* =============================================================================
   APP DOWNLOAD SECTION (persistent, between lessons and footer)
   ============================================================================= */

.app-section {
  padding: 4rem 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.app-panel {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  align-items: center;
  background: linear-gradient(135deg, rgba(var(--royal-rgb), 0.12), rgba(var(--deep-rgb), 0.4));
  border: 1px solid rgba(var(--royal-rgb), 0.2);
  border-radius: 24px;
  padding: 2.5rem;
}

.app-copy { text-align: left; }

.app-eyebrow {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.app-title {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: -0.02em;
  color: var(--white);
  margin-bottom: 0.5rem;
}

.app-sub {
  font-size: 1.125rem;
  color: rgba(var(--white-rgb), 0.7);
  margin-bottom: 1.5rem;
}

.app-section-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* CSS device mock — a spaced-repetition flashcard moment (no screenshot needed) */
.app-device {
  justify-self: center;
  width: 210px;
  height: 420px;
  border-radius: 32px;
  background: #111114;
  border: 8px solid #050506;
  box-shadow: 0 20px 50px rgba(var(--black-rgb), 0.5), 0 0 0 1px rgba(var(--white-rgb), 0.06);
  padding: 14px;
  position: relative;
}

.app-device::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  height: 6px;
  border-radius: 6px;
  background: rgba(var(--white-rgb), 0.15);
}

.app-device-screen {
  height: 100%;
  border-radius: 20px;
  background: radial-gradient(120% 80% at 50% 0, rgba(var(--royal-rgb), 0.35), var(--deep-darker) 70%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 1.25rem;
}

.app-card {
  width: 100%;
  text-align: center;
  background: rgba(var(--white-rgb), 0.06);
  border: 1px solid rgba(var(--gold-rgb), 0.3);
  border-radius: 16px;
  padding: 1.5rem 1rem;
  box-shadow: 0 0 24px rgba(var(--gold-rgb), 0.15);
}

.app-card-word { font-family: var(--font-body); font-weight: 700; font-size: 1.5rem; color: var(--white); }
.app-card-ipa { font-family: var(--font-mono); font-size: 0.875rem; color: var(--gold); margin-top: 0.25rem; }
.app-card-hint { font-size: 0.875rem; color: rgba(var(--white-rgb), 0.55); margin-top: 0.5rem; }

.app-card-actions { display: flex; gap: 1rem; }
.app-dot {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.app-dot-again { background: rgba(244, 67, 54, 0.22); border: 1px solid var(--error-soft); color: var(--error-soft); }
.app-dot-good { background: rgba(76, 175, 80, 0.22); border: 1px solid var(--success); color: var(--success); }

@media (max-width: 768px) {
  .app-panel { grid-template-columns: 1fr; text-align: center; padding: 1.75rem; gap: 2rem; }
  .app-copy { text-align: center; }
  .app-section-buttons { justify-content: center; }
}

/* ---------- Store Badges (shared) ---------- */

.store-badge {
  display: inline-block;
  padding: 0.625rem 1.25rem;
  border-radius: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--white);
  transition: background 0.2s, transform 0.15s;
}

.store-badge:hover {
  color: var(--white);
  transform: translateY(-1px);
}

.store-badge-ios {
  background: var(--black);
  border: 1px solid rgba(var(--white-rgb), 0.2);
}

.store-badge-ios:hover {
  background: #1a1a1a;
}

.store-badge-android {
  background: #01875f;
  border: 1px solid rgba(1, 135, 95, 0.5);
}

.store-badge-android:hover {
  background: #01a270;
}

/* ---------- iOS Waitlist ---------- */

.ios-waitlist-page {
  background:
    radial-gradient(circle at 50% 0%, rgba(var(--royal-rgb), 0.16), transparent 32rem),
    var(--deep-darker);
}

.ios-waitlist-header {
  max-width: 720px;
}

.ios-waitlist-page main {
  inline-size: min(100%, 480px);
  margin-inline: auto;
  padding-block: 1rem 4rem;
  padding-inline: 1rem;
}

.ios-waitlist-hero {
  position: relative;
  overflow: hidden;
  min-block-size: 19rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-block: 2.5rem;
}

.ios-waitlist-shell {
  position: relative;
  z-index: 1;
}

.ios-kicker {
  margin: 0 0 0.75rem;
  color: rgba(var(--gold-rgb), 0.86);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ios-waitlist-hero h1,
.ios-confirmed-card h1,
.ios-erased h1 {
  margin: 0;
  color: var(--white);
  font-family: var(--font-display);
  font-size: clamp(2.45rem, 13vw, 4.8rem);
  font-weight: var(--font-display-weight);
  line-height: 0.94;
}

.ios-hero-subtitle {
  margin-block: 1rem 0;
  margin-inline: auto;
  max-inline-size: 24rem;
  color: rgba(var(--white-rgb), 0.78);
  font-size: 1.05rem;
  line-height: 1.5;
}

.ios-live-cta {
  margin-block-start: 1.25rem;
}

.ios-confirmed-card,
.ios-erased {
  border: 1px solid rgba(var(--gold-rgb), 0.18);
  border-radius: 12px;
  background: rgba(var(--deep-rgb), 0.72);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.ios-value-reminder,
.ios-status-note {
  color: rgba(var(--white-rgb), 0.72);
  line-height: 1.5;
}

.ios-remove-link {
  color: var(--gold);
}

.ios-form-message {
  margin-block: 0.7rem 0;
  color: var(--lavender);
  font-size: 0.9rem;
}

.ios-remove-link {
  min-block-size: 44px;
  border: 1px solid rgba(var(--gold-rgb), 0.26);
  border-radius: 8px;
  background: rgba(var(--gold-rgb), 0.08);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding-block: 0.65rem;
  padding-inline: 0.85rem;
}

.ios-value-reminder {
  margin-block: 1.25rem 0;
  text-align: center;
}

.ios-confirmed-view {
  position: relative;
  overflow: hidden;
  padding-block-start: 1.25rem;
}

.ios-confirmed-card,
.ios-erased {
  position: relative;
  z-index: 1;
  padding: 1.25rem;
  text-align: center;
}

.ios-remove-link {
  display: block;
  margin-block: 1rem 0;
  margin-inline: auto;
}

/* ---------- Exam Pages ---------- */

.exam-page {
  min-block-size: 100vh;
  background:
    radial-gradient(circle at 50% 0%, rgba(var(--royal-rgb), 0.14), transparent 34rem),
    var(--deep-darker);
}

.exam-header {
  max-inline-size: 1080px;
}

.exam-page main {
  inline-size: min(100%, 1080px);
  margin-inline: auto;
  padding-block: 1rem 5rem;
  padding-inline: 1.25rem;
}

.exam-hero {
  position: relative;
  display: grid;
  min-block-size: min(34rem, 72vh);
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(var(--gold-rgb), 0.18);
  border-radius: 24px;
  background:
    radial-gradient(circle at 88% 18%, rgba(var(--lavender-rgb), 0.12), transparent 18rem),
    rgba(var(--deep-rgb), 0.7);
  padding-block: clamp(3rem, 8vw, 6rem);
  padding-inline: clamp(1.25rem, 6vw, 4.5rem);
}

.exam-hero-copy {
  max-inline-size: 760px;
}

.exam-kicker {
  margin-block: 0 0.85rem;
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.exam-countdown h1 {
  margin: 0;
  color: var(--white);
  font-family: var(--font-display);
  font-size: clamp(2.7rem, 8vw, 5.8rem);
  font-variant-numeric: tabular-nums;
  font-weight: var(--font-display-weight);
  line-height: 0.98;
  text-wrap: balance;
}

.exam-hero-body {
  max-inline-size: 42rem;
  margin-block: 1.35rem 0;
  color: rgba(var(--white-rgb), 0.76);
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.6;
}

.exam-cta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.7rem 1rem;
  margin-block-start: 1.75rem;
}

.exam-primary-cta,
.exam-secondary-link {
  display: inline-flex;
  min-block-size: 48px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding-block: 0.7rem;
  padding-inline: 1.15rem;
  font-family: var(--font-body);
  font-weight: 800;
  text-decoration: none;
}

.exam-primary-cta,
.exam-primary-cta:hover {
  border: 1px solid var(--gold-warm);
  background: var(--gold-warm);
  color: var(--black);
  box-shadow: 0 12px 32px -16px rgba(var(--gold-warm-rgb), 0.9);
}

.exam-primary-cta:hover {
  transform: translateY(-1px);
}

.exam-secondary-link,
.exam-secondary-link:hover {
  border: 1px solid transparent;
  background: transparent;
  color: var(--gold);
  box-shadow: none;
}

.exam-primary-cta:focus-visible,
.exam-secondary-link:focus-visible,
.exam-table-scroll:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.exam-screenshot {
  position: relative;
  max-inline-size: 840px;
  margin-block: 2rem 0;
  margin-inline: auto;
  overflow: hidden;
  border: 1px solid rgba(var(--gold-rgb), 0.18);
  border-radius: 12px;
  background: var(--deep);
}

.exam-screenshot img {
  display: block;
  inline-size: 100%;
  block-size: auto;
}

.exam-listening-section,
.exam-dates-section,
.exam-details-grid article {
  border: 1px solid rgba(var(--gold-rgb), 0.16);
  border-radius: 12px;
  background: rgba(var(--deep-rgb), 0.62);
}

.exam-listening-section,
.exam-dates-section {
  margin-block-start: 2rem;
  padding-block: clamp(1.25rem, 4vw, 2rem);
  padding-inline: clamp(1rem, 4vw, 2rem);
}

.exam-listening-section {
  border-color: rgba(var(--lavender-rgb), 0.26);
}

.exam-listening-section h2,
.exam-dates-section h2,
.exam-details-grid h2 {
  margin-block: 0 0.7rem;
  color: var(--white);
  font-size: clamp(1.35rem, 3vw, 1.8rem);
  line-height: 1.2;
}

.exam-listening-section p,
.exam-details-grid p,
.exam-pending p,
.exam-region-notice,
.exam-verify-source {
  color: rgba(var(--white-rgb), 0.72);
  line-height: 1.65;
}

.exam-region-notice {
  margin-block: 0.25rem 1rem;
  border-inline-start: 2px solid var(--gold);
  padding-inline-start: 0.75rem;
  font-size: 0.9rem;
}

.exam-table-scroll {
  inline-size: 100%;
  overflow: auto;
  overscroll-behavior-inline: contain;
}

.exam-table-scroll table {
  inline-size: 100%;
  min-inline-size: 720px;
  border-collapse: separate;
  border-spacing: 0 0.5rem;
}

.exam-table-scroll th,
.exam-table-scroll td {
  padding-block: 0.85rem;
  padding-inline: 0.9rem;
  text-align: start;
  vertical-align: top;
}

.exam-table-scroll thead th {
  color: rgba(var(--white-rgb), 0.58);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.exam-calendar-row th,
.exam-calendar-row td {
  border-block: 1px solid rgba(var(--white-rgb), 0.1);
  background: rgba(var(--black-rgb), 0.24);
  color: rgba(var(--white-rgb), 0.8);
}

.exam-calendar-row > :first-child {
  border-inline-start: 1px solid rgba(var(--white-rgb), 0.1);
  border-start-start-radius: 8px;
  border-end-start-radius: 8px;
  color: var(--white);
}

.exam-calendar-row > :last-child {
  border-inline-end: 1px solid rgba(var(--white-rgb), 0.1);
  border-start-end-radius: 8px;
  border-end-end-radius: 8px;
}

.exam-calendar-row.is-registration-open th,
.exam-calendar-row.is-registration-open td {
  border-color: rgba(var(--gold-warm-rgb), 0.5);
  background: rgba(var(--gold-warm-rgb), 0.1);
}

.exam-calendar-row.is-cancelled {
  opacity: 0.68;
}

.exam-date-number,
.exam-registration-state {
  font-variant-numeric: tabular-nums;
}

.exam-date-number {
  font-family: var(--font-display);
  font-weight: var(--font-display-weight);
  font-size: 1.08rem;
}

.exam-registration-window,
.exam-registration-state {
  display: block;
}

.exam-registration-state {
  margin-block-start: 0.3rem;
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 700;
}

.exam-status {
  display: inline-flex;
  min-block-size: 28px;
  align-items: center;
  border: 1px solid rgba(var(--white-rgb), 0.15);
  border-radius: 999px;
  padding-block: 0.2rem;
  padding-inline: 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.exam-status-tentative {
  border-color: rgba(var(--lavender-rgb), 0.42);
  color: var(--lavender);
}

.exam-status-cancelled {
  color: rgba(var(--white-rgb), 0.6);
  text-decoration: line-through;
}

.exam-pending {
  margin-block-start: 1rem;
  border: 1px solid rgba(var(--lavender-rgb), 0.24);
  border-radius: 8px;
  background: rgba(var(--lavender-rgb), 0.07);
  padding: 1rem;
}

.exam-pending h3 {
  margin: 0;
  color: var(--white);
  font-size: 1.05rem;
}

.exam-pending p {
  margin-block: 0.45rem;
}

.exam-pending a,
.exam-source-meta a {
  display: inline-flex;
  min-block-size: 44px;
  align-items: center;
  color: var(--gold);
  font-weight: 700;
}

.exam-source-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-block-start: 1rem;
  border-block-start: 1px solid rgba(var(--white-rgb), 0.09);
  padding-block-start: 0.75rem;
  color: rgba(var(--white-rgb), 0.55);
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
}

.exam-verify-source {
  margin-block: 0.25rem 0;
  font-size: 0.78rem;
}

.exam-details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-block-start: 2rem;
}

.exam-details-grid article {
  padding: 1.35rem;
}

@media (max-width: 680px) {
  .exam-page main {
    padding-inline: 0.85rem;
  }

  .exam-hero {
    min-block-size: 28rem;
  }

  .exam-cta-row {
    align-items: stretch;
    flex-direction: column;
  }

  .exam-primary-cta,
  .exam-secondary-link {
    inline-size: 100%;
    text-align: center;
  }

  .exam-details-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .exam-primary-cta,
  .exam-secondary-link {
    transition: none;
  }

  .exam-primary-cta:hover {
    transform: none;
  }
}

/* ---------- Post-Video CTA ---------- */

.video-end-cta {
  position: absolute;
  inset: 0;
  background: rgba(var(--deep-darker-rgb), 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}


.video-end-cta-content {
  text-align: center;
  padding: 2rem;
  max-width: 480px;
}

.video-end-cta-headline {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.video-end-cta-subtext {
  color: rgba(var(--white-rgb), 0.7);
  font-size: 1rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.video-end-cta-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.video-end-cta-dismiss {
  background: none;
  border: none;
  color: rgba(var(--white-rgb), 0.5);
  font-size: 0.8125rem;
  cursor: pointer;
  padding: 0.5rem;
  transition: color 0.15s;
}

.video-end-cta-dismiss:hover {
  color: rgba(var(--white-rgb), 0.8);
}

/* ---------- Android Smart Banner ---------- */

.android-app-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 900;
  height: 56px;
  background: var(--deep);
  border-bottom: 1px solid rgba(var(--royal-rgb), 0.2);
  display: flex;
  align-items: center;
  padding: 0 1rem;
  gap: 0.75rem;
}

.has-android-banner {
  padding-top: 56px;
}

.android-app-banner-content {
  flex: 1;
  min-width: 0;
}

.android-app-banner-name {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--white);
  display: block;
}

.android-app-banner-text {
  font-size: 0.75rem;
  color: rgba(var(--white-rgb), 0.6);
}

.android-app-banner-cta {
  flex-shrink: 0;
  padding: 0.375rem 1rem;
  background: var(--royal);
  border-radius: 6px;
  color: var(--white);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.8125rem;
}

.android-app-banner-cta:hover {
  background: var(--royal-light);
  color: var(--white);
}

.android-app-banner-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: rgba(var(--white-rgb), 0.5);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

/* ---------- Sticky Mobile Bar ---------- */

.sticky-mobile-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  min-height: 52px;
  background: var(--deep);
  border-top: 1px solid rgba(var(--royal-rgb), 0.2);
  display: flex;
  align-items: center;
  /* Respect the iOS home-indicator inset so the bar sits flush at the bottom
     instead of appearing to float above the safe area. */
  padding: 0 1rem env(safe-area-inset-bottom) 1rem;
  gap: 0.75rem;
}

.has-sticky-bar {
  padding-bottom: calc(52px + env(safe-area-inset-bottom));
}

.sticky-mobile-bar-text {
  flex: 1;
  font-size: 0.8125rem;
  color: rgba(var(--white-rgb), 0.85);
}

.sticky-mobile-bar-cta {
  flex-shrink: 0;
  padding: 0.375rem 1.25rem;
  background: var(--royal);
  border-radius: 6px;
  color: var(--white);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.8125rem;
}

.sticky-mobile-bar-cta:hover {
  background: var(--royal-light);
  color: var(--white);
}

.sticky-mobile-bar-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: rgba(var(--white-rgb), 0.5);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

/* ---------- Footer ---------- */

.footer {
  padding: 2rem;
  border-top: 1px solid rgba(var(--white-rgb), 0.08);
  margin-top: 4rem;
}

.footer-content {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-brand {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  color: rgba(var(--white-rgb), 0.5);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: rgba(var(--white-rgb), 0.5);
  font-size: 0.8125rem;
  transition: color 0.15s;
}

.footer-links a:hover {
  color: rgba(var(--white-rgb), 0.8);
}

.footer-language-select {
  background: rgba(var(--deep-rgb), 0.5);
  border: 1px solid rgba(var(--royal-rgb), 0.2);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  color: var(--white);
  font-size: 0.875rem;
  cursor: pointer;
}

.footer-language-select option {
  background: var(--deep);
  color: var(--white);
}

/* ---------- RTL Support ---------- */

html[dir="rtl"] .selected-language-label {
  margin-right: 0;
  margin-left: 0.5rem;
}

html[dir="rtl"] .hero-pair-selector {
  flex-direction: row-reverse;
}

html[dir="rtl"] .hero-pair-arrow {
  transform: scaleX(-1);
}

html[dir="rtl"] .combo-result-link {
  direction: ltr;
}

html[dir="rtl"] .footer-content {
  flex-direction: row-reverse;
}

/* ---------- Legal Pages ---------- */

.legal-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem;
}

.legal-page h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.legal-page .legal-date {
  color: rgba(var(--white-rgb), 0.5);
  font-size: 0.875rem;
  margin-bottom: 2rem;
}

.legal-page h2 {
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--royal);
}

.legal-page p,
.legal-page li {
  color: rgba(var(--white-rgb), 0.85);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.legal-page ul {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.legal-page a {
  color: var(--royal);
}

.legal-back {
  display: inline-block;
  padding: 1rem 0;
  color: rgba(var(--white-rgb), 0.6);
  font-size: 0.875rem;
}

.legal-back:hover {
  color: var(--white);
}

.legal-page h3 {
  font-size: 1.05rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: rgba(var(--white-rgb), 0.95);
}

.legal-governs {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(var(--white-rgb), 0.1);
  color: rgba(var(--white-rgb), 0.5);
  font-size: 0.875rem;
}

/* ---------- Hero Pair Selector ---------- */

.hero-pair-selector {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.6rem;
  max-width: 500px;
  margin: 0 auto 0.75rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, rgba(var(--royal-rgb), 0.12), rgba(var(--deep-rgb), 0.35));
  border: 1px solid rgba(var(--royal-rgb), 0.2);
  border-radius: 14px;
}

.hero-pair-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.hero-pair-label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(var(--white-rgb), 0.6);
  font-weight: 700;
}

.hero-pair-select {
  appearance: none;
  -webkit-appearance: none;
  background-color: rgba(var(--deep-rgb), 0.7);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='%23FFD700'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  border: 1px solid rgba(var(--royal-rgb), 0.35);
  border-radius: 10px;
  padding: 0.55rem 2.1rem 0.55rem 0.9rem;
  color: var(--white);
  font-size: 0.95rem;
  font-family: var(--font-body);
  cursor: pointer;
  min-width: 150px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.hero-pair-select:hover { border-color: rgba(var(--gold-rgb), 0.5); }
.hero-pair-select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(var(--gold-rgb), 0.15); }

.hero-pair-select option {
  background: var(--deep);
  color: var(--white);
}

.hero-pair-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(var(--gold-rgb), 0.15);
  color: var(--gold);
  font-size: 1rem;
  margin-bottom: 0.3rem;
}

.hero-lang-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 0 auto 0.75rem;
  opacity: 0.85;
  transition: opacity 0.2s;
}

.hero-lang-bar:hover {
  opacity: 1;
}

/* ---------- Combo Preview ---------- */

.pair-pron {
  text-align: center;
  max-width: 960px;
  margin: 1.5rem auto 0;
  padding: 2.5rem 1rem 3rem;
  border-top: 1px solid rgba(var(--white-rgb), 0.08);
}

.combo-preview {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.5rem 1rem 1.5rem;
  text-align: center;
}

.combo-result {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.combo-result.visible {
  opacity: 1;
  transform: translateY(0);
}


.combo-result-header {
  text-align: center;
  margin-bottom: 2rem;
}

.combo-result-header h2 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.combo-result-header p {
  color: rgba(var(--white-rgb), 0.65);
  margin-bottom: 1rem;
}

.combo-result-link {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.75rem 1.5rem;
  background: rgba(var(--royal-rgb), 0.2);
  border: 1px solid rgba(var(--royal-rgb), 0.4);
  border-radius: 10px;
  color: var(--white);
  font-weight: 600;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  transition: background 0.2s, border-color 0.2s;
}

.combo-result-link:hover {
  background: rgba(var(--royal-rgb), 0.35);
  border-color: rgba(var(--royal-rgb), 0.6);
  color: var(--white);
}

.combo-unavailable {
  text-align: center;
  padding: 2rem 0;
}


.combo-unavailable h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: rgba(var(--white-rgb), 0.85);
}

.combo-unavailable p {
  color: rgba(var(--white-rgb), 0.5);
  margin-bottom: 1.5rem;
}

.combo-alternative-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  justify-content: center;
}

.combo-alternative-chip {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: rgba(var(--deep-rgb), 0.4);
  border: 1px solid rgba(var(--royal-rgb), 0.2);
  border-radius: 20px;
  color: var(--white);
  font-size: 0.9375rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  font-family: var(--font-body);
}

.combo-alternative-chip:hover {
  border-color: var(--royal);
  background: rgba(var(--royal-rgb), 0.15);
}

/* No-guide-yet state (app.js showComboUnavailable): drill link, app block,
   guide request, the visitor's other guides. */
.combo-unavailable .pair-unavailable-drill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.pair-unavailable-drill-link {
  color: var(--gold);
  font-weight: 600;
  border-bottom: 1px solid rgba(var(--gold-rgb), 0.35);
  padding-bottom: 0.1rem;
}

.pair-unavailable-drill-link:hover {
  color: var(--gold-warm);
}

.pair-unavailable-drill-caption {
  color: rgba(var(--white-rgb), 0.5);
  font-size: 0.8125rem;
}

.pair-unavailable-app {
  max-width: 34rem;
  margin: 0 auto 1.25rem;
  padding: 1.1rem 1rem 1.25rem;
  background: rgba(var(--gold-rgb), 0.05);
  border: 1px solid rgba(var(--gold-rgb), 0.25);
  border-radius: 12px;
}

.combo-unavailable .pair-unavailable-app-claim {
  color: var(--white);
  font-weight: 500;
  margin-bottom: 0.9rem;
}

.pair-unavailable-stores {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
}

.guide-request {
  max-width: 34rem;
  margin: 0 auto;
}

.guide-request-button,
.combo-retry-button {
  padding: 0.55rem 1.2rem;
  border-radius: 8px;
  border: 1px solid rgba(var(--white-rgb), 0.28);
  background: transparent;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.guide-request-button:hover,
.combo-retry-button:hover {
  border-color: rgba(var(--white-rgb), 0.5);
  background: rgba(var(--white-rgb), 0.05);
}

.guide-request-panel {
  text-align: start;
  padding: 1.1rem 1rem;
  background: rgba(110, 231, 183, 0.08);
  border: 1px solid rgba(110, 231, 183, 0.4);
  border-radius: 12px;
}

.combo-unavailable .guide-request-panel p {
  color: var(--white);
  font-size: 0.9375rem;
  margin-bottom: 0.75rem;
}

.combo-unavailable .guide-request-panel p:last-child {
  margin-bottom: 0;
}

.guide-request-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.guide-request-email {
  flex: 1 1 12rem;
  min-width: 0;
  padding: 0.55rem 0.75rem;
  background: rgba(var(--white-rgb), 0.05);
  border: 1px solid rgba(var(--white-rgb), 0.15);
  border-radius: 8px;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.875rem;
}

.guide-request-email::placeholder {
  color: rgba(var(--white-rgb), 0.45);
}

.guide-request-hp {
  position: absolute;
  inset-inline-start: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  opacity: 0;
}

.guide-request-notify {
  padding: 0.55rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--success-soft);
  background: rgba(110, 231, 183, 0.15);
  color: var(--success-soft);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
}

.guide-request-notify:disabled {
  opacity: 0.6;
  cursor: default;
}

.combo-unavailable .guide-request-panel .guide-request-fine {
  color: rgba(var(--white-rgb), 0.55);
  font-size: 0.75rem;
}

.guide-request-fine a {
  color: inherit;
  text-decoration: underline;
}

.combo-unavailable .guide-request-panel .guide-request-message {
  color: var(--error-soft);
  font-size: 0.8125rem;
}

.combo-unavailable .guide-request-error {
  color: var(--error-soft);
  font-size: 0.8125rem;
  margin: 0.6rem 0 0;
}

/* Guide email notice on the drill page (js/guide-manage.js). */
.guide-notice {
  max-width: 40rem;
  margin: 1rem auto 1.5rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(110, 231, 183, 0.4);
  border-radius: 12px;
  background: rgba(110, 231, 183, 0.08);
  color: var(--white);
  font-size: 0.9375rem;
}

.guide-notice p {
  margin: 0;
}

.guide-notice-delete {
  margin-top: 0.5rem;
  padding: 0;
  border: 0;
  background: none;
  color: rgba(var(--white-rgb), 0.7);
  font: inherit;
  font-size: 0.8125rem;
  text-decoration: underline;
  cursor: pointer;
}

.guide-notice-delete:disabled {
  opacity: 0.6;
  cursor: default;
}

.guide-notice-result {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
}

.combo-unavailable .combo-load-error {
  color: rgba(var(--white-rgb), 0.85);
  margin-bottom: 1rem;
}

.combo-unavailable .combo-alternatives-label {
  margin: 1.25rem 0 0.6rem;
  font-size: 0.8125rem;
}

.methodology-rec-note {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--gold);
  margin-bottom: 1rem;
}


/* ---------- Narration Notice ---------- */

.narration-notice {
  max-width: 600px;
  margin: 0 auto 1.5rem;
  padding: 0.75rem 1.25rem;
  background: rgba(var(--gold-rgb), 0.08);
  border: 1px solid rgba(var(--gold-rgb), 0.2);
  border-radius: 10px;
  text-align: center;
  font-size: 0.9375rem;
  color: rgba(var(--white-rgb), 0.75);
  line-height: 1.5;
}


/* ==========================================================================
   Responsive
   ========================================================================== */

/* Small phones */
@media (max-width: 480px) {
  .hero {
    padding: 2rem 1rem 1.5rem;
  }

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

  .hero-tagline {
    font-size: 1.05rem;
  }

  .hero-bar-btn {
    width: 32px;
    height: 32px;
  }

  .hero-bar-icon {
    width: 18px;
    height: 18px;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .lessons-grid {
    padding-left: 1.9rem;
  }

  .hero-pair-selector {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .hero-pair-arrow {
    text-align: center;
    transform: rotate(90deg);
    margin-bottom: 0;
  }

  .hero-pair-select {
    min-width: 0;
    width: 100%;
  }

  .target-lang-item {
    padding: 0.625rem 1rem;
    font-size: 0.9375rem;
  }
}

/* Tablet / mobile */
@media (max-width: 768px) {
  .flag-grid {
    display: grid;
  }

  body {
    background-attachment: scroll;
  }
}

/* Desktop */
@media (min-width: 769px) {
  .flag-grid {
    display: none !important;
  }
}

@media (min-width: 1200px) {
  /* Single centered column so the firing-axon impulse runs straight down one path */
  .lessons-grid {
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ==========================================================================
   Learn (Language Combo) Page
   ========================================================================== */

.learn-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid rgba(var(--white-rgb), 0.08);
}

.learn-brand {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--white);
}

.learn-brand:hover {
  color: var(--white);
}

.learn-back {
  color: rgba(var(--white-rgb), 0.6);
  font-size: 0.875rem;
}

.learn-back:hover {
  color: var(--white);
}

/* ---------- Language Pair Selector ---------- */

.learn-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 2rem;
  flex-wrap: wrap;
}

.learn-selector-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.learn-selector-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(var(--white-rgb), 0.5);
  font-weight: 600;
}

.learn-select {
  background: rgba(var(--deep-rgb), 0.5);
  border: 1px solid rgba(var(--royal-rgb), 0.3);
  border-radius: 8px;
  padding: 0.625rem 1rem;
  color: var(--white);
  font-size: 1rem;
  font-family: var(--font-body);
  cursor: pointer;
  min-width: 160px;
}

.learn-select option {
  background: var(--deep);
  color: var(--white);
}

.learn-selector-arrow {
  font-size: 1.5rem;
  color: var(--gold);
  margin-top: 1.25rem;
}

/* ---------- Content ---------- */

.learn-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
}

.learn-loading {
  text-align: center;
  padding: 4rem;
  color: rgba(var(--white-rgb), 0.5);
}

.learn-hero {
  text-align: center;
  padding: 2rem 0 3rem;
}

.learn-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.learn-subtitle {
  font-size: 1.125rem;
  color: rgba(var(--white-rgb), 0.7);
  margin-bottom: 1.5rem;
}

/* ---------- Difficulty Meter ---------- */

.difficulty-meter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.difficulty-bars {
  display: flex;
  gap: 4px;
}

.difficulty-bar {
  width: 32px;
  height: 8px;
  border-radius: 4px;
  background: rgba(var(--white-rgb), 0.1);
  transition: background 0.3s;
}

.difficulty-bar.filled {
  background: var(--gold);
}

.difficulty-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gold);
}

/* ---------- Learn Sections ---------- */

.learn-section {
  margin-bottom: 3rem;
}

.learn-section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.learn-section-desc {
  color: rgba(var(--white-rgb), 0.65);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

/* ---------- Challenge Cards ---------- */

.challenges-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.challenge-card {
  background: rgba(var(--deep-rgb), 0.3);
  border: 1px solid rgba(var(--royal-rgb), 0.15);
  border-radius: 16px;
  padding: 1.5rem;
}

.challenge-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--white);
}

.challenge-desc {
  color: rgba(var(--white-rgb), 0.7);
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.challenge-diagrams {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* ---------- Sound Cards (shared: learn pages + homepage preview) ---------- */
/* One uniform card everywhere (U4, owner decision 2026-08-29): portrait 2:3
   image, micro-caption, concept-instance play pill. The whole card is a
   button; per-card `.playing` carries the glow, so siblings never co-light. */

.sound-card {
  background: rgba(var(--deep-darker-rgb), 0.6);
  border: 1px solid rgba(var(--gold-rgb), 0.15);
  border-radius: 12px;
  padding: 0.75rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
  width: 220px;
  font-family: inherit;
  color: inherit;
}

.sound-card:hover,
.sound-card:focus-visible {
  border-color: rgba(var(--gold-rgb), 0.5);
  transform: translateY(-2px);
}

.sound-card:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.sound-card[disabled] {
  cursor: default;
  opacity: 0.55;
}

.sound-card[disabled]:hover {
  border-color: rgba(var(--gold-rgb), 0.15);
  transform: none;
}

.sound-card.playing {
  border-color: rgba(var(--gold-rgb), 0.7);
  box-shadow: 0 0 12px rgba(var(--gold-rgb), 0.3);
}

.sound-card-img {
  display: block;
  /* The containing block for the absolutely-positioned lips badge — without
     this the badge resolves against the viewport (live regression 2026-08-30). */
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  background: #000;
}

.sound-card-img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sound-card-lips {
  position: absolute;
  bottom: 6%;
  left: 5%;
  width: 34%;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid rgba(var(--gold-rgb), 0.7);
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.sound-card-lips img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sound-card-caption {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(var(--white-rgb), 0.5);
  margin-top: 0.55rem;
}

.label-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-height: 44px;
  margin-top: 0.3rem;
  padding: 0 0.5rem;
  min-width: 0;
  white-space: normal;
  border: 1px solid rgba(var(--gold-rgb), 0.55);
  border-radius: 999px;
  background: rgba(var(--gold-rgb), 0.08);
  color: var(--gold);
  font-weight: 600;
  font-size: 0.75rem;
}

.label-pill::before {
  content: '\25B6';
  font-size: 0.55rem;
}

.sound-card[disabled] .label-pill::before {
  content: none;
}

.sound-card.playing .label-pill {
  background: var(--gold);
  color: var(--deep-darker);
}

.pill-word {
  font-weight: 400;
  white-space: pre;
}

/* ---------- Lesson Recommendations ---------- */

.lesson-recs {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.lesson-rec-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(var(--deep-rgb), 0.3);
  border: 1px solid rgba(var(--royal-rgb), 0.15);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  color: var(--white);
  transition: border-color 0.2s;
}

.lesson-rec-card:hover {
  border-color: rgba(var(--royal-rgb), 0.4);
  color: var(--white);
}

.lesson-rec-title {
  font-weight: 600;
}

.lesson-rec-duration {
  color: rgba(var(--white-rgb), 0.5);
  font-size: 0.875rem;
}

/* ---------- Tips ---------- */

.tips-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tip-item {
  background: rgba(var(--deep-rgb), 0.3);
  border: 1px solid rgba(var(--gold-rgb), 0.1);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  color: rgba(var(--white-rgb), 0.85);
  font-size: 0.9375rem;
  line-height: 1.6;
  position: relative;
  padding-left: 2.5rem;
}

.tip-item::before {
  content: '\2713';
  position: absolute;
  left: 1rem;
  color: var(--gold);
  font-weight: 700;
}

html[dir="rtl"] .tip-item {
  padding-left: 1.25rem;
  padding-right: 2.5rem;
}

html[dir="rtl"] .tip-item::before {
  left: auto;
  right: 1rem;
}

/* ---------- Learn CTA ---------- */

.learn-cta-section {
  text-align: center;
  padding: 3rem 0;
}

.learn-cta-btn {
  display: inline-block;
  padding: 0.875rem 2rem;
  background: var(--royal);
  border-radius: 10px;
  color: var(--white);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  transition: background 0.2s, transform 0.15s;
  margin-top: 1rem;
}

.learn-cta-btn:hover {
  background: var(--royal-light);
  color: var(--white);
  transform: translateY(-1px);
}

/* ---------- Not Found ---------- */

.learn-not-found {
  text-align: center;
  padding: 4rem 2rem;
}

.learn-not-found h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.learn-not-found p {
  color: rgba(var(--white-rgb), 0.65);
  margin-bottom: 2rem;
}

.learn-available-combos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.combo-link {
  display: inline-block;
  padding: 0.625rem 1.25rem;
  background: rgba(var(--deep-rgb), 0.3);
  border: 1px solid rgba(var(--royal-rgb), 0.2);
  border-radius: 8px;
  color: var(--white);
  font-size: 0.9375rem;
  transition: border-color 0.2s;
}

.combo-link:hover {
  border-color: var(--royal);
  color: var(--white);
}

/* ---------- Learn Responsive ---------- */

@media (max-width: 480px) {
  .learn-title {
    font-size: 1.75rem;
  }

  .learn-selector {
    flex-direction: column;
    gap: 0.75rem;
  }

  .learn-selector-arrow {
    transform: rotate(90deg);
    margin-top: 0;
  }

  /* Three-up stays three-up: shrink the cards instead of wrapping the row. */
  .challenge-diagrams {
    gap: 0.5rem;
  }

  .sound-card {
    width: 102px;
    padding: 0.45rem;
  }

  .sound-card .label-pill {
    min-height: 40px;
    padding: 0 0.3rem;
    font-size: 0.6875rem;
  }

  .sound-card-caption {
    font-size: 0.58rem;
  }

  .lang-toggle {
    width: 100%;
  }

  .ear-quiz-heading,
  .ear-quiz-review,
  .ear-quiz-replays {
    align-items: stretch;
    flex-direction: column;
  }

  .ear-quiz-answers {
    grid-template-columns: 1fr;
  }

  .ear-quiz-btn {
    width: 100%;
  }
}

/* ---------- Audio Playback States ---------- */

/* Hash deep-link pulse — draws attention to the target card */
.challenge-card.is-hash-target {
  animation: hash-pulse 2s ease-out;
}

@keyframes hash-pulse {
  0% { border-color: rgba(var(--gold-rgb), 0.6); box-shadow: 0 0 20px rgba(var(--gold-rgb), 0.4); }
  100% { border-color: rgba(var(--royal-rgb), 0.15); box-shadow: none; }
}

/* ---------- Challenge Header (title + IPA badge) ---------- */

.challenge-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.challenge-header .challenge-title {
  margin-bottom: 0;
}

.ipa-badge {
  font-family: 'DejaVu Sans', 'Noto Sans', 'Lucida Grande', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--gold);
  white-space: nowrap;
  letter-spacing: 0.05em;
}

/* ---------- Audio provenance dots + preview banner (#74) ----------
   Honest signal for AI audio awaiting native-speaker review. Gold-warm ring =
   preview, green fill = certified. Ring-vs-fill is the primary (colourblind-safe)
   signal; colour reinforces. Dots are decorative overlays and never interactive. */

.challenge-header-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.quality-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
  vertical-align: middle;
  pointer-events: none; /* decorative — never intercept the card's tap/keyboard */
}

.quality-dot-provisional {  /* AI preview — hollow gold ring */
  background: transparent;
  border: 2px solid var(--gold-warm);
}

.quality-dot-certified {    /* native-speaker certified — filled green */
  background: #5FBF7A;
}

.quality-dot-pending {      /* awaiting native recording — hollow grey dashed ring */
  background: transparent;
  border: 2px dashed rgba(255, 255, 255, 0.45);
}

.example-word .quality-dot {
  margin-left: 0.3rem;
}

.pron-preview-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(var(--gold-warm-rgb), 0.32);
  background: rgba(var(--gold-warm-rgb), 0.09);
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--white);
}

.pron-preview-banner .quality-dot {
  width: 11px;
  height: 11px;
}

/* The notice grows to whatever its column allows: the text keeps the dot
   company on the first line and the link drops below it when there is no room
   for both, rather than the dot orphaning onto a line of its own. */
.pron-preview-banner-text {
  flex: 1 1 12rem;
}

.pron-preview-banner-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
  font-weight: 600;
  color: var(--gold);
  text-decoration: none;
}

.pron-preview-banner-link:hover,
.pron-preview-banner-link:focus-visible {
  color: var(--gold-warm);
  text-decoration: underline;
}

/* ---------- Challenge Controls (toggle + report + examples) ---------- */

.challenge-controls {
  margin-top: 1rem;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.3s ease, max-height 0.3s ease;
}

.challenge-controls.is-revealed {
  opacity: 1;
  max-height: 200px;
}

.controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

/* ---------- Language Toggle ---------- */

.lang-toggle {
  display: inline-flex;
  border: 1px solid rgba(var(--royal-rgb), 0.2);
  border-radius: 8px;
  overflow: hidden;
}

.lang-toggle-btn {
  background: transparent;
  border: none;
  color: rgba(var(--white-rgb), 0.5);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.5rem 0.875rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  border-bottom: 2px solid transparent;
  min-height: 44px;
}

.lang-toggle-btn.is-active {
  color: var(--white);
  background: rgba(var(--royal-rgb), 0.3);
  border-bottom-color: var(--gold);
}

.lang-toggle-btn:hover:not(.is-active) {
  color: rgba(var(--white-rgb), 0.8);
  background: rgba(var(--royal-rgb), 0.1);
}

/* ---------- Example Words ---------- */

.example-words {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-family: var(--font-body);
  font-size: 0.9375rem;
}

.example-word {
  color: rgba(var(--white-rgb), 0.6);
  transition: color 0.2s, font-weight 0.2s;
}

.example-word.is-active {
  color: var(--gold);
  font-weight: 700;
}

.example-sep {
  color: rgba(var(--white-rgb), 0.25);
  font-size: 0.75rem;
}

/* ---------- Report Button ---------- */

.report-btn {
  background: transparent;
  border: none;
  color: rgba(var(--white-rgb), 0.3);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.5rem;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

.report-btn:hover {
  color: rgba(var(--white-rgb), 0.6);
  background: rgba(var(--white-rgb), 0.05);
}

.report-btn.is-reported {
  color: var(--gold);
  cursor: default;
}

/* ---------- Quality Whisper Flag UX ---------- */

.quality-whisper-bubble {
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  min-height: 44px;
  margin-top: 0.5rem;
  background: var(--deep);
  border: 1px solid rgba(var(--gold-rgb), 0.5);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(var(--black-rgb), 0.35);
  overflow: hidden;
  animation: quality-whisper-in 0.22s ease-out;
}

.quality-whisper-open,
.quality-whisper-dismiss {
  min-height: 44px;
  border: none;
  color: var(--white);
  font-family: var(--font-body);
  cursor: pointer;
}

.quality-whisper-open {
  padding: 0.625rem 0.875rem;
  background: rgba(var(--gold-rgb), 0.13);
  font-size: 0.875rem;
  font-weight: 700;
}

.quality-whisper-dismiss {
  min-width: 44px;
  background: rgba(var(--deep-darker-rgb), 0.55);
  font-size: 1.125rem;
  line-height: 1;
}

.quality-whisper-open:hover,
.quality-whisper-dismiss:hover,
.quality-whisper-open:focus-visible,
.quality-whisper-dismiss:focus-visible {
  outline: none;
  background: rgba(var(--gold-rgb), 0.22);
}

@keyframes quality-whisper-in {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes quality-whisper-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.quality-flag-sheet {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.quality-flag-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(var(--black-rgb), 0.72);
}

.quality-flag-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 480px);
  padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom));
  background: var(--deep-darker);
  border: 1px solid rgba(var(--gold-rgb), 0.38);
  border-bottom: none;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -18px 50px rgba(var(--black-rgb), 0.45);
  animation: quality-sheet-in 0.22s ease-out;
}

.quality-flag-title {
  margin-bottom: 0.75rem;
  font-size: 1rem;
  color: var(--white);
}

.quality-flag-actions {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.quality-flag-reason,
.quality-flag-cancel {
  min-height: 44px;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.quality-flag-reason {
  background: rgba(var(--gold-rgb), 0.12);
  border: 1px solid rgba(var(--gold-rgb), 0.45);
  color: var(--white);
}

.quality-flag-cancel {
  background: transparent;
  border: 1px solid rgba(var(--white-rgb), 0.16);
  color: rgba(var(--white-rgb), 0.72);
  text-align: center;
}

.quality-flag-reason:hover,
.quality-flag-reason:focus-visible {
  outline: none;
  background: rgba(var(--gold-rgb), 0.22);
  border-color: rgba(var(--gold-rgb), 0.75);
}

.quality-flag-cancel:hover,
.quality-flag-cancel:focus-visible {
  outline: none;
  color: var(--white);
  border-color: rgba(var(--white-rgb), 0.35);
}

@keyframes quality-sheet-in {
  from { transform: translateY(20px); }
  to { transform: translateY(0); }
}

.quality-flag-toast {
  position: fixed;
  left: 50%;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  z-index: 1250;
  width: min(calc(100% - 2rem), 460px);
  padding: 0.875rem 1rem;
  transform: translate(-50%, 12px);
  opacity: 0;
  pointer-events: none;
  background: var(--deep);
  border: 1px solid rgba(var(--gold-rgb), 0.45);
  border-radius: 8px;
  color: var(--white);
  font-size: 0.9375rem;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 12px 34px rgba(var(--black-rgb), 0.42);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.quality-flag-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Ear Quiz ---------- */

.ear-quiz {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(var(--white-rgb), 0.08);
}

.ear-quiz-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.ear-quiz-title {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--white);
  margin: 0;
}

.ear-quiz-prompt {
  color: rgba(var(--white-rgb), 0.65);
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

.ear-quiz-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  border: 1px solid rgba(var(--royal-rgb), 0.3);
  border-radius: 8px;
  min-height: 44px;
  padding: 0.5rem 0.875rem;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
}

.ear-quiz-btn:hover {
  transform: translateY(-1px);
}

.ear-quiz-btn.is-playing {
  border-color: rgba(var(--gold-rgb), 0.75);
  box-shadow: 0 0 10px rgba(var(--gold-rgb), 0.25);
}

.ear-quiz-play-btn,
.ear-quiz-next-btn {
  background: var(--gold);
  border-color: rgba(var(--gold-rgb), 0.75);
  color: var(--deep-darker);
}

.ear-quiz-replay-btn {
  background: rgba(var(--deep-darker-rgb), 0.55);
  color: rgba(var(--white-rgb), 0.85);
}

.ear-quiz-answers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.ear-quiz-answer {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 72px;
  padding: 0.75rem;
  background: rgba(var(--deep-darker-rgb), 0.45);
  border: 1px solid rgba(var(--royal-rgb), 0.25);
  border-radius: 8px;
  color: var(--white);
  font-family: var(--font-body);
  text-align: start;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.ear-quiz-answer:not(:disabled):hover {
  background: rgba(var(--royal-rgb), 0.18);
  border-color: rgba(var(--royal-rgb), 0.45);
}

.ear-quiz-answer:disabled {
  cursor: default;
}

.ear-quiz-answer:disabled:not(.is-correct):not(.is-wrong) {
  color: rgba(var(--white-rgb), 0.55);
}

.ear-quiz-choice-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.625rem;
  height: 1.625rem;
  border-radius: 999px;
  background: rgba(var(--gold-rgb), 0.12);
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 800;
}

.ear-quiz-choice-main {
  min-width: 0;
}

.ear-quiz-word {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.ear-quiz-lang {
  display: block;
  margin-top: 0.125rem;
  color: rgba(var(--white-rgb), 0.75);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  unicode-bidi: isolate;
}

.ear-quiz-ipa {
  display: block;
  margin-top: 0.125rem;
  color: rgba(var(--white-rgb), 0.55);
  font-family: 'DejaVu Sans', 'Noto Sans', 'Lucida Grande', sans-serif;
  font-size: 0.875rem;
  unicode-bidi: isolate;
}

.ear-quiz-answer.is-correct {
  background: rgba(52, 211, 153, 0.16);
  border-color: rgba(52, 211, 153, 0.75);
}

.ear-quiz-answer.is-correct .ear-quiz-choice-badge {
  background: rgba(52, 211, 153, 0.22);
  color: var(--success-soft);
}

.ear-quiz-answer.is-wrong {
  background: rgba(248, 113, 113, 0.13);
  border-color: rgba(248, 113, 113, 0.7);
}

.ear-quiz-answer.is-wrong .ear-quiz-choice-badge {
  background: rgba(248, 113, 113, 0.2);
  color: var(--error-soft);
}

.ear-quiz-feedback {
  margin-top: 0.75rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 700;
}

.ear-quiz-feedback.is-correct {
  color: var(--success-soft);
}

.ear-quiz-feedback.is-wrong {
  color: var(--error-soft);
}

.ear-quiz-review {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.875rem;
  flex-wrap: wrap;
}

.ear-quiz-replays {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.challenge-card.is-ear-quiz-playing {
  border-color: rgba(var(--gold-rgb), 0.35);
}

/* ==========================================================================
   Same-language Sound Gym Page
   ========================================================================== */

.sound-gym-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 12%, rgba(var(--gold-rgb), 0.08), transparent 28rem),
    radial-gradient(circle at 78% 18%, rgba(var(--lavender-rgb), 0.11), transparent 24rem),
    var(--deep-darker);
}

.sound-gym-page::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(var(--gold-rgb), 0.46) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(var(--white-rgb), 0.22) 0 1px, transparent 1.5px);
  background-position: 0 0, 3rem 4rem;
  background-size: 7rem 7rem, 11rem 11rem;
  opacity: 0.38;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}

.sound-gym-header,
.sound-gym-content,
.sound-gym-page .footer {
  position: relative;
  z-index: 1;
}

.sound-gym-content {
  max-width: 820px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.sound-gym-shell {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.sound-gym-hero {
  padding: 0.5rem 0 1.25rem;
}

.sound-gym-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.25rem 0.75rem;
  border: 1px solid rgba(var(--gold-rgb), 0.45);
  border-radius: 999px;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sound-gym-hero h1 {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  font-family: var(--font-display);
  font-weight: var(--font-display-weight);
  font-size: 2.65rem;
  line-height: 1.05;
  color: var(--white);
}

.sound-gym-hero p {
  max-width: 620px;
  color: rgba(var(--white-rgb), 0.68);
  font-size: 1.05rem;
  line-height: 1.6;
}

.sound-gym-drill-card {
  padding: 1.5rem;
  border: 1px solid rgba(var(--gold-rgb), 0.22);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(var(--deep-rgb), 0.72), rgba(var(--deep-rgb), 0.42)),
    rgba(var(--deep-darker-rgb), 0.74);
  box-shadow: 0 20px 60px rgba(var(--black-rgb), 0.28);
}

.sound-gym-card-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  min-height: 124px;
  justify-content: center;
}

.sound-gym-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-width: 96px;
  min-height: 64px;
  padding: 0.8rem 1.1rem;
  border: 0;
  border-radius: 999px;
  background: var(--gold);
  color: var(--deep-darker);
  font-family: var(--font-body);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 0 36px rgba(var(--gold-rgb), 0.28);
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}

.sound-gym-play:hover,
.sound-gym-play:focus-visible,
.sound-gym-play.is-playing {
  outline: none;
  transform: translateY(-1px);
  box-shadow: 0 0 46px rgba(var(--gold-rgb), 0.48);
}

.sound-gym-play.is-playing {
  background: var(--gold-warm);
}

.sound-gym-prompt,
.sound-gym-reps {
  color: rgba(var(--white-rgb), 0.62);
  font-size: 0.9rem;
  text-align: center;
}

.sound-gym-no-audio {
  max-width: 440px;
  margin: 0 auto;
  padding: 0.7rem 0.9rem;
  border: 1px solid rgba(var(--gold-warm-rgb), 0.3);
  border-radius: 8px;
  background: rgba(var(--gold-warm-rgb), 0.08);
  color: rgba(var(--white-rgb), 0.78);
  font-size: 0.9rem;
  text-align: center;
}

.sound-gym-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.25rem 0 1rem;
}

.sound-gym-word {
  min-width: 0;
  min-height: 104px;
  padding: 1rem;
  border: 1.5px solid rgba(var(--gold-rgb), 0.35);
  border-radius: 12px;
  background: rgba(var(--deep-darker-rgb), 0.56);
  color: var(--white);
  font-family: var(--font-body);
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.sound-gym-word:not(.sound-gym-word-static):not(:disabled):hover,
.sound-gym-word:not(.sound-gym-word-static):focus-visible {
  outline: none;
  transform: translateY(-2px);
  border-color: rgba(var(--gold-rgb), 0.72);
}

.sound-gym-word:disabled {
  cursor: default;
}

.sound-gym-word-static {
  cursor: default;
}

.sound-gym-word-text {
  display: block;
  overflow-wrap: anywhere;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
}

.sound-gym-ipa {
  display: block;
  margin-top: 0.35rem;
  color: var(--gold);
  font-family: 'DejaVu Sans', 'Noto Sans', 'Lucida Grande', sans-serif;
  font-size: 0.96rem;
  line-height: 1.25;
  unicode-bidi: isolate;
}

.sound-gym-word.is-playing {
  transform: translateY(-2px);
  box-shadow: 0 0 28px rgba(var(--gold-rgb), 0.3);
}

.sound-gym-word.is-correct {
  border-color: rgba(52, 211, 153, 0.78);
  background: rgba(52, 211, 153, 0.14);
}

.sound-gym-word.is-wrong {
  border-color: rgba(248, 113, 113, 0.72);
  background: rgba(248, 113, 113, 0.12);
}

.sound-gym-feedback {
  min-height: 1.4rem;
  color: rgba(var(--white-rgb), 0.72);
  font-size: 0.9rem;
  font-weight: 800;
  text-align: center;
}

.sound-gym-feedback.is-correct {
  color: var(--success-soft);
}

.sound-gym-feedback.is-wrong {
  color: var(--error-soft);
}

.sound-gym-next {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin: 0.75rem auto 0;
  padding: 0.55rem 1rem;
  border: 1px solid rgba(var(--gold-rgb), 0.45);
  border-radius: 8px;
  background: rgba(var(--gold-rgb), 0.12);
  color: var(--white);
  font-family: var(--font-body);
  font-weight: 800;
  cursor: pointer;
}

.sound-gym-meter {
  height: 10px;
  margin-top: 1rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(var(--white-rgb), 0.1);
}

.sound-gym-meter-fill {
  height: 100%;
  background: linear-gradient(90deg, rgba(var(--gold-rgb), 0.55), var(--gold));
  transition: width 0.28s ease;
}

.sound-gym-reps {
  margin-top: 0.5rem;
}

/* Hero bridge line: honest note above the drill when the chosen target has
   no certified audio yet — the drill below plays the page's own language. */
.sound-gym-bridge {
  margin-bottom: 0.8rem;
  padding-left: 0.7rem;
  border-inline-start: 3px solid rgba(var(--gold-rgb), 0.5);
  color: var(--gold-warm);
  font-size: 0.85rem;
}

/* Zero-certified gym: status card in the drill slot (never provisional playback). */
.sound-gym-recording-card {
  padding: 1.5rem;
  border: 1px solid rgba(var(--gold-rgb), 0.22);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(var(--deep-rgb), 0.72), rgba(var(--deep-rgb), 0.42)),
    rgba(var(--deep-darker-rgb), 0.74);
  color: rgba(var(--white-rgb), 0.78);
  font-size: 0.95rem;
}

/* Manifest unavailable: the drill card's own slot carries an honest status,
   in the recording card's voice. The card chrome is already around it. */
.sound-gym-card-status {
  color: rgba(var(--white-rgb), 0.78);
  font-size: 0.95rem;
}

/* Full pair list: certified rows play, the rest carry an honest status. */
.sound-gym-pair-list h2 {
  margin-bottom: 0.65rem;
  font-size: 1rem;
  color: var(--white);
}

.sound-gym-pairs {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(var(--white-rgb), 0.1);
  border-radius: 12px;
  overflow: hidden;
}

.sound-gym-pair-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.7rem 0.9rem;
  background: rgba(var(--deep-rgb), 0.5);
}

.sound-gym-pair-row + .sound-gym-pair-row {
  border-top: 1px solid rgba(var(--white-rgb), 0.06);
}

.sound-gym-pair-play {
  flex: none;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: var(--gold);
  color: var(--deep-darker);
  font-size: 0.72rem;
  cursor: pointer;
  transition: transform 150ms ease-out;
}

.sound-gym-pair-play:hover { transform: scale(1.06); }
.sound-gym-pair-play.is-playing { background: var(--gold-warm); }

.sound-gym-pair-pending {
  flex: none;
  color: rgba(var(--white-rgb), 0.5);
  font-size: 0.75rem;
  font-style: italic;
  max-width: 8.5rem;
}

.sound-gym-pair-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.sound-gym-pair-words {
  font-weight: 600;
  color: var(--white);
}

.sound-gym-pair-row.is-pending .sound-gym-pair-words {
  color: rgba(var(--white-rgb), 0.62);
}

.sound-gym-pair-ipa {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: rgba(var(--white-rgb), 0.55);
}

.sound-gym-pair-contrast {
  flex: none;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: rgba(var(--white-rgb), 0.45);
}

@media (max-width: 480px) {
  .sound-gym-pair-contrast { display: none; }
}

.sound-gym-app-cta h2 {
  margin-bottom: 0.65rem;
  font-size: 1rem;
  color: var(--white);
}

.sound-gym-app-cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.25rem;
  align-items: center;
  margin-top: 0.5rem;
  padding: 1.25rem 0;
  border-top: 1px solid rgba(var(--white-rgb), 0.08);
}

.sound-gym-app-cta p {
  max-width: 500px;
  color: rgba(var(--white-rgb), 0.64);
  font-size: 0.95rem;
  line-height: 1.55;
}

.sound-gym-store-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
}

@media (max-width: 700px) {
  .sound-gym-content {
    padding-top: 2rem;
  }

  .sound-gym-hero h1 {
    font-size: 2.1rem;
  }

  .sound-gym-choices {
    grid-template-columns: 1fr;
  }

  .sound-gym-app-cta {
    grid-template-columns: 1fr;
  }

  .sound-gym-store-buttons {
    justify-content: flex-start;
  }
}

/* ---------- Screen Reader Only ---------- */

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

/* ---------- Reduced Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .sound-card.playing {
    box-shadow: none;
    border-color: rgba(var(--gold-rgb), 0.7);
  }

  .challenge-card.is-hash-target {
    animation: none;
    border-color: rgba(var(--gold-rgb), 0.6);
  }

  .challenge-controls {
    transition: none;
  }

  .ear-quiz-btn,
  .ear-quiz-answer {
    transition: none;
  }

  .quality-whisper-bubble {
    animation: quality-whisper-fade-in 0.18s ease-out;
  }

  .quality-flag-panel {
    animation: none;
  }

  .quality-flag-toast {
    transition: none;
  }
}

/* ==========================================================================
   B2B "sober skin" — restrained, proof-forward expression of the brand system.
   Shares the same tokens as the consumer site; components just read them and
   dial the flash down (no word-field, gold used as hairlines, more structure).
   ========================================================================== */

.b2b-wrap { max-width: 1080px; margin: 0 auto; padding: 0 1.5rem; }

.b2b-nav { display: flex; align-items: center; justify-content: space-between; padding: 1.5rem 0; }
.b2b-nav .b2b-brand { font-family: var(--font-body); font-weight: 800; font-size: 1.25rem; color: var(--white); text-decoration: none; }
.b2b-nav a.b2b-navlink { color: rgba(var(--white-rgb), 0.7); text-decoration: none; font-weight: 600; font-size: 0.9375rem; }
.b2b-nav a.b2b-navlink:hover { color: var(--white); }

.b2b-hero { padding: 3.5rem 0 2.5rem; max-width: 760px; }
.b2b-eyebrow {
  font-family: var(--font-body); font-weight: 600; font-size: 0.75rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--gold);
  display: inline-flex; align-items: center; gap: 0.75rem; margin-bottom: 1.25rem;
}
.b2b-eyebrow::before { content: ''; width: 2.5rem; height: 1px; background: var(--gold); }
.b2b-hero h1 {
  font-family: var(--font-body); font-weight: 800; font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.08; letter-spacing: -0.02em; color: var(--white); margin-bottom: 1.25rem;
}
.b2b-lead { font-size: 1.25rem; line-height: 1.6; color: rgba(var(--white-rgb), 0.7); max-width: 620px; }

.b2b-cta-row { display: flex; gap: 1rem; margin-top: 2rem; flex-wrap: wrap; }
.b2b-btn { font-family: var(--font-body); font-weight: 700; font-size: 1rem; padding: 0.85rem 1.5rem; border-radius: 8px; text-decoration: none; transition: background 0.2s, border-color 0.2s; }
.b2b-btn-primary { background: var(--gold); color: var(--deep); }
.b2b-btn-primary:hover { background: #FFE23D; }
.b2b-btn-ghost { border: 1px solid rgba(var(--white-rgb), 0.3); color: var(--white); }
.b2b-btn-ghost:hover { border-color: var(--white); }

.b2b-stats { display: flex; gap: 2.5rem; margin-top: 3rem; padding-top: 1.75rem; border-top: 1px solid rgba(var(--white-rgb), 0.12); flex-wrap: wrap; }
.b2b-stat b { display: block; font-family: var(--font-body); font-weight: 800; font-size: 1.75rem; color: var(--white); }
.b2b-stat span { font-size: 0.875rem; color: rgba(var(--white-rgb), 0.6); }

.b2b-section { padding: 3rem 0; border-top: 1px solid rgba(var(--white-rgb), 0.08); }
.b2b-section h2 { font-family: var(--font-body); font-weight: 700; font-size: 1.5rem; color: var(--white); margin-bottom: 0.5rem; }
.b2b-sub { color: rgba(var(--white-rgb), 0.6); margin-bottom: 2rem; }

.b2b-verticals { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; }
.b2b-vcard { background: rgba(var(--deep-rgb), 0.4); border: 1px solid rgba(var(--royal-rgb), 0.15); border-radius: 12px; padding: 1.5rem; }
.b2b-vtag { display: inline-block; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--gold); margin-bottom: 0.75rem; }
.b2b-vcard h3 { font-family: var(--font-body); font-weight: 700; font-size: 1.125rem; color: var(--white); margin-bottom: 0.5rem; }
.b2b-vcard p { color: rgba(var(--white-rgb), 0.65); font-size: 0.9375rem; line-height: 1.55; }

.b2b-features { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; padding: 0; }
.b2b-features li { padding-left: 1.75rem; position: relative; color: rgba(var(--white-rgb), 0.75); line-height: 1.5; }
.b2b-features li::before { content: '✓'; position: absolute; left: 0; color: var(--gold); font-weight: 700; }
.b2b-features strong { color: var(--white); }

/* Social-proof scaffolding — hidden until Oscar supplies real logos/quotes (never fabricate) */
.b2b-logos { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 1rem; }
.b2b-logo-slot { height: 56px; border: 1px dashed rgba(var(--white-rgb), 0.18); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: rgba(var(--white-rgb), 0.35); font-size: 0.8125rem; }
.b2b-testimonial { background: rgba(var(--deep-rgb), 0.4); border-left: 3px solid var(--gold); border-radius: 8px; padding: 1.5rem; margin-top: 1.5rem; }
.b2b-testimonial p { font-size: 1.125rem; line-height: 1.6; color: rgba(var(--white-rgb), 0.85); font-style: italic; }
.b2b-testimonial cite { display: block; margin-top: 0.75rem; font-style: normal; font-size: 0.875rem; color: rgba(var(--white-rgb), 0.6); }

.b2b-final { text-align: center; padding: 3.5rem 1.5rem; background: linear-gradient(135deg, rgba(var(--royal-rgb), 0.18), rgba(var(--deep-rgb), 0.4)); border: 1px solid rgba(var(--gold-rgb), 0.2); border-radius: 16px; margin: 3rem 0; }
.b2b-final h2 { border: 0; }
.b2b-final p { color: rgba(var(--white-rgb), 0.7); margin: 0.5rem auto 1.75rem; max-width: 520px; }

.b2b-keyfeatures {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.b2b-keyfeatures li {
  font-size: 0.85rem;
  color: rgba(var(--white-rgb), 0.75);
  border: 1px solid rgba(var(--gold-rgb), 0.25);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
}
.b2b-keyfeatures li::before { content: '✓ '; color: var(--gold); font-weight: 700; }

.b2b-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.25rem; }
.b2b-steps li { display: flex; gap: 1rem; align-items: flex-start; }
.b2b-step-n {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: var(--font-display-weight);
  font-size: 1.25rem;
  color: var(--deep);
  background: var(--gold);
}
.b2b-steps strong { color: var(--white); font-size: 1.1rem; }
.b2b-steps p { color: rgba(var(--white-rgb), 0.65); margin-top: 0.25rem; }

.b2b-pricing { text-align: center; }
.b2b-pricing .b2b-lead { margin: 0 auto; }
.b2b-price { font-family: var(--font-display);
  font-weight: var(--font-display-weight); color: var(--gold); }

/* ==========================================================================
   Accessibility & responsive pass (T10)
   ========================================================================== */

/* Visible keyboard-focus ring on every interactive element */
a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Skip-to-content link (visible only on keyboard focus).
   Hidden via the clipped 1px pattern — NOT an off-screen offset: any
   -9999px technique (physical or logical) inflates RTL scrollWidth. */
.skip-link {
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  padding: 0;
  z-index: 100;
  background: var(--gold);
  color: var(--deep);
  border-radius: 0 0 8px 0;
  font-family: var(--font-body);
  font-weight: 700;
}
.skip-link:focus {
  width: auto;
  height: auto;
  overflow: visible;
  clip-path: none;
  white-space: normal;
  padding: 0.5rem 1rem;
}

/* RTL: mirror the synapse learning-path rail to the right gutter */
html[dir="rtl"] .lessons-grid { padding-left: 0; padding-right: 2.25rem; }
html[dir="rtl"] .lessons-grid::before { left: auto; right: 0.8rem; }
@media (max-width: 768px) {
  html[dir="rtl"] .lessons-grid { padding-right: 1.9rem; }
}

/* Respect reduced-motion for the app-store device float */
@media (prefers-reduced-motion: reduce) {
  .app-device { transition: none; transform: none; }
}

/* ---------- Site top bar: brand wordmark + B2B on-ramp ---------- */

.site-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.85rem;
  flex-wrap: wrap;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0.7rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(10, 10, 15, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(var(--white-rgb), 0.07);
}

/* ---------- Slim top-bar language picker (I speak → I want to learn) ---------- */
.topbar-pair {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1 1 auto;
  justify-content: center;
  min-width: 0;
}
.topbar-pair-seg { display: inline-flex; align-items: center; gap: 0.35rem; min-width: 0; }
.topbar-pair-label {
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(var(--white-rgb), 0.5);
  white-space: nowrap;
}
.topbar-pair-arrow { color: var(--gold); opacity: 0.7; flex-shrink: 0; }
.topbar-select {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--white);
  background: rgba(var(--deep-rgb), 0.6);
  border: 1px solid rgba(var(--white-rgb), 0.14);
  border-radius: 8px;
  padding: 0.3rem 0.5rem;
  max-width: 40vw;
  cursor: pointer;
  min-width: 0;
}
.topbar-select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(var(--gold-rgb), 0.15); }
.topbar-select option { background: var(--deep-darker); color: var(--white); }

@media (max-width: 720px) {
  .site-topbar { padding: 0.55rem 1rem; }
  .site-topbar-org { display: none; }        /* keep the mobile bar slim */
  .topbar-pair { order: 3; flex-basis: 100%; justify-content: stretch; gap: 0.35rem; }
  .topbar-pair-label { display: none; }       /* flags + arrow + placeholder carry it */
  .topbar-select { flex: 1 1 0; max-width: none; }
}

.site-topbar-brand {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--white);
  text-decoration: none;
}

.site-topbar-org {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.875rem;
  color: rgba(var(--white-rgb), 0.7);
  text-decoration: none;
  border: 1px solid rgba(var(--white-rgb), 0.2);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  transition: color 0.2s, border-color 0.2s;
}

.site-topbar-org:hover { color: var(--gold); border-color: rgba(var(--gold-rgb), 0.5); }

/* Globe/flag language controls tucked into the top-right corner */
.site-topbar-right { display: flex; align-items: center; gap: 0.85rem; }
.site-topbar .hero-lang-bar { margin: 0; gap: 0.4rem; }
.site-topbar .hero-bar-btn { width: 32px; height: 32px; }

/* ---------- Display serif (Playfair Display 600) on wordmarks + headlines — DESIGN.md ---------- */
.site-topbar-brand,
.b2b-brand,
.hero-title,
.hero-hl-b,
.section-title,
.b2b-hero h1,
.b2b-section h2,
.b2b-final h2,
.app-title,
.b2b-vcard h3 {
  font-family: var(--font-display);
  font-weight: var(--font-display-weight);
}


/* ---------- Consent banner (Meta pixel gate; see site/js/consent.js) ---------- */
.consent-banner {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 1200;
  max-width: 22rem;
  background: var(--deep);
  border: 1px solid rgba(var(--gold-rgb), 0.35);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}
.consent-banner-text { margin: 0 0 0.75rem; font-size: 0.85rem; color: var(--white); line-height: 1.45; }
.consent-banner-actions { display: flex; gap: 0.5rem; }
.consent-banner-actions button {
  flex: 1;
  min-height: 44px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
.consent-accept { background: var(--gold); color: var(--deep-darker); border: none; }
.consent-decline { background: transparent; color: var(--white); border: 1px solid #3a3a40; }
@media (max-width: 480px) {
  .consent-banner { left: 1rem; right: 1rem; max-width: none; }
}

/* ---------- Homepage IA rewrite (plan PR1.3) ---------- */

/* Hero: T3 waveform underline — the audio motif IS the emphasis */
.hero-wave-word { position: relative; display: inline-block; }
.hero-wave-under {
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: -0.38em;
  height: 0.32em;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}
.hero-wave-under i {
  display: block;
  width: 8%;
  background: var(--gold);
  border-radius: 2px;
  animation: hero-wave-rise 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
.hero-wave-under i:nth-child(1) { height: 34%; animation-delay: 0.05s; }
.hero-wave-under i:nth-child(2) { height: 72%; animation-delay: 0.1s; }
.hero-wave-under i:nth-child(3) { height: 100%; animation-delay: 0.15s; }
.hero-wave-under i:nth-child(4) { height: 58%; animation-delay: 0.2s; }
.hero-wave-under i:nth-child(5) { height: 88%; animation-delay: 0.25s; }
.hero-wave-under i:nth-child(6) { height: 44%; animation-delay: 0.3s; }
.hero-wave-under i:nth-child(7) { height: 76%; animation-delay: 0.35s; }
.hero-wave-under i:nth-child(8) { height: 96%; animation-delay: 0.4s; }
.hero-wave-under i:nth-child(9) { height: 50%; animation-delay: 0.45s; }
@keyframes hero-wave-rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) {
  .hero-wave-under i { animation: none; }
}

.hero-sub {
  text-align: center;
  color: rgba(var(--white-rgb), 0.72);
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 46ch;
  margin: 1.4rem auto 1.6rem;
}
/* .hero-ipa survives for the FIRSTWORD playground preview word. */
.hero-ipa { font-family: var(--font-mono); color: var(--gold); font-size: 1.15rem; }
.hero-cta { display: flex; justify-content: center; margin-top: 0.5rem; }
.hero-cta .store-badge { min-height: 44px; }

/* Pitch sections: one claim, one support, one quiet link (D1 hierarchy) */
.pitch-section {
  max-width: 44rem;
  margin: 0 auto;
  padding: 3.5rem 1.25rem 0;
  text-align: center;
}
.pitch-title { font-family: var(--font-display); font-weight: var(--font-display-weight); font-size: clamp(1.6rem, 4.5vw, 2.2rem); margin: 0 0 0.7rem; }
.pitch-body { color: rgba(245, 240, 230, 0.72); font-size: 1rem; line-height: 1.55; margin: 0 0 0.9rem; }
.pitch-link { color: var(--gold-warm); text-decoration: none; font-size: 0.95rem; }
.pitch-link:hover { text-decoration: underline; }

.forgetting-curve { margin: 1.6rem auto 0; max-width: 24rem; }
.forgetting-curve svg { width: 100%; height: auto; display: block; }
.forgetting-curve-caption { color: rgba(245, 240, 230, 0.55); font-size: 0.8rem; margin-top: 0.5rem; }

/* Language Lens: one master image, localized overlay chips */
.lens-section { padding-bottom: 0.5rem; }
.lens-scene { position: relative; margin: 1.6rem auto 0; max-width: 46rem; border-radius: 16px; overflow: hidden; }
.lens-scene img { display: block; width: 100%; height: auto; }
.lens-chip {
  position: absolute;
  transform: translate(-50%, -50%);
  font-family: var(--font-mono);
  font-size: clamp(0.65rem, 1.8vw, 0.85rem);
  color: var(--gold);
  background: rgba(10, 10, 11, 0.78);
  border: 1px solid var(--gold);
  border-radius: 7px;
  padding: 0.25em 0.6em;
  white-space: nowrap;
}
.lens-chip small { display: block; color: rgba(245, 240, 230, 0.55); font-family: var(--font-body); font-size: 0.72em; letter-spacing: 0.02em; }

/* Provisional machine-translation note (non-en pages) */
.provisional-note {
  max-width: 60rem;
  margin: 0 auto;
  padding: 0.6rem 1.25rem 0;
  color: rgba(245, 240, 230, 0.45);
  font-size: 0.75rem;
  text-align: center;
}

/* ---------- Demo shell (homepage slots + /try Playground) ---------- */
.demo-cover {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  min-height: 8rem;
  background: var(--deep);
  border: 1px solid rgba(var(--gold-rgb), 0.35);
  border-radius: 16px;
  color: var(--white);
  font-size: 1rem;
  cursor: pointer;
}
.demo-cover-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  color: var(--gold);
}
.demo-skeleton {
  min-height: 8rem;
  border-radius: 16px;
  background: linear-gradient(100deg, var(--deep) 40%, #23232a 50%, var(--deep) 60%);
  background-size: 200% 100%;
  animation: demo-skeleton-pulse 1.2s linear infinite;
  color: transparent;
}
@keyframes demo-skeleton-pulse { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .demo-skeleton { animation: none; color: var(--white); } }
.demo-error {
  border: 1px solid rgba(252, 165, 165, 0.4);
  border-radius: 16px;
  padding: 1rem;
  text-align: center;
}
.demo-error-actions { display: flex; gap: 0.75rem; justify-content: center; margin-top: 0.6rem; }
.demo-retry { min-height: 44px; padding: 0 1.1rem; border-radius: 12px; border: none; background: var(--gold); color: var(--deep-darker); font-weight: 600; cursor: pointer; }
.demo-error-link { align-self: center; color: var(--gold-warm); }
.demo-complete { text-align: center; padding: 1.2rem 1rem; border: 1px solid rgba(var(--gold-rgb), 0.35); border-radius: 16px; }
/* Provisional-tier preview note (family): gold-ring treatment per the
   provisional-content standard — visible but quiet, never alarming. */
.demo-provisional-note { border: 1px solid rgba(var(--gold-rgb), 0.45); border-radius: 10px; padding: 0.5rem 0.75rem; margin: 0 0 0.7rem; color: rgba(245, 240, 230, 0.65); font-size: 0.78rem; line-height: 1.45; }
/* TYPING.2 video-backed typing surface: video leads, type-probe beneath,
   keyboard guide + unlocked trainer pre-rendered hidden. */
.typing-surface-video { width: 100%; max-height: 340px; border-radius: 12px; background: #000; display: block; }
.typing-surface-caption { color: rgba(245, 240, 230, 0.6); font-size: 0.78rem; margin: 0.45rem 0 0.9rem; }
.typing-surface-probe-title { color: var(--white, #F5F0E6); font-size: 0.9rem; margin: 0 0 0.3rem; }
.typing-surface-probe-word { font-family: var(--font-mono); color: var(--gold); font-size: 1.35rem; margin: 0 0 0.5rem; }
.typing-surface-probe-input { width: 100%; background: #0A0A0B; border: 1px solid rgba(245, 240, 230, 0.18); border-radius: 10px; padding: 0.6rem 0.8rem; color: #F5F0E6; font-size: 1rem; min-height: 44px; }
.typing-surface-probe-input:focus { outline: 2px solid rgba(var(--gold-rgb), 0.6); outline-offset: 1px; }
.typing-surface-unlocked { margin-top: 0.9rem; }
.typing-surface-unlocked-note { color: var(--gold); font-size: 0.9rem; margin: 0 0 0.6rem; }
.typing-surface-guide { margin-top: 0.9rem; border: 1px dashed rgba(var(--gold-rgb), 0.4); border-radius: 10px; padding: 0.7rem 0.85rem; }
.typing-surface-guide-title { color: var(--gold); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; margin: 0 0 0.3rem; }
.typing-surface-guide-steps { color: rgba(245, 240, 230, 0.65); font-size: 0.8rem; margin: 0; line-height: 1.5; }
.demo-complete-title { font-family: var(--font-display); font-weight: var(--font-display-weight); font-size: 1.4rem; margin-bottom: 0.4rem; }
.demo-score-nums { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--gold); font-size: 1.3rem; }
.demo-complete-body { color: rgba(245, 240, 230, 0.7); font-size: 0.9rem; margin: 0.4rem 0 0.9rem; }
.demo-complete-ctas { display: flex; flex-direction: column; gap: 0.5rem; align-items: center; }
.demo-complete-ctas .store-badge { min-height: 44px; }
.demo-gloss { display: block; color: rgba(245, 240, 230, 0.55); font-size: 0.75rem; margin-top: 0.2rem; }
.demo-microfact { display: block; color: rgba(245, 240, 230, 0.6); font-size: 0.8rem; margin-top: 0.35rem; }

/* ---------- TPRS / typing / alphabet / family demo modules ---------- */
.tprs-scene img { width: 100%; border-radius: 12px; display: block; }
/* Emoji backdrop parity with the app player: dim glyphs floating in the
   scene's dead space when the episode ships no illustration. */
.tprs-scene--emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 7rem;
  border-radius: 12px;
  background: rgba(201, 169, 110, 0.06);
  margin: 0;
}
.tprs-backdrop-emoji { font-size: 2.6rem; letter-spacing: 0.35em; opacity: 0.55; filter: saturate(0.8); }
.tprs-title { font-family: var(--font-display); font-weight: var(--font-display-weight); font-size: 1.2rem; margin: 0.7rem 0 0.3rem; }
.tprs-text { line-height: 1.7; color: rgba(245, 240, 230, 0.85); }
.tprs-word.is-active { color: var(--gold); }
.typing-progress { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: rgba(245, 240, 230, 0.55); font-size: 0.8rem; }
.typing-prompt { font-size: 1.15rem; letter-spacing: 0.02em; margin: 0.5rem 0 0.8rem; }
.typing-ch-correct { color: var(--success-soft); }
.typing-ch-wrong { color: var(--error-soft); text-decoration: underline; }
.typing-ch-pending { color: rgba(245, 240, 230, 0.45); }
.typing-input { width: 100%; min-height: 44px; border-radius: 12px; border: 1px solid #3a3a40; background: rgba(0,0,0,0.35); color: var(--white); padding: 0 0.8rem; font-size: 1rem; }
.alphabet-glyph { position: relative; font-size: 4rem; text-align: center; font-family: var(--font-display);
  font-weight: var(--font-display-weight); }
.alphabet-trace { position: absolute; inset: 0; margin: auto; width: 120px; height: 120px; pointer-events: none; }
.alphabet-stroke { fill: none; stroke: var(--gold); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 400; stroke-dashoffset: 400; animation: alphabet-draw 0.9s ease forwards; }
@keyframes alphabet-draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .alphabet-stroke { animation: none; stroke-dashoffset: 0; } }
.family-text { font-size: 1.05rem; line-height: 1.6; }
.family-text-native { color: rgba(245, 240, 230, 0.6); font-size: 0.95rem; }
.family-controls { display: flex; gap: 0.6rem; margin: 0.7rem 0; }
.family-toggle { min-height: 44px; border-radius: 12px; border: 1px solid #3a3a40; background: transparent; color: var(--white); padding: 0 0.9rem; cursor: pointer; }
.family-toggle[aria-pressed="true"] { border-color: var(--gold); color: var(--gold); }
.family-pager { display: flex; align-items: center; justify-content: center; gap: 0.9rem; margin-top: 0.5rem; }
.family-nav { min-width: 44px; min-height: 44px; border-radius: 12px; border: 1px solid #3a3a40; background: var(--deep); color: var(--white); cursor: pointer; }
.family-page-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: rgba(245, 240, 230, 0.6); font-size: 0.85rem; }

/* ---------- /try Playground ---------- */
.try-shell { max-width: 44rem; margin: 0 auto; padding: 2.5rem 1.25rem 4rem; text-align: center; }
.try-card { margin-top: 2rem; text-align: left; background: var(--deep); border: 1px solid #26262c; border-radius: 16px; padding: 1.2rem; }
.try-card-title { font-family: var(--font-display); font-weight: var(--font-display-weight); font-size: 1.3rem; margin: 0 0 0.3rem; }
.try-card-desc { color: rgba(245, 240, 230, 0.65); font-size: 0.9rem; margin: 0 0 0.8rem; }
.try-card.demo-coming-soon { opacity: 0.5; }
.try-card-soon { color: var(--gold); font-size: 0.85rem; }

/* ---------- /quiz funnel ---------- */
.quiz-shell { max-width: 34rem; margin: 0 auto; padding: 2.5rem 1.25rem 4rem; text-align: center; }
.quiz-card { margin-top: 1.6rem; background: var(--deep); border: 1px solid #26262c; border-radius: 16px; padding: 1.4rem; }
.quiz-dots { display: flex; gap: 0.5rem; justify-content: center; margin-bottom: 1.1rem; }
.quiz-dot { width: 12px; height: 12px; min-width: 0; padding: 0; border-radius: 50%; border: 1px solid #3a3a40; background: transparent; cursor: pointer; }
.quiz-dot.is-done { background: rgba(var(--gold-rgb), 0.5); border-color: var(--gold); }
.quiz-dot.is-active { background: var(--gold); border-color: var(--gold); }
.quiz-options { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 1rem; }
.quiz-options-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); }
.quiz-option { min-height: 44px; border-radius: 12px; border: 1px solid #3a3a40; background: rgba(0,0,0,0.3); color: var(--white); font-size: 0.95rem; padding: 0.5rem 0.8rem; cursor: pointer; }
.quiz-option:hover { border-color: var(--gold); }
.quiz-result .store-badge { margin: 0.9rem auto 0.6rem; display: inline-flex; min-height: 44px; align-items: center; }
.quiz-restart { display: block; margin-top: 0.4rem; }
.app-quiz-link { display: inline-block; margin-top: 0.9rem; }

/* ---------- Share loop ---------- */
.demo-share { min-height: 44px; border-radius: 12px; border: 1px solid var(--gold); background: transparent; color: var(--gold); padding: 0 1rem; cursor: pointer; margin-bottom: 0.6rem; }
.demo-share-copied { display: block; color: var(--success-soft); font-size: 0.85rem; margin-bottom: 0.5rem; }
.result-score { font-size: 1.05rem; margin: 0.6rem 0; }
.result-beat-cta { margin: 0.9rem auto 0.5rem; display: inline-flex; min-height: 44px; align-items: center; }

.sound-gym-complete { max-width: 560px; margin: 1.5rem auto 0; }

/* ---------- Signal Sky feature band (post-#360 app home identity) ---------- */
.feature-band { padding: 4.5rem 1.5rem; max-width: 1120px; margin: 0 auto; text-align: center; }
.band-sub { max-width: 560px; margin: 0.5rem auto 0; }
.band-sky {
  position: relative; height: 340px; margin: 2rem auto 0; max-width: 960px;
  background: radial-gradient(ellipse at 50% 30%, #12121a 0%, #0B0B10 70%);
  border: 1px solid rgba(201, 169, 110, 0.14); border-radius: 24px; overflow: hidden;
}
.band-sky-canvas { position: absolute; inset: 0; pointer-events: none; }
.band-star {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
  min-width: 44px; min-height: 44px; padding: 0.4rem;
  background: none; border: none; cursor: pointer;
  color: #8B7FB5; transition: color 0.25s ease;
}
.band-star .band-figure { width: 42px; height: 42px; filter: drop-shadow(0 0 6px rgba(139, 127, 181, 0.35)); }
.band-star-hero { color: #C9A96E; }
.band-star-hero .band-figure { width: 52px; height: 52px; filter: drop-shadow(0 0 9px rgba(201, 169, 110, 0.45)); }
.band-star-dim { color: rgba(201, 169, 110, 0.32); }
.band-star-dim .band-figure { filter: none; }
.band-star-focused, .band-star:hover { color: #FFB347; }
.band-star-focused .band-figure { filter: drop-shadow(0 0 10px rgba(255, 179, 71, 0.6)); }
.band-star:focus-visible { outline: 2px solid #FFB347; outline-offset: 4px; border-radius: 12px; }
.band-star-label {
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.04em;
  color: rgba(245, 240, 230, 0.72);
}
.band-cards { max-width: 560px; margin: 1.25rem auto 0; }
.band-card {
  background: rgba(201, 169, 110, 0.06); border: 1px solid rgba(201, 169, 110, 0.22);
  border-radius: 12px; padding: 1.1rem 1.3rem; text-align: start;
}
.band-card-title { font-family: var(--font-display);
  font-weight: var(--font-display-weight); color: #F5F0E6; font-size: 1.15rem; margin: 0 0 0.35rem; }
.band-card-body { color: rgba(245, 240, 230, 0.8); margin: 0 0 0.6rem; font-size: 0.95rem; }
.band-card-coming { color: rgba(201, 169, 110, 0.7); font-size: 0.85rem; margin: 0 0 0.6rem; }
.band-card-link { color: var(--gold); display: inline-flex; min-height: 44px; align-items: center; }
@media (max-width: 640px) {
  .band-sky { height: 300px; }
  .band-star .band-figure { width: 34px; height: 34px; }
  .band-star-hero .band-figure { width: 42px; height: 42px; }
  .band-star-label { font-size: 0.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  .band-star, .band-star .band-figure { transition: none; }
}

/* ==========================================================================
   /about — mission-led origin story (sectioned layout, 2026-08-14)
   ========================================================================== */
.about-shell {
  max-width: 880px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 5rem;
}
.about-mission {
  font-family: var(--font-display);
  font-weight: var(--font-display-weight);
  font-size: clamp(2rem, 6vw, 3.1rem);
  line-height: 1.2;
  color: var(--gold);
  margin: 0 0 2.5rem;
  max-width: 22ch;
}
.about-section { margin: 0 0 2.8rem; }
.about-section-title {
  font-family: var(--font-display);
  font-weight: var(--font-display-weight);
  font-size: clamp(1.35rem, 3.5vw, 1.8rem);
  margin: 0 0 0.9rem;
}
.about-body {
  color: rgba(var(--white-rgb), 0.86);
  font-size: 1.02rem;
  line-height: 1.75;
  max-width: 62ch;
  margin: 0 0 1rem;
}
.about-plain {
  border-inline-start: 3px solid var(--lavender);
  padding-inline-start: 1rem;
}
.about-closing {
  font-family: var(--font-display);
  font-weight: var(--font-display-weight);
  font-size: clamp(1.15rem, 3vw, 1.5rem);
  color: rgba(var(--white-rgb), 0.92);
  max-width: 34ch;
  margin: 3rem 0 0;
}
.about-sig {
  font-family: 'Snell Roundhand', 'Segoe Script', 'Brush Script MT', cursive;
  font-size: 1.9rem;
  color: var(--gold);
  margin: 1.6rem 0 0;
}
.about-sig-role {
  color: rgba(var(--white-rgb), 0.55);
  font-size: 0.85rem;
  margin: 0.2rem 0 0;
}
.about-refs {
  border-top: 1px solid rgba(var(--white-rgb), 0.12);
  margin-top: 3rem;
  padding-top: 1.2rem;
}
.about-refs-title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(var(--white-rgb), 0.55);
  margin: 0 0 0.6rem;
}
.about-refs ol {
  margin: 0;
  padding-inline-start: 1.2rem;
}
.about-refs li {
  font-size: 0.82rem;
  line-height: 1.6;
  color: rgba(var(--white-rgb), 0.6);
  margin-bottom: 0.25rem;
}
.about-refs a {
  color: rgba(var(--gold-rgb), 0.85);
  text-decoration: none;
  border-bottom: 1px dotted rgba(var(--gold-rgb), 0.5);
}

/* Footer mission tagline (rides under the brand on every page) */
.footer-brand-col {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.footer-tagline {
  color: rgba(var(--white-rgb), 0.55);
  font-size: 0.78rem;
  line-height: 1.4;
  margin: 0;
  max-width: 30ch;
}

/* Top-bar "Our story" link (quiet text link beside For Organizations) */
.site-topbar-story {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.875rem;
  color: rgba(var(--white-rgb), 0.7);
  text-decoration: none;
  padding: 0.4rem 0.2rem;
}
.site-topbar-story:hover { color: var(--gold); }
@media (max-width: 640px) {
  .site-topbar-story { display: none; } /* footer link covers small screens; the pair picker owns the bar */
}

.site-topbar-gym {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.875rem;
  color: rgba(var(--white-rgb), 0.7);
  text-decoration: none;
  padding: 0.4rem 0.2rem;
}
.site-topbar-gym:hover { color: var(--gold); }
@media (max-width: 640px) {
  .site-topbar-gym { display: none; } /* matches the story link — the pair picker owns the small bar */
}

/* Hero drill — the Sound Gym card sized for the hero rather than its own page. */
.hero-drill {
  max-width: 520px;
  margin: 1.75rem auto 0;
  text-align: start;
}

.hero-drill-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  margin-top: 0.75rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--gold);
  text-decoration: none;
}
.hero-drill-more:hover { color: var(--gold-warm); }

.hero-drill-count {
  font-size: 0.8rem;
  color: rgba(var(--white-rgb), 0.55);
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------------------
   Lesson pages (layout D, 2026-09-06): the lesson's narration renders as an
   article first inside <main>; the homepage hero stays in the DOM because
   app.js reads its nodes unguarded, and is hidden here instead.
   --------------------------------------------------------------------------- */
body.lesson-page #hero {
  display: none;
}

.lesson-article {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 2rem 1rem;
}

.lesson-article h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2rem;
  line-height: 1.2;
  margin: 0 0 0.75rem;
}

.lesson-article-answer {
  font-size: 1.15rem;
  line-height: 1.6;
  color: rgba(var(--white-rgb), 0.85);
  margin: 0 0 1.5rem;
}

.lesson-article p {
  color: rgba(var(--white-rgb), 0.85);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.lesson-article-lead {
  font-size: 1.05rem;
}

.lesson-play {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0 0 2rem;
  padding: 0;
  border: 1px solid rgba(139, 127, 181, 0.25);
  border-radius: 16px;
  background: linear-gradient(160deg, #1a1a1a 0%, #0a0a0b 100%);
  color: var(--white);
  font: inherit;
  cursor: pointer;
}

.lesson-play:hover .lesson-play-icon,
.lesson-play:focus-visible .lesson-play-icon {
  transform: scale(1.06);
}

.lesson-play-icon {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--gold-warm);
  transition: transform 150ms ease;
}

.lesson-play-icon::after {
  content: '';
  position: absolute;
  left: 26px;
  top: 20px;
  border-style: solid;
  border-width: 12px 0 12px 20px;
  border-color: transparent transparent transparent #0a0a0b;
}

.lesson-play-label {
  position: absolute;
  left: 1rem;
  bottom: 0.75rem;
  font-size: 0.875rem;
  color: rgba(var(--white-rgb), 0.7);
}

.lesson-play-duration {
  position: absolute;
  right: 1rem;
  bottom: 0.75rem;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  color: rgba(var(--white-rgb), 0.85);
}

@media (prefers-reduced-motion: reduce) {
  .lesson-play-icon {
    transition: none;
  }
}

/* Chapter tray attached to the play card (owner pick 2026-09-12, mockup C). */
.lesson-play-with-chapters {
  margin-bottom: 0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.lesson-chapters {
  margin: 0 0 2rem;
  padding: 0.5rem 1rem 0.75rem;
  border: 1px solid rgba(139, 127, 181, 0.25);
  border-top: 0;
  border-radius: 0 0 16px 16px;
  background: linear-gradient(160deg, #1a1a1a 0%, #0a0a0b 100%);
}

.lesson-chapters ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.lesson-chapters li {
  border-top: 1px solid rgba(139, 127, 181, 0.14);
}

.lesson-chapters li:first-child {
  border-top: 0;
}

.lesson-chapters a {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.55rem 0.2rem;
  color: var(--white);
  text-decoration: none;
}

.lesson-chapters a:hover .lesson-chapter-label,
.lesson-chapters a:focus-visible .lesson-chapter-label {
  color: var(--gold-warm);
}

.lesson-chapter-n {
  min-width: 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: rgba(var(--white-rgb), 0.45);
}

.lesson-chapter-label {
  flex: 1;
}

.lesson-chapter-time {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
}

/* The app offer after a lesson article (layout D). Same column as the
   article; the store buttons reuse the hero's .hero-cta button styling. */
.lesson-offer {
  max-width: 720px;
  margin: 0 auto 2.5rem;
  padding: 2rem 2rem 0;
  border-top: 1px solid rgba(var(--white-rgb), 0.1);
}

.lesson-offer h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  line-height: 1.25;
  margin: 0 0 0.75rem;
}

.lesson-offer p {
  color: rgba(var(--white-rgb), 0.85);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.lesson-offer-screenshot {
  display: block;
  width: min(280px, 100%);
  height: auto;
  margin: 1.25rem auto 1.5rem;
  border-radius: 24px;
  border: 1px solid rgba(139, 127, 181, 0.25);
}

.lesson-offer-free {
  font-size: 0.9375rem;
  color: rgba(var(--white-rgb), 0.7);
}

.lesson-offer .hero-cta {
  margin: 0.5rem 0 1rem;
}

.lesson-offer-next {
  font-size: 0.9375rem;
  color: rgba(var(--white-rgb), 0.7);
}
