/* Hanzen landing page
   Dark first, light theme via system preference or the header toggle.
   Palette mirrors the app: one blue for action, one green for progress,
   purple only for the "movie" accents. */

:root {
  --bg: #10151A;
  --surface: #1A222B;
  --raised: #212B36;
  --line: #2C3742;
  --ink: #E9EEF3;
  --ink-2: #A3AEB8;
  --ink-3: #66707A;
  --blue: #5B8DEF;
  --blue-ink: #0F1A2E;
  --green: #4CB963;
  --purple: #B48BD8;
  --purple-soft: rgba(180, 139, 216, .16);
  --gold: #F1B936;
  --pink: #3A2A2F;
  --pink-ink: #F3C5CC;
  --danger: #E2604B;
  --shadow: 0 24px 60px rgba(0, 0, 0, .45);
  --radius: 10px;
  --radius-lg: 16px;
  --font: "Nunito", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-zh: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #F8F8F8;
    --surface: #FFFFFF;
    --raised: #FFFFFF;
    --line: #E4E2DD;
    --ink: #323230;
    --ink-2: #66707A;
    --ink-3: #A3AEB8;
    --blue: #2B61EF;
    --blue-ink: #FFFFFF;
    --green: #2C8D3D;
    --purple: #8250A8;
    --purple-soft: rgba(130, 80, 168, .10);
    --gold: #D49A16;
    --pink: #FFE6E9;
    --pink-ink: #7A2F3A;
    --danger: #D23A22;
    --shadow: 0 24px 60px rgba(30, 30, 40, .14);
    color-scheme: light;
  }
}

:root[data-theme="light"] {
  --bg: #F8F8F8;
  --surface: #FFFFFF;
  --raised: #FFFFFF;
  --line: #E4E2DD;
  --ink: #323230;
  --ink-2: #66707A;
  --ink-3: #A3AEB8;
  --blue: #2B61EF;
  --blue-ink: #FFFFFF;
  --green: #2C8D3D;
  --purple: #8250A8;
  --purple-soft: rgba(130, 80, 168, .10);
  --gold: #D49A16;
  --pink: #FFE6E9;
  --pink-ink: #7A2F3A;
  --danger: #D23A22;
  --shadow: 0 24px 60px rgba(30, 30, 40, .14);
  color-scheme: light;
}

/* ---------- base ---------- */

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

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

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

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
svg { display: block; }

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

.wrap {
  width: min(1120px, 100% - 40px);
  margin-inline: auto;
}

.skip {
  position: absolute; left: 16px; top: -60px;
  padding: 8px 12px; background: var(--blue); color: var(--blue-ink);
  border-radius: 8px; z-index: 100; text-decoration: none;
}
.skip:focus { top: 12px; }

.eyebrow {
  font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--purple); margin-bottom: 12px;
}

.lead { font-size: 19px; color: var(--ink-2); line-height: 1.7; }
.sub { color: var(--ink-2); max-width: 560px; margin-inline: auto; }

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: transform .15s ease, background .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue); color: var(--blue-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink-3); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 15px; }
.btn-wide { width: 100%; }
.btn[disabled] { opacity: .6; cursor: default; }

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

.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; }
.brand-mark { width: 26px; height: 26px; color: var(--ink); }
.brand-name { font-size: 20px; letter-spacing: -0.02em; }
.nav-links { display: flex; gap: 22px; margin-left: 12px; }
.nav-links a { text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 15px; }
.nav-links a:hover { color: var(--ink); }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.theme-toggle {
  width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); cursor: pointer; display: grid; place-items: center;
}
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="dark"]) .theme-toggle .icon-moon { display: none; }
}

@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-actions .btn { display: none; }
}

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

.hero { padding-block: clamp(56px, 9vw, 120px) clamp(40px, 6vw, 80px); overflow: hidden; }
.hero-grid {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(32px, 6vw, 80px); align-items: center;
}
.hero h1 { font-size: clamp(38px, 5.4vw, 64px); font-weight: 800; letter-spacing: -0.025em; }
.hero .lead { margin-top: 20px; max-width: 520px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-proof { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 36px; color: var(--ink-2); font-size: 15px; }
.hero-proof li { white-space: nowrap; }
.hero-proof strong { color: var(--ink); }

.hero-visual { position: relative; display: grid; place-items: center; min-height: 520px; }

.phone {
  width: 100%; max-width: 300px; aspect-ratio: 665 / 1448;
  border-radius: 34px; padding: 10px; background: #0A0D11;
  border: 1px solid #2B333D; box-shadow: var(--shadow);
  overflow: hidden;
}
.phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 26px; }
.phone-hero { max-width: 280px; transform: rotate(-3deg) translateX(-30px); }

