/* ============================================================
   CiaoSpeak marketing site — design tokens
   Palette: teal brand band (hero + CTA) bookending a warm paper
   body, mirroring the app icon's own teal-ground / cream-figure
   composition. Neumorphic card texture matches the app itself.
   ============================================================ */

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("assets/fonts/bricolage-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("assets/fonts/bricolage-latinext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF;
}
@font-face {
  font-family: "Karla";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("assets/fonts/karla-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
  font-family: "Karla";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("assets/fonts/karla-latinext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF;
}
@font-face {
  font-family: "Noto Sans TC";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/notosanstc.woff2") format("woff2");
  unicode-range: U+3f, U+3001, U+4e86, U+4ec0, U+4f60, U+52a0, U+53eb, U+540d, U+5462, U+592a, U+597d, U+5b57, U+5b78, U+5e2b, U+68d2, U+6cb9, U+7df4, U+8001, U+8d77, U+97f3, U+9ebc, U+ff01, U+ff0c, U+ff1f;
}
@font-face {
  font-family: "Noto Sans TC";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/notosanstc.woff2") format("woff2");
  unicode-range: U+3f, U+3001, U+4e86, U+4ec0, U+4f60, U+52a0, U+53eb, U+540d, U+5462, U+592a, U+597d, U+5b57, U+5b78, U+5e2b, U+68d2, U+6cb9, U+7df4, U+8001, U+8d77, U+97f3, U+9ebc, U+ff01, U+ff0c, U+ff1f;
}

:root {
  /* --- brand constants (same family in both themes) --- */
  --teal: #2a9d8f;
  --teal-deep: #1b665c;
  --gold: #e2a63a;
  --ember: #e76f51;

  /* Theme-aware teal text roles. --teal-ink is for links/labels/small text
     set in teal (deep teal on light paper, lightened teal on dark ground —
     bare --teal-deep is near-invisible in dark mode, measured 2.0–2.4:1).
     --teal-display is for large display numbers (stat strip, step numbers,
     quiz score): bare --teal measured 2.95:1 on the light ground, a hair
     under the 3:1 large-text minimum, so light mode darkens it slightly.
     Always use these, never --teal-deep/--teal directly, for teal TEXT. */
  --teal-ink: var(--teal-deep);
  --teal-display: #21867a;

  /* --- light theme --- */
  --ground: #f6f1e4;
  --surface: #fffdf8;
  --surface-sunken: #efe8d6;
  --ink: #1b2b28;
  --ink-muted: #5c6b63;
  --border: rgba(27, 43, 40, 0.1);
  --hero-from: #123832;
  --hero-to: #2a9d8f;
  --hero-ink: #fbf6ea;
  --hero-ink-muted: rgba(251, 246, 234, 0.78);
  --shadow-a: rgba(43, 36, 26, 0.12);
  --shadow-b: rgba(255, 255, 255, 0.9);
  --shadow-a-strong: rgba(43, 36, 26, 0.18);

  /* Modern-card surface (feature bento): a faint inset top highlight and
     a slightly lifted top edge instead of the neumorphic dual shadow,
     which reads flat on the dark ground. */
  --card-top: color-mix(in srgb, var(--surface) 70%, white);
  --card-highlight: rgba(255, 255, 255, 0.85);

  /* --- type scale --- */
  --font-display: "Bricolage Grotesque", "Noto Sans TC", system-ui, sans-serif;
  --font-body: "Karla", "Noto Sans TC", system-ui, sans-serif;
  --font-cjk: "Noto Sans TC", "Karla", system-ui, sans-serif;

  /* --- spacing scale --- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 5rem;
  --space-9: 7.5rem;

  /* Vertical rhythm between stacked <section>s specifically — kept apart
     from --space-8 since that token is also used for one-off padding
     (hero, cta-band) that shouldn't move in lockstep with this. */
  --space-section: 3.25rem;

  /* --- shape --- */
  --radius-card: 24px;
  --radius-button: 18px;
  --radius-chip: 999px;
  --radius-bubble: 22px;

  --content-width: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #1c2320;
    --surface: #252e2a;
    --surface-sunken: #171e1b;
    --ink: #f2ede0;
    --ink-muted: #b8c3bd;
    --border: rgba(242, 237, 224, 0.1);
    --hero-from: #0e2622;
    --hero-to: #1f7c6e;
    --hero-ink: #f7f2e6;
    --hero-ink-muted: rgba(247, 242, 230, 0.75);
    --shadow-a: rgba(0, 0, 0, 0.5);
    --shadow-b: rgba(255, 255, 255, 0.045);
    --shadow-a-strong: rgba(0, 0, 0, 0.65);
    --teal-ink: color-mix(in srgb, var(--teal) 70%, white);
    --teal-display: var(--teal);
    --card-top: color-mix(in srgb, var(--surface) 94%, white);
    --card-highlight: rgba(255, 255, 255, 0.07);
  }
}

:root[data-theme="dark"] {
  --ground: #1c2320;
  --surface: #252e2a;
  --surface-sunken: #171e1b;
  --ink: #f2ede0;
  --ink-muted: #b8c3bd;
  --border: rgba(242, 237, 224, 0.1);
  --hero-from: #0e2622;
  --hero-to: #1f7c6e;
  --hero-ink: #f7f2e6;
  --hero-ink-muted: rgba(247, 242, 230, 0.75);
  --shadow-a: rgba(0, 0, 0, 0.5);
  --shadow-b: rgba(255, 255, 255, 0.045);
  --shadow-a-strong: rgba(0, 0, 0, 0.65);
  --teal-ink: color-mix(in srgb, var(--teal) 70%, white);
  --teal-display: var(--teal);
  --card-top: color-mix(in srgb, var(--surface) 94%, white);
  --card-highlight: rgba(255, 255, 255, 0.07);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

.hanzi {
  font-family: var(--font-cjk);
}

a {
  color: inherit;
}

.wrap {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

@media (max-width: 640px) {
  .wrap {
    padding-inline: var(--space-4);
  }
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.08;
  margin: 0;
  text-wrap: balance;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

.eyebrow {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

/* ---------------- nav ---------------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--ink);
}

.brand img {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: var(--teal);
  padding: 4px;
}

.brand span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink-muted);
  transition: color 0.15s ease;
}

.nav-links a:hover {
  color: var(--teal);
}

a.nav-cta {
  display: none;
}

@media (min-width: 720px) {
  a.nav-cta {
    display: inline-flex;
  }
}

/* ---------------- buttons ---------------- */

.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-button);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

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

.btn-primary {
  background: var(--teal);
  color: #fbf6ea;
  box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--teal) 70%, transparent);
}

.btn-primary:hover {
  filter: brightness(1.06);
}

.btn-ghost-on-teal {
  background: color-mix(in srgb, var(--hero-ink) 14%, transparent);
  color: var(--hero-ink);
  border: 1px solid color-mix(in srgb, var(--hero-ink) 35%, transparent);
}

.btn-ghost-on-teal:hover {
  background: color-mix(in srgb, var(--hero-ink) 22%, transparent);
}

.btn-soft {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 6px 6px 14px var(--shadow-a), -6px -6px 14px var(--shadow-b);
}

.btn-soft:hover {
  filter: brightness(1.02);
}

/* ---------------- hero ---------------- */

.hero {
  background: linear-gradient(160deg, var(--hero-from), var(--hero-to) 75%);
  color: var(--hero-ink);
  padding-top: var(--space-8);
  padding-bottom: calc(var(--space-9) + 3rem);
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: var(--space-7);
  align-items: center;
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
}

.hero-eyebrow {
  color: var(--gold);
}

.hero h1 {
  font-size: clamp(2.3rem, 1.4rem + 3.6vw, 3.9rem);
  margin-top: var(--space-4);
  color: var(--hero-ink);
}

.hero-sub {
  margin-top: var(--space-5);
  font-size: clamp(1.02rem, 0.95rem + 0.3vw, 1.18rem);
  color: var(--hero-ink-muted);
  max-width: 42ch;
  line-height: 1.65;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.hero-note {
  margin-top: var(--space-5);
  font-size: 0.85rem;
  color: var(--hero-ink-muted);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.hero-note .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  flex: none;
}


/* ---- phone / chat mockup ---- */

.phone {
  background: #122622;
  border-radius: 34px;
  padding: 10px;
  box-shadow: 22px 26px 60px -18px rgba(6, 20, 17, 0.55), 0 1px 0 rgba(255, 255, 255, 0.06) inset;
  transform: rotate(2.5deg);
  max-width: 320px;
  margin-inline: auto;
}

.phone img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 26px;
}

.phone-stage {
  position: relative;
  max-width: 320px;
  margin-inline: auto;
}

.phone-stage .phone {
  margin-inline: 0;
}

.float-chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-chip);
  box-shadow: 0 14px 30px -12px rgba(6, 20, 17, 0.5);
  white-space: nowrap;
}

