/* Anki Dictionary Add-on — site chassis.
   Ink is the default ground; paper is the light alternative. The visual
   language is borrowed from print: hairline rules, mono metadata, one
   oversized Archivo display face, and screenshots framed like plates. */

:root,
html[data-theme="ink"] {
  --bg: #17171a;
  --panel: #1e1e22;
  --mass: #26262b;
  --ink: #eae8ee;
  --dim: #cdccd2;
  --faint: #b0afb6;
  --faint2: #908f96;
  --line: #26262b;
  --line2: #35353d;
  --spot: #4dabf7;
  --spot-ink: #0b1220;
  --grid: #202024;
  --run: #5fae74;
  --terminal: #0c0c0b;
  --terminal-2: #131312;
  --term-text: #c8cdd4;
  --term-line: #2b3038;
  --logo-filter: invert(1) brightness(1.7);
  --shadow: 0 18px 50px rgb(0 0 0 / 0.35);
}

html[data-theme="paper"] {
  --bg: #efece5;
  --panel: #e7e3da;
  --mass: #ddd8cc;
  --ink: #15140f;
  --dim: #55534a;
  --faint: #625d4e;
  --faint2: #6a6554;
  --line: #e2ded4;
  --line2: #cbc5b6;
  --spot: #0066cc;
  --spot-ink: #fff;
  --grid: #e4e0d6;
  --run: #2d9f52;
  --terminal: #141412;
  --terminal-2: #1c1c19;
  --term-text: #d7d3c8;
  --term-line: #33332e;
  --logo-filter: none;
  --shadow: 0 18px 50px rgb(80 70 40 / 0.14);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.65;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 72px 72px;
  overflow-x: clip;
}

:root {
  --disp: "Archivo", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --gut: clamp(20px, 3.2vw, 44px);
  --max: 1440px;
  --r: 3px;
}

::selection { background: var(--spot); color: var(--spot-ink); }

img, svg, video { display: block; max-width: 100%; }
a { color: inherit; }
button, input { font: inherit; }

h1, h2, h3, h4, p, ul, ol, figure { margin-top: 0; }

.frame {
  max-width: var(--max);
  margin: 0 auto;
  background: var(--bg);
  border-left: 1px solid var(--line2);
  border-right: 1px solid var(--line2);
  position: relative;
}

.wrap { padding-inline: var(--gut); }

.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 200;
  background: var(--spot);
  color: var(--spot-ink);
  padding: 8px 14px;
  font-family: var(--mono);
  font-size: 12px;
  text-decoration: none;
}
.skip:focus { left: 12px; }

:focus-visible {
  outline: 2px solid var(--spot);
  outline-offset: 3px;
}

/* ── nav ─────────────────────────────────────────────────────────── */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 60px;
  padding: 0 var(--gut);
  border-bottom: 1px solid var(--line2);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--disp);
  font-weight: 900;
  font-size: 20px;
  letter-spacing: -0.045em;
  white-space: nowrap;
}
.brand img { width: 23px; height: 23px; filter: var(--logo-filter); }
.brand span b { color: var(--spot); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: 8px;
}
.nav-links a {
  color: var(--faint);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.12s ease;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--spot); }

.nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stars-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line2);
  color: var(--faint);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.02em;
}
.stars-pill:hover { color: var(--spot); border-color: var(--spot); }
.stars-pill svg { width: 12px; height: 12px; fill: currentColor; }
.stars-pill b { font-weight: 400; color: var(--ink); font-variant-numeric: tabular-nums; }

.ground {
  display: flex;
  border: 1px solid var(--line2);
  height: 30px;
}
.ground button {
  border: 0;
  background: none;
  color: var(--faint);
  cursor: pointer;
  padding: 0 9px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.ground button:hover { color: var(--ink); }
.ground button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 13px;
  border: 1px solid var(--line2);
  color: var(--ink);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.nav-cta:hover { background: var(--spot); border-color: var(--spot); color: var(--spot-ink); }

.menu {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line2);
  background: none;
  color: var(--dim);
  cursor: pointer;
}
.menu span { display: block; width: 13px; height: 1px; background: currentColor; }
.menu[aria-expanded="true"] { color: var(--spot); border-color: var(--spot); }

