/* TypeMacX — top page, part 2 (loaded after style.css and keyboard.css).
   1. The desktop theatre, the "どのアプリでも" section: a Mac desktop "screen"
      in a frame, with a heading above it.
      Base styles = static sequence (no JS / reduced motion).
      html.theater = the screen pins under the site header and is scrubbed by
      scroll (set by home.js).
   2. The sections after it: feature tiles, privacy, requirements. Pricing,
      FAQ and the final call to action use the shared components in style.css.
   The first screen and the comparison section are keyboard.css.
   The screen and its windows are an illustration, so the --t-* tokens are
   the same in light and dark. Everything after the screen uses the shared,
   themed tokens. */

:root {
  /* the frame that holds the screen (continues the header bar) */
  --frame: 10px;
  --t-frame: linear-gradient(90deg, #3a68e8 0%, #5446e0 50%, #783ad6 100%);
  --t-screen-r: 18px;
  --t-screen-edge: rgba(255, 255, 255, 0.3);

  /* wallpaper */
  --t-wall-a: #4f8bff;
  --t-wall-b: #6659f5;
  --t-wall-c: #9a3fe6;
  --t-wall-hi: rgba(150, 196, 255, 0.62);
  --t-wall-hi-2: rgba(120, 132, 255, 0.6);
  --t-wall-hi-3: rgba(196, 120, 255, 0.5);
  --t-wall-lo: rgba(60, 28, 170, 0);
  --t-wall-shade: rgba(28, 12, 96, 0.62);
  --t-wall-shade-0: rgba(28, 12, 96, 0);
  --t-wall-glow: rgba(95, 242, 255, 0.3);
  --t-wall-glow-0: rgba(95, 242, 255, 0);

  /* on-wallpaper ink */
  --t-on: #ffffff;
  --t-on-2: rgba(255, 255, 255, 0.78);
  --t-on-3: rgba(255, 255, 255, 0.5);
  --t-on-line: rgba(255, 255, 255, 0.26);
  --t-on-fill: rgba(255, 255, 255, 0.16);
  --t-on-shadow: rgba(26, 10, 92, 0.42);
  --t-bar: rgba(255, 255, 255, 0.2);
  --t-bar-line: rgba(255, 255, 255, 0.22);
  --t-bar-shadow: rgba(24, 10, 80, 0.18);
  --t-bar-solid: rgba(86, 84, 236, 0.78);

  /* windows */
  --t-win: #fcfcfe;
  --t-win-2: #f3f3f8;
  --t-win-3: #e9e9f1;
  --t-win-line: rgba(22, 16, 60, 0.1);
  --t-win-line-2: rgba(22, 16, 60, 0.06);
  --t-win-edge: rgba(20, 8, 70, 0.28);
  --t-win-hi: rgba(255, 255, 255, 0.9);
  --t-sh-1: rgba(22, 8, 84, 0.2);
  --t-sh-2: rgba(22, 8, 84, 0.26);
  --t-sh-3: rgba(22, 8, 84, 0.42);
  --t-veil: #4a34c4;
  --t-ink: #1d1b2c;
  --t-ink-2: #55536a;
  --t-ink-3: #8f8da3;
  --t-ink-4: #bdbccb;
  --t-sk: #e3e3ec;
  --t-bubble: #ecebfb;
  --t-en: #3d37d6;
  --t-en-bg: rgba(91, 110, 255, 0.13);
  --t-raw: #6d6b82;
  --t-miss: #c2410c;
  --t-code-kw: #8a3fd9;
  --t-code-fn: #2563c9;
  --t-code-cm: #6f8f7a;
  --t-code-st: #0f7f6b;
  --t-ind: rgba(255, 255, 255, 0.94);
  --t-ind-ink: #2a2470;
  --t-cur-line: rgba(91, 110, 255, 0.07);
  --t-term-pr: #2563c9;
  --t-term-ps: #8a3fd9;
  --t-key: #ffffff;
  --t-key-2: #eeeef5;
  --t-key-edge: rgba(22, 16, 60, 0.2);
  --t-hud: rgba(255, 255, 255, 0.96);


  --win-w: 53.4;   /* window size in em (1em = 13.5px x scale) */
  --win-h: 33;
  --ws: 1;
  --cam: 0;
}

/* ------------------------------------------------------------------ */
/* Section heading (on the frame) and the stage: wallpaper + menu bar  */
/* ------------------------------------------------------------------ */
.track { position: relative; background: var(--t-frame); padding-bottom: var(--frame); color: var(--t-on); --focus: var(--brand-cyan); }
.track i { font-style: normal; }
.track-head { padding: clamp(48px, 7vw, 84px) var(--pad) clamp(28px, 4vw, 44px); text-align: center; }
.track-head h2 { font-size: var(--fs-h2); line-height: 1.25; text-shadow: 0 2px 30px var(--t-on-shadow); }
.track-head p { margin-top: var(--s-3); font-size: var(--fs-lead); font-weight: 600; line-height: 1.7; color: var(--t-on-2); text-wrap: balance; }
.stage {
  position: relative;
  margin: 0 var(--frame);
  border-radius: var(--t-screen-r);
  box-shadow: 0 0 0 1px var(--t-screen-edge), 0 18px 40px -18px var(--t-on-shadow);
  color: var(--t-on);
  background: linear-gradient(140deg, var(--t-wall-a) 0%, var(--t-wall-b) 46%, var(--t-wall-c) 100%);
  overflow: clip;
  isolation: isolate;
  padding-bottom: 88px;
}
.wall {
  position: sticky; top: 0; z-index: -1; overflow: hidden; pointer-events: none;
  height: 100vh; height: 100lvh; margin-bottom: -100vh; margin-bottom: -100lvh;
}
.wl { position: absolute; display: block; border-radius: 50%; }
.wl1 {
  width: 170vmax; height: 170vmax; left: calc(8vw - 85vmax); top: 50vh;
  background: radial-gradient(closest-side, var(--t-wall-lo) 64%, var(--t-wall-hi) 100%);
  transform: translate3d(calc(var(--cam) * -1.2vw), 0, 0);
}
.wl2 {
  width: 150vmax; height: 150vmax; left: calc(88vw - 75vmax); top: 60vh;
  background: radial-gradient(closest-side, var(--t-wall-lo) 66%, var(--t-wall-hi-2) 100%);
  transform: translate3d(calc(var(--cam) * -2.4vw), 0, 0);
}
.wl3 {
  width: 190vmax; height: 190vmax; left: calc(46vw - 95vmax); top: 76vh;
  background: radial-gradient(closest-side, var(--t-wall-lo) 72%, var(--t-wall-hi-3) 100%);
  transform: translate3d(calc(var(--cam) * -4vw), 0, 0);
}
.wl4 {
  width: 180vmax; height: 180vmax; left: calc(24vw - 90vmax); top: calc(20vh - 180vmax);
  background: radial-gradient(closest-side, var(--t-wall-lo) 70%, var(--t-wall-hi) 100%);
  opacity: 0.5;
  transform: translate3d(calc(var(--cam) * -0.7vw), 0, 0);
}
.w-glow {
  position: absolute; right: -14vmax; top: -30vmax; width: 70vmax; height: 70vmax;
  background: radial-gradient(closest-side, var(--t-wall-glow), var(--t-wall-glow-0));
}
.w-shade {
  position: absolute; left: 0; right: 0; top: 0; height: 100%;
  background: linear-gradient(180deg, var(--t-wall-shade-0) 44%, var(--t-wall-shade) 100%);
}

.menubar {
  position: sticky; top: var(--header-h); z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  height: 36px; padding: 0 18px;
  font: 500 13.5px/1 var(--f-ui);
  color: var(--t-on);
  background: var(--t-bar);
  border-bottom: 1px solid var(--t-bar-line);
  box-shadow: 0 8px 30px var(--t-bar-shadow);
  -webkit-backdrop-filter: blur(26px) saturate(1.5);
  backdrop-filter: blur(26px) saturate(1.5);
  text-shadow: 0 1px 1px var(--t-bar-shadow);
  white-space: nowrap;
}
/* static sequence: windows scroll under the bar, so it needs its own tint */
html:not(.theater) .menubar { background: var(--t-bar-solid); }
.mb-l, .mb-r { display: flex; align-items: center; gap: 20px; min-width: 0; }
.mb-r { gap: 16px; }
.mb-mark {
  width: 13px; height: 13px; border-radius: 4px; background: var(--t-on);
  transform: rotate(45deg) scale(0.86); opacity: 0.95;
}
.mb-app { font-weight: 700; }
.mb-keys { color: var(--t-on-2); font-variant-numeric: tabular-nums; font-size: 12.5px; }
.mb-keys span { display: inline-block; min-width: 1.6em; text-align: right; color: var(--t-on); }
.mb-clock { font-variant-numeric: tabular-nums; }
.mb-batt {
  position: relative; width: 25px; height: 12px; border-radius: 3.5px;
  border: 1px solid var(--t-on-2); padding: 1.5px;
}
.mb-batt i { display: block; width: 78%; height: 100%; border-radius: 1.5px; background: var(--t-on); }
.mb-batt::after {
  content: ""; position: absolute; right: -3.5px; top: 3px; width: 2px; height: 4px;
  border-radius: 0 1.5px 1.5px 0; background: var(--t-on-2);
}

/* the star: the input-source indicator */
.ind {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  height: 26px; padding: 0 11px 0 3px; border-radius: 8px;
  color: var(--t-ind-ink); text-shadow: none;
  background: var(--t-ind);
  box-shadow: 0 0 0 1px var(--t-win-hi), 0 0 0 3px var(--t-wall-glow), 0 0 26px var(--brand-cyan), 0 2px 8px var(--t-on-shadow);
}
.ind-i { position: relative; display: block; width: 22px; height: 22px; }
.ind-i img { width: 22px; height: 22px; border-radius: 6px; box-shadow: 0 1px 3px var(--t-on-shadow); }
.ind-i::after {
  content: ""; position: absolute; inset: -5px; border-radius: 11px;
  box-shadow: 0 0 0 1.5px var(--brand-cyan), 0 0 14px var(--brand-cyan);
  opacity: 0;
}
.ind.is-ping .ind-i::after { animation: ping 0.9s cubic-bezier(0.2, 0.7, 0.2, 1); }
.ind-t { font-weight: 600; letter-spacing: 0.01em; }
.ind-t b { font: 800 14.5px/1 var(--f-ui); color: var(--t-en); padding: 0 1px; }
.ind-n {
  position: absolute; right: 0; top: calc(100% + 14px);
  padding: 7px 11px; border-radius: 8px;
  font: 600 11.5px/1 var(--f-jp); letter-spacing: 0.04em; color: var(--t-on);
  background: var(--t-on-fill); box-shadow: inset 0 0 0 1px var(--t-on-line);
  text-shadow: 0 1px 2px var(--t-on-shadow);
}
.ind-n::before {
  content: ""; position: absolute; right: 22px; bottom: 100%; width: 1px; height: 9px; background: var(--t-on-2);
}
@keyframes ping {
  0% { opacity: 0.95; transform: scale(0.7); }
  100% { opacity: 0; transform: scale(1.7); }
}

/* ------------------------------------------------------------------ */
/* Lead: the strip under the desk (theatre mode only)                  */
/* ------------------------------------------------------------------ */
.lead { display: none; }
.cap-t {
  font-family: var(--f-ui);
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-shadow: 0 2px 36px var(--t-on-shadow), 0 1px 2px var(--t-on-shadow);
  font-feature-settings: "palt";
}

/* ------------------------------------------------------------------ */
/* Chapters (static sequence)                                          */
/* ------------------------------------------------------------------ */
.desk { padding: 0 16px; }
.chapter { max-width: 760px; margin: 0 auto; padding-top: 76px; }
.cap { text-align: center; margin-bottom: 26px; }
.cap-k { font: 600 12.5px/1 var(--f-jp); letter-spacing: 0.16em; color: var(--t-on-2); margin-bottom: 12px; }
.cap-t { font-size: clamp(24px, 4.4vw, 40px); }
.cap-end { display: none; }

/* ------------------------------------------------------------------ */
/* Windows                                                             */
/* ------------------------------------------------------------------ */
.win {
  position: relative;
  font-size: calc(13.5px * var(--ws));
  width: min(100%, calc(var(--win-w) * 1em));
  margin: 0 auto;
  border-radius: 0.86em;
  background: var(--t-win);
  color: var(--t-ink);
  font-family: var(--f-ui);
  line-height: 1.5;
  text-align: left;
  box-shadow:
    0 0 0 0.5px var(--t-win-edge),
    0 0.1em 0.2em var(--t-sh-1),
    0 1.1em 2.2em -0.6em var(--t-sh-2),
    0 3.4em 6em -1.6em var(--t-sh-3);
}
.win::after { /* depth veil for windows that are not in front */
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: var(--t-veil); opacity: var(--dim, 0); pointer-events: none;
}
.win-in { border-radius: inherit; overflow: hidden; display: flex; flex-direction: column; height: 100%; box-shadow: inset 0 1px 0 var(--t-win-hi); }
.tb {
  position: relative; flex: none;
  height: 2.8em; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, var(--t-win) 0%, var(--t-win-2) 100%);
  border-bottom: 1px solid var(--t-win-line);
}
.tb-t { font-size: 0.96em; font-weight: 600; color: var(--t-ink-2); letter-spacing: 0.01em; }
.tb-g { position: absolute; right: 1em; top: 50%; display: flex; gap: 0.5em; transform: translateY(-50%); }
.tb-g i { width: 1.25em; height: 1.25em; border-radius: 0.36em; background: var(--t-win-3); }
.tb-g i:last-child { width: 2.6em; }
.win-b { flex: 1; display: flex; min-height: 0; }