.float-chip-icon {
  font-size: 1.05rem;
  line-height: 1;
}

.float-chip-streak {
  top: -6%;
  left: -14%;
}

.float-chip-xp {
  bottom: 12%;
  right: -6%;
  color: #2b2109;
  background: var(--gold);
  box-shadow: 0 14px 30px -12px rgba(43, 33, 9, 0.55);
}

@media (max-width: 480px) {
  .float-chip {
    font-size: 0.78rem;
    padding: 0.5rem 0.8rem;
  }
  .float-chip-streak { top: -4%; left: -4%; }
  .float-chip-xp { right: -2%; }
}

@media (prefers-reduced-motion: no-preference) {
  .float-chip-streak { animation: float-bob 5s ease-in-out infinite; }
  .float-chip-xp { animation: float-bob 5s ease-in-out infinite -2.5s; }
}

@keyframes float-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* "A look inside" — real app screenshots in slim device bezels, as a
   scroll-snap carousel: swipe on touch, arrows + dots elsewhere. Works
   without JS (it's just a horizontally scrolling row); the script only
   adds the arrows' behavior and the dots. */
.peek-carousel {
  position: relative;
  margin-top: var(--space-6);
}

.peek-track {
  display: flex;
  gap: var(--space-5);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 6px 6px 14px;
  scrollbar-width: none;
}

.peek-track::-webkit-scrollbar {
  display: none;
}

.peek-track:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 4px;
  border-radius: 12px;
}

.peek-item {
  flex: 0 0 min(272px, 76vw);
  scroll-snap-align: center;
  margin: 0;
  /* Depth as the track moves: the centred screen (`.is-active`, set by
     the script) sits at full size, its neighbours a touch smaller and
     softer. Without JS nothing is ever marked active, so every item
     must render at full size by default — the sit-back state only
     applies once the script has started managing the class. */
  transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1), opacity 0.5s ease;
  transform-origin: center;
}

.js-reveal-ready .peek-item:not(.is-active) {
  transform: scale(0.94);
  opacity: 0.72;
}

.peek-toggle {
  width: 28px;
  height: 28px;
  margin-left: var(--space-2);
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-muted);
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.peek-toggle svg {
  width: 14px;
  height: 14px;
}