.sheet {
  display: none;
  position: sticky;
  top: 60px;
  z-index: 55;
  background: var(--bg);
  border-bottom: 1px solid var(--line2);
}
.sheet.is-open { display: block; }
.sheet a {
  display: block;
  padding: 14px var(--gut);
  border-top: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.sheet a:hover { color: var(--spot); }

/* ── shared type ─────────────────────────────────────────────────── */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 18px;
  color: var(--spot);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 42px;
  height: 1px;
  background: var(--spot);
  flex: 0 0 auto;
}
.eyebrow.center { justify-content: center; }
.eyebrow.center::after {
  content: "";
  width: 42px;
  height: 1px;
  background: var(--spot);
  flex: 0 0 auto;
}

h1, h2, h3 { color: var(--ink); }

.display,
.section-head h2,
.cta h2,
.page-head h1 {
  font-family: var(--disp);
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 0.92;
}
.display em,
.section-head h2 em,
.cta h2 em,
.page-head h1 em {
  font-style: italic;
  color: var(--spot);
}

.section-head {
  padding: clamp(48px, 6vw, 76px) var(--gut) clamp(28px, 3vw, 40px);
}
.section-head h2 {
  margin: 0;
  font-size: clamp(2.2rem, 4.6vw, 4.2rem);
  max-width: 20ch;
}
.section-head .lede {
  margin: 18px 0 0;
  max-width: 62ch;
  color: var(--dim);
  font-size: 15.5px;
  line-height: 1.75;
}
.section-head .lede b { color: var(--ink); font-weight: 500; }

/* ── hero ────────────────────────────────────────────────────────── */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
  min-height: calc(100svh - 60px);
  border-bottom: 1px solid var(--line2);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(40px, 6vw, 86px) var(--gut);
}

.hero h1 {
  margin: 0;
  font-family: var(--disp);
  font-weight: 900;
  font-size: clamp(3.2rem, 7.1vw, 7.4rem);
  line-height: 0.87;
  letter-spacing: -0.058em;
  max-width: 12ch;
}
.hero h1 em { font-style: italic; color: var(--spot); display: inline-block; }

.hero-lede {
  margin: 26px 0 0;
  max-width: 49ch;
  color: var(--dim);
  font-size: clamp(15px, 1.35vw, 17px);
  line-height: 1.7;
}
.hero-lede b { color: var(--ink); font-weight: 500; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--line2);
  color: var(--ink);
  background: none;
  text-decoration: none;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.btn:hover { border-color: var(--spot); color: var(--spot); }
.btn-solid { background: var(--spot); border-color: var(--spot); color: var(--spot-ink); }
.btn-solid:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn-ghost { border-color: var(--line2); }

.install-panel { margin-top: 30px; max-width: 560px; }
.install-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.install-label i {
  width: 6px;
  height: 6px;
  background: var(--run);
  display: inline-block;
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }

.install-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--terminal);
  border: 1px solid var(--term-line);
  color: var(--term-text);
  box-shadow: var(--shadow);
}
.install-card .prompt {
  color: var(--spot);
  font-family: var(--mono);
  font-weight: 600;
  font-size: 13px;
}
.install-card code {
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--term-text);
  user-select: all;
}
.install-card code::-webkit-scrollbar { display: none; }
.install-card .copy {
  border: 1px solid var(--term-line);
  background: var(--terminal-2);
  color: var(--term-text);
  cursor: pointer;
  padding: 5px 9px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.install-card .copy:hover { border-color: var(--spot); color: var(--spot); }
.install-card .copy.is-done { border-color: var(--run); color: var(--run); }
.install-card-secondary { margin-top: 8px; box-shadow: none; opacity: 0.85; }
.install-card-secondary code { font-size: 11px; color: var(--faint); }
.install-card-secondary .prompt { font-size: 11px; color: var(--faint); }

.hero-note {
  margin: 12px 0 0;
  color: var(--faint2);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.7;
}
.hero-note a { color: var(--spot); text-decoration: none; }
.hero-note a:hover { text-decoration: underline; }

.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(26px, 3.4vw, 50px);
  border-left: 1px solid var(--line2);
  background: var(--panel);
  overflow: hidden;
}
.hero-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 36px 36px;
  opacity: 0.55;
  pointer-events: none;
}
.hero-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 30%, var(--panel) 82%);
  pointer-events: none;
}
.hero-shot {
  position: relative;
  z-index: 1;
  margin: 0;
  width: 100%;
  max-width: 720px;
}
.hero-shot figcaption {
  margin-top: 12px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10.5px;
  text-align: center;
  letter-spacing: 0.04em;
}

