/* Kaita site — one stylesheet, no external resources. */
@font-face {
  font-family: "Kaita Lora";
  src: url("/assets/fonts/lora-560.woff") format("woff");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0020-007E, U+00A0-00FF, U+0400-045F, U+2013-2014, U+2018-201E, U+2022, U+2026, U+2192, U+20BD, U+2116;
}

:root {
  --paper: #F3F5F4;
  --paper-2: #E7EBE9;
  --surface: #FFFFFF;
  --ink: #1B1D27;
  --slate: #575B69;
  --rule: #D3D8D5;
  --wine: #9C1F35;
  --wine-deep: #5C1120;
  --wine-wash: #F6E7EA;
  --jade: #1D7350;
  --ochre: #9A5B0E;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", sans-serif;
  --serif: "Kaita Lora", "Noto Serif CJK SC", "Source Han Serif SC", "Noto Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --cjk-serif: "Noto Serif CJK SC", "Source Han Serif SC", "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --wrap: 1160px;
  --gut: clamp(20px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  font-synthesis: none;
}
:lang(zh) body, body:lang(zh) { line-height: 1.75; }
img, svg, picture { display: block; max-width: 100%; height: auto; }
a { color: var(--wine); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--wine); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 560; line-height: 1.15; margin: 0; letter-spacing: -.005em; }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.75rem); }
h3 { font-size: 1.3rem; line-height: 1.3; }
p { margin: 0 0 1em; }
code { font-size: .9em; background: var(--paper-2); padding: .1em .35em; border-radius: 4px; overflow-wrap: anywhere; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut); }
.skip { position: absolute; left: 12px; top: -60px; z-index: 10; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 6px; }
.skip:focus { top: 12px; }

