/* Live Subtitles — product site.
   The subtitle is the hero; the six keyword colours are the only accents. */

/* ---------- tokens: light (default) ---------- */
:root {
  --bg: #f5f6f8;
  --bg-tint: #eceff3;
  --surface: #ffffff;
  --ink: #161a22;
  --muted: #5e6573;
  --line: #e1e5ea;
  --btn: #161a22;
  --btn-ink: #ffffff;
  --focus: #3b6fd8;
  /* keyword colours, light variants (1st orange, 2nd red, ...) */
  --k0: #d46a00; --k1: #d62839; --k2: #7a4fd6; --k3: #13915a; --k4: #a07b00; --k5: #c02687;
  --shadow: 0 1px 2px rgba(22, 26, 34, .05), 0 24px 60px -24px rgba(22, 26, 34, .25);
  color-scheme: light;
}
/* ---------- dark (system choice, unless the visitor picked light) ---------- */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --bg: #0f131b; --bg-tint: #131824; --surface: #161c28; --ink: #e8ecf3; --muted: #98a1b2; --line: #232b3a;
    --btn: #e8ecf3; --btn-ink: #0f131b; --focus: #8fb4ff;
    --k0: #ff9f1c; --k1: #ff5a5f; --k2: #b48cff; --k3: #4fd68b; --k4: #f7d046; --k5: #ff7ac8;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 30px 80px -30px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