.side {
  flex: none; width: 12.4em; padding: 0.9em 0.7em;
  background: var(--t-win-2); border-right: 1px solid var(--t-win-line);
}
.side-h { font-size: 0.8em; font-weight: 600; color: var(--t-ink-3); padding: 0.9em 0.6em 0.4em; letter-spacing: 0.04em; }
.side-new {
  display: flex; align-items: center; gap: 0.6em; height: 2.3em; padding: 0 0.7em; border-radius: 0.55em;
  background: var(--t-win); box-shadow: 0 0 0 1px var(--t-win-line), 0 1px 2px var(--t-win-line-2);
  font-size: 0.92em; font-weight: 600; color: var(--t-ink-2);
}
.plus { position: relative; width: 0.9em; height: 0.9em; }
.plus::before, .plus::after { content: ""; position: absolute; left: 50%; top: 50%; background: var(--t-ink-3); border-radius: 1px; }
.plus::before { width: 100%; height: 1.5px; transform: translate(-50%, -50%); }
.plus::after { width: 1.5px; height: 100%; transform: translate(-50%, -50%); }
.side-it { height: 2.1em; display: flex; align-items: center; padding: 0 0.6em; border-radius: 0.5em; }
.side-it.is-on { background: var(--t-win-3); }
.sk { display: block; height: 0.56em; border-radius: 0.3em; background: var(--t-sk); }
.side-it.is-on .sk { background: var(--t-ink-4); }
.sk-40 { width: 40%; } .sk-50 { width: 50%; } .sk-60 { width: 60%; } .sk-70 { width: 70%; }
.sk-80 { width: 80%; } .sk-90 { width: 90%; } .sk-100 { width: 100%; }