/* ---------- header */
.site-head { border-bottom: 1px solid var(--rule); }
.head-row { display: flex; align-items: center; gap: 12px 28px; min-height: 68px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; margin-right: auto; }
.brand .mark { width: 34px; height: 34px; }
.brand-name { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; }
.brand-sub { color: var(--slate); font-size: .95rem; }
.site-head ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px 22px; }
.main-nav a { color: var(--ink); text-decoration: none; font-size: .98rem; padding: 6px 0; }
.main-nav a:hover { color: var(--wine); text-decoration: underline; }
.lang ul { gap: 2px; border: 1px solid var(--rule); border-radius: 999px; padding: 3px; }
.lang a { display: block; padding: 3px 11px; border-radius: 999px; color: var(--slate); text-decoration: none; font-size: .88rem; font-weight: 600; }
.lang a:hover { color: var(--ink); background: var(--paper-2); }
.lang a[aria-current="page"] { background: var(--ink); color: #fff; }

/* ---------- hero */
.hero { padding: clamp(48px, 8vw, 104px) 0 clamp(56px, 8vw, 96px); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero h1 { font-size: clamp(2.5rem, 4.9vw, 4rem); line-height: 1.06; letter-spacing: -.015em; text-wrap: balance; }
.hero h1:lang(zh) { letter-spacing: .02em; line-height: 1.15; }
.hero-name { font-family: var(--serif); color: var(--wine); font-size: 1.2rem; margin: 18px 0 22px; }
.lead { font-size: 1.15rem; color: var(--slate); max-width: 34em; }
.cta-block { margin: 28px 0 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 12px 24px; border-radius: 10px; font-weight: 650; text-decoration: none; font-size: 1.02rem; }
.btn-primary { background: var(--wine); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 10px 24px -14px var(--wine-deep); }
.btn-primary:hover { background: #861a2d; text-decoration: none; }
.pending-note { display: inline-block; margin: 12px 0 0; font-size: .92rem; color: var(--wine-deep); background: var(--wine-wash); padding: 4px 10px; border-radius: 6px; }
.store-live .pending-note { display: none; }
.cta-block .pending-note { display: block; width: fit-content; }
.store-live .cta-block .pending-note { display: none; }
.cta-note { font-size: .95rem; color: var(--slate); margin: 8px 0 6px; }
.link-quiet { color: var(--ink); font-weight: 600; }

/* hero demo: the scored phrase */
.demo { margin: 0; position: relative; padding-top: 74px; }
.echo { position: absolute; inset: 0 -40px auto -10px; display: flex; flex-direction: column; pointer-events: none; user-select: none; }
.echo span { font-family: var(--cjk-serif); font-size: clamp(2.2rem, 4.4vw, 3.4rem); line-height: 1; color: var(--wine); white-space: nowrap; }
.echo span:first-child { opacity: .07; transform: translateX(46px); }
.echo span:last-child { opacity: .13; transform: translateX(22px); margin-top: .02em; }
.demo-ru .echo span { font-family: var(--serif); }
.demo-card { position: relative; background: var(--surface); border: 1px solid var(--rule); border-radius: 16px; padding: 24px 26px 22px; box-shadow: 0 34px 60px -38px rgba(92, 17, 32, .45); }
.demo-meta { display: flex; justify-content: space-between; color: var(--slate); font-size: .88rem; font-variant-numeric: tabular-nums; margin-bottom: 10px; }
.demo-meta span:first-child { color: var(--wine); font-weight: 650; }
.demo-phrase { font-family: var(--cjk-serif); font-size: clamp(1.9rem, 3.4vw, 2.5rem); line-height: 1.5; margin: 0 0 4px; }
.demo-phrase rt { font-family: var(--sans); font-size: .36em; color: var(--slate); letter-spacing: .02em; }
.demo-ru .demo-phrase { font-family: var(--serif); font-size: clamp(1.6rem, 2.8vw, 2.1rem); }
.demo-ru .demo-phrase ruby { margin-right: .1em; }
.demo-tr { color: var(--slate); margin-bottom: 18px; }
.demo-attempt { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; border-top: 1px solid var(--rule); padding-top: 16px; }
.demo-said { font-size: .88rem; color: var(--slate); margin: 0 0 4px; }
.demo-units { font-family: var(--cjk-serif); font-size: 1.6rem; margin: 0; }
.demo-ru .demo-units { font-family: var(--serif); font-size: 1.3rem; }
.u { display: inline-block; padding-bottom: 3px; border-bottom: 3px solid transparent; animation: mark .5s ease-out both; }
.u-ok { color: var(--jade); border-bottom-color: var(--jade); }
.u-slip { color: var(--ochre); border-bottom: 3px dotted var(--ochre); }
.u-punct { color: var(--slate); }
.demo-ru .u { margin-right: .08em; }
.d0 { animation-delay: .5s; } .d1 { animation-delay: .62s; } .d2 { animation-delay: .74s; } .d3 { animation-delay: .86s; }
.d4 { animation-delay: .98s; } .d5 { animation-delay: 1.1s; } .d6 { animation-delay: 1.22s; } .d7 { animation-delay: 1.34s; }
@keyframes mark { from { color: #A7ACB4; border-bottom-color: transparent; } }
.demo-score { margin: 0; text-align: right; white-space: nowrap; animation: rise .5s 1.5s ease-out both; }
.demo-score .num { font-family: var(--serif); font-size: 2.9rem; line-height: 1; color: var(--jade); font-variant-numeric: lining-nums; }
.demo-score .of { color: var(--slate); font-size: .9rem; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.demo-tip { margin: 16px 0 0; padding: 12px 14px; background: var(--paper); border-radius: 10px; font-size: .95rem; animation: rise .5s 1.75s ease-out both; }

/* ---------- section rhythm */
.modes, .library, .who, .start, .pricing, .faq { padding: clamp(56px, 8vw, 104px) 0; }
.library { padding-top: 0; }
.modes { background: var(--surface); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 56px; align-items: end; margin-bottom: 36px; }
.section-head p { color: var(--slate); margin: 0; max-width: 34em; }

/* modes: segmented control mirrors the panel's own tabs */
.seg { display: none; }
.js .seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 4px; background: var(--paper); border: 1px solid var(--rule); border-radius: 12px; margin-bottom: 32px; }
.seg-btn { font: inherit; font-size: .98rem; font-weight: 600; color: var(--slate); background: transparent; border: 0; border-radius: 9px; padding: 9px 20px; cursor: pointer; min-height: 44px; }
.seg-btn:hover { color: var(--ink); }
.seg-btn[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--rule), 0 2px 6px -3px rgba(27, 29, 39, .3); }
.mode-panel { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.mode-panel + .mode-panel { margin-top: 64px; }
.js .mode-panel + .mode-panel { margin-top: 0; }
.js .mode-panel { display: none; }
.js .mode-panel.on { display: grid; }
.mode-text { padding-top: 12px; }
.mode-text h3 { font-size: clamp(1.5rem, 2.4vw, 1.9rem); margin-bottom: 14px; }
.mode-text p { color: var(--slate); font-size: 1.08rem; max-width: 30em; }
.shot img { border-radius: 14px; border: 1px solid var(--rule); background: var(--paper); box-shadow: 0 24px 48px -36px rgba(27, 29, 39, .5); }
.mode-media .shot { max-width: 560px; }

.watch-mock { background: var(--paper); border: 1px solid var(--rule); border-radius: 14px; padding: 14px; max-width: 560px; }
.watch-mock ol { list-style: none; margin: 0; padding: 0; }
.watch-mock li { display: flex; gap: 14px; align-items: flex-start; padding: 14px 14px; border-radius: 10px; color: var(--slate); }
.watch-mock li + li { margin-top: 4px; }
.watch-mock .current { background: var(--surface); color: var(--ink); box-shadow: inset 3px 0 0 var(--wine), 0 0 0 1px var(--rule); }
.watch-mock .ts { font-size: .85rem; font-variant-numeric: tabular-nums; padding-top: .35em; min-width: 2.6em; }
.watch-mock .lines { display: flex; flex-direction: column; flex: 1; }
.watch-mock .zh { font-family: var(--cjk-serif); font-size: 1.3rem; line-height: 1.5; }
.watch-mock .tr { font-size: .95rem; }
.watch-mock .star { color: #C58A00; font-size: 1.1rem; }

/* ---------- library */
.lib-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px 56px; padding-top: clamp(56px, 8vw, 104px); }
.lib-text { display: contents; }
.lib-text h2 { grid-column: 1; }
.lib-text p { grid-column: 2; color: var(--slate); max-width: 34em; }
.shot-wide { grid-column: 1 / -1; margin-top: 16px; }

/* ---------- who */
.who { border-top: 1px solid var(--rule); }
.who-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 24px 56px; }
.who-list { list-style: none; margin: 0; padding: 0; }
.who-list li { padding: 22px 0; border-top: 1px solid var(--rule); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 32px; }
.who-list li:first-child { border-top: 0; padding-top: 4px; }
.who-list p { color: var(--slate); margin: 0; }

/* ---------- steps (a real sequence, so numbered) */
.start { background: var(--paper-2); }
.steps { list-style: none; margin: 36px 0 8px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; counter-reset: step; }
.steps li { counter-increment: step; border-top: 2px solid var(--ink); padding-top: 16px; }
.steps li::before { content: counter(step); display: block; font-family: var(--serif); font-size: 2.6rem; line-height: 1; color: var(--wine); margin-bottom: 14px; }
.steps h3 { font-size: 1.15rem; margin-bottom: 8px; }
.steps p { color: var(--slate); margin: 0; font-size: .98rem; }

/* ---------- privacy band */
.privacy-band { background: var(--wine-deep); color: #F3F5F4; padding: clamp(56px, 8vw, 104px) 0; }
.privacy-band h2 { max-width: 16em; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; margin: 40px 0 28px; }
.facts dt { font-family: var(--serif); font-size: 1.2rem; margin-bottom: 8px; color: #fff; }
.facts dd { margin: 0; color: #F2C9D1; }
.privacy-band a { color: #fff; font-weight: 600; }
.privacy-band :focus-visible { outline-color: #fff; }

/* ---------- pricing */
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 36px; max-width: 880px; }
.plan { border-radius: 16px; padding: 28px; border: 1.5px dashed #A9B0AC; position: relative; }
.plan-now { border: 2px solid var(--wine); background: var(--surface); }
.plan-badge { position: absolute; top: -13px; left: 24px; margin: 0; background: var(--wine); color: #fff; font-size: .85rem; font-weight: 650; padding: 2px 10px; border-radius: 999px; }
.plan h3 { font-size: 1.35rem; }
.price { margin: 10px 0 16px; }
.price .amount { font-family: var(--serif); font-size: 3rem; line-height: 1; }
.price .per { color: var(--slate); }
.plan ul { margin: 0; padding-left: 1.1em; }
.plan li { margin: 6px 0; }
.plan li::marker { color: var(--wine); }

/* ---------- faq */
.faq { border-top: 1px solid var(--rule); }
.faq-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 24px 56px; }
.faq-list details { border-bottom: 1px solid var(--rule); }
.faq-list details:first-child { border-top: 1px solid var(--rule); }
.faq-list summary { cursor: pointer; list-style: none; padding: 18px 40px 18px 0; font-weight: 650; position: relative; font-size: 1.05rem; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: 1.5rem; font-weight: 400; color: var(--wine); }
.faq-list details[open] summary::after { content: "−"; }
.faq-list details p { color: var(--slate); margin: 0 0 20px; max-width: 40em; }

/* ---------- footer */
.site-foot { border-top: 1px solid var(--rule); background: var(--paper-2); padding: 40px 0 48px; font-size: .95rem; }
.foot-grid { display: grid; grid-template-columns: auto 1fr; gap: 16px 40px; align-items: start; }
.foot-brand { display: flex; gap: 10px; align-items: center; }
.foot-brand .mark { width: 30px; height: 30px; }
.foot-brand p { margin: 0; }
.foot-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: flex-end; }
.foot-links a { color: var(--ink); }
.foot-small { grid-column: 1 / -1; color: var(--slate); font-size: .88rem; margin: 8px 0 0; }

/* ---------- document pages (privacy, terms, support, 404) */
.doc { padding: clamp(40px, 6vw, 72px) 0 clamp(56px, 8vw, 96px); }
.doc-wrap { max-width: 800px; }
.doc h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: 20px; color: var(--ink); }
.doc h2 { font-size: 1.45rem; margin: 2.2em 0 .6em; scroll-margin-top: 16px; }
.doc h3 { font-size: 1.15rem; margin: 1.6em 0 .5em; }
.doc ul, .doc ol { padding-left: 1.3em; }
.doc li { margin: .35em 0; }
.doc .lead { font-size: 1.15rem; }
.doc-note { background: var(--wine-wash); color: var(--wine-deep); padding: 10px 14px; border-radius: 8px; }
.doc-back { margin-top: 48px; }
.mail-big { font-family: var(--serif); font-size: clamp(1.15rem, 3vw, 1.6rem); overflow-wrap: anywhere; }
.table-wrap { overflow-x: auto; margin: 16px 0; border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); }
.table-wrap table { border-collapse: collapse; width: 100%; font-size: .95rem; min-width: 560px; }
.table-wrap th, .table-wrap td { padding: 10px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; text-align: left; }
.table-wrap th { background: var(--paper); }
.table-wrap tr:last-child td { border-bottom: 0; }
.trouble dt { font-weight: 700; margin-top: 18px; }
.trouble dd { margin: 4px 0 0; color: var(--slate); }
.nf { text-align: left; }
.nf .mark { width: 56px; height: 56px; margin-bottom: 24px; }
.nf-block { padding: 20px 0; border-top: 1px solid var(--rule); }
.nf-block:first-of-type { border-top: 0; }
.nf .nf-h { font-size: 1.8rem; margin-bottom: 8px; }

/* ---------- responsive */
@media (max-width: 900px) {
  .hero-grid, .section-head, .lib-grid, .who-grid, .faq-grid, .mode-panel { grid-template-columns: minmax(0, 1fr); }
  .lib-text h2, .lib-text p { grid-column: 1; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .demo { max-width: 560px; }
}
@media (max-width: 640px) {
  .head-row { padding-top: 10px; padding-bottom: 6px; }
  .main-nav { order: 3; width: 100%; overflow-x: auto; }
  .main-nav ul { gap: 4px 18px; }
  .brand-sub { display: none; }
  .who-list li { grid-template-columns: minmax(0, 1fr); }
  .plans { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .steps { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .btn { width: 100%; }
  .js .seg { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .seg-btn { padding: 9px 10px; }
  .demo { padding-top: 56px; }
  .demo-card { padding: 20px 18px; }
  .demo-attempt { flex-wrap: wrap; }
  .foot-grid { grid-template-columns: minmax(0, 1fr); }
  .foot-links { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .u, .demo-score, .demo-tip { animation: none; }
}
@media print {
  .site-head nav, .skip, .cta-block, .site-foot .foot-links { display: none; }
  body { background: #fff; }
}
