/* Captionary site. Highlighter direction from the extension's own pages: neutral paper, ink, square
   shoulders (3px controls, 6px cards), Bricolage Grotesque for headings, Atkinson Hyperlegible for text,
   and the lime "learn" highlighter used only on what a learner would save. The video player and the
   look-up card are always dark, drawn the way the extension draws them on a video site. */

/* ---------- fonts (SIL OFL 1.1, licences in fonts/) ---------- */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url('fonts/BricolageGrotesque-latin.woff2') format('woff2');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url('fonts/BricolageGrotesque-latin-ext.woff2') format('woff2');
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/AtkinsonHyperlegibleNext-latin.woff2') format('woff2');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/AtkinsonHyperlegibleNext-latin-ext.woff2') format('woff2');
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Atkinson Hyperlegible Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('fonts/AtkinsonHyperlegibleMono-latin.woff2') format('woff2');
}

/* ---------- tokens ---------- */
/* Layout: one paper column, the player as the hero object, then alternating text/figure pairs. */
:root {
  --paper: #f7f7f7;
  --raised: #ffffff;
  --sunk: #efefef;
  --line: #e3e3e3;
  --line-strong: #8a8a8a;
  --ink: #161616;
  --ink-muted: #4d4d4d;
  --ink-subtle: #6b6b6b;
  --hover: #1616160d;
  --learn: #d7f04a;
  --learn-edge: #b9cf2c;
  --on-learn: #17181b;
  --learn-line: #6f7f00;
  --known: #1a7049;
  --warn: #8a5a00;
  --focus: #2348d8;
  --col-us: #f4f9dc;

  /* the player and look-up card look the same in both themes */
  --player-surface: #282828;
  --player-ink: #f1f1f1;
  --player-muted: #aaaaaa;
  --player-line: #ffffff33;
  --player-hover: #ffffff1a;
  --player-warn: #f5c451;
  --caption-plate: #080808bf;
  --caption-selected: #ffffff40;

  --font-display:
    'Bricolage Grotesque', 'Atkinson Hyperlegible Next', system-ui, -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei',
    'PingFang TC', 'Hiragino Sans', 'Yu Gothic', 'Meiryo', sans-serif;
  --font-sans:
    'Atkinson Hyperlegible Next', system-ui, -apple-system, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'PingFang TC',
    'Hiragino Sans', 'Yu Gothic', 'Meiryo', 'Noto Sans CJK JP', sans-serif;
  --font-mono: 'Atkinson Hyperlegible Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --font-host:
    system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei',
    'PingFang TC', 'Hiragino Sans', 'Yu Gothic', 'Meiryo', sans-serif;

  --fs-h1: clamp(2.5rem, 1.35rem + 4.4vw, 4.4rem);
  --fs-h2: clamp(1.8rem, 1.3rem + 1.9vw, 2.7rem);
  --fs-h3: 1.2rem;
  --fs-lead: clamp(1.125rem, 1.02rem + 0.42vw, 1.3rem);
  --fs-body: 1.0625rem;
  --fs-small: 0.9375rem;
  --fs-fine: 0.8125rem;
  --fs-label: 0.75rem;

  --radius-control: 3px;
  --radius-card: 6px;
  --gutter: 24px;
  --band-pad: clamp(64px, 9vw, 120px);
  --shadow-float: 0 1px 2px #1616160f, 0 4px 8px #16161612, 0 12px 24px #16161614;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --paper: #111111;
    --raised: #1a1a1a;
    --sunk: #242424;
    --line: #2d2d2d;
    --line-strong: #6b6b6b;
    --ink: #f2f2f2;
    --ink-muted: #b3b3b3;
    --ink-subtle: #8f8f8f;
    --hover: #ffffff12;
    --learn-line: #d7f04a;
    --known: #5cc98f;
    --warn: #f5c451;
    --focus: #8ea2ff;
    --col-us: #ffffff0a;
    --shadow-float: 0 2px 4px #00000066, 0 12px 28px #00000099;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --paper: #111111;
  --raised: #1a1a1a;
  --sunk: #242424;
  --line: #2d2d2d;
  --line-strong: #6b6b6b;
  --ink: #f2f2f2;
  --ink-muted: #b3b3b3;
  --ink-subtle: #8f8f8f;
  --hover: #ffffff12;
  --learn-line: #d7f04a;
  --known: #5cc98f;
  --warn: #f5c451;
  --focus: #8ea2ff;
  --col-us: #ffffff0a;
  --shadow-float: 0 2px 4px #00000066, 0 12px 28px #00000099;
  color-scheme: dark;
}