/* typed line */
.ime { font-family: var(--f-ui); color: var(--t-ink); white-space: nowrap; }
.ime .jp, .ime .en, .ime .raw { display: inline-block; }
.ime .en {
  font-family: var(--f-mono); font-size: 0.95em; font-weight: 600; color: var(--t-en);
  background: var(--t-en-bg); border-radius: 0.3em; padding: 0 0.28em; margin: 0 0.1em;
}
.ime .raw {
  font-family: var(--f-mono); font-size: 0.95em; color: var(--t-raw);
  box-shadow: 0 0.16em 0 -0.06em var(--t-ink-4);
}
.ime .miss { color: var(--t-miss); box-shadow: 0 0.16em 0 -0.06em var(--t-miss); }
.ime .pop { animation: pop 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
@keyframes pop {
  0% { transform: translateY(0.3em) scale(0.92); opacity: 0.2; }
  100% { transform: none; opacity: 1; }
}
.track .caret {
  animation: none; min-width: 0;
  display: inline-block; vertical-align: -0.2em; width: 0.16em; height: 1.25em; margin-left: 0.12em;
  border-radius: 0.1em; background: var(--brand-cyan-deep);
  box-shadow: 0 0 0.5em var(--brand-cyan), 0 0 0.1em var(--brand-cyan-deep);
}

/* chat */
.chat { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 1.3em 1.5em 1.3em; gap: 1.2em; }
.msgs { flex: 1; display: flex; flex-direction: column; gap: 1.1em; justify-content: flex-end; }
.msg-me { align-self: flex-end; max-width: 80%; background: var(--t-bubble); border-radius: 1.1em 1.1em 0.3em 1.1em; padding: 0.6em 1em; color: var(--t-ink); }
.msg-ai { display: flex; gap: 0.8em; align-items: flex-start; }
.ava { flex: none; width: 1.8em; height: 1.8em; border-radius: 50%; background: linear-gradient(140deg, var(--t-ink-4), var(--t-sk)); }
.msg-sk { flex: 1; max-width: 24em; display: flex; flex-direction: column; gap: 0.62em; padding-top: 0.5em; }
.composer {
  flex: none; border-radius: 1.1em; padding: 1em 1em 0.8em 1.2em; background: var(--t-win);
  box-shadow: 0 0 0 1px var(--t-win-line), 0 0.5em 1.4em -0.5em var(--t-sh-1), 0 1px 2px var(--t-win-line-2);
}
.composer .ime { font-size: 1.24em; min-height: 1.7em; line-height: 1.7; }
.comp-f { display: flex; align-items: center; justify-content: space-between; gap: 0.8em; margin-top: 0.9em; }
.hint { display: inline-flex; align-items: center; gap: 0.36em; font-size: 0.86em; color: var(--t-ink-3); min-width: 0; transition: color 0.3s ease; }
.hint span { margin-left: 0.4em; white-space: nowrap; }
.hint.is-on { color: var(--t-en); }
.track kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.9em; height: 1.75em; padding: 0 0.5em; border-radius: 0.42em;
  font: 600 0.92em/1 var(--f-ui); color: var(--t-ink-2);
  background: linear-gradient(180deg, var(--t-key), var(--t-key-2));
  box-shadow: 0 0 0 1px var(--t-key-edge), 0 0.14em 0 0 var(--t-key-edge);
}
.send {
  flex: none; display: grid; place-items: center; width: 2.3em; height: 2.3em; border-radius: 50%;
  background: var(--t-win-3); color: var(--t-ink-3);
}
.send svg { width: 1.15em; height: 1.15em; }