.scene-card {
  position: absolute; right: 0; bottom: 8%;
  width: min(300px, 78%);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 18px 18px 14px; box-shadow: var(--shadow);
  transform: rotate(2deg);
  transition: opacity .25s ease;
}
.scene-card.fade { opacity: 0; }
.scene-top { display: flex; align-items: baseline; gap: 14px; margin-bottom: 12px; }
.scene-hanzi { font-family: var(--font-zh); font-size: 52px; line-height: 1; font-weight: 500; }
.scene-pinyin { font-size: 18px; font-weight: 700; color: var(--purple); }
.scene-gloss { font-weight: 500; color: var(--ink-2); }
.scene-beats { display: grid; gap: 7px; font-size: 14px; color: var(--ink-2); }
.scene-beats li { display: flex; align-items: center; gap: 10px; }
.scene-beats li span:last-child { font-family: var(--font-zh); }
.beat-tag {
  font-family: var(--font); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  padding: 3px 8px; border-radius: 999px; min-width: 56px; text-align: center;
}
.tag-actor { background: var(--purple-soft); color: var(--purple); }
.tag-set { background: color-mix(in srgb, var(--blue) 16%, transparent); color: var(--blue); }
.tag-tone { background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold); }
.tag-prop { background: var(--pink); color: var(--pink-ink); }
.scene-dots { display: flex; gap: 6px; margin-top: 14px; }
.scene-dots button {
  width: 8px; height: 8px; border-radius: 999px; border: 0; padding: 0; cursor: pointer;
  background: var(--line);
}
.scene-dots button[aria-selected="true"] { background: var(--purple); }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { min-height: 0; margin-top: 8px; }
  .phone-hero { transform: none; max-width: 240px; }
  .scene-card { position: relative; right: auto; bottom: auto; width: min(360px, 100%); margin-top: -70px; transform: none; }
}

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

.strip { border-block: 1px solid var(--line); background: var(--surface); }
.strip-inner { padding-block: 36px; text-align: center; }
.strip p { max-width: 760px; margin-inline: auto; font-size: clamp(18px, 2.2vw, 22px); line-height: 1.6; font-weight: 500; }

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

.section { padding-block: clamp(64px, 9vw, 120px); }
.section-alt { background: var(--surface); border-block: 1px solid var(--line); }
.section-head { text-align: center; margin-bottom: clamp(36px, 5vw, 64px); }
.section-head h2 { font-size: clamp(30px, 4vw, 44px); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 14px; }

/* steps */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.step {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 24px 22px;
}
.section-alt .step { background: var(--bg); }
.step-num {
  width: 34px; height: 34px; border-radius: 999px; display: grid; place-items: center;
  background: var(--purple-soft); color: var(--purple); font-weight: 800; margin-bottom: 16px;
}
.step h3 { font-size: 19px; margin-bottom: 8px; }
.step p { color: var(--ink-2); font-size: 15.5px; }

@media (max-width: 960px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }

/* example */
.example {
  margin-top: clamp(32px, 5vw, 56px);
  display: grid; grid-template-columns: auto 1fr; gap: 24px 40px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(22px, 3vw, 36px);
}
.example-char { display: grid; place-items: center; gap: 4px; }
.example-hanzi { font-family: var(--font-zh); font-size: clamp(72px, 9vw, 112px); line-height: 1; font-weight: 500; }
.example-pinyin { font-size: 20px; font-weight: 700; color: var(--purple); }
.example-formula { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.chip {
  display: inline-flex; align-items: baseline; gap: 8px;
  background: var(--pink); color: var(--pink-ink); border-radius: 20px; padding: 8px 16px;
  font-family: var(--font-zh); font-size: 24px; line-height: 1;
}
.chip small { font-family: var(--font); font-size: 13px; font-weight: 700; }
.chip-result { background: var(--purple-soft); color: var(--purple); }
.plus, .equals { font-size: 22px; font-weight: 700; color: var(--ink-3); }
.example-text { grid-column: 2; color: var(--ink-2); }

@media (max-width: 720px) {
  .example { grid-template-columns: 1fr; text-align: center; }
  .example-formula { justify-content: center; }
  .example-text { grid-column: 1; }
}

/* screenshots */
.shots {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 36px);
  justify-items: center;
}
.shot { margin: 0; display: grid; gap: 16px; justify-items: center; }
.shot .phone { max-width: 270px; }
.shot figcaption { text-align: center; max-width: 260px; }
.shot figcaption strong { display: block; font-size: 17px; margin-bottom: 4px; }
.shot figcaption span { color: var(--ink-2); font-size: 15px; }
.shot:nth-child(2) { transform: translateY(-16px); }

@media (max-width: 860px) {
  .shots { grid-template-columns: 1fr; }
  .shot:nth-child(2) { transform: none; }
}

/* features */
.features {
  margin-top: clamp(48px, 6vw, 80px);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
}
.features li {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px;
}
.features svg {
  width: 26px; height: 26px; fill: none; stroke: var(--blue); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  margin-bottom: 14px;
}
.features h3 { font-size: 17px; margin-bottom: 6px; }
.features p { color: var(--ink-2); font-size: 15px; }

@media (max-width: 860px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .features { grid-template-columns: 1fr; } }

/* ---------- watch ---------- */

.watch-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 72px); align-items: center; }
.watch-copy h2 { font-size: clamp(30px, 4vw, 44px); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 16px; }
.watch-list { display: grid; gap: 12px; margin-top: 28px; }
.watch-list li { padding-left: 26px; position: relative; color: var(--ink-2); font-size: 16px; }
.watch-list li::before {
  content: ""; position: absolute; left: 0; top: 9px; width: 10px; height: 10px; border-radius: 999px;
  background: var(--green);
}
.watch-list strong { color: var(--ink); }