.peek-toggle:hover {
  color: var(--teal-ink);
  border-color: color-mix(in srgb, var(--teal) 45%, var(--border));
}

.peek-toggle:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}

.peek-nav {
  position: absolute;
  top: 38%;
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(18, 38, 34, 0.12);
  background: var(--surface, #fff);
  color: var(--ink);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 24px -12px rgba(6, 20, 17, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
}

.peek-prev { left: -10px; }
.peek-next { right: -10px; }

.peek-nav:hover { color: var(--teal-ink); }
.peek-nav:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }

@media (hover: hover) and (min-width: 700px) {
  .peek-nav { display: flex; }
}

.peek-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: var(--space-4);
  min-height: 8px;
}

.peek-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: 0;
  padding: 0;
  background: var(--ink-muted);
  opacity: 0.35;
  cursor: pointer;
  transition: width 200ms ease, opacity 200ms ease, background 200ms ease;
}

.peek-dot.is-active {
  width: 24px;
  opacity: 1;
  background: var(--teal);
}

@media (prefers-reduced-motion: reduce) {
  .peek-track { scroll-behavior: auto; }
  .peek-dot { transition: none; }
}

.phone-mini {
  background: #122622;
  border-radius: 30px;
  padding: 9px;
  box-shadow: 0 18px 40px -18px rgba(6, 20, 17, 0.35);
}

.phone-mini img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 22px;
}

.peek-item figcaption {
  margin-top: var(--space-3);
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.92rem;
  line-height: 1.5;
  padding-inline: var(--space-2);
}

.phone-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.phone-head img {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--teal);
  padding: 3px;
}

.phone-head strong {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--ink);
}

.phone-head small {
  display: block;
  color: var(--ink-muted);
  font-size: 0.75rem;
}

.bubble-row {
  display: flex;
  margin-bottom: var(--space-3);
}

.bubble-row.from-ai {
  justify-content: flex-start;
}

.bubble-row.from-user {
  justify-content: flex-end;
}

.bubble {
  max-width: 82%;
  padding: 0.7rem 0.95rem;
  border-radius: var(--radius-bubble);
  font-size: 0.92rem;
}

.from-ai .bubble {
  background: var(--surface-sunken);
  color: var(--ink);
  border-bottom-left-radius: 6px;
}

.from-user .bubble {
  background: var(--teal);
  color: #fbf6ea;
  border-bottom-right-radius: 6px;
}

.bubble .zh {
  font-family: var(--font-cjk);
  font-weight: 500;
  font-size: 1.05rem;
}

.bubble .py {
  display: block;
  font-size: 0.72rem;
  opacity: 0.75;
  margin-top: 0.15rem;
}

.bubble .en {
  display: block;
  font-size: 0.72rem;
  opacity: 0.65;
  margin-top: 0.3rem;
}

.correct-tick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: var(--gold);
  color: #2b2109;
  font-size: 0.65rem;
  font-weight: 800;
  margin-left: 0.4rem;
  vertical-align: middle;
}

.chip-row {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-2);
}

.reply-chip {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-chip);
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-muted);
}

/* ---- stat strip ---- */

/* Three compact tiles on the same border + lit-top-edge surface as the
   feature bento (2026-09-05), replacing bare numbers on a hairline that
   read as filler. */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
  padding-block: var(--space-7);
}

@media (max-width: 720px) {
  .stat-strip {
    grid-template-columns: 1fr;
    gap: var(--space-3);
    padding-block: var(--space-6);
  }
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5);
  background: linear-gradient(180deg, var(--card-top) 0%, var(--surface) 38%);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: inset 0 1px 0 var(--card-highlight), 0 16px 32px -24px var(--shadow-a);
}

.stat-number {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 1.6rem + 1.2vw, 2.75rem);
  color: var(--teal-display);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 0.88rem;
  color: var(--ink-muted);
  max-width: 32ch;
}

/* ---------------- sections ---------------- */

section {
  padding-block: var(--space-section);
}

.section-head {
  max-width: 640px;
  margin-bottom: var(--space-7);
}

.section-head .eyebrow {
  color: var(--teal-ink);
}

/* Homepage sections only ever put an h2 here (the page's own h1 lives in
   the hero instead); standalone content pages below use .section-head for
   their real page h1, so both need the same treatment. .hunch-copy is the
   one section heading living outside a .section-head (its copy column
   carries the eyebrow+h2 itself) — without being listed here it fell back
   to the browser-default 24px, visibly smaller than every sibling section. */
.section-head h1,
.section-head h2,
.hunch-copy h2 {
  font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.5rem);
  margin-top: var(--space-3);
  color: var(--ink);
}

.section-intro {
  margin-top: var(--space-3);
  color: var(--ink-muted);
  font-size: 1rem;
}

/* ---- feature grid ---- */

/* A fully-tiled bento: 4 columns, two rows, each row = one wide tile
   (span 2) + two singles, so no row is ever left with an orphan gap.
   The wide tiles earn their size with a small real-product visual
   (`.feature-visual`) beside the copy. Surfaces are border + gradient +
   inset top highlight rather than the neumorphic dual shadow used
   elsewhere — that shadow pair reads as flat slabs on the dark ground
   (user screenshot, 2026-09-05), where a 1px border and a lit top edge
   still separate card from page. */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
}

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

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

/* `span 2` must never run inside the 1-column layout — it would force an
   implicit second track instead of clamping (a real bug, 2026-09-05). */
@media (min-width: 621px) {
  .feature-card.is-wide {
    grid-column: span 2;
  }
}