/* editor */
.side-tree { width: 11.4em; font-size: 1em; }
.tr { position: relative; font: 500 0.9em/2.1 var(--f-ui); color: var(--t-ink-2); padding-left: 1.7em; border-radius: 0.45em; white-space: nowrap; }
.tr-2 { padding-left: 2.8em; }
.tr.is-on { background: var(--t-win-3); color: var(--t-ink); font-weight: 600; }
.tr-d::before {
  content: ""; position: absolute; left: 0.7em; top: 50%; width: 0.4em; height: 0.4em;
  border-right: 1.5px solid var(--t-ink-3); border-bottom: 1.5px solid var(--t-ink-3);
  transform: translateY(-70%) rotate(45deg);
}
.code { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tabs { flex: none; display: flex; height: 2.5em; background: var(--t-win-2); border-bottom: 1px solid var(--t-win-line); }
.tab { display: flex; align-items: center; padding: 0 1.2em; font-size: 0.9em; color: var(--t-ink-3); border-right: 1px solid var(--t-win-line); }
.tab.is-on { background: var(--t-win); color: var(--t-ink); font-weight: 600; box-shadow: 0 1px 0 var(--t-win); }
.lines { flex: 1; padding: 0.9em 0; font: 500 1em/1.95 var(--f-mono); color: var(--t-ink); }
.ln { display: flex; white-space: pre; }
.ln b { flex: none; width: 3.3em; padding-right: 1.1em; text-align: right; font-weight: 400; color: var(--t-ink-4); }
.ln.is-cur { background: var(--t-cur-line); }
.ln.is-cur b { color: var(--t-ink-2); }
.kw { color: var(--t-code-kw); }
.fn { color: var(--t-code-fn); }
.st { color: var(--t-code-st); }
.cm, .cm .ime, .cm .raw { color: var(--t-code-cm); }
.cm .ime { font-family: var(--f-mono); }
.status {
  flex: none; display: flex; gap: 1.4em; align-items: center; height: 2em; padding: 0 1em;
  font-size: 0.8em; color: var(--t-ink-3); background: var(--t-win-2); border-top: 1px solid var(--t-win-line);
}
.st-r { margin-left: auto; }

/* memo */
.side-notes { width: 13em; padding: 0.7em; }
.note { padding: 0.6em 0.8em; border-radius: 0.6em; display: flex; flex-direction: column; gap: 0.1em; }
.note b { font-size: 0.94em; font-weight: 600; color: var(--t-ink); }
.note span { font-size: 0.8em; color: var(--t-ink-3); }
.note.is-on { background: var(--t-win-3); }
.memo { flex: 1; min-width: 0; padding: 1.5em 2.2em 2.4em; }
.memo-d { text-align: center; font-size: 0.8em; color: var(--t-ink-4); margin-bottom: 1.2em; }
.memo-h { font: 800 1.7em/1.3 var(--f-jp); color: var(--t-ink); margin-bottom: 0.8em; letter-spacing: 0.01em; }
.todo { display: flex; align-items: center; gap: 0.8em; min-height: 2.5em; font-size: 1.16em; }
.todo i:first-child { flex: none; width: 1.1em; height: 1.1em; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--t-ink-4); }
.todo.is-done i:first-child { background: var(--t-en); box-shadow: none; position: relative; }
.todo.is-done i:first-child::after {
  content: ""; position: absolute; left: 34%; top: 22%; width: 26%; height: 44%;
  border-right: 1.5px solid var(--t-win); border-bottom: 1.5px solid var(--t-win); transform: rotate(40deg);
}
.todo.is-done span { color: var(--t-ink-3); }