.browser {
  border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--surface);
  box-shadow: var(--shadow);
}
.browser-bar { display: flex; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--raised); }
.browser-bar span { width: 10px; height: 10px; border-radius: 999px; background: var(--line); }
.browser-body { display: grid; grid-template-columns: 1fr 224px; min-height: 340px; background: #0F0F0F; }

.yt-stage { padding: 16px; display: grid; align-content: start; gap: 12px; }
.yt-video {
  aspect-ratio: 16 / 9; border-radius: 8px; display: grid; place-items: center;
  background: linear-gradient(135deg, #263240, #141A21);
}
.yt-play {
  width: 0; height: 0; border-left: 22px solid rgba(255, 255, 255, .85);
  border-top: 13px solid transparent; border-bottom: 13px solid transparent; margin-left: 6px;
}
.yt-caption {
  justify-self: center; font-family: var(--font-zh); font-size: 15px; color: #fff;
  background: rgba(0, 0, 0, .75); padding: 4px 10px; border-radius: 4px;
}

.hz-panel {
  background: #FBF7EF; color: #3A342B; border-left: 1px solid #E5DCC8;
  padding: 10px; font-size: 11px; display: grid; align-content: start; gap: 8px; min-width: 0; overflow: hidden;
}
.hz-head { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 11px; }
.hz-head img { border-radius: 4px; }
.hz-chip { margin-left: auto; font-family: var(--font-mono); font-size: 9px; background: #EDE5D3; padding: 2px 6px; border-radius: 999px; }
.hz-fit { height: 5px; border-radius: 999px; background: #EDE5D3; overflow: hidden; }
.hz-fit span { display: block; height: 100%; background: #2C8D3D; }
/* Width lives here, not in a style attribute, so the CSP can keep style-src at 'self'. */
.hz-fit-bar { width: 62%; }
.hz-line { display: grid; gap: 3px; padding: 6px 8px; border-radius: 6px; font-family: var(--font-zh); }
.hz-line em { font-style: normal; font-family: var(--font-mono); font-size: 9px; color: #9A907F; }
.hz-line span { font-size: 13px; }
.hz-line small { font-family: var(--font); color: #7A6F5E; }
.hz-line.past { opacity: .55; }
.hz-line.cur { background: #fff; border-left: 3px solid #2B61EF; box-shadow: 0 2px 8px rgba(120, 100, 60, .12); }
.hz-line u { text-decoration: none; border-bottom: 1.5px dotted; }
.hz-line u.new { border-color: #D49A16; }
.hz-line u.gram { border-color: #2C8D3D; }
.hz-ctl { display: flex; gap: 4px; margin-top: 3px; }
.hz-ctl b { font-family: var(--font); font-weight: 700; font-size: 9px; padding: 2px 6px; border: 1px solid #DCD2BD; border-radius: 999px; background: #F6F0E2; }
.hz-card { background: #fff; border: 1px solid #E5DCC8; border-radius: 6px; padding: 8px; display: grid; gap: 3px; }
.hz-word { font-family: var(--font-zh); font-size: 18px; font-weight: 500; }
.hz-word small { font-family: var(--font); font-size: 10px; color: #8250A8; font-weight: 800; margin-left: 4px; }
.hz-gloss { color: #7A6F5E; }
.hz-parts { font-family: var(--font-zh); font-size: 12px; }
.hz-parts i { font-family: var(--font); font-style: normal; color: #8250A8; font-weight: 700; font-size: 10px; }

@media (max-width: 960px) {
  .watch-grid { grid-template-columns: 1fr; }
  .watch-visual { order: -1; }
}
@media (max-width: 480px) {
  .browser-body { grid-template-columns: 1fr; }
  .yt-stage { display: none; }
}

/* ---------- waitlist ---------- */

.waitlist-wrap { max-width: 560px; }
.waitlist {
  display: grid; gap: 18px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(22px, 4vw, 32px);
}
.field { display: grid; gap: 6px; }
.field label, .interest legend { font-weight: 700; font-size: 14px; }
.field input {
  font: inherit; min-height: 50px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.field input:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: transparent; }
.field input[aria-invalid="true"] { border-color: var(--danger); }

.interest { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 10px; }
.interest legend { padding: 0; margin-bottom: 8px; width: 100%; }
.interest label {
  display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; font-size: 15px;
}
.interest label:has(input:checked) { border-color: var(--blue); color: var(--blue); }
.interest input { accent-color: var(--blue); margin: 0; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-status { min-height: 1.4em; font-size: 15px; font-weight: 600; }
.form-status.ok { color: var(--green); }
.form-status.err { color: var(--danger); }
.fine { font-size: 13px; color: var(--ink-3); text-align: center; }

/* ---------- faq ---------- */

.faq-wrap { max-width: 720px; }
.faq { display: grid; gap: 10px; }
.faq details { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.faq summary {
  cursor: pointer; padding: 16px 18px; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--ink-3); font-weight: 400; }
.faq details[open] summary::after { content: "-"; }
.faq details p { padding: 0 18px 16px; color: var(--ink-2); }

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

.footer { border-top: 1px solid var(--line); padding-block: 32px; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.footer-note { color: var(--ink-3); font-size: 14px; }

/* ---------- motion ---------- */

.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .scene-card { transition: none; }
}

/* ---- payment note + post-purchase success page ---- */
.pay-note { text-align: center; font-size: 13px; margin: 0 auto 24px; max-width: 46ch; color: var(--ink-3); }
.success-wrap { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 40px 18px; }
.success-brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 19px; color: var(--ink); text-decoration: none; }
.success-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 30px 28px; max-width: 560px; width: 100%; }
.success-card h1 { font-size: 24px; margin: 0 0 8px; letter-spacing: -.01em; }
.success-sub { color: var(--ink-2); font-size: 15px; margin: 0 0 18px; }
.success-badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--blue-ink); background: var(--green); border-radius: 20px; padding: 3px 11px; margin-bottom: 12px; }
.success-label { display: block; font-size: 12px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; margin: 4px 0 6px; }
.success-keyrow { display: flex; gap: 8px; margin-bottom: 18px; }
.success-key { flex: 1; min-width: 0; font-family: var(--font-mono); font-size: 12.5px; background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 12px; }
.success-fine { font-size: 12.5px; color: var(--ink-3); margin: 12px 0 0; }
.success-card .btn-wide { margin-top: 4px; }