.feature-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--card-top) 0%, var(--surface) 38%);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--space-6) var(--space-5);
  box-shadow: inset 0 1px 0 var(--card-highlight), 0 16px 32px -24px var(--shadow-a);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

@media (hover: hover) {
  .feature-card:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--teal) 45%, var(--border));
    box-shadow:
      inset 0 1px 0 var(--card-highlight),
      0 0 0 4px color-mix(in srgb, var(--teal) 10%, transparent),
      0 22px 40px -24px var(--shadow-a-strong);
  }
}

@media (prefers-reduced-motion: reduce) {
  .feature-card { transition: none; }
  .feature-card:hover { transform: none; }
}

.feature-card.is-wide {
  padding: var(--space-6);
}

@media (min-width: 900px) {
  .feature-card.is-wide {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-5);
    align-items: center;
  }
}

.feature-copy {
  display: flex;
  flex-direction: column;
}

.feature-kicker {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal-ink);
  margin-bottom: var(--space-2);
}

.feature-icon {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
  flex: none;
}

.feature-icon svg {
  width: 1.35rem;
  height: 1.35rem;
}

.feature-icon.tint-teal {
  background: color-mix(in srgb, var(--teal) 14%, var(--surface));
  color: var(--teal-ink);
}

.feature-icon.tint-gold {
  background: color-mix(in srgb, var(--gold) 20%, var(--surface));
  color: color-mix(in srgb, var(--gold) 65%, var(--ink));
}

.feature-icon.tint-ember {
  background: color-mix(in srgb, var(--ember) 16%, var(--surface));
  color: color-mix(in srgb, var(--ember) 75%, var(--ink));
}

.feature-card h3 {
  font-size: 1.15rem;
  margin-bottom: var(--space-2);
}

.feature-card.is-wide h3 {
  font-size: 1.35rem;
}

.feature-card p {
  color: var(--ink-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ---- wide-tile visuals ---- */

.feature-visual {
  margin-top: var(--space-5);
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: var(--space-4);
}

@media (min-width: 900px) {
  .feature-visual {
    margin-top: 0;
  }
}

.mini-chat .bubble-row {
  margin-bottom: var(--space-2);
}

.mini-chat .bubble {
  max-width: 88%;
  padding: 0.55rem 0.8rem;
  font-size: 0.85rem;
  box-shadow: 0 6px 16px -12px var(--shadow-a);
}

.mini-chat .from-ai .bubble {
  background: var(--surface);
}

.mini-chat .bubble .zh {
  font-size: 0.98rem;
}

.mini-chat .chip-row {
  margin-top: var(--space-3);
}

.mini-chat .reply-chip small {
  font-weight: 500;
  opacity: 0.75;
  margin-left: 0.2rem;
}

.mini-queue {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.mini-queue-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-1);
}

.mini-queue-count {
  color: var(--ember);
}

.mini-queue-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  background: var(--surface);
  border-radius: 12px;
  padding: 0.5rem 0.7rem;
}

/* Word above its pinyin (not beside) so a three-character word plus a
   status chip never wraps the hanzi vertically in the narrow visual
   column — it did, one character per line, at the first render. */
.mini-queue-word {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.mini-queue-word .zh {
  font-weight: 500;
  font-size: 0.98rem;
  color: var(--ink);
  white-space: nowrap;
}

.mini-queue-word small {
  font-size: 0.7rem;
  color: var(--ink-muted);
  white-space: nowrap;
}

.mini-queue-status {
  flex: none;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.22rem 0.6rem;
  border-radius: var(--radius-chip);
  background: color-mix(in srgb, var(--ink-muted) 14%, var(--surface));
  color: var(--ink-muted);
}

.mini-queue-status.is-due {
  background: color-mix(in srgb, var(--ember) 18%, var(--surface));
  color: color-mix(in srgb, var(--ember) 78%, var(--ink));
}

.mini-queue-status.is-done {
  background: color-mix(in srgb, var(--teal) 16%, var(--surface));
  color: var(--teal-ink);
}

/* ---- how it works ---- */

/* A connected timeline (2026-09-05): numbered teal dots sit on a thin
   rail above the three cards on desktop, so the "loop" reads as one
   sequence rather than three unrelated slabs. The rail is drawn on
   `.steps::before` and each dot punches through it with a ground-colored
   ring. Below 900px the dots go inline (no rail) and the cards stack. */
.steps {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  max-width: 720px;
}

.step {
  position: relative;
  background: linear-gradient(180deg, var(--card-top) 0%, var(--surface) 38%);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--space-5) var(--space-5) var(--space-6);
  box-shadow: inset 0 1px 0 var(--card-highlight), 0 16px 32px -24px var(--shadow-a);
}

.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  background: var(--teal);
  color: #fbf6ea;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: var(--space-4);
}

@media (min-width: 900px) {
  .steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-4);
    max-width: none;
    /* Room above the cards for the floating dots (2.2rem) + a breath. */
    padding-top: 2.6rem;
  }

  /* Each dot is centred over its card, so the rail runs symmetrically
     from the first dot's centre to the last dot's centre: half a card
     width in from each edge, where a card is (100% - 2 gaps) / 3.
     (Left-pinned dots with the same rail read lopsided — the rail
     overshot cards 1 and 2 and left most of card 3 bare; user
     screenshot, 2026-09-05.) */
  .steps::before {
    content: "";
    position: absolute;
    top: 1.1rem;
    left: calc((100% - 2 * var(--space-4)) / 6);
    right: calc((100% - 2 * var(--space-4)) / 6);
    height: 2px;
    transform: translateY(-1px);
    background: var(--border);
  }

  .step {
    padding-top: var(--space-6);
  }

  .step-num {
    position: absolute;
    top: -2.6rem;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 0;
    /* Ground-colored ring so the dot punches through the rail. Desktop
       only — on mobile there is no rail and it read as a dark halo. */
    box-shadow: 0 0 0 4px var(--ground);
  }
}