/* terminal */
.term { position: relative; flex: 1; padding: 1.1em 1.4em 6.6em; font: 500 1em/1.9 var(--f-mono); color: var(--t-ink); }
.term p { min-height: 1.9em; white-space: pre; }
.term .ime { font-family: var(--f-mono); }
.t-dim { color: var(--t-ink-3); }
.pr { color: var(--t-term-pr); font-weight: 600; }
.ps { color: var(--t-term-ps); font-weight: 600; }
.keys {
  position: absolute; left: 50%; bottom: 1.6em;
  display: flex; align-items: center; gap: 0.6em; white-space: nowrap;
  padding: 0.75em 1.2em 0.75em 0.8em; border-radius: 1.1em;
  background: var(--t-hud);
  box-shadow: 0 0 0 1px var(--t-win-line), 0 1.2em 2.6em -0.8em var(--t-sh-2), 0 0.2em 0.5em var(--t-win-line);
  font-family: var(--f-ui);
  transform: translate3d(-50%, 0, 0);
}
.keys kbd { height: 2.5em; min-width: 2.6em; padding: 0 0.9em; font-size: 1em; border-radius: 0.55em; color: var(--t-ink); transition: transform 0.12s ease, box-shadow 0.12s ease; }
.keys.is-down kbd { transform: translateY(0.14em); box-shadow: 0 0 0 1px var(--t-key-edge), 0 0 0 2px var(--t-en-bg); color: var(--t-en); }
.keys-p { color: var(--t-ink-3); font-weight: 600; }
.keys-l { margin-left: 0.5em; font: 600 0.9em/1 var(--f-jp); color: var(--t-ink-2); }