.window {
  border: 1px solid var(--line2);
  background: var(--terminal);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.window-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border-bottom: 1px solid var(--term-line);
  background: var(--terminal-2);
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
}
.window-bar i {
  width: 7px;
  height: 7px;
  border: 1px solid var(--faint2);
  border-radius: 50%;
  flex: 0 0 auto;
}
.window-bar i:first-child { border-color: var(--spot); }
.window-bar span {
  margin-left: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.window-bar .win-badge {
  margin-left: auto;
  padding: 2px 6px;
  border: 1px solid var(--term-line);
  color: var(--run);
  font-size: 8.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.window video,
.window img {
  width: 100%;
  aspect-ratio: 1280 / 800;
  object-fit: cover;
  background: var(--terminal);
}

/* ── stats strip ─────────────────────────────────────────────────── */

.strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line2);
}
.stat {
  display: flex;
  flex-direction: column;
  padding: 24px var(--gut) 26px;
  border-right: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: background 0.12s ease;
}
.stat:last-child { border-right: 0; }
a.stat:hover { background: color-mix(in srgb, var(--spot) 6%, transparent); }
.stat b {
  display: block;
  font-family: var(--disp);
  font-weight: 900;
  font-size: clamp(1.9rem, 3.1vw, 3rem);
  line-height: 1;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.stat span {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 11px;
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.stat .live {
  width: 6px;
  height: 6px;
  background: var(--run);
  animation: pulse 2.2s ease-in-out infinite;
}
.stat.is-fallback b { color: var(--faint); }

/* ── feature router ──────────────────────────────────────────────── */

.features { border-top: 1px solid var(--line2); }
.feature {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) minmax(270px, 400px);
  gap: clamp(20px, 3vw, 44px);
  align-items: start;
  padding: 34px var(--gut);
  border-bottom: 1px solid var(--line);
  transition: background 0.12s ease;
}
.feature:hover { background: color-mix(in srgb, var(--spot) 4%, transparent); }
.feature .num {
  font-family: var(--disp);
  font-weight: 900;
  font-size: clamp(2.4rem, 3.2vw, 3.2rem);
  line-height: 1;
  letter-spacing: -0.05em;
  color: var(--mass);
  transition: color 0.12s ease;
}
.feature:hover .num { color: var(--line2); }
.feature h3 {
  margin: 0;
  font-family: var(--disp);
  font-weight: 800;
  font-size: clamp(1.35rem, 1.9vw, 1.75rem);
  letter-spacing: -0.03em;
  line-height: 1.12;
}
.feature p {
  margin: 10px 0 0;
  max-width: 60ch;
  color: var(--dim);
  font-size: 14px;
  line-height: 1.7;
}
.feature p b { color: var(--ink); font-weight: 500; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}
.tags li {
  padding: 3px 8px;
  border: 1px solid var(--line2);
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.05em;
}

.spec {
  align-self: stretch;
  border: 1px solid var(--line2);
  background: var(--panel);
  padding: 13px 15px;
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.8;
  color: var(--faint);
}
.spec-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 5px 0;
  border-bottom: 1px dashed var(--line2);
}
.spec-row:last-child { border-bottom: 0; }
.spec-row b {
  margin-left: auto;
  color: var(--dim);
  font-weight: 400;
  text-align: right;
}
.spec-row .dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  align-self: center;
  background: var(--spot);
}
.spec-row .dot.g { background: var(--run); }
.spec-row .dot.y { background: #e6b84a; }
.spec-row .dot.r { background: #e05a5a; }
.spec.terminal {
  background: var(--terminal);
  border-color: var(--term-line);
  color: var(--faint2);
}
.spec.terminal b { color: var(--term-text); }
.spec.terminal .spot { color: var(--spot); }
.spec.terminal .run { color: var(--run); }

/* ── theme gallery ───────────────────────────────────────────────── */

.gallery {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  padding: 0 var(--gut) clamp(48px, 6vw, 76px);
}
.theme-card {
  grid-column: span 2;
  margin: 0;
  border: 1px solid var(--line2);
  background: var(--panel);
  overflow: hidden;
  transition: border-color 0.14s ease, transform 0.14s ease;
}
.theme-card:first-child,
.theme-card:nth-child(2) { grid-column: span 3; }
.theme-card:hover { border-color: var(--spot); transform: translateY(-2px); }
.theme-card a { display: block; text-decoration: none; color: inherit; }
.theme-card picture { display: block; overflow: hidden; background: var(--terminal); }
.theme-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.theme-card:hover img { transform: scale(1.015); }
.theme-card figcaption {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 11px 13px;
  border-top: 1px solid var(--line2);
}
.theme-card figcaption b {
  font-family: var(--disp);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.02em;
}
.theme-card figcaption span {
  margin-left: auto;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ── films ───────────────────────────────────────────────────────── */

.films {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 0 var(--gut) clamp(52px, 6vw, 80px);
}
.film {
  margin: 0;
  border: 1px solid var(--line2);
  background: var(--panel);
  overflow: hidden;
}
.film video {
  width: 100%;
  aspect-ratio: 1280 / 800;
  object-fit: cover;
  background: var(--terminal);
}
.film figcaption {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 12px 14px;
  border-top: 1px solid var(--line2);
  color: var(--dim);
  font-size: 12.5px;
}
.film figcaption b {
  color: var(--ink);
  font-family: var(--mono);
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.film figcaption span { color: var(--faint); }
.film-wide { grid-column: 1 / -1; }
.film-wide video { aspect-ratio: 16 / 9; object-fit: contain; }
.film-wide figcaption { flex-wrap: wrap; }
.film-wide figcaption a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* Chaptered feature walkthroughs: a section rail beside the video. */
.film-chapters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 310px);
}
.film-chapters .film-player {
  position: relative;
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  background: var(--terminal);
}
.film-chapters .film-player video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: var(--terminal);
}
.chapter-now {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  display: flex;
  gap: 8px;
  align-items: center;
  max-width: calc(100% - 28px);
  padding: 7px 10px;
  border: 1px solid rgb(255 255 255 / 0.16);
  border-radius: 2px;
  background: rgb(12 12 11 / 0.82);
  color: #eae8ee;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  pointer-events: none;
  backdrop-filter: blur(6px);
}
.chapter-now-index { color: var(--spot); }
.chapter-now-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.film-chapters .chapter-rail {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-left: 1px solid var(--line2);
  background: var(--panel);
}
.chapter-rail-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line2);
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.chapter-time {
  color: var(--faint2);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.chapter-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  list-style: none;
}
.chapter-list button {
  display: flex;
  gap: 10px;
  align-items: baseline;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  color: var(--dim);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.chapter-list button:hover {
  background: var(--mass);
  color: var(--ink);
}
.chapter-list button.is-active {
  border-color: var(--line2);
  background: var(--mass);
  box-shadow: inset 2px 0 0 var(--spot);
  color: var(--ink);
}
.chapter-at {
  min-width: 34px;
  color: var(--faint2);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
}
.chapter-list button.is-active .chapter-at { color: var(--spot); }
.chapter-label { font-size: 12.5px; line-height: 1.35; }
.film-chapters figcaption {
  grid-column: 1 / -1;
  grid-row: 2;
}

@media (max-width: 980px) {
  .film-chapters { grid-template-columns: 1fr; }
  .film-chapters .chapter-rail {
    grid-column: 1;
    grid-row: 2;
    border-top: 1px solid var(--line2);
    border-left: 0;
  }
  .film-chapters figcaption { grid-row: 3; }
  .chapter-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
  }
}