.step h3 {
  font-size: 1.1rem;
  margin-bottom: var(--space-2);
}

.step p {
  color: var(--ink-muted);
  font-size: 0.95rem;
}

/* ---- niche / sticker aside ---- */

.aside {
  background: var(--surface-sunken);
  border-radius: 32px;
  padding: var(--space-7);
  position: relative;
  overflow: visible;
}

.aside-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-6);
  align-items: center;
}

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

.aside blockquote {
  margin: var(--space-3) 0 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.6rem);
  line-height: 1.35;
  color: var(--ink);
}

.aside p.support {
  margin-top: var(--space-4);
  color: var(--ink-muted);
  max-width: 56ch;
}

.sticker {
  background: var(--gold);
  color: #2b2109;
  border-radius: 20px;
  padding: var(--space-4) var(--space-5);
  transform: rotate(-6deg);
  box-shadow: 8px 10px 0 rgba(0, 0, 0, 0.08);
  text-align: center;
  justify-self: center;
}

.sticker .zh {
  font-family: var(--font-cjk);
  font-weight: 700;
  font-size: 1.6rem;
  display: block;
}

.sticker .py {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0.75;
}

/* ---- Hunches (signature-feature section) ---- */

.hunch-grid {
  display: grid;
  grid-template-columns: 1fr minmax(220px, 290px);
  gap: var(--space-7);
  align-items: center;
  margin-top: var(--space-5);
}

@media (max-width: 780px) {
  .hunch-grid {
    grid-template-columns: 1fr;
  }
  .hunch-grid .phone-mini {
    max-width: 300px;
    margin-inline: auto;
  }
}

.hunch-copy p {
  color: var(--ink-muted);
  line-height: 1.7;
  margin-top: var(--space-3);
  max-width: 58ch;
}

.hunch-copy p strong {
  color: var(--ink);
}

.hunch-more {
  display: inline-block;
  margin-top: var(--space-4);
  font-weight: 700;
  color: var(--teal-ink);
}

/* ---- Stories showcase (a CiaoSpeak+ highlight, not just another
   feature card — this is the app's second-largest content system and
   the one most tied to the paid tier, so it earns its own section like
   Hunches does rather than a single card buried in the feature grid). ---- */

.stories-card {
  background: var(--surface-sunken);
  border-radius: 32px;
  padding: var(--space-7);
}

@media (max-width: 640px) {
  .stories-card {
    padding: var(--space-6) var(--space-5);
    border-radius: 24px;
  }
}

.stories-grid {
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr;
  gap: var(--space-8);
  align-items: center;
}

@media (max-width: 780px) {
  .stories-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
}

/* Two overlapping real screenshots (home shelf behind, a story mid-read
   in front) read as "a library," not a single screen — the same visual
   idea a den of app-store listings use, built from this app's own real
   screens rather than a generic device mockup. */
.stories-visual {
  position: relative;
  max-width: 280px;
  margin-inline: auto;
  padding: var(--space-4) 0 var(--space-6) var(--space-6);
}

@media (max-width: 780px) {
  .stories-visual {
    max-width: 240px;
  }
}

.stories-visual-back {
  width: 78%;
  transform: rotate(-6deg);
  filter: saturate(0.9) brightness(0.94);
}

.stories-visual-front {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 78%;
  transform: rotate(4deg);
  box-shadow: 0 24px 48px -18px rgba(6, 20, 17, 0.45);
}

.plus-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: color-mix(in srgb, var(--gold) 24%, var(--surface));
  color: color-mix(in srgb, var(--gold) 55%, var(--ink));
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-chip);
}

.stories-copy h2 {
  margin-top: var(--space-3);
  font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.5rem);
  color: var(--ink);
}

.stories-copy p {
  color: var(--ink-muted);
  line-height: 1.7;
  margin-top: var(--space-4);
  max-width: 58ch;
}

.stories-tiers {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.stories-tier {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  background: var(--surface);
  border-radius: 16px;
  padding: var(--space-4);
  box-shadow: 6px 6px 14px var(--shadow-a), -6px -6px 14px var(--shadow-b);
}

.stories-tier-icon {
  font-size: 1.15rem;
  line-height: 1.3;
}

.stories-tier strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--ink);
}

.stories-tier p {
  margin: 0.15rem 0 0;
  font-size: 0.88rem;
  color: var(--ink-muted);
}

.stories-tier-plus {
  background: color-mix(in srgb, var(--gold) 10%, var(--surface));
  box-shadow: 6px 6px 14px var(--shadow-a), -6px -6px 14px var(--shadow-b), inset 0 0 0 1px color-mix(in srgb, var(--gold) 35%, transparent);
}

.stories-tier-plus strong {
  color: color-mix(in srgb, var(--gold) 60%, var(--ink));
}

/* ---- long-form article content (differentiator page, blog posts) ---- */

/* An article's head section and body section are two consecutive
   <section> elements, each carrying the general `section` rule's full
   padding-block — stacked, that doubles into a ~6.5rem dead gap right
   where the intro hands off to the body (most visible now that a large
   image often sits at the very top of the body). Tighten just that seam. */
section:has(.article-head) {
  padding-bottom: var(--space-4);
}

section:has(.article-body) {
  padding-top: var(--space-4);
}