/* ------------------------------------------------------------------ */
/* Theater mode                                                        */
/* ------------------------------------------------------------------ */
.theater .track { height: 540vh; height: calc(100svh + 440svh); }
.theater .stage {
  position: sticky; top: var(--header-h); padding-bottom: 0;
  height: calc(100vh - var(--header-h) - var(--frame)); height: calc(100svh - var(--header-h) - var(--frame));
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
}
.theater .wall { position: absolute; inset: 0; height: auto; margin: 0; }
.theater .menubar { grid-row: 1; position: relative; }
.theater .desk { grid-row: 2; position: relative; padding: 0; }
.theater .stage { --cap-fs: clamp(23px, min(5.4vw, 6.6vh), 62px); }
/* the caption of the current chapter sits in the top of this strip */
.theater .lead { display: block; grid-row: 3; position: relative; z-index: 20; padding: calc(var(--cap-fs) * 1.25) 40px 26px; }
.theater .chapter { display: contents; }
.theater .cap-k { display: none; }
.theater .cap {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 21; margin: 0; padding: 0 16px;
  opacity: 0; pointer-events: none;
}
.theater .cap-t { font-size: var(--cap-fs); line-height: 1.25; white-space: nowrap; }
.theater .cap-end { display: block; }
.theater .lead-row {
  margin-top: clamp(12px, 2.2vh, 22px);
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 24px;
}
.theater .win {
  position: absolute; left: 50%; top: 50%;
  width: calc(var(--win-w) * 1em); height: calc(var(--win-h) * 1em);
  margin: calc(var(--win-h) * -0.5em) 0 0 calc(var(--win-w) * -0.5em);
  backface-visibility: hidden;
}
.theater .keys { opacity: var(--k, 0); transform: translate3d(-50%, calc((1 - var(--k, 0)) * 1.2em), 0) scale(calc(0.94 + var(--k, 0) * 0.06)); }

.theater .rail { display: flex; gap: 6px; grid-column: 2; }
.rail-b {
  display: flex; flex-direction: column; gap: 9px; align-items: flex-start;
  padding: 10px 4px 10px; min-width: 76px; border-radius: 8px;
  color: var(--t-on-3); transition: color 0.25s ease;
}
.rail-b:hover { color: var(--t-on-2); }
.rail-b[aria-current="true"] { color: var(--t-on); }
.rail-l { font: 600 12px/1 var(--f-jp); letter-spacing: 0.04em; white-space: nowrap; }
.rail-bar { display: block; width: 100%; height: 3px; border-radius: 2px; background: var(--t-on-line); overflow: hidden; }
.rail-bar i { display: block; width: 100%; height: 100%; border-radius: 2px; background: var(--t-on); transform: scaleX(0); transform-origin: 0 50%; }
.rail-b[aria-current="true"] .rail-bar i { background: var(--brand-cyan); box-shadow: 0 0 8px var(--brand-cyan); }

.theater .cue {
  display: flex; align-items: center; gap: 12px; grid-column: 3; justify-self: end;
  font: 600 12px/1 var(--f-jp); letter-spacing: 0.14em; color: var(--t-on-2);
}
.cue i { position: relative; display: block; width: 1px; height: 38px; background: var(--t-on-line); overflow: hidden; }
.cue i::after {
  content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 40%; background: var(--t-on);
  animation: cue 1.9s cubic-bezier(0.6, 0, 0.3, 1) infinite;
}
@keyframes cue {
  0% { transform: translateY(-110%); }
  100% { transform: translateY(260%); }
}
.theater .track .caret { animation: caret-blink 1.1s steps(1) infinite; }
.theater .track .is-typing .caret { animation: none; }