@media (max-width: 620px) {
  .chapter-list { grid-template-columns: 1fr; }
  .chapter-now { top: 10px; left: 10px; }
}

/* ── CTA ─────────────────────────────────────────────────────────── */

.cta {
  border-top: 1px solid var(--line2);
  border-bottom: 1px solid var(--line2);
  background:
    radial-gradient(ellipse at 80% 20%, color-mix(in srgb, var(--spot) 9%, transparent), transparent 55%),
    var(--bg);
}
.cta-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: clamp(28px, 5vw, 70px);
  align-items: center;
  padding: clamp(48px, 6vw, 82px) var(--gut);
}
.cta h2 {
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 4.8rem);
  max-width: 15ch;
}
.cta p { margin: 18px 0 0; max-width: 48ch; color: var(--dim); }
.cta .install-panel { margin-top: 0; max-width: none; }
.cta .hero-note { margin-top: 14px; }

/* ── footer ──────────────────────────────────────────────────────── */

.footer {
  padding: clamp(38px, 5vw, 60px) var(--gut) 34px;
  background: var(--bg);
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) repeat(3, minmax(130px, 0.6fr));
  gap: 34px;
}
.footer .brand { font-size: 18px; }
.footer-tag {
  margin: 14px 0 0;
  max-width: 34ch;
  color: var(--faint);
  font-size: 12.5px;
  line-height: 1.7;
}
.footer h4 {
  margin: 0 0 12px;
  color: var(--faint2);
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.footer ul { margin: 0; padding: 0; list-style: none; }
.footer li { margin: 0 0 8px; }
.footer li a {
  color: var(--dim);
  text-decoration: none;
  font-size: 12.5px;
}
.footer li a:hover { color: var(--spot); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 28px;
  align-items: baseline;
  margin-top: 42px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--faint2);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.03em;
}
.footer-bottom span:last-child { margin-left: auto; }
.footer-bottom a { color: var(--faint); text-decoration: none; }
.footer-bottom a:hover { color: var(--spot); }

/* ── docs page ───────────────────────────────────────────────────── */

.page-head {
  padding: clamp(46px, 6vw, 76px) var(--gut) clamp(34px, 4vw, 52px);
  border-bottom: 1px solid var(--line2);
}
.page-head h1 {
  margin: 0;
  font-size: clamp(2.8rem, 6vw, 5.6rem);
  max-width: 16ch;
}
.page-head .lede {
  margin: 20px 0 0;
  max-width: 62ch;
  color: var(--dim);
  font-size: 16px;
  line-height: 1.75;
}
.page-head .meta-line {
  margin-top: 18px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 11px;
}
.page-head .meta-line a { color: var(--spot); text-decoration: none; }
.page-head .meta-line a:hover { text-decoration: underline; }