/* ---------- base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  text-wrap: balance;
}
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}
a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: var(--line-strong);
}
a:hover {
  text-decoration-color: currentColor;
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
img,
svg {
  max-width: 100%;
}
kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0 0.4em;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: var(--radius-control);
  background: var(--raised);
  font-family: var(--font-mono);
  font-size: 0.85em;
  line-height: 1.5;
  text-align: center;
}
[hidden] {
  display: none !important;
}
.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 20;
  padding: 8px 14px;
  border-radius: var(--radius-control);
  background: var(--ink);
  color: var(--paper);
}
.skip:focus {
  top: 12px;
}

.wrap {
  width: 100%;
  max-width: calc(1120px + 2 * var(--gutter));
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

/* the lime highlighter: only on what a learner would save */
.hl {
  padding: 0 0.1em;
  border-radius: 2px;
  background: var(--learn);
  color: var(--on-learn);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.btn-sm {
  height: 36px;
  padding: 0 14px;
  font-size: 0.9375rem;
}
.btn-lg {
  height: 52px;
  padding: 0 22px;
  font-size: 1.0625rem;
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
}
.btn-primary:hover {
  background: var(--ink-muted);
}
.btn-quiet {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--ink);
}
.btn-quiet:hover {
  background: var(--hover);
}

