:root {
  --bg: #faf7f2; --fg: #1f1b16; --muted: #6f655a; --card: #ffffff; --line: #e8e0d4; --soft: #f3ede3;
  --red: #c8372d; --red-d: #a52a21; --glot: #c8372d; --ok: #2f7d4f; --gold: #b7791f;
  --shadow: 0 10px 40px rgba(60, 40, 20, .12);
  --max: 1120px;
  font-family: system-ui, -apple-system, 'Segoe UI', 'PingFang SC', 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
  color: var(--fg); background: var(--bg);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #17140f; --fg: #f2ece2; --muted: #a39887; --card: #221e17; --line: #36301f; --soft: #1e1a14; --shadow: 0 10px 40px rgba(0, 0, 0, .45); --glot: #e5503f; }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { animation: none !important; transition: none !important; } }
body { margin: 0; background: var(--bg); line-height: 1.55; -webkit-text-size-adjust: 100%; }
h1, h2, h3 { line-height: 1.12; margin: 0 0 .6rem; letter-spacing: -.02em; }
h1 { font-size: clamp(2.2rem, 5.6vw, 3.8rem); }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); }
h3 { font-size: 1.15rem; letter-spacing: -.01em; }
p { margin: 0 0 1rem; }
a { color: inherit; }
.cjk { font-family: 'Songti SC', 'Noto Serif SC', 'STSong', 'SimSun', 'PingFang SC', serif; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 1rem; top: 1rem; background: var(--card); padding: .5rem 1rem; z-index: 99; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 4.5rem 1.25rem; }
.center { text-align: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: var(--red); margin: 0 0 .7rem; }
.accent { color: var(--red); }

/* nav */
.nav { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1.2rem; padding: .7rem 1.25rem; padding-top: calc(.7rem + env(safe-area-inset-top)); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.15rem; text-decoration: none; margin-right: auto; }
.logo { display: block; width: 2rem; height: 2rem; flex: none; }
.logo.sm { width: 1.5rem; height: 1.5rem; }
.glot { color: var(--glot); }
.nav nav { display: flex; gap: 1.3rem; }
.nav nav a { text-decoration: none; color: var(--muted); font-size: .95rem; }
.nav nav a:hover { color: var(--fg); }
.nav-cta { display: flex; gap: .5rem; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .62rem 1.05rem; border-radius: 11px; border: 1px solid var(--line); background: var(--card); color: var(--fg); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; transition: transform .12s, background .15s, border-color .15s; }
.btn:hover { border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--red) 35%, transparent); }
.btn.primary:hover { background: var(--red-d); border-color: var(--red-d); }
.btn.ghost { background: transparent; }
.btn.big { padding: .85rem 1.4rem; font-size: 1.05rem; border-radius: 13px; }
.btn.small { padding: .4rem .8rem; font-size: .9rem; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--red) 55%, transparent); outline-offset: 2px; }

/* hero */
.hero { max-width: var(--max); margin: 0 auto; padding: 3.2rem 1.25rem 4rem; display: grid; grid-template-columns: 1.02fr 1fr; gap: 3rem; align-items: center; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 34rem; }
.cta { display: flex; flex-wrap: wrap; gap: .7rem; margin: 1.6rem 0 1.2rem; }
.cta.center { justify-content: center; }
.proof { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.3rem; color: var(--muted); font-size: .92rem; }
.proof li::before { content: '✓'; color: var(--ok); font-weight: 800; margin-right: .4rem; }