.article-head {
  max-width: 760px;
}

.article-byline {
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-top: var(--space-2);
}

.article-body {
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.article-figure {
  margin: 0;
}

.article-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 20px;
}

.article-figure figcaption {
  margin-top: var(--space-2);
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.article-figure figcaption a {
  color: inherit;
}

.article-body h2 {
  font-size: clamp(1.3rem, 1.1rem + 0.7vw, 1.55rem);
  margin-top: var(--space-3);
}

/* Per-question subheadings inside an article's own "Frequently asked
   questions" block — one step down from .article-body h2's section
   headings, matching the light color/whitespace of a regular paragraph
   heading rather than the larger, more prominent section h2s. */
.article-body h3 {
  font-size: 1.05rem;
  margin-top: var(--space-2);
  color: var(--ink);
}

.article-body p {
  color: var(--ink-muted);
  font-size: 1rem;
  line-height: 1.75;
}

.article-body ul {
  margin: 0;
  padding-left: 1.3rem;
  color: var(--ink-muted);
  font-size: 1rem;
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.article-body li strong {
  color: var(--ink);
}

.article-body a {
  color: var(--teal-ink);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--teal-ink) 40%, transparent);
}

/* ---- blog index ---- */

/* Three across on desktop (2026-09-05): at two-up each card was ~520px
   wide, so the image alone ran ~330px tall and a row of cards reached
   500px+ with ragged bottoms (user screenshot). Cards are flex columns
   that stretch to the row's height, with the excerpt clamped, so every
   row lines up; the old `align-items: start` (kept for the image-less
   draft placeholder) is no longer needed because a stretched card just
   grows its body. */
.blog-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-7);
}

@media (max-width: 900px) {
  .blog-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .blog-list {
    grid-template-columns: 1fr;
  }
}

.blog-card {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--card-top) 0%, var(--surface) 38%);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: inset 0 1px 0 var(--card-highlight), 0 16px 32px -24px var(--shadow-a);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.blog-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--teal) 45%, var(--border));
}

.blog-card-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  flex: none;
}

.blog-card-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding: var(--space-5) var(--space-4) var(--space-5);
}

.blog-card-badge {
  display: inline-block;
  background: color-mix(in srgb, var(--gold) 24%, var(--surface));
  color: var(--teal-deep);
  /* Not --teal-ink: on the dark gold-tinted chip even the lightened teal
     only reaches ~3.9:1 at this small size, so dark mode uses plain ink. */
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--radius-chip);
  padding: 0.25rem 0.7rem;
  margin-bottom: var(--space-3);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .blog-card-badge {
    color: var(--ink);
  }
}

:root[data-theme="dark"] .blog-card-badge {
  color: var(--ink);
}

.blog-card h2 {
  font-size: 1.15rem;
  margin-bottom: var(--space-2);
  /* Titles run one or two lines depending on length; the glyphs are the
     same size either way, but a one-line title next to a two-line one
     reads as a smaller heading and knocks the meta/description rows out
     of alignment across the grid row. Reserve the two-line box (2 lines
     at the global 1.08 heading line-height) so every card lines up. */
  min-height: 2.16em;
}

.blog-card-meta {
  display: block;
  font-size: 0.78rem;
  color: var(--ink-muted);
  margin-bottom: var(--space-2);
}

.blog-card p {
  color: var(--ink-muted);
  font-size: 0.9rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Topic filter chips on the blog index. Pure progressive enhancement:
   without JS every card stays visible and the chips are inert. */
.blog-filter {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-6);
}

.blog-filter-chip {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-muted);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: var(--radius-chip);
  padding: 0.45rem 1rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.blog-filter-chip:hover {
  border-color: color-mix(in srgb, var(--teal) 45%, transparent);
}

.blog-filter-chip.is-active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fbf6ea;
}

/* The author `.blog-card { display: block }` would otherwise beat the UA's
   [hidden] rule, so filtered-out cards need this explicitly. */
.blog-card[hidden] {
  display: none;
}

/* ---- "Keep reading" related-post cards at the foot of each blog post ---- */

.related-title {
  font-size: clamp(1.3rem, 1.1rem + 0.7vw, 1.6rem);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: stretch;
  gap: var(--space-5);
  margin-top: var(--space-5);
}

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

.related-card {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--card-top) 0%, var(--surface) 38%);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--space-5);
  box-shadow: inset 0 1px 0 var(--card-highlight), 0 16px 32px -24px var(--shadow-a);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.related-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--teal) 45%, var(--border));
}

.related-card-topic {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal-ink);
  margin-bottom: var(--space-2);
}

.related-card h3 {
  font-size: 1.02rem;
  line-height: 1.35;
  margin-bottom: var(--space-3);
}

.related-card-meta {
  margin-top: auto;
  font-size: 0.78rem;
  color: var(--ink-muted);
}

/* ---- FAQ ---- */

.faq-list {
  display: flex;
  flex-direction: column;
  max-width: 720px;
}

.faq-item {
  padding-block: var(--space-5);
  border-bottom: 1px solid var(--border);
}

.faq-item:first-child {
  border-top: 1px solid var(--border);
}

.faq-q {
  font-size: 1.05rem;
  margin-bottom: var(--space-2);
}

.faq-a {
  color: var(--ink-muted);
  font-size: 0.95rem;
  max-width: 62ch;
}

/* Homepage FAQ is native <details> accordions (2026-09-05); the FAQ
   page still uses plain div.faq-item, which the base rules above cover,
   so everything here is scoped to details.faq-item. */
details.faq-item {
  padding-block: 0;
}

details.faq-item summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-block: var(--space-4);
}

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