/* ---------- header ---------- */
.site-head {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.head-row {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand-mark {
  width: 28px;
  height: 28px;
  flex: none;
}
.bm-bg {
  fill: var(--ink);
}
.bm-fg {
  fill: var(--paper);
}
.bm-learn {
  fill: var(--learn);
}
.head-nav {
  display: flex;
  gap: 24px;
  margin-left: auto;
  font-size: var(--fs-small);
}
.head-nav a {
  color: var(--ink-muted);
  text-decoration: none;
}
.head-nav a:hover {
  color: var(--ink);
}
.head-end {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.lang-select {
  height: 36px;
  padding: 0 28px 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background-color: var(--raised);
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 14px) 50%,
    calc(100% - 9px) 50%;
  background-size:
    5px 5px,
    5px 5px;
  background-repeat: no-repeat;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.lang-select:hover {
  background-color: var(--hover);
}

/* ---------- hero ---------- */
.hero {
  padding-block: clamp(40px, 5vw, 72px) var(--band-pad);
}
.hero-text {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.hero h1 {
  max-width: 18ch;
  font-size: var(--fs-h1);
  line-height: 1.02;
  letter-spacing: -0.03em;
}
:lang(zh-CN) .hero h1,
:lang(zh-TW) .hero h1,
:lang(ja) .hero h1 {
  max-width: 22ch;
  line-height: 1.18;
  letter-spacing: -0.01em;
}
:lang(zh-CN) .band h2,
:lang(zh-TW) .band h2,
:lang(ja) .band h2,
:lang(zh-CN) .final h2,
:lang(zh-TW) .final h2,
:lang(ja) .final h2,
:lang(zh-CN) .legal h1,
:lang(zh-TW) .legal h1,
:lang(ja) .legal h1 {
  line-height: 1.22;
  letter-spacing: -0.01em;
}
:lang(zh-CN) body,
:lang(zh-TW) body,
:lang(ja) body {
  line-height: 1.7;
}
.lead {
  max-width: 62ch;
  color: var(--ink-muted);
  font-size: var(--fs-lead);
  line-height: 1.55;
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}
.cta-note {
  color: var(--ink-subtle);
  font-size: var(--fs-small);
}
.phone-note {
  display: none;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--raised);
  color: var(--ink-muted);
  font-size: var(--fs-small);
}
@media (hover: none) and (pointer: coarse) {
  .phone-note {
    display: block;
  }
}

/* ---------- demo: the player ---------- */
.demo {
  position: relative;
  margin-top: clamp(32px, 4vw, 52px);
}
.demo-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 14px;
}
.demo-hint {
  font-size: var(--fs-small);
  color: var(--ink-muted);
}
.seg {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--raised);
}
.seg button {
  height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--ink-muted);
  font: inherit;
  font-size: var(--fs-small);
  cursor: pointer;
}
.seg button[aria-checked='true'] {
  background: var(--ink);
  color: var(--paper);
}
.player {
  position: relative;
  aspect-ratio: 16 / 9;
  max-width: 100%;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: #0c0d10;
  container-type: inline-size;
  user-select: none;
  -webkit-user-select: none;
}
.scene {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 30% 20%, #2b3346 0%, transparent 60%), radial-gradient(90% 80% at 85% 85%, #3a2a2a 0%, transparent 65%),
    linear-gradient(170deg, #1b2130 0%, #101217 55%, #0b0c0f 100%);
}
.bokeh {
  position: absolute;
  border-radius: 50%;
  filter: blur(18px);
  opacity: 0.55;
}
.b1 {
  left: 12%;
  top: 14%;
  width: 18cqi;
  height: 18cqi;
  background: #f1b766;
}
.b2 {
  left: 62%;
  top: 10%;
  width: 11cqi;
  height: 11cqi;
  background: #8fb2ff;
  opacity: 0.35;
}
.b3 {
  left: 74%;
  top: 34%;
  width: 7cqi;
  height: 7cqi;
  background: #f08a62;
  opacity: 0.45;
}
.b4 {
  left: 30%;
  top: 46%;
  width: 26cqi;
  height: 12cqi;
  background: #3c4a66;
  opacity: 0.5;
}
.captions {
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: calc(44px + 3.2cqi);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
  font-family: var(--font-host);
}
.cap {
  display: inline-block;
  max-width: 100%;
  padding: 1px 8px;
  border-radius: 2px;
  background: var(--caption-plate);
  color: #ffffff;
  line-height: 1.3;
}
.cap-orig {
  font-size: clamp(15px, 3.2cqi, 31px);
  font-weight: 500;
  touch-action: pan-y;
}
.cap-tr {
  color: #ffffffd1;
  font-size: clamp(13px, 2.5cqi, 24px);
}
.w {
  display: inline;
  margin: 0;
  padding: 0 1px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
  cursor: pointer;
}
.w:hover,
.w.is-sel,
.gap.is-sel {
  background: var(--caption-selected);
}
.w.is-sel:has(+ .gap.is-sel) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.gap.is-sel + .w.is-sel {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
.w.is-learn,
.gap.is-learn {
  text-decoration: underline dotted var(--learn) 2px;
  text-underline-offset: 0.24em;
}
.w:focus-visible {
  outline: 2px solid var(--learn);
  outline-offset: 1px;
}
.controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 28px 14px 8px;
  background: linear-gradient(to top, #000000b3, transparent);
  color: #f1f1f1;
}
.scrub {
  position: relative;
  height: 3px;
  margin-bottom: 8px;
  border-radius: 2px;
  background: #ffffff40;
}
.scrub-fill {
  position: absolute;
  inset: 0 71% 0 0;
  border-radius: 2px;
  background: #f1f1f1;
}
.ctl-row {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2.2cqi, 22px);
}
.ctl {
  width: clamp(16px, 2.3cqi, 22px);
  height: clamp(16px, 2.3cqi, 22px);
  flex: none;
}
.ctl-time {
  font-family: var(--font-host);
  font-size: clamp(11px, 1.4cqi, 13px);
  font-variant-numeric: tabular-nums;
}
.ctl-gap {
  flex: 1;
}
.demo figcaption {
  margin-top: 12px;
  color: var(--ink-subtle);
  font-size: var(--fs-fine);
}

/* ---------- demo: the look-up card (native, as on a video site) ---------- */
.lk {
  position: absolute;
  z-index: 5;
  width: 340px;
  border-radius: 12px;
  background: var(--player-surface);
  color: var(--player-ink);
  font-family: var(--font-host);
  font-size: 14px;
  line-height: 1.45;
  box-shadow: 0 4px 32px #00000073;
}
.lk-body {
  max-height: var(--lk-max, none);
  overflow-y: auto;
  padding: 12px 0 8px;
  overscroll-behavior: contain;
}
.lk-arrow {
  position: absolute;
  left: var(--ax, 50%);
  bottom: -6px;
  width: 12px;
  height: 12px;
  transform: translateX(-50%) rotate(45deg);
  border-radius: 2px;
  background: var(--player-surface);
}
.lk-head {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 6px 0 16px;
}
.lk-word {
  min-width: 0;
  font-size: 18px;
  line-height: 24px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.lk-pos {
  margin-left: auto;
  padding: 0 4px;
  color: var(--player-muted);
  font-size: 12px;
  white-space: nowrap;
}
.lk-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  color: var(--player-muted);
  cursor: pointer;
}
.lk-icon:hover {
  background: var(--player-hover);
  color: var(--player-ink);
}
.lk-icon svg {
  width: 18px;
  height: 18px;
}
.lk-tr {
  padding: 2px 16px 0;
  font-size: 15px;
}
.lk-def {
  padding: 3px 16px 0;
  color: var(--player-muted);
  font-size: 13.5px;
}
.lk-chunk {
  display: flex;
  align-items: baseline;
  gap: 8px;
  width: calc(100% - 32px);
  margin: 8px 16px 0;
  padding: 7px 8px 7px 10px;
  border: 1px solid var(--player-line);
  border-radius: 4px;
  background: transparent;
  color: var(--player-ink);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
}
.lk-chunk:hover {
  background: var(--player-hover);
}
.lk-chunk-label {
  flex: none;
  color: var(--player-muted);
  font-size: 12px;
}
.lk-chunk-text {
  flex: none;
  font-weight: 500;
}
.lk-chunk-meaning {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--player-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lk-chunk svg {
  width: 16px;
  height: 16px;
  flex: none;
  align-self: center;
  color: var(--player-muted);
}
.lk-sep {
  height: 1px;
  margin: 12px 0 6px;
  background: var(--player-line);
}
.lk-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 8px;
}
.lk-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  color: var(--player-ink);
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}
.lk-btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}
.lk-btn:hover,
.lk-btn[aria-pressed='true'] {
  background: var(--player-hover);
}
.lk-btn .is-learn {
  color: var(--learn);
}
.lk-ai {
  padding: 4px 16px 4px;
}
.lk-ai p + p {
  margin-top: 6px;
}
.lk-warn {
  color: var(--player-warn);
}
.lk-meta {
  margin-top: 10px;
  color: var(--player-muted);
  font-size: 12px;
}
.lk-note {
  padding: 6px 16px 2px;
  color: var(--player-muted);
  font-size: 12.5px;
}
.lk-note b {
  color: var(--player-ink);
  font-weight: 500;
}
.lk.is-in {
  animation: lk-in 140ms ease-out;
}
@keyframes lk-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}
/* narrow players: the card sits under the video instead of over it */
.demo.is-docked .lk {
  position: static;
  width: auto;
  margin-top: 10px;
}
.demo.is-docked .lk-arrow {
  display: none;
}

