/* CmdIME landing page. Dark only.
   Radius rule: controls 8px, surfaces 14px. */
:root {
  --bg: #0F1014;
  --surface: #16171C;
  --line: #262830;
  --text: #F4F4F6;
  --muted: #9A9AA5;
  --accent: #4D8CFF;
  --accent-ink: #0F1014;
  --code-bg: #121318;
  --ok: #33A854;
  --r-ctl: 8px;
  --r-surf: 14px;
  --gutter: 16px;
  --max: 1120px;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "PingFang SC", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans CJK SC", "Noto Sans CJK JP", "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}



/* Language visibility: only the active language's copies render. */
html[data-ui="en"] .i-zh, html[data-ui="en"] .i-ja,
html[data-ui="zh-CN"] .i-en, html[data-ui="zh-CN"] .i-ja,
html[data-ui="ja"] .i-en, html[data-ui="ja"] .i-zh { display: none !important; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
code { font-family: var(--mono); font-size: 0.88em; overflow-wrap: anywhere; }
p code, li code, h3 code { background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 0.05em 0.35em; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem); font-weight: 650; letter-spacing: -0.02em; margin-bottom: 28px; }
h3 { font-size: 1.1rem; font-weight: 620; }
p { margin: 0 0 14px; }
figure { margin: 0; }
figcaption { color: var(--muted); font-size: 0.9rem; margin-top: 12px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 768px) { :root { --gutter: 32px; } }

/* Top bar */
.bar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.bar-row { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 650; }
.brand img { border-radius: 6px; }
.bar-nav { display: flex; align-items: center; gap: 16px; }
.langs { display: flex; border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 2px; }
.langs button {
  font: inherit; font-size: 0.82rem; color: var(--muted); background: none; border: 0;
  padding: 4px 10px; border-radius: 6px; cursor: pointer; line-height: 1.4; min-height: 44px; min-width: 44px;
}
.langs button:hover { color: var(--text); }
.langs button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.bar-link { color: var(--text); text-decoration: none; font-size: 0.92rem; }
.bar-link:hover { color: var(--accent); }
@media (max-width: 420px) { .bar-link { display: none; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px; white-space: nowrap;
  font-weight: 600; font-size: 1rem; text-decoration: none;
  padding: 11px 20px; border-radius: var(--r-ctl);
  transition: transform 160ms var(--ease), background-color 160ms var(--ease);
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--text)); }
.btn-quiet { color: var(--text); border: 1px solid var(--line); background: var(--surface); }
.btn-quiet:hover { border-color: var(--accent); }
.ver { color: var(--muted); font-weight: 500; font-size: 0.9rem; }
.ver:empty { display: none; }

/* Hero: see "Hero demo" below */

/* Install */
/* One column: the command gets the full panel width, so it stays on one line on desktop. */
.install-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }
.install-main p { max-width: 64ch; }
.install-alt { border-top: 1px solid var(--line); padding-top: 28px; font-size: 0.95rem; }
.install-alt h3 { margin-bottom: 16px; }
.install-alt p { color: var(--muted); }
.install-alt p code { color: var(--text); }
@media (max-width: 860px) {
  .install-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .install-alt { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 32px; }
}