/* demo device */
.demo { background: var(--card); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); overflow: hidden; display: grid; grid-template-rows: auto 1fr auto; min-height: 36rem; position: relative; }
.steps { display: flex; gap: .15rem; padding: .55rem; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.steps::-webkit-scrollbar { display: none; }
.steps button { flex: 1 0 auto; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600; font-size: .9rem; padding: .5rem .8rem; border-radius: 10px; cursor: pointer; white-space: nowrap; }
.steps button[aria-selected="true"] { background: var(--soft); color: var(--fg); }
.stage { padding: 1.1rem 1.2rem 1.2rem; position: relative; }
.panel { display: grid; gap: .8rem; align-content: start; animation: rise .35s ease; }
.panel[hidden] { display: none; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.caption { color: var(--muted); font-size: .93rem; margin: .2rem 0 0; }
.caption b { color: var(--fg); }
.progress { height: 3px; background: var(--line); } .progress span { display: block; height: 100%; width: 0; background: var(--red); }
.progress.run span { animation: fill var(--dur, 7s) linear forwards; }
@keyframes fill { to { width: 100%; } }

/* poster + scan */
.poster-wrap { position: relative; width: min(100%, 17rem); margin: .2rem auto; border-radius: 12px; overflow: hidden; box-shadow: 0 12px 30px rgba(0, 0, 0, .25); }
.poster { display: block; width: 100%; height: auto; }
.poster .cjk { font-family: 'PingFang SC', 'Noto Sans SC', 'Microsoft YaHei', sans-serif; }
.corner { position: absolute; width: 22px; height: 22px; border: 3px solid #fff; opacity: .9; }
.corner.tl { top: 8px; left: 8px; border-right: 0; border-bottom: 0; border-top-left-radius: 8px; }
.corner.tr { top: 8px; right: 8px; border-left: 0; border-bottom: 0; border-top-right-radius: 8px; }
.corner.bl { bottom: 8px; left: 8px; border-right: 0; border-top: 0; border-bottom-left-radius: 8px; }
.corner.br { bottom: 8px; right: 8px; border-left: 0; border-top: 0; border-bottom-right-radius: 8px; }
.scanline { position: absolute; left: 0; right: 0; height: 36px; top: -36px; background: linear-gradient(to bottom, transparent, rgba(120, 220, 255, .55), transparent); }
.scanning .scanline { animation: scan 2.6s ease-in-out infinite; }
@keyframes scan { 0% { top: -36px; } 100% { top: 100%; } }

/* unpack */
.hint { margin: 0; font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { border: 1px solid var(--line); background: var(--card); color: var(--fg); border-radius: 999px; padding: .4rem .85rem; font: inherit; cursor: pointer; }
.chip .cjk { font-size: 1.1rem; }
.chip.on { background: var(--red); border-color: var(--red); color: #fff; }
.wordcard { background: var(--soft); border-radius: 14px; padding: .95rem 1rem; display: grid; gap: .25rem; min-height: 9.5rem; }
.wordcard .zh { font-size: 1.9rem; line-height: 1.1; }
.wordcard .py { color: var(--muted); }
.wordcard .mean { font-weight: 700; }
.wordcard .note { font-size: .93rem; color: var(--muted); border-left: 3px solid var(--red); padding-left: .65rem; margin-top: .3rem; }
.fa { height: 1em; width: 1.25em; vertical-align: -.125em; fill: currentColor; flex: none; }
.say { border: 0; background: none; cursor: pointer; font-size: 1rem; padding: .1rem .3rem; border-radius: 8px; color: var(--muted); }
.say:hover, .say.live { color: var(--fg); }
.say:hover { background: var(--soft); }
.say.live { animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* connect */
.seen { background: var(--soft); border-radius: 14px; padding: 1rem; display: grid; gap: .8rem; }
.seen-head { display: flex; align-items: center; justify-content: space-between; }
.big { font-size: 1.7rem; }
.badge { background: var(--red); color: #fff; border-radius: 999px; font-size: .8rem; font-weight: 700; padding: .25rem .7rem; }
.encounters { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.encounters li { display: flex; gap: .75rem; align-items: center; background: var(--card); border-radius: 12px; padding: .55rem .7rem; }
.encounters li span:last-child { display: grid; line-height: 1.25; }
.encounters small { color: var(--muted); }
.thumb { display: block; flex: none; width: 3.2rem; height: 3.2rem; border-radius: 10px; object-fit: cover; }
.menu-photo { display: block; width: 100%; height: auto; aspect-ratio: 5 / 3; object-fit: cover; object-position: center 38%; border-radius: 12px; margin-bottom: .9rem; }

/* lesson dialogue */
.lesson-head h3 { margin: .25rem 0 0; }
.tag { display: inline-block; background: var(--soft); border-radius: 999px; padding: .2rem .65rem; font-size: .82rem; font-weight: 600; }
.dialogue { display: grid; gap: .5rem; max-height: 19rem; overflow: auto; padding-right: .2rem; }
.turn { position: relative; display: grid; gap: .05rem; padding: .45rem 2.2rem .45rem .75rem; border-left: 3px solid var(--line); border-radius: 0 10px 10px 0; }
.turn.me { border-left-color: var(--red); }
.turn.now { background: var(--soft); }
.turn b { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.turn p { margin: 0; font-size: 1.12rem; }
.turn .py { color: var(--muted); } .turn .en { font-size: .93rem; }
.turn .say { position: absolute; right: .3rem; top: .4rem; }

/* chat */
.chat { display: grid; gap: .55rem; min-height: 14rem; align-content: start; }
.bubble { max-width: 90%; padding: .55rem .8rem; border-radius: 14px; display: grid; gap: .1rem; animation: rise .3s ease; }
.bubble p { margin: 0; font-size: 1.1rem; }
.bubble small, .bubble b { font-size: .8rem; color: var(--muted); }
.bubble.npc { background: var(--soft); justify-self: start; }
.bubble.me { background: color-mix(in srgb, var(--red) 14%, var(--card)); justify-self: end; }
.narr { font-style: italic; color: var(--muted); }
.typing::after { content: '…'; animation: pulse 1s infinite; }
.replies { min-height: 2.6rem; }

/* sections */
.band { background: var(--soft); border-block: 1px solid var(--line); }
.band.alt { background: var(--bg); border: 0; }
.cards { display: grid; gap: 1rem; margin-top: 1.8rem; padding: 0; list-style: none; }
.cards.four { grid-template-columns: repeat(4, 1fr); } .cards.three { grid-template-columns: repeat(3, 1fr); } .cards.two { grid-template-columns: repeat(2, 1fr); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 1.3rem; }
.card p { margin: 0; color: var(--muted); }
.num { display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--red); color: #fff; font-weight: 800; margin-bottom: .7rem; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.split.rev > :first-child { order: 0; }
.ticks { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .5rem; }
.ticks li::before { content: '✓'; color: var(--ok); font-weight: 800; margin-right: .5rem; }
.lesson-cards { display: grid; gap: .8rem; }
.lcard { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 1.1rem 1.2rem; box-shadow: var(--shadow); }
.lcard:nth-child(2) { margin-left: 1.5rem; } .lcard:nth-child(3) { margin-left: 3rem; }
.lcard h3 { margin: .5rem 0 .25rem; } .lcard p { margin: 0; color: var(--muted); font-size: .95rem; }

.menu-mock { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 1.3rem; box-shadow: var(--shadow); display: grid; gap: .8rem; }
.dish { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.dish small { display: block; color: var(--muted); }
.spice { background: #e0f2e6; color: #1e5b37; border-radius: 999px; padding: .2rem .65rem; font-size: .8rem; font-weight: 700; white-space: nowrap; }
@media (prefers-color-scheme: dark) { .spice { background: #1f3a2a; color: #8fd4a8; } }
.tagrow { list-style: none; margin: 0; padding: 0; display: flex; gap: .4rem; flex-wrap: wrap; }
.tagrow li { background: var(--soft); border-radius: 999px; padding: .15rem .6rem; font-size: .82rem; }
.ask { background: var(--soft); border-radius: 12px; padding: .8rem .9rem; display: grid; gap: .4rem; }
.ask p { margin: 0; } .ask .q { font-weight: 700; } .ask .a { color: var(--muted); font-size: .95rem; }

.quiz { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 1.1rem; margin-top: 1.2rem; display: grid; gap: .6rem; }
.qtext { font-size: 1.8rem; margin: 0; }
.opts { display: grid; gap: .45rem; }
.opts button { text-align: left; padding: .65rem .85rem; border-radius: 11px; border: 1px solid var(--line); background: var(--card); color: var(--fg); font: inherit; cursor: pointer; }
.opts button:disabled { cursor: default; }
.opts button.right { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 16%, var(--card)); }
.opts button.wrong { border-color: var(--red); background: color-mix(in srgb, var(--red) 14%, var(--card)); }
.result { margin: 0; font-weight: 600; }
.roleplay-note { display: grid; gap: .7rem; box-shadow: var(--shadow); }
.roleplay-note h3 { margin: 0; }

.plain { padding: 0; }
.final { background: linear-gradient(160deg, color-mix(in srgb, var(--red) 12%, var(--bg)), var(--bg)); border-top: 1px solid var(--line); }
.final .wrap { padding: 5rem 1.25rem; }
.final p { max-width: 34rem; margin-inline: auto; color: var(--muted); }
footer { border-top: 1px solid var(--line); }
.foot { padding: 1.6rem 1.25rem calc(1.6rem + env(safe-area-inset-bottom)); display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.foot > span:first-child { display: flex; align-items: center; gap: .5rem; font-weight: 700; }
.foot .small { max-width: 38rem; margin: 0; }

.sticky-cta { position: fixed; left: 0; right: 0; bottom: 0; padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--line); display: none; transform: translateY(110%); transition: transform .25s; z-index: 15; }
.sticky-cta .btn { width: 100%; }
.sticky-cta.show { transform: none; }

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

.btn.disabled { background: var(--soft); border-color: var(--line); color: var(--muted); box-shadow: none; cursor: not-allowed; pointer-events: none; }
.btn.primary.disabled:hover { background: var(--soft); border-color: var(--line); }

/* tablet and phone */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 2rem; padding-top: 2rem; }
  .cards.four { grid-template-columns: repeat(2, 1fr); }
  .cards.three { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; gap: 2rem; }
  .nav nav { display: none; }
}
@media (max-width: 640px) {
  .wrap { padding: 3rem 1.1rem; }
  .hide-sm { display: none; }
  .hero { padding: 1.5rem 1.1rem 2.5rem; }
  .cta .btn.big { flex: 1 1 100%; }
  .cta .btn.ghost.big { display: none; } /* the demo is right below */
  .lede { font-size: 1.04rem; }
  .eyebrow { font-size: .72rem; }
  .cards.four, .cards.two { grid-template-columns: 1fr; }
  .lcard:nth-child(n) { margin-left: 0; }
  .demo { min-height: 0; border-radius: 20px; }
  .stage { padding: .9rem; }
  .sticky-cta { display: block; }
  body { padding-bottom: 4.6rem; }
}