details.faq-item summary:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 4px;
  border-radius: 8px;
}

details.faq-item .faq-q {
  margin: 0;
}

/* Chevron: a rotated bordered square, no icon font, takes --teal-ink. */
details.faq-item summary::after {
  content: "";
  flex: none;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.35rem;
  border-right: 2px solid var(--teal-ink);
  border-bottom: 2px solid var(--teal-ink);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

details.faq-item[open] summary::after {
  transform: rotate(-135deg);
}

details.faq-item .faq-a {
  padding-bottom: var(--space-5);
}

@media (prefers-reduced-motion: reduce) {
  details.faq-item summary::after { transition: none; }
}

/* ---- closing CTA ---- */

.cta-band {
  background: linear-gradient(155deg, var(--hero-from), var(--hero-to) 80%);
  color: var(--hero-ink);
  border-radius: 32px;
  padding: var(--space-8) var(--space-6);
  text-align: center;
}

.cta-band .eyebrow {
  color: var(--gold);
  justify-content: center;
}

.cta-band h2 {
  color: var(--hero-ink);
  margin-top: var(--space-3);
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem);
}

.cta-band p {
  color: var(--hero-ink-muted);
  max-width: 46ch;
  margin: var(--space-4) auto 0;
}

.cta-form {
  margin-top: var(--space-6);
  max-width: 440px;
  margin-inline: auto;
}

.cta-form-row {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.cta-input {
  flex: 1 1 240px;
  min-width: 0;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: var(--radius-button);
  padding: 0.85rem 1.1rem;
  box-shadow: inset 3px 3px 8px rgba(0, 0, 0, 0.12), inset -3px -3px 8px rgba(255, 255, 255, 0.06);
}

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

.cta-input:focus {
  outline: none;
  border-color: var(--gold);
}

.formkit-alert {
  list-style: none;
  margin: 0 0 var(--space-3);
  padding: 0;
  font-size: 0.85rem;
  text-align: center;
}

.formkit-alert:empty {
  display: none;
}

.cta-band .formkit-alert-error {
  color: #ffd9cc;
}

.cta-band .formkit-alert-success {
  color: var(--hero-ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
}

.mid-cta .formkit-alert-error {
  color: var(--ember);
}

.mid-cta .formkit-alert-success {
  color: var(--teal-ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
}

/* ---- mid-page CTA card ---- */

.mid-cta {
  background: linear-gradient(180deg, var(--card-top) 0%, var(--surface) 38%);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--space-6) var(--space-7);
  box-shadow: inset 0 1px 0 var(--card-highlight), 0 16px 32px -24px var(--shadow-a);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-6);
  align-items: center;
}

@media (max-width: 720px) {
  .mid-cta {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

.mid-cta h2 {
  font-size: 1.2rem;
  margin-bottom: var(--space-2);
}

.mid-cta p {
  color: var(--ink-muted);
  font-size: 0.92rem;
}

.mid-cta-form {
  margin-top: 0;
  max-width: 420px;
}

.mid-cta .cta-input {
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  box-shadow: none;
}

@media (max-width: 720px) {
  .mid-cta-form {
    margin-inline: auto;
  }
}

/* A plain centered button row inside .cta-band, for pages whose closing
   CTA doesn't need a full email-capture form (e.g. /faq, /blog — the
   homepage's own cta-band uses .cta-form instead). */
.cta-band-ctas {
  justify-content: center;
  margin-top: var(--space-6);
}

.cta-fineprint {
  margin-top: var(--space-4);
  font-size: 0.82rem;
  color: var(--hero-ink-muted);
}

.cta-fineprint a {
  color: var(--hero-ink);
  text-decoration: underline;
}

/* ---------------- footer ---------------- */

footer {
  padding-block: var(--space-7);
  border-top: 1px solid var(--border);
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.footer-brand {
  max-width: 320px;
}

.footer-brand .brand {
  margin-bottom: var(--space-3);
}

.footer-brand p {
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  gap: var(--space-7);
  flex-wrap: wrap;
}

.footer-links h4 {
  font-family: var(--font-body);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin: 0 0 var(--space-3);
}

.footer-links ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer-links a {
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}

.footer-links a:hover {
  color: var(--teal);
}

.footer-badges {
  margin-top: var(--space-6);
}

.footer-badges-label {
  display: block;
  font-size: 0.82rem;
  color: var(--ink-muted);
  margin-bottom: var(--space-3);
}

.footer-badges-scroller {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: var(--space-2);
  -webkit-overflow-scrolling: touch;
}

.footer-badges-scroller a {
  flex: none;
  scroll-snap-align: start;
}

.footer-badges-scroller img {
  display: block;
  border-radius: 6px;
  /* The four directory badges ship at four different native heights
     (54/64/56/68) — normalize so the row reads as one tidy strip. */
  height: 54px;
  width: auto;
}

.footer-bottom {
  margin-top: var(--space-7);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--ink-muted);
}

/* ---------------- reveal-on-scroll ---------------- */

@media (prefers-reduced-motion: no-preference) {
  .js-reveal-ready .reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }

  .js-reveal-ready .reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}

/* ---------------- mobile nav ---------------- */

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink);
  padding: var(--space-2);
  min-width: 44px;
  min-height: 44px;
}

/* 1024px, not 720px: with 6 nav links (added "Stories") the inline row
   no longer fits alongside the brand + CTA button below roughly 950px —
   confirmed visually at 800px (Features overlapping the logo, the CTA
   button overlapping FAQ). The standalone CTA button keeps its own
   720px threshold (see .nav-cta below) so tablet widths still show a
   clean brand + hamburger + CTA row instead of an overflowing one. */