html[data-theme="dark"] {
  --bg: #0f131b; --bg-tint: #131824; --surface: #161c28; --ink: #e8ecf3; --muted: #98a1b2; --line: #232b3a;
  --btn: #e8ecf3; --btn-ink: #0f131b; --focus: #8fb4ff;
  --k0: #ff9f1c; --k1: #ff5a5f; --k2: #b48cff; --k3: #4fd68b; --k4: #f7d046; --k5: #ff7ac8;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 30px 80px -30px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.6 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "SF Pro Text", "Helvetica Neue",
        "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
html:lang(zh-TW) body { font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Microsoft JhengHei UI", "PingFang TC", "Noto Sans CJK TC", sans-serif; }
html:lang(ja) body { font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Yu Gothic UI", "Hiragino Sans", "Noto Sans CJK JP", sans-serif; }
html:lang(ko) body { font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans CJK KR", sans-serif; }
h1, h2, h3 { margin: 0; color: var(--ink); font-family: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "SF Pro Display", inherit; }
html:lang(zh) h1, html:lang(zh-TW) h1, html:lang(ja) h1, html:lang(ko) h1,
html:lang(zh) h2, html:lang(zh-TW) h2, html:lang(ja) h2, html:lang(ko) h2 { font-family: inherit; letter-spacing: 0; }
p { margin: 0; }
a { color: inherit; }
img, svg { display: block; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -48px; background: var(--btn); color: var(--btn-ink); padding: 8px 14px; border-radius: 8px; z-index: 20; }
.skip:focus { top: 12px; }
.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 86%, transparent);
       backdrop-filter: saturate(160%) blur(16px); -webkit-backdrop-filter: saturate(160%) blur(16px);
       border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.nav-row { display: flex; align-items: center; gap: 28px; height: 60px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 650; font-size: 16px; letter-spacing: -.01em; }
.logo.small { font-size: 14px; gap: 8px; }
.links { display: flex; gap: 24px; }
.links a { text-decoration: none; color: var(--muted); font-size: 14.5px; }
.links a:hover { color: var(--ink); }
.nav-end { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.lang select { appearance: none; background: transparent; color: var(--ink); border: 1px solid var(--line); border-radius: 999px;
               padding: 6px 30px 6px 14px; font: inherit; font-size: 13.5px; cursor: pointer;
               background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
               background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.lang select option { color: #161a22; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--line);
            background: transparent; color: var(--ink); cursor: pointer; }
.icon-btn:hover { background: var(--surface); }
.i-moon { display: none; }
html[data-theme="dark"] .i-sun { display: none; }
html[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .i-sun { display: none; }
  html:not([data-theme="light"]) .i-moon { display: block; }
}

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border-radius: 999px; padding: 13px 24px;
       font: inherit; font-size: 15.5px; font-weight: 600; text-decoration: none; border: 1px solid transparent; cursor: pointer;
       transition: transform .15s ease, background-color .15s ease; }
.btn.small { padding: 7px 16px; font-size: 13.5px; }
.btn.block { width: 100%; }
.btn.primary { background: var(--btn); color: var(--btn-ink); }
.btn.primary:hover { transform: translateY(-1px); }
.btn.ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn.ghost:hover { background: var(--surface); }
.btn[aria-disabled="true"] { opacity: .4; pointer-events: none; }
.btn .size { font-weight: 450; opacity: .65; font-size: .88em; }

/* ---------- hero ---------- */
.hero { padding: 104px 0 56px; }
.hero h1 { font-size: clamp(40px, 6.2vw, 74px); line-height: 1.04; font-weight: 700; letter-spacing: -.035em; max-width: 17ch; text-wrap: balance; }
html:lang(zh) .hero h1, html:lang(zh-TW) .hero h1, html:lang(ja) .hero h1, html:lang(ko) .hero h1 { max-width: 15em; line-height: 1.15; letter-spacing: 0; }
.lead { margin-top: 26px; font-size: clamp(17px, 1.6vw, 20px); color: var(--muted); max-width: 56ch; line-height: 1.55; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.trust { margin-top: 20px; font-size: 14px; color: var(--muted); }

/* ---------- the stage (always dark, like a screen) ---------- */
.stage-wrap { padding-bottom: 24px; }
.stage {
  --s-bg: #0b0f16; --s-ink: #f4f6fa; --s-tgt: #8fdcf0; --s-muted: #7e889a;
  --k0: #ff9f1c; --k1: #ff5a5f; --k2: #b48cff; --k3: #4fd68b; --k4: #f7d046; --k5: #ff7ac8;
  position: relative; border-radius: 22px; overflow: hidden; color: var(--s-ink);
  background: radial-gradient(120% 90% at 50% 0%, #1a2232 0%, var(--s-bg) 62%);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, .06); padding: 28px clamp(20px, 4vw, 56px) 22px; min-height: 380px;
  display: flex; flex-direction: column;
}
.stage-meta { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--s-muted); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--k1); box-shadow: 0 0 0 4px rgba(255, 90, 95, .16); }
.playing .live-dot { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.caption { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 36px 0 30px; max-width: 920px; }
.cap-src { font-size: clamp(22px, 2.6vw, 32px); font-weight: 600; line-height: 1.32; letter-spacing: -.01em; min-height: 2.64em; }
.cap-tgt { margin-top: 12px; font-size: clamp(19px, 2.2vw, 27px); line-height: 1.45; color: var(--s-tgt); min-height: 1.45em; }
.cap-tgt:lang(zh) { font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", sans-serif; }
.cap-tgt:lang(zh-TW) { font-family: "Microsoft JhengHei UI", "PingFang TC", "Noto Sans CJK TC", sans-serif; }
.cap-tgt:lang(ja) { font-family: "Yu Gothic UI", "Hiragino Sans", "Noto Sans CJK JP", sans-serif; }
.cap-tgt:lang(ko) { font-family: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans CJK KR", sans-serif; }
.stage-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
             border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 18px; }
.tabs { display: flex; gap: 4px; }
.tabs button { border: 0; background: transparent; color: var(--s-muted); font: inherit; font-size: 14px; padding: 6px 12px;
               border-radius: 999px; cursor: pointer; }
.tabs button:hover { color: var(--s-ink); }
.tabs button[aria-selected="true"] { background: rgba(255, 255, 255, .1); color: var(--s-ink); }
.player { display: flex; align-items: center; gap: 14px; }
.time { font-size: 13px; color: var(--s-muted); font-variant-numeric: tabular-nums; min-width: 2.6em; text-align: right; }
.progress { width: 140px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .12); overflow: hidden; }
#demo-progress { height: 100%; width: 0; background: var(--s-ink); }
.play { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 9px 16px; cursor: pointer;
        background: var(--s-ink); color: #0b0f16; font: inherit; font-size: 14px; font-weight: 600; }
.play svg { width: 15px; height: 15px; fill: currentColor; stroke: none; }
.stage-note { margin-top: 14px; font-size: 14px; color: var(--muted); max-width: 72ch; }

/* keyword colours: the n-th difficult word of a sentence and its translation */
.t0 { color: var(--k0); } .t1 { color: var(--k1); } .t2 { color: var(--k2); }
.t3 { color: var(--k3); } .t4 { color: var(--k4); } .t5 { color: var(--k5); }

/* ---------- sections ---------- */
.section { padding: 112px 0; }
.section.tint { background: var(--bg-tint); }
.section h2 { font-size: clamp(30px, 3.6vw, 44px); line-height: 1.1; font-weight: 700; letter-spacing: -.025em; }
.sub { margin-top: 14px; color: var(--muted); max-width: 60ch; }

.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; align-items: start; }
.statement { position: sticky; top: 100px; }
.features { margin: 0; }
.features > div { padding: 22px 0; border-top: 1px solid var(--line); }
.features > div:last-child { border-bottom: 1px solid var(--line); }
.features dt { display: flex; align-items: center; gap: 12px; font-weight: 650; font-size: 18px; }
.features dd { margin: 6px 0 0 22px; color: var(--muted); }
.k { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.k0 { background: var(--k0); } .k1 { background: var(--k1); } .k2 { background: var(--k2); }
.k3 { background: var(--k3); } .k4 { background: var(--k4); } .k5 { background: var(--k5); }

.flow { list-style: none; padding: 0; margin: 48px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; position: relative; }
.flow::before { content: ""; position: absolute; top: 17px; left: 18px; right: 18px; height: 1px; background: var(--line); }
.flow li { position: relative; }
.node { position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
        background: var(--btn); color: var(--btn-ink); font-weight: 650; font-size: 14px; }
.flow h3 { margin-top: 18px; font-size: 19px; }
.flow p { margin-top: 6px; color: var(--muted); max-width: 34ch; }

.downloads { margin-top: 44px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.dl { display: flex; flex-direction: column; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 26px; }
.dl.mine { border-color: var(--ink); box-shadow: var(--shadow); }
.dl h3 { display: flex; align-items: center; gap: 10px; font-size: 19px; }
.req { font-size: 14px; }
.steps { font-size: 13.5px; color: var(--muted); flex: 1; }
.sum summary { cursor: pointer; font-size: 12.5px; color: var(--muted); list-style: none; }
.sum summary::-webkit-details-marker { display: none; }
.sha { display: block; margin-top: 6px; word-break: break-all; font-size: 11.5px; color: var(--muted); }
.docker { margin-top: 18px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 28px; align-items: center;
          border: 1px solid var(--line); border-radius: 18px; padding: 26px; }
.docker h3 { font-size: 19px; }
.docker p { margin-top: 6px; color: var(--muted); font-size: 15px; }
.cmds { display: grid; gap: 10px; }
.cmd { display: flex; align-items: center; gap: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 9px 10px 9px 14px; }
.cmd code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; font-size: 13.5px; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }
.copy { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 12.5px; cursor: pointer; }

.faq { margin-top: 40px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; }
.faq details { border-top: 1px solid var(--line); padding: 18px 0; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin-top: 10px; color: var(--muted); }

.foot { padding: 40px 0 56px; border-top: 1px solid var(--line); font-size: 14px; }
.foot-row { display: grid; gap: 8px; }

/* static hosting (no live server): hide what needs one */
html.static .app-only { display: none !important; }
html:not(.static) .static-only { display: none !important; }

/* ---------- responsive ---------- */
@media (max-width: 920px) {
  .split { grid-template-columns: 1fr; gap: 28px; }
  .statement { position: static; }
  .downloads, .flow, .faq { grid-template-columns: 1fr; }
  .flow::before { display: none; }
  .docker { grid-template-columns: 1fr; }
  .links { display: none; }
}
@media (max-width: 560px) {
  .hero { padding: 64px 0 36px; }
  .section { padding: 76px 0; }
  .nav-end .btn { display: none; }
  .stage { min-height: 320px; border-radius: 16px; }
  .progress { width: 80px; }
  .play span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .playing .live-dot { animation: none; }
  .btn { transition: none; }
}