.rail-b { font: inherit; background: none; border: 0; cursor: pointer; }
.theater .menubar { top: 0; }

/* ------------------------------------------------------------------ */
/* Stage on narrow / short screens                                     */
/* ------------------------------------------------------------------ */
@media (max-width: 1180px) {
  html:not(.theater) .ind-n { display: none; }
}
@media (max-width: 1040px) {
  .theater .cue { display: none; }
}
@media (max-width: 880px) {
  .mb-x, .mb-keys, .ind-n { display: none; }
}
@media (max-width: 760px) {
  .theater .lead-row { display: block; }
  .theater .rail { width: 100%; }
  .rail-b { flex: 1; min-width: 0; align-items: center; }
}
@media (max-width: 700px) {
  :root { --win-w: 25.4; --win-h: 29; --frame: 6px; --t-screen-r: 14px; }
  .menubar { height: 34px; padding: 0 12px; }
  .mb-l span, .mb-batt { display: none; }
  .mb-r { gap: 12px; }
  .side { display: none; }
  .tb-g { display: none; }
  .chat { padding: 1em 1em 1em; }
  .memo { padding: 1.2em 1.4em 2em; }
  .msg-sk { max-width: 14em; }
  .chapter { padding-top: 60px; }
  .ln b { width: 2.6em; padding-right: 0.8em; }
  .ln:nth-child(n+10) { display: none; }
  .term { padding: 1em 1em 6.4em; font-size: 0.94em; }
  .keys-l { display: none; }
  .theater .stage { --cap-fs: clamp(20px, min(5.9vw, 6.6vh), 62px); }
  .theater .lead { padding: calc(var(--cap-fs) * 1.25) 14px 14px; }
  .theater .lead-row { margin-top: 12px; }
  .theater .rail { gap: 6px; }
  .rail-b { padding: 6px 0; gap: 7px; }
  .rail-l { font-size: 10.5px; letter-spacing: 0; }
}
@media (max-height: 760px) {
  .ind-n { display: none; }
}
@media (max-width: 400px) {
  .hint span { margin-left: 0.2em; }
}

/* ------------------------------------------------------------------ */
/* Features: compact visual tiles                                      */
/* ------------------------------------------------------------------ */
.tiles { list-style: none; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--s-4); }
.tile {
  grid-column: span 2; display: flex; flex-direction: column; min-width: 0;
  padding: 10px 10px var(--s-5); border-radius: var(--r-xl);
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.tile-3 { grid-column: span 3; }
.tile h3 { margin: var(--s-5) var(--s-4) 0; font-size: var(--fs-h3); line-height: 1.45; }
.tile > p { margin: var(--s-2) var(--s-4) 0; font-size: 14.5px; line-height: 1.75; color: var(--text-2); text-wrap: pretty; word-break: auto-phrase; }
.tile-vis {
  flex: none; min-height: 196px; padding: var(--s-5) var(--s-4);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-3);
  border-radius: calc(var(--r-xl) - 8px); overflow: hidden;
  background: linear-gradient(160deg, var(--accent-soft), var(--surface-2) 70%);
  font-family: var(--f-ui); color: var(--text); text-align: center;
}
.tile-vis .key { font-size: 13px; }
.tile-vis .caret { height: 1.2em; }
.vis-arrow { color: var(--text-3); font-weight: 700; }
.vis-note { font-size: var(--fs-xs); line-height: 1.5; color: var(--text-3); }

/* a typed line, drawn as a small input */
.fx-line {
  display: inline-flex; align-items: center; max-width: 100%; min-height: 46px; padding: 6px 18px;
  border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-sm);
  font: 700 18px/1.5 var(--f-ui); white-space: nowrap;
}
.fx-line .en { margin: 0 3px; }
.fx-miss { color: var(--danger); text-decoration: underline wavy; text-decoration-thickness: 1px; text-underline-offset: 0.3em; }
.fx-raw { font-family: var(--f-mono); font-weight: 600; color: var(--text-2); }
.fx-keys { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 700; color: var(--text-2); white-space: nowrap; }
.fx-plus { color: var(--text-3); }

/* 1. typed -> result rows */
.vis-rows { align-items: stretch; gap: 0; padding-block: var(--s-3); }
.io { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: var(--s-3); padding: 11px var(--s-2); text-align: left; }
.io + .io { border-top: 1px solid var(--line-2); }
.io-in { justify-self: end; max-width: 100%; font: 500 13px/1.5 var(--f-mono); color: var(--text-3); overflow-wrap: anywhere; text-align: right; }
.io-out { font: 700 18px/1.5 var(--f-ui); white-space: nowrap; }
.io-out .en { margin: 0 2px; }

/* 2. flip */
.vis-flip { flex-direction: row; flex-wrap: wrap; gap: var(--s-3) var(--s-4); }