.docs-layout {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  align-items: start;
}
.docs-layout > *,
.toc,
.toc-inner,
.doc { min-width: 0; }
.toc {
  border-right: 1px solid var(--line2);
  min-height: 100%;
}
.toc-inner {
  position: sticky;
  top: 60px;
  max-height: calc(100svh - 60px);
  overflow-y: auto;
  padding: 28px 22px 40px var(--gut);
  scrollbar-width: thin;
}
.toc .eyebrow { font-size: 9.5px; letter-spacing: 0.22em; margin-bottom: 16px; }
.toc .eyebrow::before { width: 24px; }
.toc nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  max-width: 100%;
}
.toc nav a {
  display: block;
  padding: 6px 0 6px 12px;
  border-left: 1px solid var(--line2);
  color: var(--faint);
  text-decoration: none;
  font-size: 12px;
  line-height: 1.4;
}
.toc nav a:hover { color: var(--ink); border-left-color: var(--faint2); }
.toc nav a.is-active {
  color: var(--spot);
  border-left: 2px solid var(--spot);
  padding-left: 11px;
}
.toc-cta {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--faint2);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.7;
}
.toc-cta a { color: var(--spot); text-decoration: none; }
.toc-cta a:hover { text-decoration: underline; }

.doc {
  width: 100%;
  max-width: 940px;
  margin-inline: auto;
  padding: 12px var(--gut) 90px;
}
.doc section {
  padding-top: 40px;
  margin-top: 28px;
  border-top: 1px solid var(--line);
}
.doc section:first-of-type { border-top: 0; margin-top: 0; }
.doc h2 {
  margin: 0 0 16px;
  font-family: var(--disp);
  font-weight: 900;
  font-size: clamp(1.9rem, 3vw, 2.7rem);
  line-height: 1;
  letter-spacing: -0.045em;
}
.doc h3 {
  margin: 32px 0 10px;
  font-family: var(--disp);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.doc h4 {
  margin: 24px 0 8px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.doc p,
.doc li { max-width: 36em; color: var(--dim); font-size: 14.5px; line-height: 1.75; }
.doc .note { max-width: 36em; }
.doc .doc-sub { color: var(--faint); font-size: 0.55em; letter-spacing: 0; }
.doc p { margin: 0 0 14px; }
.doc ul, .doc ol { margin: 0 0 16px; padding-left: 22px; }
.doc li { margin: 5px 0; }
.doc li::marker { color: var(--faint2); }
.doc b, .doc strong { color: var(--ink); font-weight: 600; }
.doc a {
  color: var(--spot);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.doc a:hover { text-decoration-thickness: 2px; }
.doc code {
  padding: 1px 5px;
  border: 1px solid var(--line2);
  background: var(--panel);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.84em;
  white-space: nowrap;
}
.doc kbd {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid var(--line2);
  border-bottom-width: 2px;
  background: var(--panel);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.78em;
  line-height: 1.5;
  white-space: nowrap;
}
.doc pre {
  position: relative;
  margin: 18px 0 22px;
  padding: 15px 16px;
  overflow-x: auto;
  background: var(--terminal);
  border: 1px solid var(--term-line);
  color: var(--term-text);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
}
.doc pre code {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  white-space: pre;
  font-size: inherit;
}
.doc pre .copy {
  position: absolute;
  top: 7px;
  right: 7px;
  padding: 3px 7px;
  border: 1px solid var(--term-line);
  background: var(--terminal-2);
  color: var(--faint);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.doc pre .copy:hover { color: var(--spot); border-color: var(--spot); }
.doc pre .copy.is-done { color: var(--run); border-color: var(--run); }

.table-wrap {
  margin: 18px 0 24px;
  overflow-x: auto;
  border: 1px solid var(--line2);
}
.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.doc th {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line2);
  background: var(--panel);
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.doc td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--dim);
  vertical-align: top;
}
.doc tr:last-child td { border-bottom: 0; }
.doc td code { white-space: nowrap; }

.note {
  margin: 18px 0 22px;
  padding: 13px 16px;
  border-left: 2px solid var(--spot);
  background: var(--panel);
  color: var(--dim);
  font-size: 13.5px;
  line-height: 1.7;
}
.note b { color: var(--ink); }
.note a { color: var(--spot); }

.steps {
  margin: 18px 0 24px;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li {
  position: relative;
  padding: 0 0 14px 42px;
  color: var(--dim);
}
.steps li::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 1px;
  color: var(--spot);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
}
.steps li b { color: var(--ink); }

.doc-fig {
  margin: 24px 0 28px;
  border: 1px solid var(--line2);
  background: var(--panel);
  overflow: hidden;
}
.doc-fig picture { display: block; background: var(--terminal); }
.doc-fig img { width: 100%; height: auto; }
.doc-fig figcaption {
  padding: 9px 12px;
  border-top: 1px solid var(--line2);
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.03em;
}
.doc-fig-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 24px 0 28px;
}
.doc-fig-row .doc-fig { margin: 0; }

.cta-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.doc section:last-of-type { padding-bottom: 8px; }

/* ── reveal / motion ─────────────────────────────────────────────── */

[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
[data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}

/* ── responsive ──────────────────────────────────────────────────── */

@media (max-width: 1120px) {
  .feature { grid-template-columns: 76px minmax(0, 1fr) minmax(240px, 330px); }
  .nav-links { gap: 16px; }
}

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-copy { padding-top: 52px; padding-bottom: 42px; }
  .hero-visual { border-left: 0; border-top: 1px solid var(--line2); }
  .hero-shot { max-width: 680px; }
  .feature { grid-template-columns: 64px minmax(0, 1fr); }
  .feature .spec { grid-column: 2; }
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .docs-layout { grid-template-columns: 1fr; }
  .toc { border-right: 0; border-bottom: 1px solid var(--line2); }
  .toc-inner {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 18px var(--gut);
  }
  .toc .eyebrow { margin-bottom: 10px; }
  .toc nav {
    flex-direction: row;
    gap: 0;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .toc nav::-webkit-scrollbar { display: none; }
  .toc nav a {
    border-left: 0;
    border-bottom: 1px solid var(--line2);
    padding: 8px 12px;
    white-space: nowrap;
  }
  .toc nav a.is-active {
    border-left: 0;
    border-bottom: 2px solid var(--spot);
    padding-left: 12px;
  }
  .toc-cta { display: none; }
  .cta-inner { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .nav-links, .stars-pill { display: none; }
  .menu { display: inline-flex; }
  .nav-cta { display: none; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .theme-card,
  .theme-card:first-child,
  .theme-card:nth-child(2) { grid-column: span 1; }
  .theme-card:first-child { grid-column: span 2; }
  .films { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid > div:first-child { grid-column: span 2; }
}

@media (max-width: 620px) {
  body { font-size: 14.5px; }
  .brand { font-size: 17px; }
  .hero h1 { font-size: clamp(2.9rem, 14vw, 4.4rem); }
  .hero-actions { gap: 8px; }
  .install-card { padding: 10px 11px; gap: 8px; }
  .install-card code { font-size: 11.5px; }
  .stat b { font-size: clamp(1.15rem, 6.2vw, 1.8rem); letter-spacing: -0.06em; }
  .feature { grid-template-columns: 1fr; gap: 8px; padding: 26px var(--gut); }
  .feature .num { font-size: 2.2rem; }
  .feature .spec { grid-column: 1; margin-top: 6px; }
  .gallery { grid-template-columns: 1fr; }
  .theme-card:first-child { grid-column: span 1; }
  .doc-fig-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-grid > div:first-child { grid-column: span 1; }
  .footer-bottom span:last-child { margin-left: 0; }
  .page-head h1 { font-size: clamp(2.4rem, 12vw, 3.4rem); }
  .doc { padding-bottom: 60px; }
}