/* ---------- bands ---------- */
.band {
  padding-block: var(--band-pad);
  border-top: 1px solid var(--line);
}
.band h2 {
  font-size: var(--fs-h2);
  line-height: 1.08;
  letter-spacing: -0.02em;
}
.section-head {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 68ch;
  margin-bottom: 48px;
}
.section-head p {
  color: var(--ink-muted);
  font-size: var(--fs-lead);
}
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(40px, 6vw, 88px);
}
.split-flip .split-text {
  order: 2;
}
.split-text {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
  max-width: 60ch;
}
.split-text > p {
  color: var(--ink-muted);
}
.small {
  font-size: var(--fs-small);
  color: var(--ink-subtle);
}
.ticks {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
  list-style: none;
}
.ticks li {
  position: relative;
  padding-left: 26px;
}
.ticks li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 14px;
  height: 7px;
  border-radius: 2px;
  background: var(--learn);
  box-shadow: inset 0 0 0 1px var(--learn-edge);
}
.ticks-wide {
  gap: 18px;
}

/* phrase illustration */
.gloss {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--raised);
}
.gloss-line {
  font-size: clamp(1.4rem, 1rem + 1.6vw, 2.1rem);
  line-height: 1.3;
}
.gloss-line .hl {
  white-space: nowrap;
}
.gloss-rows {
  display: flex;
  flex-direction: column;
}
.gloss-rows > div {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr);
  gap: 16px;
  align-items: baseline;
  padding-block: 14px;
  border-top: 1px solid var(--line);
}
.gloss-rows dt,
.panel-label,
.compare thead th,
.v-tag,
.mark {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
:lang(zh-CN) .gloss-rows dt,
:lang(zh-TW) .gloss-rows dt,
:lang(ja) .gloss-rows dt,
:lang(zh-CN) .panel-label,
:lang(zh-TW) .panel-label,
:lang(ja) .panel-label,
:lang(zh-CN) .v-tag,
:lang(zh-TW) .v-tag,
:lang(ja) .v-tag,
:lang(zh-CN) .mark,
:lang(zh-TW) .mark,
:lang(ja) .mark {
  font-family: var(--font-sans);
  letter-spacing: 0.02em;
}
.gloss-rows dt {
  color: var(--ink-subtle);
}
.gloss-rows dd {
  font-size: 1.15rem;
}
.gloss-rows > div:first-child dd {
  color: var(--ink-subtle);
  text-decoration: line-through;
  text-decoration-color: var(--line-strong);
}

/* ways to connect AI */
.ways {
  display: flex;
  flex-direction: column;
}
.ways > div {
  padding-block: 16px;
  border-top: 1px solid var(--line);
}
.ways > div:last-child {
  border-bottom: 1px solid var(--line);
}
.ways dt {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-weight: 600;
}
.ways dd {
  margin-top: 4px;
  color: var(--ink-muted);
}

/* example panels drawn like the extension's own pages */
.panel-fig {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.panel-fig figcaption {
  color: var(--ink-subtle);
  font-size: var(--fs-fine);
}
.panel {
  padding: 22px 22px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--raised);
  box-shadow: var(--shadow-float);
}
.panel-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
}
.panel-count {
  color: var(--ink-subtle);
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  font-weight: 400;
}
.panel-label {
  margin: 22px 0 6px;
  color: var(--ink-subtle);
}
.prov,
.vocab {
  padding: 0;
  list-style: none;
}
.prov li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  padding-block: 11px;
  border-top: 1px solid var(--line);
}
.prov li:last-child {
  border-bottom: 1px solid var(--line);
}
.prov-name {
  font-weight: 700;
}
.prov-state {
  color: var(--ink-subtle);
  font-size: var(--fs-small);
  font-variant-numeric: tabular-nums;
}
.prov-state.is-ok {
  color: var(--known);
}
.prov-state.is-ok::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 0.1em;
}
.route > div {
  display: grid;
  grid-template-columns: minmax(0, 11rem) minmax(0, 1fr);
  gap: 12px;
  padding-block: 7px;
  font-size: var(--fs-small);
}
.route dt {
  color: var(--ink-muted);
}
.route dd {
  font-weight: 700;
  overflow-wrap: break-word;
}
.vocab li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-block: 14px;
  border-top: 1px solid var(--line);
}
.v-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.v-top b {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
}
.v-tag {
  padding: 2px 7px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  color: var(--ink-muted);
  font-size: 0.6875rem;
}
.v-tag.is-learn {
  border-color: var(--learn-edge);
  background: var(--learn);
  color: var(--on-learn);
}
.v-mean {
  color: var(--ink-muted);
}
.v-ctx {
  color: var(--ink-subtle);
  font-size: var(--fs-small);
}
.v-ctx u {
  text-decoration: underline dotted var(--learn-line) 2px;
  text-underline-offset: 0.24em;
}
.panel-actions {
  display: flex;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.fake-btn {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  font-size: var(--fs-small);
  font-weight: 700;
}

/* ---------- comparison ---------- */
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--raised);
}
.compare {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-small);
}
.compare th,
.compare td {
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.compare thead th {
  border-top: 0;
  color: var(--ink-subtle);
}
.compare thead th.col-us {
  color: var(--ink);
}
.compare tbody th {
  width: 28%;
  font-weight: 700;
}
.compare td {
  width: 36%;
  color: var(--ink-muted);
}
.compare td.col-us {
  color: var(--ink);
}
.compare .col-us {
  background: var(--col-us);
}
.mark {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
  color: var(--ink);
}
.mark::before {
  content: '';
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
}
.mark.yes::before {
  background: var(--known);
}
.mark.part::before {
  border: 1.5px solid var(--warn);
  background: linear-gradient(90deg, var(--warn) 50%, transparent 50%);
}
.mark.no::before {
  border: 1.5px solid var(--line-strong);
}
.mark.no {
  color: var(--ink-subtle);
}
.fn {
  margin-left: 3px;
  color: var(--ink-subtle);
  font-size: 0.75em;
  vertical-align: super;
  line-height: 0;
  text-decoration: none;
}
.fair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  margin-top: 56px;
}
.fair-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.fair-col h3 {
  font-size: var(--fs-h3);
}
.fair-col h3:not(:first-child) {
  margin-top: 18px;
}
.fair-col p {
  color: var(--ink-muted);
}
.plain {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-left: 1.1em;
  color: var(--ink-muted);
}
.plain li::marker {
  color: var(--ink-subtle);
}
.sources {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 56px;
  padding-top: 20px;
  padding-left: 1.4em;
  border-top: 1px solid var(--line);
  color: var(--ink-subtle);
  font-size: var(--fs-fine);
}
.sources li:target {
  color: var(--ink);
}
.fine {
  margin-top: 12px;
  color: var(--ink-subtle);
  font-size: var(--fs-fine);
}