/* 4. record */
.vis-stats { gap: var(--s-4); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); width: 100%; max-width: 420px; }
.stat { display: grid; gap: 2px; padding: 14px 6px 12px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-sm); }
.stat b { font: 800 clamp(22px, 2.4vw, 28px)/1.2 var(--f-ui); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--accent); white-space: nowrap; }
.stat b small { margin-left: 2px; font-size: 12.5px; font-weight: 700; letter-spacing: 0; color: var(--text-2); }
.stat span { font-size: 12px; line-height: 1.5; color: var(--text-2); }

/* 6. Tab rows */
.tab-rows { display: grid; gap: 8px; width: 100%; max-width: 280px; }
.tab-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; }
.tab-row .fx-raw { justify-self: end; font-size: 14px; }
.tab-row b { justify-self: start; font: 700 15px/1.5 var(--f-ui); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* 7. candidates */
.cands { display: grid; gap: 2px; width: 170px; padding: 6px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-md); text-align: left; }
.cand { display: flex; align-items: center; gap: 12px; padding: 5px 10px; border-radius: var(--r-sm); font: 600 16px/1.5 var(--f-ui); color: var(--text-2); }
.cand i { font: 600 12px/1 var(--f-mono); font-style: normal; color: var(--text-3); }
.cand.is-on { color: var(--btn-ink); background: linear-gradient(135deg, var(--btn-a), var(--btn-b)); }
.cand.is-on i { color: var(--btn-hi); }

/* ------------------------------------------------------------------ */
/* Privacy                                                             */
/* ------------------------------------------------------------------ */
.priv { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--s-7); align-items: center; }
.priv-mark {
  display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: var(--s-5);
  border-radius: var(--r-md); color: var(--btn-ink);
  background: linear-gradient(135deg, var(--btn-a), var(--btn-b)); box-shadow: var(--shadow-btn);
}
.priv-mark svg { width: 28px; height: 28px; }
.priv h2 { font-size: var(--fs-h2); line-height: 1.3; }
.priv h2 span { display: inline-block; }
.priv-text p { margin-top: var(--s-4); color: var(--text-2); }
.priv .notice-list { background: var(--surface-2); }
.priv .notice-list li { position: relative; padding: var(--s-5) var(--s-5) var(--s-5) 62px; }
.priv .notice-list li::before { content: ""; position: absolute; left: 22px; top: 26px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft-2); }
.priv .notice-list li::after { content: ""; position: absolute; left: 31px; top: 31px; width: 6px; height: 10px; border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(45deg); }
.priv .notice-list strong { font-size: 17px; }

/* ------------------------------------------------------------------ */
/* Requirements: one slim row                                          */
/* ------------------------------------------------------------------ */
.reqs-band { padding: var(--s-6) 0; background: var(--bg-2); }
.reqs-band .wrap { display: flex; align-items: center; gap: var(--s-4) var(--s-6); }
.reqs-band h2 { flex: none; font-size: 17px; }
.reqs { flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-3); }
.reqs > div { display: grid; gap: 1px; padding: 12px 18px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-sm); }
.reqs dt { font: 700 12px/1.5 var(--f-ui); letter-spacing: 0.08em; color: var(--text-3); }
.reqs dd { font: 700 15px/1.6 var(--f-ui); color: var(--text); }

.home-faq { padding-top: 0; }
#pricing .price-sub { margin-bottom: var(--s-5); }

@media (max-width: 1000px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile, .tile-3 { grid-column: span 1; }
  .tile-first { grid-column: span 2; }
  .reqs-band .wrap { flex-direction: column; align-items: stretch; }
}
@media (max-width: 900px) {
  .priv { grid-template-columns: minmax(0, 1fr); gap: var(--s-6); }
}
@media (max-width: 640px) {
  .tiles { grid-template-columns: minmax(0, 1fr); }
  .tile, .tile-3, .tile-first { grid-column: auto; }
  .tile-vis { min-height: 168px; }
  .reqs { grid-template-columns: minmax(0, 1fr); }
  .io { grid-template-columns: minmax(0, 1fr); gap: 0; text-align: center; padding-block: 9px; }
  .io .vis-arrow { display: none; }
  .io-in { justify-self: center; text-align: center; }
  .io-out { white-space: normal; }
  .fx-line { font-size: 16.5px; padding-inline: 14px; }
  .stat { padding-inline: 2px; }
  .stat b { font-size: 20px; }
  .stat b small { font-size: 11px; margin-left: 1px; }
}

@media (prefers-reduced-motion: reduce) {
  .cue i::after, .track .caret, .ime .pop, .ind.is-ping .ind-i::after { animation: none !important; }
}
