/* ============================================================
   Panda LaoShi — marketing site
   Design tokens ported verbatim from the extension (DESIGN.md,
   extension/src/app.css) so the site matches the product 1:1.
   Pure CSS, no build step. One high-contrast panda theme
   (white + black as equals, bamboo as the single accent).
   ============================================================ */

/* Self-hosted fonts (SIL OFL 1.1, licenses in assets/fonts/). Variable weight files. */
/* Pinyin: Onest, because Manrope has no third-tone letters (ǎ ě ǐ ǒ ǔ) or ǖ ǘ ǚ ǜ. */
@font-face {
  font-family: "Onest"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("assets/fonts/onest-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Onest"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("assets/fonts/onest-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Newsreader"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url("assets/fonts/newsreader-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("assets/fonts/manrope-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("assets/fonts/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #1c1c1e;
  --bg: #f9f9f9;
  --surface: #ffffff;
  --text-2: #6e6e73;
  --text-3: #8e8e93;
  --fill: rgba(60, 60, 67, 0.06);
  --hairline: rgba(60, 60, 67, 0.1);
  --bamboo: #34c759;
  --bamboo-ink: #248a3d;
  --gold: #d99e00;
  --danger: #d7372f;

  /* Pleco-style tone colors (opt-in learning aid, DESIGN.md §2). Light values. */
  --tone-1: #c8102e;
  --tone-2: #1a8a3c;
  --tone-3: #1f6feb;
  --tone-4: #8b46c8;
  --tone-5: #6e6e73;

  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --shadow-1: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-2: 0 10px 34px rgba(0, 0, 0, 0.1);

  --font-sys: -apple-system, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --font-ui: "Manrope", "PL WenKai", var(--font-sys);
  --font-pinyin: "Onest", var(--font-ui);
  --font-display: "Newsreader", Georgia, serif;
  --font-cjk: "PL WenKai", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", var(--font-ui);

  --maxw: 1080px;
  --reading: 68ch;
}

/* ── Panda "black" sections ───────────────────────────────────
   One global theme — no auto dark mode. Sections marked
   .section--dark re-scope the design tokens locally, so every
   child (cards, text, eyebrows, links) inverts to white-on-black.
   This is the black half of the panda, used as equally as white. */
.section--dark {
  --ink: #f4f4f6;
  --bg: #161617;
  --surface: #232327;
  --text-2: #adadb4;
  --text-3: #8e8e93;
  --fill: rgba(235, 235, 245, 0.08);
  --hairline: rgba(235, 235, 245, 0.14);
  --bamboo: #32d74b;
  --bamboo-ink: #5fe07a;
  --shadow-1: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 16px 44px rgba(0, 0, 0, 0.5);
  /* brighter tone colors for the dark band (DESIGN.md §2) */
  --tone-1: #ff6b61;
  --tone-2: #4cd964;
  --tone-3: #5aa9ff;
  --tone-4: #c89bf0;
  --tone-5: #adadb4;
  background: var(--bg);
  color: var(--ink);
}

/* ── Reset / base ─────────────────────────────────────────── */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
[id] { scroll-margin-top: 80px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.015em; line-height: 1.08; margin: 0; }
p { margin: 0; }
a { color: var(--bamboo-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

:focus-visible {
  outline: 2px solid var(--bamboo);
  outline-offset: 2px;
  border-radius: 4px;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ── Nav (shared) ─────────────────────────────────────────
   Floating pill bar. Transparent at the top of the page; nav.js adds
   .is-scrolled, which gives it a white fill, hairline and soft shadow. */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 8px 24px 0;
}
.nav-bar {
  max-width: 1200px;
  height: 56px;
  margin: 0 auto;
  padding: 0 8px 0 16px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.nav.is-scrolled .nav-bar {
  background: var(--surface);
  border-color: rgba(60, 60, 67, 0.18);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 6px 20px rgba(0, 0, 0, 0.06);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 400;
  color: var(--ink);
  justify-self: start;
}
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; border-radius: 8px; }
.brand b { font-weight: 700; }
.nav-links { display: flex; gap: 2px; align-items: center; justify-content: center; }
.nav-links a, .nav-pill {
  font-size: 14px;
  line-height: 24px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--ink);
  white-space: nowrap;
  transition: background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}
.nav-links a:hover { background: var(--fill); text-decoration: none; }
.nav-links a[aria-current="page"] { background: var(--fill); }
.nav-cta { display: flex; gap: 6px; justify-content: flex-end; }
.nav-pill:hover { text-decoration: none; }
.nav-pill--outline { border-color: rgba(60, 60, 67, 0.2); }
.nav-pill--outline:hover { background: var(--fill); }
.nav-pill--solid { background: var(--ink); color: var(--surface); padding: 6px 16px; }
.nav-pill--solid:hover { opacity: 0.88; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  padding: 12px 24px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s ease, background 0.2s ease;
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { opacity: 0.88; text-decoration: none; }
.btn-accent { background: var(--bamboo); color: #fff; }
.btn-accent:hover { opacity: 0.9; text-decoration: none; }
.btn-ghost { background: var(--fill); color: var(--ink); }
.btn-ghost:hover { background: var(--hairline); text-decoration: none; }
.btn[disabled], .btn.is-disabled {
  background: var(--fill);
  color: var(--text-3);
  cursor: not-allowed;
  opacity: 1;
}
.btn-sub { font-size: 13px; color: var(--text-2); margin-top: 10px; }

/* ── Uninstall survey (goodbye.html) ──────────────────────── */
.gb-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 15px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.gb-opt:hover { background: var(--fill); border-color: var(--text-3); }
.gb-opt input { margin: 0; accent-color: var(--bamboo); }
.gb-text {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  font: inherit;
  font-size: 15px;
  resize: vertical;
  background: var(--surface);
  color: var(--ink);
}
.gb-text:focus { outline: 2px solid var(--bamboo); outline-offset: 1px; }

/* ── Hero (split: copy left · big blended logo right) ──────── */
.hero {
  position: relative;
  margin-top: -64px;          /* sit under the floating nav, so its strip is hero-white */
  padding: 136px 0 88px;
  background: var(--surface);
}
.hero .wrap {
  position: relative;
  display: grid;
  grid-template-columns: 1.04fr 0.96fr;
  gap: 64px;
  align-items: center;
}
.hero-copy { text-align: left; }

/* announcement pill */
.hero-badge {
  display: inline-flex; align-items: center; gap: 9px;
  margin-bottom: 18px; padding: 5px 14px 5px 5px;
  border-radius: 100px; font-size: 13.5px; font-weight: 500;
  color: var(--text-2); background: var(--fill);
  transition: color .2s ease, background .2s ease;
}
.hero-badge:hover { color: var(--ink); text-decoration: none; background: var(--hairline); }
.hero-badge .tag {
  font-size: 12px; font-weight: 600;
  color: #fff; background: var(--ink);
  padding: 3px 9px; border-radius: 100px;
}
.hero-badge svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }

.hero h1 {
  font-size: clamp(46px, 6.6vw, 86px); line-height: 0.98; letter-spacing: -0.025em; max-width: 11ch;
}
.hero .sub { margin: 24px 0 0; max-width: 40ch; font-size: 18px; color: var(--text-2); }
.hero .free-line { margin: 12px 0 0; font-size: 16.5px; font-weight: 500; color: var(--ink); }
.hl { color: var(--bamboo-ink); font-weight: 700; }
.hero-cta { margin-top: 32px; }

/* product window over a solid bamboo block (no glows) */
.hero-visual { position: relative; padding: 0 0 32px 32px; }
.hero-block {
  position: absolute; left: 0; bottom: 0; width: 62%; height: 78%;
  background: var(--bamboo); border-radius: var(--r-md);
}
.window {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--r-md); box-shadow: var(--shadow-2);
}
.window img { width: 100%; }

/* premium stat band under the hero — vertically centered in the band */
.stats { padding: 48px 0; border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); background: var(--surface); }
.stats .wrap {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 22px 56px; min-height: 84px;
}
.stat { text-align: center; min-width: 92px; }
.stat .num {
  display: block; font-family: var(--font-display);
  font-size: clamp(36px, 4.6vw, 52px); font-weight: 400; letter-spacing: -0.02em; line-height: 1; color: var(--ink);
}
.stat .num .u { color: var(--bamboo-ink); }
.stat .lbl { display: block; margin-top: 9px; font-size: 13px; color: var(--text-2); }

/* scroll-reveal — only when motion is allowed, so it can never hide content */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
  .reveal.in { opacity: 1; transform: none; }
}

/* ── Sections ─────────────────────────────────────────────── */
section { padding: 104px 0; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 56px; }
.section-head p { max-width: 52ch; margin-left: auto; margin-right: auto; }
.section-head h2 { font-size: clamp(36px, 5vw, 56px); }
.section-head p { margin-top: 18px; color: var(--text-2); font-size: 17px; }
.eyebrow {
  display: inline-block;
  font-size: 14px;
  font-weight: 500;
  color: var(--bamboo-ink);
  margin-bottom: 16px;
}

/* showcase image frame */
.shot {
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  border: 1px solid var(--hairline);
  overflow: hidden;
  background: var(--surface);
}
.shot-hero { max-width: 760px; margin: 44px auto 0; }

/* alternating media + text rows */
.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  margin-bottom: 72px;
}
.feature-row:last-child { margin-bottom: 0; }
.feature-row.reverse .feature-media { order: 2; }
/* product panels are portrait crops — center them, cap height, never distort */
.feature-media { display: flex; justify-content: center; }
.feature-media .shot { display: inline-block; }
.feature-media .shot img { width: auto; max-width: 100%; max-height: 540px; }
.feature-row h3 { font-size: clamp(28px, 3.4vw, 38px); }
.feature-row p { margin-top: 16px; color: var(--text-2); font-size: 17px; max-width: 42ch; }
.feature-text .kbd { margin: 0; vertical-align: baseline; }

/* ── Pinyin-mode illustration (ruby pinyin over a page + tone toggle) ── */
.pin-card {
  width: 100%; max-width: 460px;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  border: 1px solid var(--hairline);
  overflow: hidden;
}
.pin-body { padding: 30px 26px 22px; }
.pin-line {
  font-family: var(--font-cjk);
  font-size: clamp(24px, 4.4vw, 32px);
  line-height: 2.5;          /* room for the ruby pinyin above each glyph */
  color: var(--ink);
  margin: 0;
  text-align: center;
}
.pin-line ruby { margin: 0 1px; }
.pin-line rt {
  font-family: var(--font-pinyin);
  font-size: 0.42em;
  font-weight: 500;
  color: var(--text-2);      /* calm gray by default — matches the product */
  transition: color 0.22s ease;
}
/* tone colors on (opt-in) — paired with the tone mark, never color-only (DESIGN.md §8) */
.pin-card.tones-on .t1 rt { color: var(--tone-1); }
.pin-card.tones-on .t2 rt { color: var(--tone-2); }
.pin-card.tones-on .t3 rt { color: var(--tone-3); }
.pin-card.tones-on .t4 rt { color: var(--tone-4); }
.pin-card.tones-on .t5 rt { color: var(--tone-5); }

.pin-toggle {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 18px; padding-top: 16px;
  border-top: 1px solid var(--hairline);
}
.pin-toggle-label { font-size: 14px; font-weight: 500; color: var(--text-2); }

/* iOS-style sliding switch (DESIGN.md §5) */
.tswitch {
  position: relative; flex-shrink: 0;
  width: 44px; height: 26px; padding: 0;
  border: none; border-radius: 999px;
  background: var(--fill);
  cursor: pointer;
  transition: background 0.22s ease;
}
.tswitch-thumb {
  position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.22s ease;
}
.tswitch[aria-checked="true"] { background: var(--bamboo); }
.tswitch[aria-checked="true"] .tswitch-thumb { transform: translateX(18px); }
.tswitch:focus-visible { outline: 2px solid var(--bamboo); outline-offset: 2px; }

/* ── How it works (key modes) ─────────────────────────────── */
.kbd {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: var(--fill);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 4px 10px;
  margin-bottom: 14px;
}

/* ── Live demo (How it works) ─────────────────────────────────
   A working recreation of the extension's hover modes (demo.js).
   The fake "webpage" and the cards are always LIGHT — hard-coded
   values mirroring the extension popup (popup/styles.ts) — so the
   product looks the same here as in the screenshots, even though
   the demo sits inside a .section--dark band. */
.demo { margin-top: 36px; }

.demo-bar {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 10px 18px;
  margin-bottom: 14px;
}
.demo-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.demo-chip {
  font: inherit; font-size: 13.5px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 100px;
  border: 1px solid var(--hairline);
  background: var(--surface); color: var(--text-2);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.demo-chip:hover { color: var(--ink); }
.demo-chip kbd {
  font-family: inherit; font-size: 10.5px; font-weight: 700;
  padding: 2px 6px; border-radius: 6px;
  background: var(--fill); border: 1px solid var(--hairline);
  color: inherit;
}
.demo-chip.is-active {
  background: var(--bamboo); border-color: var(--bamboo); color: #0c3317;
}
.demo-chip.is-active kbd { background: rgba(0, 0, 0, 0.14); border-color: transparent; }
.demo-hint { font-size: 13px; color: var(--text-2); }
.demo-hint b { color: var(--ink); font-weight: 600; }

.demo-stage {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 18px;
  align-items: stretch;
}

/* the fake webpage the sample text lives on */
.demo-page {
  position: relative;
  background: #ffffff; color: #1c1c1e;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-1);
  min-height: 450px;
  border: 1px solid rgba(60, 60, 67, 0.12);
  overflow: hidden;
}
.demo-chrome {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px;
  background: #f6f6f7;
  border-bottom: 1px solid rgba(60, 60, 67, 0.1);
}
.demo-chrome span { width: 10px; height: 10px; border-radius: 50%; }
.demo-chrome span:nth-child(1) { background: #ff5f57; }
.demo-chrome span:nth-child(2) { background: #febc2e; }
.demo-chrome span:nth-child(3) { background: #28c840; }
.demo-chrome i {
  font-style: normal; font-size: 11.5px; color: #8e8e93;
  background: #fff; border: 1px solid rgba(60, 60, 67, 0.08);
  border-radius: 6px; padding: 3px 0;
  flex: 1; max-width: 220px; margin-left: 10px; text-align: center;
}
.demo-text {
  font-family: var(--font-cjk);
  font-size: clamp(22px, 2.6vw, 27px);
  line-height: 2;
  padding: 24px 26px 26px;
  margin: 0;
  cursor: default;
  user-select: none;
}
.demo-w { border-radius: 3px; }
.demo-w.is-hl, .demo-sent.is-hl, .demo-text.is-hl { background: rgba(52, 199, 89, 0.16); }

/* right panel where the phrase list / AI breakdown appear */
.demo-result { position: relative; display: flex; min-height: 300px; }
/* The empty state fills the column as a dashed "output" panel, so the space
   reads as intentional instead of a stray caption floating in the dark. */
.demo-result .d-empty {
  flex: 1; margin: 0;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  font-size: 14px; color: var(--text-2); padding: 24px;
  border: 1.5px dashed var(--hairline);
  border-radius: var(--r-md);
}

/* shared light card — mirrors the extension popup */
.demo-card {
  box-sizing: border-box; width: 100%;
  background: #ffffff; color: #1c1c1e;
  border-radius: var(--r-md);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.3), 0 0 0 0.5px rgba(60, 60, 67, 0.1);
  font-family: var(--font-ui); font-size: 14px; line-height: 1.5;
  text-align: left;
}

/* word mode: floating card anchored beside the hovered word. Mirrors the
   extension card: headword + pinyin/HSK, icon actions on the right, the
   active tab's body, and the tab bar as a fixed footer. */
.demo-word-card {
  position: absolute; z-index: 3; display: none;
  width: auto; min-width: 260px;
  max-width: min(340px, calc(100% - 16px));
  padding: 0; border-radius: 12px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 6px 20px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(60, 60, 67, 0.1);
}
.d-scroll { padding: 16px 18px 14px; max-height: 280px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.d-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.d-head-main { min-width: 0; }
.d-word {
  font-family: var(--font-cjk); font-size: 36px; font-weight: 400;
  margin: 0; line-height: 1.05; letter-spacing: 0.01em; white-space: nowrap;
}
.d-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-top: 6px; }
.d-py { font-size: 15px; font-weight: 400; color: #6e6e73; margin: 0; line-height: 1.25; }
.d-actions { display: flex; gap: 2px; flex-shrink: 0; margin: -4px -6px 0 0; }
.d-act {
  appearance: none; border: none; cursor: pointer;
  display: grid; place-items: center; width: 30px; height: 30px; padding: 0;
  border-radius: 8px; background: transparent; color: #6e6e73;
}
.d-act:hover { background: rgba(60, 60, 67, 0.06); color: #1c1c1e; }
.d-act.is-on { color: #248a3d; }
.d-act.is-on svg { fill: currentColor; }
.d-act svg { width: 16px; height: 16px; display: block; }

.d-defs { margin: 0; padding: 0; list-style: none; counter-reset: def; }
.d-defs li {
  counter-increment: def; display: grid; grid-template-columns: 18px 1fr;
  font-size: 14.5px; padding: 2px 0; color: #1c1c1e;
}
.d-defs li::before { content: counter(def); font-size: 12px; font-weight: 600; color: #8e8e93; padding-top: 2px; }
.d-also { margin: 14px 0 0; font-size: 12px; line-height: 1.6; color: #6e6e73; }
.d-also a { color: #6e6e73; font-weight: 600; text-decoration: none; }
.d-also a:hover { color: #1c1c1e; text-decoration: underline; }
.d-also + .d-credit { margin-top: 4px; }
.d-credit { margin: 12px 0 0; font-size: 10px; color: #8e8e93; opacity: 0.8; }

/* Back (shown after drilling into a character) */
.d-back {
  appearance: none; background: none; border: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 3px;
  font: inherit; font-size: 12px; font-weight: 600; color: #6e6e73;
  padding: 0; margin: 0 0 10px;
}
.d-back svg { width: 14px; height: 14px; }
.d-back:hover { color: #1c1c1e; }

/* tab bar: a footer under the scrolling body */
.d-tabs {
  display: flex; gap: 18px; padding: 0 18px;
  border-top: 1px solid rgba(60, 60, 67, 0.1); background: #ffffff;
}
.d-tab {
  appearance: none; background: none; border: none; cursor: pointer;
  font: inherit; font-size: 12.5px; font-weight: 600; line-height: 1.2;
  padding: 11px 0 12px; color: #8e8e93; transition: color 0.15s ease;
}
.d-tab:hover, .d-tab.is-active { color: #1c1c1e; }

/* active-tab body */
.d-panel { padding-top: 14px; }

/* Characters tab: hairline rows that drill in */
.d-chars { display: flex; flex-direction: column; }
.d-char {
  appearance: none; background: none; cursor: pointer; text-align: left;
  font: inherit; width: 100%; border: none;
  border-top: 1px solid rgba(60, 60, 67, 0.1);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center;
  column-gap: 12px; padding: 8px 6px; border-radius: 0;
}
.d-char:first-child { border-top: none; padding-top: 0; }
.d-char:hover { background: rgba(60, 60, 67, 0.06); }
.d-char-zh { font-family: var(--font-cjk); font-size: 26px; font-weight: 400; line-height: 1; }
.d-char-meta { display: flex; flex-direction: column; min-width: 0; }
.d-char-py { font-size: 12.5px; color: #6e6e73; line-height: 1.25; }
.d-char-def { font-size: 13px; color: #1c1c1e; line-height: 1.3; overflow-wrap: anywhere; }
.d-char-chev { color: #8e8e93; line-height: 0; }
.d-char-chev svg { width: 16px; height: 16px; }

/* Sentences tab */
.d-sents { display: flex; flex-direction: column; }
.d-sent-ex { padding: 10px 0; border-top: 1px solid rgba(60, 60, 67, 0.1); }
.d-sent-ex:first-child { border-top: none; padding-top: 0; }
.d-sent-zh { font-family: var(--font-cjk); font-size: 15px; font-weight: 500; line-height: 1.35; margin: 0 0 2px; }
.d-sent-py { font-size: 12px; color: #6e6e73; line-height: 1.25; margin: 0 0 2px; }
.d-sent-en { font-size: 12px; color: #8e8e93; line-height: 1.35; margin: 0; }

/* AI tab: word explanation */
.d-wai-mean { font-size: 14px; margin: 0; }
.d-wai-pos { font-size: 12px; color: #8e8e93; margin: 3px 0 0; }
.d-wai-usage { margin: 0; padding-left: 18px; list-style: disc outside; }
.d-wai-usage li { font-size: 12.5px; color: #6e6e73; line-height: 1.45; padding: 1px 0; }

.demo .hsk-badge {
  display: inline-block; font-size: 10px; font-weight: 600; line-height: 1;
  padding: 3px 7px; border-radius: 7px; letter-spacing: 0.02em;
}
.demo .hsk-1 { background: rgba(52, 199, 89, 0.13); color: #248a3d; }
.demo .hsk-2 { background: rgba(100, 210, 70, 0.14); color: #3d7a22; }
.demo .hsk-3 { background: rgba(255, 214, 10, 0.15); color: #7a6500; }
.demo .hsk-none { background: rgba(60, 60, 67, 0.06); color: #8e8e93; }

/* phrase mode: word-by-word list */
.d-list { padding: 6px 0; max-height: 360px; overflow-y: auto; overscroll-behavior: contain; }
.d-row {
  display: grid; grid-template-columns: auto 1fr; column-gap: 12px;
  padding: 8px 16px; border-top: 1px solid rgba(60, 60, 67, 0.1);
}
.d-row:first-child { border-top: none; }
.d-zh { font-family: var(--font-cjk); font-size: 17px; font-weight: 600; align-self: center; }
.d-rpy { display: block; font-size: 12px; color: #6e6e73; line-height: 1.25; }
.d-rdef { display: block; font-size: 12.5px; color: #6e6e73; line-height: 1.35; }

/* sentence mode: the three-section AI breakdown */
.d-ai { padding: 16px 18px; max-height: 420px; overflow-y: auto; overscroll-behavior: contain; }
.d-aih { font-size: 12px; font-weight: 600; color: #8e8e93; margin: 18px 0 6px; }
.d-aih:first-child { margin-top: 0; }
.d-trans { font-family: var(--font-display); font-size: 19px; line-height: 1.4; letter-spacing: -0.01em; margin: 0; }
.d-chunk { padding: 10px 0; border-top: 1px solid rgba(60, 60, 67, 0.1); }
.d-aih + .d-chunk { border-top: none; padding-top: 4px; }
.d-chunk-zh { font-family: var(--font-cjk); font-size: 20px; font-weight: 400; line-height: 1.3; margin: 0 0 2px; }
.d-chunk-py { font-size: 12.5px; color: #6e6e73; line-height: 1.3; margin: 0; }
.d-chunk-en { font-size: 13.5px; color: #1c1c1e; line-height: 1.4; margin: 1px 0 0; }
.d-ai { counter-reset: nug; }
.d-nug {
  counter-increment: nug; display: grid; grid-template-columns: 22px 1fr;
  padding: 8px 0; border-top: 1px solid rgba(60, 60, 67, 0.1);
}
.d-aih + .d-nug { border-top: none; padding-top: 4px; }
.d-nug::before { content: counter(nug); grid-row: span 2; font-size: 12px; font-weight: 600; color: #8e8e93; padding-top: 1px; }
.d-nug-t { font-size: 13.5px; font-weight: 600; line-height: 1.35; margin: 0 0 2px; }
.d-nug-d { font-size: 13px; color: #6e6e73; line-height: 1.5; margin: 0; }
.d-ainote {
  margin: 14px 0 0; padding-top: 10px;
  border-top: 1px solid rgba(60, 60, 67, 0.1);
  font-size: 11px; color: #8e8e93;
}
/* AI is the one place with motion, matching the product. */
@media (prefers-reduced-motion: no-preference) {
  .d-trans, .d-chunk, .d-nug { animation: demoFadeUp 0.22s ease both; }
  @keyframes demoFadeUp {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
  }
}

/* ── Getting-started steps ────────────────────────────────── */
.steps {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 900px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 24px;
}
.step-num {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--ink);
  border: 1px solid var(--hairline);
}
.step-body h3 { font-size: 22px; }
.step-body p { margin-top: 7px; color: var(--text-2); font-size: 15px; line-height: 1.5; }
.step-body .kbd { margin: 0 2px; vertical-align: baseline; }

/* ── Feature list (Granola-style rows: title left, line right) ── */
.feature-list { list-style: none; margin: 0 auto; padding: 0; max-width: 920px; }
.feature-list li {
  display: grid; grid-template-columns: 1fr 1.3fr; gap: 32px; align-items: baseline;
  padding: 26px 0; border-top: 1px solid var(--hairline);
}
.feature-list li:last-child { border-bottom: 1px solid var(--hairline); }
.feature-list h3 { font-size: clamp(22px, 2.4vw, 28px); }
.feature-list p { color: var(--text-2); font-size: 16px; }
.cjk { font-family: var(--font-cjk); }

/* ── Pro tier ─────────────────────────────────────────────── */
.pro {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 44px 40px 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}
.pro::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--bamboo);
}
.pro-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.03em;
  color: #fff; background: var(--bamboo);
  padding: 4px 10px; border-radius: 20px;
  margin-bottom: 14px;
}
.pro h2 { font-size: 36px; }
.pro ul { list-style: none; margin: 20px 0 0; padding: 0; }
.pro li { display: flex; gap: 10px; padding: 8px 0; color: var(--text-2); font-size: 15.5px; }
.pro li b { color: var(--ink); font-weight: 600; }
.pro li::before { content: "✓"; color: var(--bamboo-ink); font-weight: 700; flex-shrink: 0; }
.pro-note { margin-top: 18px; font-size: 13px; color: var(--text-2); }

/* ── Pricing tiers ────────────────────────────────────────── */
/* Plus: Monthly and Yearly side by side, yearly saving loud */
.cycles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-top: 18px; }
.cycle {
  position: relative; display: flex; flex-direction: column; text-align: left;
  padding: 20px 14px 14px; border: 1px solid var(--hairline); border-radius: var(--r-lg);
  background: var(--surface); font: inherit; color: inherit;
}
.cycle--best { border: 2px solid var(--bamboo); background: color-mix(in srgb, var(--bamboo) 8%, var(--surface)); }
.cycle-badge {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: var(--bamboo); color: #fff; font-size: 12.5px; font-weight: 700;
  padding: 4px 12px; border-radius: 20px; white-space: nowrap;
}
.cycle-name { font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink); }
.cycle .tier-price { margin-top: 6px; flex-wrap: wrap; }
.cycle .tier-amt { font-size: 36px; }
.cycle .tier-per { font-size: 13px; }
.cycle .tier-alt { font-size: 12.5px; line-height: 1.4; }
.save-big {
  align-self: flex-start; margin: 12px 0 0; padding: 6px 12px; border-radius: 999px;
  background: var(--gold); color: var(--ink); font-size: 14px; font-weight: 700;
}
.save-green { background: var(--bamboo); color: #fff; font-size: 15px; padding: 7px 14px; white-space: nowrap; }
/* In the Yearly box: a full-width strip along the bottom edge */
.cycle .save-green { align-self: stretch; text-align: center; margin: auto -14px -14px; padding: 9px 4px; border-radius: 0 0 calc(var(--r-lg) - 2px) calc(var(--r-lg) - 2px); }
.cycle--best .tier-price { margin-bottom: 14px; }
.tier-save { color: var(--bamboo-ink); font-weight: 600; }
.pricing {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: stretch;
}
.tier {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 32px 28px;
}
/* featured tier (Plus) — bamboo top edge + soft lift */
.tier--featured {
  border-color: var(--bamboo);
}
.tier--lifetime { border: 2px solid var(--gold); background: color-mix(in srgb, var(--gold) 7%, var(--surface)); }
.tier--lifetime .tier-badge { background: var(--gold); color: var(--ink); }
.tier-badge {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: var(--bamboo); color: #fff;
  font-size: 12.5px; font-weight: 600;
  padding: 4px 12px; border-radius: 20px; white-space: nowrap;
}
.tier-name {
  font-size: 26px; color: var(--ink); margin: 0;
}
.tier-price { margin: 10px 0 0; display: flex; align-items: baseline; gap: 6px; }
.tier-amt { font-family: var(--font-display); font-size: 48px; font-weight: 400; letter-spacing: -0.02em; color: var(--ink); line-height: 1; }
.tier-per { font-size: 15px; font-weight: 500; color: var(--text-2); }
.tier-tag { margin: 12px 0 0; color: var(--text-2); font-size: 14.5px; line-height: 1.45; }
.tier-alt { margin: 4px 0 0; color: var(--text-2); font-size: 13.5px; }
.tier .btn { margin-top: 22px; width: 100%; justify-content: center; }
.tier-lead { margin: 22px 0 0; font-size: 13px; font-weight: 600; color: var(--ink); }
.tier-feats { list-style: none; margin: 14px 0 0; padding: 0; }
.tier .btn + .tier-feats { margin-top: 22px; } /* Free tier: list follows the button directly */
.tier-feats li {
  display: flex; gap: 10px; padding: 7px 0;
  font-size: 14.5px; line-height: 1.4; color: var(--text-2);
}
.tier-feats li::before { content: "✓"; color: var(--bamboo-ink); font-weight: 700; flex-shrink: 0; }
.tier-feats li b { font-weight: 600; color: var(--ink); }
.pricing-note { text-align: center; margin: 26px auto 0; max-width: 52ch; font-size: 13px; color: var(--text-3); }

/* ── Closing CTA ──────────────────────────────────────────── */
.closing { text-align: center; }
.closing h2 { font-size: clamp(40px, 6vw, 72px); line-height: 1; }
.closing p { margin: 14px auto 26px; max-width: 42ch; color: var(--text-2); font-size: 17px; }

/* ── Privacy summary band ─────────────────────────────────── */
.privacy-band { background: var(--surface); border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }
.privacy-band .wrap { max-width: var(--reading); text-align: center; }
.privacy-band h2 { font-size: clamp(32px, 4vw, 44px); }
.privacy-band p { margin: 16px auto 0; color: var(--text-2); font-size: 16px; }
.privacy-band .btn { margin-top: 24px; }

/* ── Footer ───────────────────────────────────────────────── */
footer {
  padding: 56px 0 48px;
  border-top: 1px solid var(--hairline);
  color: var(--text-2);
  font-size: 14px;
}
footer .wrap { display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between; }
footer .foot-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 15px; }
footer .foot-brand img { width: 26px; height: 26px; border-radius: 7px; }
footer .foot-brand b { font-weight: 700; }
footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
footer nav a { color: var(--text-2); }
footer .credits { width: 100%; margin-top: 8px; line-height: 1.7; }
footer .credits a { color: var(--text-2); }

/* ── Legal pages (privacy / terms) ────────────────────────── */
.legal { padding: 56px 0 80px; }
.legal .wrap { max-width: var(--reading); }
.legal h1 { font-size: clamp(40px, 6vw, 64px); line-height: 1; }
.legal .updated { margin-top: 12px; color: var(--text-3); font-size: 14px; }
.legal .lede { margin-top: 20px; font-size: 17px; color: var(--text-2); }
.legal h2 {
  font-size: 30px; margin-top: 48px;
  padding-top: 12px; border-top: 1px solid var(--hairline);
}
.legal h3 { font-size: 21px; margin-top: 28px; }
.legal p, .legal li { font-size: 15.5px; color: var(--text-2); }
.legal p { margin-top: 14px; }
.legal ul { margin-top: 14px; padding-left: 22px; }
.legal li { margin-top: 8px; }
.legal strong, .legal b { color: var(--ink); font-weight: 600; }
.legal .callout {
  margin-top: 24px;
  background: var(--fill);
  border-radius: var(--r-md);
  padding: 18px 20px;
  font-size: 14.5px;
}
.legal .callout p { margin-top: 0; }

/* responsive tables for legal docs */
.table-scroll { margin-top: 18px; overflow-x: auto; border: 1px solid var(--hairline); border-radius: var(--r-md); }
table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 14px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--hairline); vertical-align: top; }
th { color: var(--ink); font-weight: 600; background: var(--fill); }
tr:last-child td { border-bottom: none; }
td { color: var(--text-2); }
td strong { color: var(--ink); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 860px) {
  .nav-bar { grid-template-columns: 1fr auto; }
  .nav-links { display: none; }
  .hero .wrap { grid-template-columns: 1fr; gap: 36px; }
  .hero-copy { text-align: center; }
  .hero-copy .tagline, .hero-copy .sub { margin-left: auto; margin-right: auto; }
  .hero h1 { margin: 0 auto; }
  .hero .btn-sub { margin-left: auto; margin-right: auto; }
  .demo-stage { grid-template-columns: 1fr; }
  .demo-page { min-height: 0; padding-bottom: 86px; }
  .demo-result { min-height: 0; }
  .demo-result .d-empty { padding: 24px 16px; }
  .feature-row { grid-template-columns: 1fr; gap: 24px; margin-bottom: 48px; }
  .feature-row.reverse .feature-media { order: 0; }
  .pro { grid-template-columns: 1fr; gap: 28px; padding: 32px; }
  .pricing { grid-template-columns: 1fr; gap: 24px; max-width: 420px; margin: 0 auto; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 18px; }
  .hero { padding: 112px 0 56px; }
  section { padding: 64px 0; }
  .feature-list li { grid-template-columns: 1fr; gap: 6px; padding: 20px 0; }
  .steps { grid-template-columns: 1fr; }
  .nav { padding: 8px 12px 0; }
  .nav-pill--outline { display: none; }
  footer .wrap { flex-direction: column; gap: 20px; }
}

/* Pinyin uses Onest (full tone-mark coverage). */
.d-py, .d-sent-py, .d-char-py, .d-chunk-py, .py, rt { font-family: var(--font-pinyin); }