@media (min-width: 1024px) {
  .nav-toggle {
    display: none;
  }

  .nav-links {
    display: flex !important;
  }
}

.nav-links {
  display: none;
}

@media (max-width: 719px) {
  .nav-links.is-open {
    display: flex;
    position: absolute;
    top: 4.25rem;
    left: 0;
    right: 0;
    background: var(--ground);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-5);
    gap: var(--space-4);
  }
}

/* Mobile-menu-only "Get notified" item: below 720px the header's own
   .nav-cta button is hidden, which used to leave the primary conversion
   action with no path from the header at all on phones. */
.nav-links .nav-cta-mobile a {
  color: var(--teal-ink);
}

@media (min-width: 720px) {
  .nav-links .nav-cta-mobile {
    display: none;
  }
}

/* ---- TOCFL mock quiz ---- */

.quiz-promo {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  background: linear-gradient(180deg, var(--card-top) 0%, var(--surface) 38%);
  border-radius: var(--radius-card);
  padding: var(--space-5) var(--space-6);
  margin-top: 0;
  box-shadow: inset 0 1px 0 var(--card-highlight), 0 16px 32px -24px var(--shadow-a);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.quiz-promo:hover {
  border-color: color-mix(in srgb, var(--teal) 45%, var(--border));
  transform: translateY(-2px);
}

.quiz-promo-icon {
  flex: none;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--teal) 14%, var(--surface));
  color: var(--teal-ink);
  display: flex;
  align-items: center;
  justify-content: center;
}

.quiz-promo-icon svg {
  width: 1.35rem;
  height: 1.35rem;
}

.quiz-promo-text {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.quiz-promo-eyebrow {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--teal-ink);
}

.quiz-promo-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
}

.quiz-promo-cta {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--teal-ink);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .quiz-promo {
    flex-wrap: wrap;
  }

  .quiz-promo-cta {
    width: 100%;
    justify-content: flex-end;
  }
}

.quiz-disclaimer {
  background: var(--surface-sunken);
  border-radius: 16px;
  padding: var(--space-4) var(--space-5);
  font-size: 0.88rem;
  color: var(--ink-muted);
  max-width: 720px;
  margin-top: var(--space-5);
}

.quiz-disclaimer a {
  color: var(--teal-ink);
  text-decoration-color: color-mix(in srgb, var(--teal-ink) 40%, transparent);
}

.quiz-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  max-width: 720px;
  margin-top: var(--space-6);
}

.quiz-card {
  background: linear-gradient(180deg, var(--card-top) 0%, var(--surface) 38%);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--space-5) var(--space-6);
  box-shadow: inset 0 1px 0 var(--card-highlight), 0 16px 32px -24px var(--shadow-a);
  margin: 0;
}

.quiz-q-head {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  padding: 0;
  margin-bottom: var(--space-4);
  width: 100%;
}

.quiz-q-num {
  flex: none;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--teal) 16%, var(--surface));
  color: var(--teal-ink);
  font-weight: 700;
  font-family: var(--font-display);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.quiz-q-text {
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--ink);
}

.quiz-q-text .py {
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.quiz-translation {
  display: block;
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-top: var(--space-1);
}

.quiz-blank {
  display: inline-block;
  min-width: 1.6em;
  text-align: center;
  border-bottom: 2px solid var(--teal);
  color: var(--teal-ink);
}

.quiz-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

@media (max-width: 480px) {
  .quiz-options {
    grid-template-columns: 1fr;
  }
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--surface-sunken);
  border-radius: var(--radius-button);
  padding: 0.7rem 1rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.quiz-option:hover {
  border-color: color-mix(in srgb, var(--teal) 35%, transparent);
}

.quiz-option input {
  accent-color: var(--teal);
  width: 1.05rem;
  height: 1.05rem;
  flex: none;
}

.quiz-option:has(input:checked) {
  background: color-mix(in srgb, var(--teal) 14%, var(--surface));
  border-color: var(--teal);
}

.quiz-option .hanzi {
  font-weight: 600;
  font-family: var(--font-cjk);
}

.quiz-option .py {
  color: var(--ink-muted);
  font-size: 0.85rem;
  margin-left: 0.3em;
}

.quiz-unlock {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: var(--space-6) var(--space-7);
  box-shadow: 10px 10px 24px var(--shadow-a), -10px -10px 24px var(--shadow-b);
  max-width: 720px;
  margin-top: var(--space-7);
  text-align: center;
}

.quiz-unlock h2 {
  margin-bottom: var(--space-2);
}

.quiz-unlock-note {
  color: var(--ink-muted);
  margin-bottom: var(--space-5);
}

.quiz-unlock .cta-form {
  margin-top: 0;
}

.quiz-unlock .btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: none;
  box-shadow: none;
}

.quiz-results {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: var(--space-7);
  box-shadow: 10px 10px 24px var(--shadow-a), -10px -10px 24px var(--shadow-b);
  max-width: 720px;
  margin-top: var(--space-6);
  text-align: center;
}

.quiz-score-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 0.2em;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--teal-display);
  font-size: 2.4rem;
  margin-bottom: var(--space-3);
}

.quiz-score-of {
  font-size: 1.1rem;
  color: var(--ink-muted);
  font-weight: 600;
}

.quiz-results h2 {
  margin-bottom: var(--space-3);
}

.quiz-results p {
  color: var(--ink-muted);
  max-width: 56ch;
  margin: 0 auto var(--space-6);
}

.quiz-results .hero-ctas {
  justify-content: center;
}