/* ---------- toolkit ---------- */
.grid3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px 48px;
}
.grid3 > div {
  padding-top: 18px;
  border-top: 1px solid var(--line-strong);
}
.grid3 dt {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-weight: 600;
}
.grid3 dd {
  margin-top: 6px;
  color: var(--ink-muted);
  font-size: var(--fs-small);
}

/* ---------- FAQ ---------- */
.faq-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
.faq details {
  border-top: 1px solid var(--line);
}
.faq details:last-child {
  border-bottom: 1px solid var(--line);
}
.faq summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-block: 18px;
  font-size: 1.125rem;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: '+';
  flex: none;
  color: var(--ink-subtle);
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1;
}
.faq details[open] summary::after {
  content: '−';
}
.faq details p {
  max-width: 64ch;
  padding-bottom: 20px;
  color: var(--ink-muted);
}

/* ---------- final call ---------- */
.final-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}
.final h2 {
  max-width: 18ch;
  font-size: clamp(2.1rem, 1.4rem + 2.8vw, 3.6rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
}
.final p {
  max-width: 56ch;
  color: var(--ink-muted);
  font-size: var(--fs-lead);
}

/* ---------- privacy policy ---------- */
.legal {
  padding-block: clamp(40px, 5vw, 72px) var(--band-pad);
}
.legal > * {
  max-width: 46rem;
}
.legal h1 {
  font-size: clamp(2.2rem, 1.5rem + 2.6vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
}
.legal h2 {
  margin-top: 2.4em;
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.legal p,
.legal .plain {
  margin-top: 1em;
  color: var(--ink-muted);
}
.legal h2 + p,
.legal h2 + .plain {
  margin-top: 0.75em;
}
.draft-note {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-block: 28px 36px;
  padding: 18px 20px;
  border: 1px solid var(--warn);
  border-radius: var(--radius-card);
  background: var(--raised);
  font-size: var(--fs-small);
}
.draft-note p {
  margin: 0;
}
.legal .draft-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--warn);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.draft-label::before {
  content: '';
  width: 9px;
  height: 9px;
  flex: none;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  background: linear-gradient(90deg, currentColor 50%, transparent 50%);
}
.placeholder {
  padding: 0 0.3em;
  border: 1px dashed var(--warn);
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--warn);
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* ---------- footer ---------- */
.site-foot {
  padding-block: 32px calc(32px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: var(--fs-small);
}
.foot-row .fine {
  margin-top: 8px;
}

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .head-nav {
    display: none;
  }
  .head-row {
    justify-content: space-between;
  }
  .split,
  .fair,
  .faq-wrap {
    grid-template-columns: minmax(0, 1fr);
  }
  .split-flip .split-text {
    order: 0;
  }
  .grid3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  :root {
    --gutter: 16px;
  }
  .head-row {
    gap: 12px;
  }
  .head-end {
    gap: 8px;
  }
  .lang-select {
    padding: 0 24px 0 9px;
    font-size: 0.8125rem;
  }
  .grid3 {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
  .cta-row .btn {
    width: 100%;
  }
  .gloss-rows > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }
  .route > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .controls {
    padding: 18px 10px 6px;
  }
  .controls .ctl-row > :nth-child(2),
  .controls .ctl-row > :nth-child(3),
  .controls .ctl-row > :nth-child(8) {
    display: none;
  }
  /* the comparison becomes one block per row */
  .table-scroll {
    border: 0;
    background: transparent;
  }
  .compare thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .compare,
  .compare tbody,
  .compare tr,
  .compare th,
  .compare td {
    display: block;
    width: auto;
  }
  .compare tr {
    margin-bottom: 14px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background: var(--raised);
  }
  .compare tbody th {
    width: auto;
    border-top: 0;
    padding: 14px 16px 10px;
    font-size: 1rem;
  }
  .compare td {
    padding: 12px 16px 14px;
  }
  .compare td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 6px;
    color: var(--ink-subtle);
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .lk.is-in {
    animation: none;
  }
}