.code {
  position: relative; display: flex; align-items: flex-start; gap: 12px;
  background: var(--code-bg); border: 1px solid var(--line); border-radius: var(--r-surf);
  padding: 18px 18px 18px 20px; margin: 0 0 24px;
}
.code-hero {
  align-items: center; margin-bottom: 24px; padding: 22px 22px 22px 26px;
  border-color: color-mix(in srgb, var(--accent) 60%, var(--line));
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 10%, transparent);
}
.code.code-hero pre { font-size: clamp(0.8rem, 0.62rem + 0.4vw, 0.92rem); white-space: pre; overflow-x: auto; overflow-wrap: normal; }
.code-hero pre::before { content: "$ "; color: var(--accent); }
.code-hero .copy { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); padding: 7px 16px; }
.code-hero .copy.is-done { background: var(--surface); }
.install h2 { margin-bottom: 20px; }
.code pre { margin: 0; flex: 1; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.95rem; line-height: 1.55; }
.code pre code { font-size: inherit; }
.code-small pre { font-size: 0.86rem; }
.copy {
  flex: none; font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer;
  color: var(--text); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-ctl); padding: 5px 12px; line-height: 1.4;
  transition: transform 160ms var(--ease), border-color 160ms var(--ease);
}
.copy:hover { border-color: var(--accent); }
.copy:active { transform: scale(0.97); }
.copy.is-done { color: var(--ok); border-color: var(--ok); }
.install-facts { color: var(--text); margin-bottom: 20px; max-width: 64ch; }
.code-label { color: var(--muted); font-size: 0.9rem; margin-bottom: 8px; }
.steps { margin: 0 0 18px; padding-left: 1.4em; }
.steps li { margin-bottom: 6px; }
.more { margin: 0 0 14px; }
.more summary { cursor: pointer; font-weight: 600; min-height: 32px; }
.more[open] summary { margin-bottom: 10px; }
.source-link { font-size: 0.95rem; }
.copy { min-width: 6.5em; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[id] { scroll-margin-top: 76px; }

/* Sections */
.art img { border-radius: 0; }
.reasons { list-style: none; padding: 0; margin: 36px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 48px; }
.reasons li { color: var(--muted); }
.reasons strong { display: block; color: var(--text); margin-bottom: 4px; font-size: 1.05rem; }
@media (max-width: 760px) {
  .reasons { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}

/* Features */
.feature { margin-top: 24px; }
.feature + .feature { margin-top: 80px; }
.feature-text h3 { margin-bottom: 8px; }
.feature-text p { color: var(--muted); }
.feature-text p + h3 { margin-top: 24px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 56px; align-items: center; }
.split.reverse { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.narrow { max-width: 62ch; margin-bottom: 24px; }
.shot img { border-radius: var(--r-surf); margin: 0 auto; }
.shot-narrow img { max-width: 520px; width: 100%; }
@media (max-width: 860px) {
  .split, .split.reverse { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .feature + .feature { margin-top: 56px; }
}

/* Troubleshooting */
.trouble > div, .trouble > h3 { max-width: 72ch; }
.trouble h3 { margin-bottom: 14px; }
.trouble ol { padding-left: 1.3em; margin: 0 0 14px; }
.trouble li { margin-bottom: 10px; }
.trouble li code { overflow-wrap: anywhere; }

/* Footer */
.foot { margin-top: 96px; border-top: 1px solid var(--line); padding: 32px 0 48px; color: var(--muted); font-size: 0.92rem; }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }
.foot-name { margin: 0; color: var(--text); font-weight: 600; }
.foot-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; }
.foot a { color: inherit; }
.foot a:hover { color: var(--accent); }

/* ---- Print layer: one ink (the accent), exposed paper, a halftone plate ---- */
/* The app's preset slot palette (SwitchSlots.colors). */
:root {
  --slot-blue: #4D8CFF; --slot-green: #33A854; --slot-red: #E3574A;
  --slot-purple: #9664D8; --slot-orange: #E49B35; --slot-teal: #32A6A8;
  --dot: 9px;
}
.hero h1 { text-wrap: balance; }
.nw { white-space: nowrap; }
.field::before,
.install::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  background-image: radial-gradient(circle, var(--accent) 1.3px, transparent 1.7px);
  background-size: var(--dot) var(--dot);
  opacity: 0.55;
}
.install { position: relative; }
.install::before {
  inset: -10% -10% auto auto; width: 60%; height: 90%;
  -webkit-mask-image: radial-gradient(closest-side at 75% 30%, #000 10%, transparent 100%);
  mask-image: radial-gradient(closest-side at 75% 30%, #000 10%, transparent 100%);
  opacity: 0.4;
}
@media (max-width: 640px) {
  .install::before { width: 80%; height: 40%; }
}

@media (max-width: 640px) {
  .code { flex-direction: column; align-items: stretch; gap: 12px; }
  .code pre { white-space: pre; overflow-x: auto; overflow-wrap: normal; -webkit-overflow-scrolling: touch; padding-bottom: 6px; }
  .code .copy { align-self: flex-end; }
  /* Diagrams stay legible: swipe inside the figure instead of shrinking the text. */
  .art .art-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .art .art-scroll img { width: 720px; max-width: none; }
}
.art img { width: 100%; }

/* ---- Hero demo ---- */
:root {
  --hero-pad-top: 36px;
  --hero-pad-bottom: 56px;
  --hero-gap: 28px;
  --stage-max: 820px;
  --field-font: clamp(1.6rem, 1.1rem + 2vw, 2.6rem);
  --field-min-h: 150px;
  --kb-gap: 10px;          /* between the two rows */
  --kb-key-gap: 8px;       /* between keys in a row */
  --kb-letter: 1fr;        /* each inert letter key in the shift row */
  --kb-space: 8.6fr;       /* the inert spacebar */
  --keycap-h: 62px;
  --kc-radius: 12px;
  /* Keycap drawn like the README art (hero-2.svg): #2F2F37 to #1D1D22, 10% white edge. */
  --kc-top: #2F2F37; --kc-bottom: #1D1D22; --kc-edge: rgb(255 255 255 / 0.10);
  --kc-glyph: #F4F4F6;
  --field-fill: rgb(22 23 28 / 0.84);
  --kb-fill: rgb(22 23 28 / 0.95);   /* labels sit here: the rain must not show through */
}

.hero { position: relative; padding-top: var(--hero-pad-top); padding-bottom: var(--hero-pad-bottom); }
/* Pitch, Install and the demo share one column, so the hero reads as one unit. */
.hero-head { max-width: var(--stage-max); margin: 0 auto; }
.hero h1 { font-size: var(--h1-size); font-weight: 700; letter-spacing: -0.03em; line-height: 1.12; margin-bottom: 14px; }
.hero h1 .muted { color: var(--muted); }
.lede { font-size: clamp(1rem, 0.95rem + 0.3vw, 1.15rem); color: var(--muted); margin: 0; }
.hero-cta { margin: 20px 0 0; }
@media (max-width: 760px) {
  :root { --hero-pad-top: 24px; }
}

/* Field, keyboard and hint form one centred column. */
.stage {
  margin: var(--hero-gap) auto 0; max-width: var(--stage-max);
  display: grid; gap: 16px; justify-items: stretch;
}
.field {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: var(--field-min-h); padding: calc(1.05em + 26px) 28px 30px;
  background: var(--field-fill); border: 1px solid var(--line); border-radius: var(--r-surf);
  font-size: var(--field-font); line-height: 1.25; font-weight: 500; letter-spacing: -0.01em;
  text-align: center; cursor: text; overflow-wrap: anywhere;
}
.field:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
/* Halftone plate centred behind the text: part of what the glass bubble blurs. */
.field::before {
  inset: 0; opacity: 0.35;
  -webkit-mask-image: radial-gradient(closest-side at 50% 70%, #000 0%, transparent 100%);
  mask-image: radial-gradient(closest-side at 50% 70%, #000 0%, transparent 100%);
}
/* Each language segment carries a faint underline in its slot colour. */
.seg {
  text-decoration: underline 2px color-mix(in srgb, var(--seg, transparent) 70%, transparent);
  text-underline-offset: 0.18em; text-decoration-skip-ink: none;
}
.caret {
  display: inline-block; width: 3px; height: 1.1em; margin-left: 2px; vertical-align: -0.16em;
  background: var(--slot, var(--accent)); border-radius: 1px;
}
@media (prefers-reduced-motion: no-preference) {
  .caret { animation: blink 1.06s steps(1) infinite; }
  .field.is-typing .caret { animation: none; }
  @keyframes blink { 50% { opacity: 0; } }
}
.stage-foot { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; }
.replay {
  font: inherit; font-size: 0.88rem; font-weight: 600; cursor: pointer; min-height: 36px;
  color: var(--text); background: var(--kb-fill); border: 1px solid var(--line);
  border-radius: var(--r-ctl); padding: 6px 14px;
}
.replay:hover { border-color: var(--accent); }
.replay[hidden] { display: none; }
.field { cursor: default; }
/* The hint sits on its own backing so the rain never crosses it. */
.stage-hint {
  justify-self: center; margin: 0; padding: 4px 12px; border-radius: var(--r-ctl);
  background: var(--kb-fill); color: var(--muted); font-size: 0.92rem; text-align: center;
  text-wrap: balance;
}

/* Miniature Mac keyboard: the shift row, then option, command, space, command, option,
   on a solid chassis so the rain stays behind it. */
.kb {
  display: grid; gap: var(--kb-gap); padding: 12px 12px 8px;
  background: var(--kb-fill); border: 1px solid var(--line); border-radius: var(--r-surf);
}
.kb-row { display: grid; gap: var(--kb-key-gap); align-items: start; }
.kb-row-shift { grid-template-columns: 2.4fr repeat(10, var(--kb-letter)) 2.6fr; }
.kb-row-bottom { grid-template-columns: 1.4fr 1.8fr var(--kb-space) 1.8fr 1.4fr; }
.keycap {
  --slot: var(--accent);
  font: inherit; color: var(--text); background: none; border: 0; padding: 0; cursor: pointer;
  display: grid; gap: 6px; min-width: 0;
}
.kc-cap {
  height: var(--keycap-h); width: 100%;
  display: grid; grid-template: "key key" auto ". tile" 1fr / 1fr auto; align-items: end; padding: 7px 8px;
  background: linear-gradient(var(--kc-top), var(--kc-bottom));
  border: 1px solid var(--kc-edge); border-radius: var(--kc-radius);
  box-shadow: 0 2px 0 rgb(0 0 0 / 0.35);
  transition: transform 120ms var(--ease), box-shadow 120ms var(--ease), border-color 160ms var(--ease);
}
.kc-glyph { display: none; }
.kc-key { grid-area: key; align-self: start; text-align: left; font-size: 0.72rem; font-weight: 600; line-height: 1.2; color: var(--kc-glyph); opacity: 0.85; }
.kc-tile {
  grid-area: tile; display: grid; place-items: center;
  min-width: 24px; height: 24px; padding: 0 5px; border-radius: 6px;
  background: var(--slot); color: #FFFFFF; font-size: 0.78rem; font-weight: 700; line-height: 1;
}
.kc-name {
  display: block; text-align: center; white-space: nowrap;
  font-size: 0.82rem; font-weight: 600; color: var(--muted);
}
.kb-blank .kc-cap { background: var(--kc-bottom); box-shadow: none; }
.keycap:hover .kc-cap { border-color: color-mix(in srgb, var(--slot) 55%, transparent); }
.keycap:active .kc-cap, .keycap.is-pressed .kc-cap { transform: translateY(2px); box-shadow: 0 0 0 rgb(0 0 0 / 0.35); }
.keycap.is-active .kc-cap { border-color: var(--slot); box-shadow: 0 2px 0 rgb(0 0 0 / 0.35), inset 0 -3px 0 var(--slot); }
.keycap.is-active .kc-name { color: var(--text); }
@media (max-width: 760px) {
  :root {
    --field-min-h: 116px; --kb-gap: 8px; --kb-key-gap: 5px;
    --kb-letter: 0.35fr; --kb-space: 2fr; --keycap-h: 50px; --kc-radius: 9px;
  }
  .field { padding: calc(1.05em + 20px) 16px calc(1.05em + 18px); }
  .kb { padding: 8px 6px 6px; }
  .kc-cap { padding: 5px 6px; }
  .kc-key { font-size: 0.6rem; }
  .kc-tile { min-width: 20px; height: 20px; padding: 0 3px; font-size: 0.68rem; border-radius: 5px; }
  .kc-name { font-size: 0.7rem; }
}
/* Phones: the six caps as a 3 x 2 grid, left-hand keys first, no decorative keys. */
@media (max-width: 480px) {
  .kb { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 8px; padding: 10px; }
  .kb-row { display: contents; }
  .kb-blank { display: none; }
  .keycap[data-slot="5"] { order: 1; } .keycap[data-slot="3"] { order: 2; } .keycap[data-slot="0"] { order: 3; }
  .keycap[data-slot="1"] { order: 4; } .keycap[data-slot="4"] { order: 5; } .keycap[data-slot="2"] { order: 6; }
  :root { --keycap-h: 52px; }
  .kc-cap { grid-template: "key tile" 1fr / 1fr auto; align-items: center; padding: 6px 8px; }
  .kc-key { align-self: center; font-size: 0.75rem; }
  .kc-name { font-size: 0.8125rem; }
}

/* ---- Page-wide glyph field (rain.js). Content sits above it. ---- */
.glyph-field { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
main, .foot { position: relative; z-index: 1; }

/* ---- Switch bubble, Liquid Glass theme ----
   Proportions from the app: BuiltInIndicatorThemes.liquidGlass (radius 16, inset 9, no
   wash, no drawn highlight) and BubbleMetrics.Base (tile 32, title 13, key shadow 18/8):
   a one-line bubble is 50 pt tall, the tile is 64% of it, the radius 32%. Here the whole
   bubble is sized in em of the typed text, so it stays a small hint next to the caret:
   about 1em tall, tile 0.64em, label 0.57em. BubbleChrome gives the separation hairline
   and highlight; BubbleInks the text colours. The system material is approximated with
   backdrop-filter; this is a web approximation, not Apple's NSGlassEffectView. */
.glass-bubble {
  --slot: var(--slot-blue);
  --gb-fill: rgb(30 30 34 / 0.30);          /* #1E1E22 */
  --gb-solid: #1E1E22;
  --gb-title: #FFFFFF;
  --gb-edge: rgb(255 255 255 / 0.16);       /* strokeOpacity 0.16 */
  --gb-sep: rgb(0 0 0 / 0.32);              /* darkSeparation */
  --gb-light: rgb(255 255 255 / 0.34);      /* darkHighlight, the material's top edge */
  --gb-shadow: rgb(0 0 0 / 0.30);           /* darkKeyShadow 0.50 x shadowStrength 0.6 */
  position: absolute; left: 0; top: 0; z-index: 2;
  display: inline-flex; align-items: center; gap: 0.15em;
  padding: 0.16em 0.27em 0.16em 0.16em;
  border-radius: 0.31em;
  background: var(--gb-fill);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid var(--gb-edge);
  box-shadow:
    inset 0 1px 0 var(--gb-light),
    0 0 0 0.5px var(--gb-sep),
    0 0.16em 0.36em var(--gb-shadow);
  font-size: 1em; font-weight: 400; letter-spacing: 0; line-height: 1;
  opacity: 0; transform: scale(0.94); transform-origin: 50% 100%;
  pointer-events: none; white-space: nowrap;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass-bubble { background: var(--gb-solid); }
}
@media (prefers-reduced-transparency: reduce) {
  .glass-bubble { background: var(--gb-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
.glass-bubble.is-shown { opacity: 1; transform: none; }
@media (prefers-reduced-motion: no-preference) {
  .glass-bubble { transition: opacity 180ms var(--ease), transform 260ms var(--ease); }
}
/* The tile's own font is 0.34em of the bubble, so 1.88em here is 0.64em of the bubble
   and 0.44em is the concentric radius (0.31em minus the 0.16em inset). */
.gb-tile {
  display: grid; place-items: center; flex: none;
  font-size: 0.34em; font-weight: 700; min-width: 1.88em; height: 1.88em; padding: 0 0.24em;
  border-radius: 0.44em;
  background: var(--slot); color: #FFFFFF;
  box-shadow: inset 0 0 0 0.5px rgb(255 255 255 / 0.18);
}
.gb-text { display: grid; }
.gb-title { font-size: 0.57em; font-weight: 600; color: var(--gb-title); line-height: 1.2; }

/* ---- Promo video ---- */
.promo { margin-top: 36px; }
.promo video {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9;
  border-radius: var(--r-surf); border: 1px solid var(--line); background: #0F1014;
}

/* ---- Round 3: type scale, measure and line breaks ---- */
:root {
  --h1-size: clamp(2rem, 1.25rem + 2.6vw, 3.1rem);
  --measure: 65ch;          /* Latin reading paragraphs */
  --measure-cjk: 38em;      /* about 36-40 ideographs per line */
  --panel-pad: clamp(22px, 4.2vw, 52px);
  --panel-gap: clamp(28px, 4vw, 44px);
  --panel-radius: 24px;
}
.nw { white-space: nowrap; }
/* CJK: strict punctuation rules (no line starts with 。、」), phrase-aware breaks in Japanese. */
:lang(ja) { line-break: strict; word-break: auto-phrase; }
:lang(zh-CN) { line-break: strict; }
main :is(p, li, figcaption) { max-width: var(--measure); }
html[data-ui="zh-CN"] main :is(p, li, figcaption),
html[data-ui="ja"] main :is(p, li, figcaption) { max-width: var(--measure-cjk); }
.stage-hint { max-width: 36em; }
@media (max-width: 480px) {
  :root { --h1-size: clamp(1.75rem, 7vw, 2rem); }
  .hero h1 { line-height: 1.15; }
}

/* ---- One glass sheet below the hero ----
   The page reads as one continuous surface: a single translucent sheet over the faint
   ambient glyph layer holds every section. Sections have no box of their own; headings
   and spacing separate them. One container level per block: diagrams are frameless,
   code and media keep a plain surface without borders. The sheet edge is only a faint
   top highlight. Moderate blur, only on the sheet; the page background is not blurred. */
.sheet {
  --sheet-fill: rgb(22 23 28 / 0.58);
  --sheet-solid: #16171C;
  --sheet-light: rgb(255 255 255 / 0.07);
  position: relative;
  width: min(var(--max), calc(100% - 2 * var(--gutter)));
  margin: 0 auto;
  border-radius: var(--panel-radius);
  background: var(--sheet-fill);
  -webkit-backdrop-filter: blur(10px) saturate(150%);
  backdrop-filter: blur(10px) saturate(150%);
  box-shadow: inset 0 1px 0 var(--sheet-light), 0 30px 80px rgb(0 0 0 / 0.25);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .sheet { background: var(--sheet-solid); }
}
@media (prefers-reduced-transparency: reduce) {
  .sheet { background: var(--sheet-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
/* Every section: same left edge, same width, same rhythm. */
.sheet > .panel { padding: var(--section-space) var(--panel-pad) 0; }
.sheet > .panel:last-child { padding-bottom: var(--section-space); }
.sheet > .panel:first-child { padding-top: var(--panel-pad); }
.panel > h2:first-child { margin-top: 0; }

/* No sub-block borders: surfaces only where the content needs one. */
.code { border: 0; }
.code-hero { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent); }
p code, li code, h3 code { border: 0; }
.install-alt { border-top: 0; padding-top: 8px; }
.install::before { display: none; }
.promo video { border: 0; }
.foot { border-top: 0; }

:root { --section-space: clamp(56px, 7vw, 96px); }
@media (max-width: 760px) {
  :root { --panel-radius: 18px; }
}

/* Reduced motion: the Play demo button is the visible way to see the story. */
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.play-demo { font: inherit; font-weight: 600; cursor: pointer; }
.play-demo[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) {
  .kc-cap, .btn, .copy { transition: none; }
}

/* ---- Structure below the hero ----
   One content column (1040px, centred, 32px side padding; 16px on phones). Everything
   starts at its left edge; nothing below the hero is centred except inside a diagram.
   Figures (diagrams, video, screenshots) sit on a quiet surface so they read as part
   of their section; text stays on the sheet. */
:root {
  --col-max: 1040px;
  --col-pad: 32px;
  --section-space: 120px;
  --head-gap: 32px;
  --block-gap: 32px;
  --figure-fill: rgb(255 255 255 / 0.035);
  --figure-pad: 20px;
}
@media (max-width: 760px) {
  :root { --col-pad: 16px; --section-space: 72px; --figure-pad: 12px; }
}
.sheet { width: min(calc(var(--col-max) + 2 * var(--col-pad)), calc(100% - 2 * var(--gutter))); }
@media (max-width: 760px) { .sheet { width: 100%; border-radius: 0; } }
.sheet > .panel { padding: var(--section-space) var(--col-pad) 0; }
.sheet > .panel:first-child { padding-top: 56px; }
.sheet > .panel:last-child { padding-bottom: var(--section-space); }
.sheet h2 { margin: 0 0 var(--head-gap); }
.sheet figure { margin: 0; }
.sheet figcaption { text-align: left; margin: 10px 0 0; max-width: none; }

/* Figures: full column width on a quiet surface, caption directly under, left-aligned. */
.sheet .art, .sheet .promo, .sheet .shot {
  background: var(--figure-fill); border-radius: 16px; padding: var(--figure-pad);
}
.sheet .art img, .sheet .promo video { width: 100%; }
.sheet .promo { margin-top: var(--block-gap); }
.sheet .promo video { border-radius: 10px; }
.sheet .shot img { margin: 0; border-radius: 10px; }
.shot-narrow img { max-width: 100%; }

/* Why: the reasons as an even grid of text blocks, no borders. */
.reasons { margin: var(--block-gap) 0 0; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 48px; }
@media (max-width: 760px) { .reasons { grid-template-columns: minmax(0, 1fr); gap: 24px; } }

/* Features: text | image rows, top aligned, both columns filled. */
.feature { margin-top: 0; }
.feature + .feature { margin-top: 48px; }
.split, .split.reverse { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; align-items: start; }
.wide .narrow { max-width: var(--measure); margin-bottom: 24px; }
@media (max-width: 860px) {
  .split, .split.reverse { grid-template-columns: minmax(0, 1fr); gap: 24px; }
}
.feature-text p { max-width: none; }

/* Install and help: text blocks at the same left edge. */
.install-grid { gap: var(--block-gap); }
.trouble > div, .trouble > h3 { max-width: none; }
/* Phones: diagrams keep a legible size and scroll sideways inside their surface. */
@media (max-width: 640px) {
  .sheet .art .art-scroll img { width: 720px; max-width: none; }
}
/* English only: avoid one-word last lines. CJK keeps plain strict wrapping. */
html[data-ui="en"] main :is(p, li, figcaption) { text-wrap: pretty; }
/* The web screenshots carry only the window (README frame cropped off); their corners
   match the window radius so the figure surface stays the only container. */
.sheet .shot img { border-radius: 16px; }
