/* ==========================================================================
   Failover LB - failoverlb.net
   One stylesheet for the whole site. No frameworks, no build step, no CDN.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */

:root {
  color-scheme: light dark;

  /* Type */
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", "Menlo",
    "Cascadia Mono", "Consolas", "Liberation Mono", monospace;

  --step--2: clamp(0.72rem, 0.70rem + 0.10vw, 0.78rem);
  --step--1: clamp(0.84rem, 0.81rem + 0.15vw, 0.92rem);
  --step-0:  clamp(1.00rem, 0.97rem + 0.16vw, 1.09rem);
  --step-1:  clamp(1.18rem, 1.12rem + 0.30vw, 1.36rem);
  --step-2:  clamp(1.42rem, 1.31rem + 0.55vw, 1.78rem);
  --step-3:  clamp(1.72rem, 1.52rem + 0.98vw, 2.42rem);
  --step-4:  clamp(2.05rem, 1.71rem + 1.70vw, 3.30rem);
  --step-5:  clamp(2.45rem, 1.85rem + 3.00vw, 4.60rem);

  /* Space */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;
  --sp-9: 6rem;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-xl: 30px;

  --wrap: 1200px;
  --wrap-narrow: 780px;
  --wrap-wide: 1440px;

  --nav-h: 66px;
}

/* Light palette on bare :root so nothing is ever undefined. */
:root {
  --bg:            #ffffff;
  --bg-sunken:     #f5f6f9;
  --bg-raised:     #ffffff;
  --bg-inset:      #eef0f5;
  --surface-glass: rgba(255, 255, 255, 0.72);

  --fg:            #10131a;
  --fg-strong:     #05070c;
  --fg-muted:      #56607a;
  --fg-faint:      #7b849b;

  --line:          #e2e6ee;
  --line-strong:   #ccd2df;

  --brand:         #4739e0;
  --brand-2:       #0d9bd6;
  --brand-3:       #17b8a6;
  --brand-soft:    rgba(71, 57, 224, 0.10);
  --brand-ink:     #2b1fb0;

  --ok:            #0f8a52;
  --ok-soft:       rgba(15, 138, 82, 0.12);
  --warn:          #a2650a;
  --warn-soft:     rgba(162, 101, 10, 0.13);
  --bad:           #c33025;
  --bad-soft:      rgba(195, 48, 37, 0.11);

  --code-bg:       #0d1017;
  --code-fg:       #dfe5f2;

  --shadow-1: 0 1px 2px rgba(11, 16, 32, 0.05), 0 1px 3px rgba(11, 16, 32, 0.05);
  --shadow-2: 0 4px 12px rgba(11, 16, 32, 0.07), 0 2px 4px rgba(11, 16, 32, 0.04);
  --shadow-3: 0 18px 46px rgba(11, 16, 32, 0.13), 0 4px 12px rgba(11, 16, 32, 0.06);
  --shadow-glow: 0 0 0 1px rgba(71, 57, 224, 0.14), 0 20px 60px rgba(71, 57, 224, 0.14);

  --mesh-1: rgba(71, 57, 224, 0.20);
  --mesh-2: rgba(13, 155, 214, 0.18);
  --mesh-3: rgba(23, 184, 166, 0.16);
}

/* Dark, applied when the reader has not explicitly chosen light. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:            #080a10;
    --bg-sunken:     #05060b;
    --bg-raised:     #10131c;
    --bg-inset:      #161a25;
    --surface-glass: rgba(16, 19, 28, 0.68);

    --fg:            #e6e9f2;
    --fg-strong:     #ffffff;
    --fg-muted:      #9aa3ba;
    --fg-faint:      #737d95;

    --line:          #222739;
    --line-strong:   #303751;

    --brand:         #8b83ff;
    --brand-2:       #46c8f5;
    --brand-3:       #4fe3cd;
    --brand-soft:    rgba(139, 131, 255, 0.14);
    --brand-ink:     #b6b0ff;

    --ok:            #43d391;
    --ok-soft:       rgba(67, 211, 145, 0.14);
    --warn:          #f0b95c;
    --warn-soft:     rgba(240, 185, 92, 0.14);
    --bad:           #ff7a6e;
    --bad-soft:      rgba(255, 122, 110, 0.13);

    --code-bg:       #04060c;
    --code-fg:       #d8dfef;

    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-2: 0 6px 18px rgba(0, 0, 0, 0.45);
    --shadow-3: 0 24px 60px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 0 1px rgba(139, 131, 255, 0.20), 0 24px 70px rgba(80, 60, 220, 0.28);

    --mesh-1: rgba(110, 90, 255, 0.26);
    --mesh-2: rgba(50, 170, 240, 0.20);
    --mesh-3: rgba(60, 220, 200, 0.16);
  }
}

/* Dark chosen by the toggle. */
:root[data-theme="dark"] {
  --bg:            #080a10;
  --bg-sunken:     #05060b;
  --bg-raised:     #10131c;
  --bg-inset:      #161a25;
  --surface-glass: rgba(16, 19, 28, 0.68);

  --fg:            #e6e9f2;
  --fg-strong:     #ffffff;
  --fg-muted:      #9aa3ba;
  --fg-faint:      #737d95;

  --line:          #222739;
  --line-strong:   #303751;

  --brand:         #8b83ff;
  --brand-2:       #46c8f5;
  --brand-3:       #4fe3cd;
  --brand-soft:    rgba(139, 131, 255, 0.14);
  --brand-ink:     #b6b0ff;

  --ok:            #43d391;
  --ok-soft:       rgba(67, 211, 145, 0.14);
  --warn:          #f0b95c;
  --warn-soft:     rgba(240, 185, 92, 0.14);
  --bad:           #ff7a6e;
  --bad-soft:      rgba(255, 122, 110, 0.13);

  --code-bg:       #04060c;
  --code-fg:       #d8dfef;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-2: 0 6px 18px rgba(0, 0, 0, 0.45);
  --shadow-3: 0 24px 60px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 0 1px rgba(139, 131, 255, 0.20), 0 24px 70px rgba(80, 60, 220, 0.28);

  --mesh-1: rgba(110, 90, 255, 0.26);
  --mesh-2: rgba(50, 170, 240, 0.20);
  --mesh-3: rgba(60, 220, 200, 0.16);
}

/* --------------------------------------------------------------------------
   2. Reset and base
   -------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 20px);
}

@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;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, video, canvas { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4, h5 {
  color: var(--fg-strong);
  line-height: 1.15;
  letter-spacing: -0.022em;
  margin: 0 0 var(--sp-4);
  font-weight: 660;
  text-wrap: balance;
}
h1 { font-size: var(--step-4); letter-spacing: -0.032em; }
h2 { font-size: var(--step-3); letter-spacing: -0.028em; }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }
h5 { font-size: var(--step-0); }

p { margin: 0 0 var(--sp-4); text-wrap: pretty; }

a {
  color: var(--brand-ink);
  text-decoration-color: color-mix(in oklab, var(--brand-ink) 35%, transparent);
  text-underline-offset: 3px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
a:hover { color: var(--brand); text-decoration-color: currentColor; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: var(--sp-7) 0;
}

ul, ol { margin: 0 0 var(--sp-4); padding-left: 1.35rem; }
li { margin-bottom: var(--sp-2); }
li::marker { color: var(--fg-faint); }

strong { font-weight: 640; color: var(--fg-strong); }
small { font-size: var(--step--1); }

code, kbd, samp, pre { font-family: var(--font-mono); font-size: 0.9em; }

:not(pre) > code {
  background: var(--bg-inset);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.12em 0.38em;
  font-size: 0.86em;
  color: var(--fg-strong);
  word-break: break-word;
}

kbd {
  background: var(--bg-inset);
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 0.08em 0.42em;
  font-size: 0.8em;
  color: var(--fg-strong);
}

pre {
  background: var(--code-bg);
  color: var(--code-fg);
  border-radius: var(--radius);
  padding: var(--sp-5);
  overflow-x: auto;
  line-height: 1.6;
  margin: 0 0 var(--sp-5);
  border: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 0.86rem;
  -webkit-overflow-scrolling: touch;
}
pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }

table { border-collapse: collapse; width: 100%; font-size: var(--step--1); }
th, td { text-align: left; padding: 0.7rem 0.85rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--fg-strong); font-weight: 620; background: var(--bg-sunken); }
tbody tr:hover td { background: color-mix(in oklab, var(--brand) 4%, transparent); }

::selection { background: color-mix(in oklab, var(--brand) 30%, transparent); }

/* --------------------------------------------------------------------------
   3. Layout helpers
   -------------------------------------------------------------------------- */

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.wrap-wide { width: min(100% - 2.5rem, var(--wrap-wide)); margin-inline: auto; }
.wrap-narrow { width: min(100% - 2.5rem, var(--wrap-narrow)); margin-inline: auto; }

.section { padding-block: var(--sp-9); }
.section-tight { padding-block: var(--sp-8); }
.section-sunken { background: var(--bg-sunken); }
.section-line { border-top: 1px solid var(--line); }

.stack > * + * { margin-top: var(--sp-4); }
.center { text-align: center; }
.muted { color: var(--fg-muted); }
.faint { color: var(--fg-faint); }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--font-mono); }
.hide { display: none !important; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-6 { margin-top: var(--sp-6); }
.mb-6 { margin-bottom: var(--sp-6); }

.lead {
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--fg-muted);
  max-width: 62ch;
}
.lead-center { margin-inline: auto; }

.grid { display: grid; gap: var(--sp-5); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(275px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }

.split {
  display: grid;
  gap: var(--sp-7);
  grid-template-columns: 1fr;
  align-items: center;
}
@media (min-width: 900px) {
  .split { grid-template-columns: 1fr 1fr; gap: var(--sp-8); }
  .split-wide-right { grid-template-columns: 5fr 7fr; }
  .split-wide-left { grid-template-columns: 7fr 5fr; }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--step--2);
  font-weight: 640;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--brand-ink);
  margin-bottom: var(--sp-3);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

.section-head { max-width: 66ch; margin-bottom: var(--sp-7); }
.section-head.center { margin-inline: auto; }
.section-head p:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   4. Header and navigation
   -------------------------------------------------------------------------- */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 200;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip:focus { left: 0; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: var(--surface-glass);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.site-header.is-stuck { border-bottom-color: var(--line); }

.nav {
  width: min(100% - 2rem, var(--wrap-wide));
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: var(--sp-5);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 680;
  font-size: 1.03rem;
  letter-spacing: -0.02em;
  color: var(--fg-strong);
  text-decoration: none;
  flex: none;
}
.brand:hover { color: var(--fg-strong); }
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2) 60%, var(--brand-3));
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 3px 10px color-mix(in oklab, var(--brand) 40%, transparent);
  flex: none;
}
.brand-mark svg { width: 17px; height: 17px; }

.nav-links {
  display: none;
  align-items: center;
  gap: 0.15rem;
  margin-left: auto;
}
@media (min-width: 1060px) { .nav-links { display: flex; } }

.nav-links a {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 530;
  padding: 0.45rem 0.7rem;
  border-radius: 9px;
  transition: color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--fg-strong); background: var(--bg-inset); }
.nav-links a.active { color: var(--fg-strong); background: var(--brand-soft); }

.nav-tools { display: flex; align-items: center; gap: 0.4rem; margin-left: auto; }
@media (min-width: 1060px) { .nav-tools { margin-left: 0.5rem; } }

.icon-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-raised);
  color: var(--fg-muted);
  cursor: pointer;
  padding: 0;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.icon-btn:hover { color: var(--fg-strong); border-color: var(--line-strong); }
.icon-btn svg { width: 17px; height: 17px; }

.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: block; }
}

.nav-toggle { display: grid; }
@media (min-width: 1060px) { .nav-toggle { display: none; } }

.mobile-nav {
  position: fixed;
  inset: var(--nav-h) 0 0 0;
  background: var(--bg);
  z-index: 99;
  overflow-y: auto;
  padding: var(--sp-5) 1.25rem var(--sp-8);
  display: none;
}
.mobile-nav.open { display: block; }
.mobile-nav h4 {
  font-size: var(--step--2);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-faint);
  margin: var(--sp-5) 0 var(--sp-2);
}
.mobile-nav a {
  display: block;
  padding: 0.55rem 0;
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  font-weight: 520;
}

/* --------------------------------------------------------------------------
   5. Buttons and pills
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.82rem 1.35rem;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.15s ease,
    border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; flex: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 6px 20px color-mix(in oklab, var(--brand) 35%, transparent);
}
.btn-primary:hover {
  color: #fff;
  box-shadow: 0 10px 30px color-mix(in oklab, var(--brand) 45%, transparent);
}

.btn-secondary {
  background: var(--bg-raised);
  border-color: var(--line-strong);
  color: var(--fg-strong);
}
.btn-secondary:hover { border-color: var(--brand); color: var(--brand-ink); }

.btn-ghost { background: transparent; color: var(--fg-muted); }
.btn-ghost:hover { color: var(--fg-strong); background: var(--bg-inset); }

.btn-sm { padding: 0.55rem 0.95rem; font-size: 0.86rem; border-radius: 10px; }
.btn-lg { padding: 1rem 1.7rem; font-size: 1.02rem; border-radius: 14px; }

.btn-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.btn-row.center { justify-content: center; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--step--2);
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: var(--bg-inset);
  border: 1px solid var(--line);
  color: var(--fg-muted);
  white-space: nowrap;
}
.pill-brand { background: var(--brand-soft); border-color: color-mix(in oklab, var(--brand) 28%, transparent); color: var(--brand-ink); }
.pill-ok { background: var(--ok-soft); border-color: color-mix(in oklab, var(--ok) 30%, transparent); color: var(--ok); }
.pill-warn { background: var(--warn-soft); border-color: color-mix(in oklab, var(--warn) 30%, transparent); color: var(--warn); }
.pill-bad { background: var(--bad-soft); border-color: color-mix(in oklab, var(--bad) 30%, transparent); color: var(--bad); }
.pill-dot::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}

/* --------------------------------------------------------------------------
   6. Cards
   -------------------------------------------------------------------------- */

.card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  box-shadow: var(--shadow-1);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card h3, .card h4 { margin-bottom: var(--sp-2); }
.card p:last-child { margin-bottom: 0; }

a.card, .card-link { text-decoration: none; color: inherit; display: block; }
a.card:hover, .card-hover:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-3);
  border-color: color-mix(in oklab, var(--brand) 40%, var(--line));
}
a.card h3, a.card h4 { color: var(--fg-strong); }

.card-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand-ink);
  margin-bottom: var(--sp-4);
}
.card-icon svg { width: 21px; height: 21px; }

.card-more {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 620;
  color: var(--brand-ink);
  margin-top: var(--sp-3);
}
.card-more svg { width: 14px; height: 14px; transition: transform 0.15s ease; }
a.card:hover .card-more svg { transform: translateX(3px); }

.card-flush { padding: 0; overflow: hidden; }
.card-body { padding: var(--sp-5); }

/* Callouts */
.note {
  border-radius: var(--radius);
  padding: var(--sp-4) var(--sp-5);
  margin: 0 0 var(--sp-5);
  border: 1px solid var(--line);
  background: var(--bg-sunken);
  font-size: var(--step--1);
}
.note > :last-child { margin-bottom: 0; }
.note-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 660;
  color: var(--fg-strong);
  margin-bottom: var(--sp-2);
  font-size: var(--step--1);
}
.note-title svg { width: 16px; height: 16px; flex: none; }
.note-tip { background: var(--brand-soft); border-color: color-mix(in oklab, var(--brand) 25%, transparent); }
.note-tip .note-title { color: var(--brand-ink); }
.note-warn { background: var(--warn-soft); border-color: color-mix(in oklab, var(--warn) 28%, transparent); }
.note-warn .note-title { color: var(--warn); }
.note-ok { background: var(--ok-soft); border-color: color-mix(in oklab, var(--ok) 28%, transparent); }
.note-ok .note-title { color: var(--ok); }
.note-bad { background: var(--bad-soft); border-color: color-mix(in oklab, var(--bad) 28%, transparent); }
.note-bad .note-title { color: var(--bad); }

/* --------------------------------------------------------------------------
   7. Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  padding-block: clamp(3rem, 7vw, 6rem) clamp(3rem, 7vw, 5.5rem);
  overflow: hidden;
  isolation: isolate;
}
.hero-mesh {
  position: absolute;
  inset: -30% -10% auto -10%;
  height: 130%;
  z-index: -1;
  background:
    radial-gradient(42% 46% at 18% 22%, var(--mesh-1) 0%, transparent 62%),
    radial-gradient(38% 44% at 82% 18%, var(--mesh-2) 0%, transparent 60%),
    radial-gradient(46% 48% at 52% 88%, var(--mesh-3) 0%, transparent 64%);
  filter: blur(10px);
  animation: drift 26s ease-in-out infinite alternate;
}
@keyframes drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(-3%, 3%, 0) scale(1.08); }
}
.hero-grid-lines {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right, color-mix(in oklab, var(--fg) 6%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in oklab, var(--fg) 6%, transparent) 1px, transparent 1px);
  background-size: 62px 62px;
  mask-image: radial-gradient(70% 60% at 50% 35%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(70% 60% at 50% 35%, #000 0%, transparent 78%);
  opacity: 0.7;
}

.hero-inner { display: grid; gap: var(--sp-7); align-items: center; }
@media (min-width: 1040px) {
  .hero-inner { grid-template-columns: 1fr 1.08fr; gap: var(--sp-8); }
}

.hero h1 {
  font-size: var(--step-5);
  margin-bottom: var(--sp-5);
}
.hero .lead { font-size: var(--step-1); max-width: 56ch; }

.gradient-text {
  background: linear-gradient(100deg, var(--brand) 0%, var(--brand-2) 48%, var(--brand-3) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-badges { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: var(--sp-5); }

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-5) var(--sp-6);
  margin-top: var(--sp-6);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--line);
}
.hero-fact strong {
  display: block;
  font-size: var(--step-2);
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--fg-strong);
}
.hero-fact span { font-size: var(--step--1); color: var(--fg-muted); }

/* --------------------------------------------------------------------------
   8. Browser and terminal frames
   -------------------------------------------------------------------------- */

.frame {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-raised);
  box-shadow: var(--shadow-3);
}
.frame-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.85rem;
  background: var(--bg-inset);
  border-bottom: 1px solid var(--line);
}
.frame-dots { display: flex; gap: 6px; flex: none; }
.frame-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); display: block; }
.frame-dots i:nth-child(1) { background: #ff5f57; }
.frame-dots i:nth-child(2) { background: #febc2e; }
.frame-dots i:nth-child(3) { background: #28c840; }
.frame-url {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--fg-faint);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0.22rem 0.6rem;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.frame img { display: block; width: 100%; height: auto; }

/* Click to enlarge. The button is the picture, so the whole capture is the
   target rather than a small link underneath it. */
.frame-zoom {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  position: relative;
  color: inherit;
  font: inherit;
}
.frame-zoom .zoom-hint {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #fff;
  background: rgba(12, 14, 20, 0.72);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
.frame-zoom .zoom-hint svg { width: 14px; height: 14px; }
.frame-zoom:hover .zoom-hint,
.frame-zoom:focus-visible .zoom-hint { opacity: 1; transform: none; }
.frame-zoom:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }

/* Coarse pointers get no hover, so show the badge from the start. */
@media (hover: none) {
  .frame-zoom .zoom-hint { opacity: 1; transform: none; }
}

/* The enlarged view */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  padding: clamp(0.75rem, 2.5vw, 2rem);
  background: rgba(8, 10, 15, 0.86);
  backdrop-filter: blur(14px);
  opacity: 0;
  visibility: hidden;
  /* Visibility waits for the fade out to finish on the way out, and flips at
     once on the way in. A browser part way through hiding it will not hand
     keyboard focus to anything inside it. */
  transition: opacity 0.24s ease, visibility 0s linear 0.24s;
}
.lightbox.open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.24s ease, visibility 0s linear 0s;
}
.lightbox-stage {
  max-width: min(1800px, 100%);
  max-height: calc(100vh - 14rem);
  border-radius: var(--radius-lg);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #0c0e14;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.55);
  transform: scale(0.97);
  transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.lightbox.open .lightbox-stage { transform: none; }
/* Fit the whole capture on screen first. True pixel size is one click away. */
.lightbox-stage img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(1800px, 100%);
  /* Two pixels less than the panel, which is what its border takes up. */
  max-height: calc(100vh - 14rem - 2px);
}
/* True size: whatever the capture really is, with the panel doing the scrolling. */
.lightbox-stage.zoomed img { width: auto; height: auto; max-width: none; max-height: none; }
.lightbox-cap {
  color: rgba(255, 255, 255, 0.86);
  font-size: var(--step--1);
  text-align: center;
  max-width: 60ch;
  margin: 0;
}
.lightbox-cap .lb-url {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 0.3rem;
}
.lightbox-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.lightbox-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-width: 2.6rem;
  height: 2.6rem;
  padding: 0 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  font: inherit;
  font-size: var(--step--1);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.lightbox-btn:hover { background: rgba(255, 255, 255, 0.18); border-color: rgba(255, 255, 255, 0.35); }
.lightbox-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lightbox-btn svg { width: 17px; height: 17px; }
.lightbox-btn[disabled] { opacity: 0.35; cursor: default; }
.lightbox-count {
  color: rgba(255, 255, 255, 0.6);
  font-size: var(--step--2);
  font-variant-numeric: tabular-nums;
  min-width: 5.5ch;
  text-align: center;
}
.lightbox-close { position: absolute; top: clamp(0.75rem, 2vw, 1.25rem); right: clamp(0.75rem, 2vw, 1.25rem); }
@media (max-width: 640px) {
  .lightbox-cap { display: none; }
  .lightbox-stage,
  .lightbox-stage img { max-height: calc(100vh - 8rem); }
}
@media (prefers-reduced-motion: reduce) {
  .lightbox, .lightbox-stage, .frame-zoom .zoom-hint { transition: none; }
  .lightbox-stage { transform: none; }
}
body.lb-open { overflow: hidden; }

.frame-float {
  transform: perspective(1600px) rotateY(-4deg) rotateX(2deg);
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.frame-float:hover { transform: perspective(1600px) rotateY(0deg) rotateX(0deg); }

figure.shot { margin: 0 0 var(--sp-6); }
figure.shot figcaption {
  font-size: var(--step--1);
  color: var(--fg-muted);
  margin-top: var(--sp-3);
  text-align: center;
}

/* Terminal */
.term {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #05070d;
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: var(--shadow-3);
  color: #cfd8ec;
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.85rem;
  background: #0d1119;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.term-title {
  flex: 1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #7d88a3;
}
.term-body {
  font-family: var(--font-mono);
  font-size: 0.79rem;
  line-height: 1.62;
  padding: var(--sp-5);
  min-height: 300px;
  max-height: 460px;
  overflow-y: auto;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  scrollbar-width: thin;
}
.term-body::-webkit-scrollbar { width: 9px; height: 9px; }
.term-body::-webkit-scrollbar-thumb { background: #232a3a; border-radius: 6px; }

.t-cmd { color: #ffffff; font-weight: 600; }
.t-prompt { color: #4fe3cd; }
.t-ok { color: #43d391; }
.t-warn { color: #f0b95c; }
.t-bad { color: #ff7a6e; }
.t-head { color: #6fa8ff; font-weight: 600; }
.t-dim { color: #78829b; }
.t-url { color: #46c8f5; }

.term-caret {
  display: inline-block;
  width: 8px;
  height: 1.05em;
  vertical-align: text-bottom;
  background: #4fe3cd;
  animation: blink 1.05s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Player controls shared by terminal and screencast */
.player-controls {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.85rem;
  border-top: 1px solid var(--line);
  background: var(--bg-inset);
  font-size: 0.78rem;
  color: var(--fg-muted);
}
.term .player-controls {
  border-top-color: rgba(255, 255, 255, 0.07);
  background: #0d1119;
  color: #8b95ad;
}
.player-btn {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  background: var(--bg-raised);
  color: var(--fg-strong);
  cursor: pointer;
  flex: none;
  padding: 0;
}
.term .player-btn { background: #161c28; border-color: #262e40; color: #dfe6f5; }
.player-btn svg { width: 14px; height: 14px; }
.player-btn:hover { border-color: var(--brand); }

.player-track {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
  cursor: pointer;
  min-width: 60px;
}
.term .player-track { background: #222a3a; }
.player-fill {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transition: width 0.15s linear;
}
.player-time { font-family: var(--font-mono); font-size: 0.72rem; flex: none; }
.player-label { flex: none; font-weight: 560; }

.player-note {
  font-size: var(--step--2);
  color: var(--fg-faint);
  margin-top: var(--sp-2);
  text-align: center;
}

/* Screencast */
.cast { position: relative; }
.cast-stage {
  position: relative;
  background: var(--bg-inset);
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
.cast-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.cast-stage img.on { opacity: 1; }
.cast-caption {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  max-width: min(90%, 620px);
  background: rgba(8, 10, 16, 0.86);
  color: #f2f5fb;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 0.6rem 0.95rem;
  font-size: 0.85rem;
  line-height: 1.45;
  text-align: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.cast-step {
  position: absolute;
  top: 12px; left: 12px;
  background: rgba(8, 10, 16, 0.8);
  color: #cfd8ec;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.72rem;
  font-family: var(--font-mono);
}
.cast-cursor {
  position: absolute;
  width: 22px; height: 22px;
  z-index: 5;
  pointer-events: none;
  transition: left 0.9s cubic-bezier(0.25, 0.9, 0.3, 1), top 0.9s cubic-bezier(0.25, 0.9, 0.3, 1);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}
.cast-ring {
  position: absolute;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 2px solid var(--brand-2);
  transform: translate(-50%, -50%) scale(0.4);
  opacity: 0;
  pointer-events: none;
  z-index: 4;
}
.cast-ring.pulse { animation: ringpulse 0.85s ease-out; }
@keyframes ringpulse {
  0%   { opacity: 0.95; transform: translate(-50%, -50%) scale(0.35); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); }
}

/* --------------------------------------------------------------------------
   9. Steps and timelines
   -------------------------------------------------------------------------- */

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 3.1rem;
  padding-bottom: var(--sp-6);
  margin: 0;
}
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: -2px;
  width: 34px; height: 34px;
  border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-weight: 680;
  font-size: 0.88rem;
  box-shadow: 0 4px 12px color-mix(in oklab, var(--brand) 32%, transparent);
}
.steps > li::after {
  content: "";
  position: absolute;
  left: 17px; top: 40px; bottom: 6px;
  width: 2px;
  background: linear-gradient(to bottom, var(--line-strong), transparent);
}
.steps > li:last-child { padding-bottom: 0; }
.steps > li:last-child::after { display: none; }
.steps h3, .steps h4 { margin-bottom: var(--sp-2); }
.steps > li > :last-child { margin-bottom: 0; }

.steps-plain { counter-reset: step; list-style: none; padding: 0; }
.steps-plain > li {
  counter-increment: step;
  position: relative;
  padding-left: 2.1rem;
  margin-bottom: var(--sp-3);
}
.steps-plain > li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 1px;
  width: 22px; height: 22px;
  border-radius: 7px;
  display: grid; place-items: center;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: 0.74rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

/* --------------------------------------------------------------------------
   10. Search (how to)
   -------------------------------------------------------------------------- */

.search-shell {
  position: relative;
  max-width: 720px;
}
.search-shell.wide { max-width: none; }
.search-input {
  width: 100%;
  font: inherit;
  font-size: var(--step-0);
  padding: 0.95rem 3rem 0.95rem 3rem;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: var(--bg-raised);
  color: var(--fg);
  box-shadow: var(--shadow-1);
  transition: border-color 0.15s ease, box-shadow 0.2s ease;
}
.search-input::placeholder { color: var(--fg-faint); }
.search-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--shadow-glow);
}
.search-icon {
  position: absolute;
  left: 1rem; top: 50%;
  transform: translateY(-50%);
  color: var(--fg-faint);
  pointer-events: none;
  width: 19px; height: 19px;
}
.search-kbd {
  position: absolute;
  right: 0.85rem; top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}
.search-clear {
  position: absolute;
  right: 0.7rem; top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 0;
  color: var(--fg-faint);
  cursor: pointer;
  padding: 0.3rem;
  display: none;
}
.search-clear.on { display: block; }
.search-clear svg { width: 17px; height: 17px; }

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: var(--sp-4);
}
.chip {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 560;
  padding: 0.38rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-raised);
  color: var(--fg-muted);
  cursor: pointer;
  transition: all 0.14s ease;
  white-space: nowrap;
}
.chip:hover { border-color: var(--line-strong); color: var(--fg-strong); }
.chip.on {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.search-meta {
  margin-top: var(--sp-4);
  font-size: var(--step--1);
  color: var(--fg-muted);
}

mark {
  background: color-mix(in oklab, var(--brand) 26%, transparent);
  color: inherit;
  border-radius: 3px;
  padding: 0 2px;
}

.howto-list { display: grid; gap: var(--sp-3); margin-top: var(--sp-5); }

.howto {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raised);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.2s ease;
}
.howto:hover { border-color: var(--line-strong); }
.howto[open] { border-color: color-mix(in oklab, var(--brand) 45%, var(--line)); box-shadow: var(--shadow-2); }
.howto > summary {
  cursor: pointer;
  list-style: none;
  padding: 0.95rem 1.15rem 0.95rem 1.15rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-weight: 580;
  color: var(--fg-strong);
}
.howto > summary::-webkit-details-marker { display: none; }
.howto > summary::after {
  content: "";
  margin-left: auto;
  width: 9px; height: 9px;
  border-right: 2px solid var(--fg-faint);
  border-bottom: 2px solid var(--fg-faint);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  flex: none;
  margin-top: 6px;
}
.howto[open] > summary::after { transform: rotate(-135deg); }
.howto-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--fg-faint);
  background: var(--bg-inset);
  border-radius: 6px;
  padding: 0.15rem 0.4rem;
  flex: none;
  margin-top: 3px;
}
.howto-body {
  padding: 0 1.15rem 1.15rem;
  border-top: 1px solid var(--line);
  padding-top: var(--sp-4);
  margin-top: 0;
  font-size: var(--step--1);
}
.howto-body > :last-child { margin-bottom: 0; }
.howto-cat {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 640;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--brand-ink);
  margin-bottom: var(--sp-2);
}
.howto-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: var(--sp-4); }
.howto-tags span {
  font-size: 0.7rem;
  color: var(--fg-faint);
  background: var(--bg-inset);
  border-radius: 5px;
  padding: 0.1rem 0.4rem;
  font-family: var(--font-mono);
}

.empty-state {
  text-align: center;
  padding: var(--sp-8) var(--sp-4);
  color: var(--fg-muted);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
}

/* --------------------------------------------------------------------------
   11. Docs layout with sidebar
   -------------------------------------------------------------------------- */

.doc-layout {
  display: grid;
  gap: var(--sp-6);
  align-items: start;
  padding-block: var(--sp-7) var(--sp-9);
}
@media (min-width: 1000px) {
  .doc-layout { grid-template-columns: 236px minmax(0, 1fr); gap: var(--sp-8); }
  .doc-layout.with-toc { grid-template-columns: 236px minmax(0, 1fr) 200px; }
}

.doc-side { position: sticky; top: calc(var(--nav-h) + 20px); max-height: calc(100vh - var(--nav-h) - 40px); overflow-y: auto; }
.doc-side h4 {
  font-size: var(--step--2);
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--fg-faint);
  margin: var(--sp-5) 0 var(--sp-2);
}
.doc-side h4:first-child { margin-top: 0; }
.doc-side ul { list-style: none; padding: 0; margin: 0 0 var(--sp-3); }
.doc-side li { margin: 0; }
.doc-side a {
  display: block;
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 0.875rem;
  border-left: 2px solid transparent;
}
.doc-side a:hover { color: var(--fg-strong); background: var(--bg-inset); }
.doc-side a.active {
  color: var(--brand-ink);
  background: var(--brand-soft);
  font-weight: 600;
}
@media (max-width: 999px) { .doc-side { position: static; max-height: none; } }

.toc { position: sticky; top: calc(var(--nav-h) + 20px); font-size: var(--step--1); }
.toc h4 {
  font-size: var(--step--2);
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--fg-faint);
  margin: 0 0 var(--sp-2);
}
.toc ul { list-style: none; padding: 0; margin: 0; }
.toc a {
  display: block;
  padding: 0.22rem 0 0.22rem 0.7rem;
  border-left: 2px solid var(--line);
  color: var(--fg-muted);
  text-decoration: none;
}
.toc a:hover, .toc a.active { color: var(--brand-ink); border-left-color: var(--brand); }
@media (max-width: 1199px) { .toc { display: none; } }

.prose { max-width: 74ch; }
.prose h2 { margin-top: var(--sp-8); scroll-margin-top: calc(var(--nav-h) + 24px); }
.prose h3 { margin-top: var(--sp-6); scroll-margin-top: calc(var(--nav-h) + 24px); }
.prose > h2:first-child, .prose > h3:first-child { margin-top: 0; }
.prose img { border-radius: var(--radius); }
.prose table { margin-bottom: var(--sp-5); }
.prose-wide { max-width: none; }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--step--2);
  color: var(--fg-faint);
  margin-bottom: var(--sp-4);
  padding: 0;
  list-style: none;
}
.breadcrumb li { margin: 0; display: flex; align-items: center; gap: 0.4rem; }
.breadcrumb li + li::before { content: "/"; color: var(--line-strong); }
.breadcrumb a { color: var(--fg-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--brand-ink); }

.page-head { padding-block: var(--sp-7) var(--sp-5); }
.page-head h1 { margin-bottom: var(--sp-3); }
.page-head .lead { margin-bottom: 0; }

.next-prev {
  display: grid;
  gap: var(--sp-3);
  margin-top: var(--sp-8);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--line);
}
@media (min-width: 640px) { .next-prev { grid-template-columns: 1fr 1fr; } }
.next-prev a {
  display: block;
  padding: var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease;
}
.next-prev a:hover { border-color: var(--brand); }
.next-prev span { display: block; font-size: var(--step--2); color: var(--fg-faint); margin-bottom: 2px; }
.next-prev strong { color: var(--fg-strong); font-weight: 600; }
.next-prev .np-next { text-align: right; }

/* --------------------------------------------------------------------------
   12. Comparison table
   -------------------------------------------------------------------------- */

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raised);
  -webkit-overflow-scrolling: touch;
}
.table-scroll table { margin: 0; border-radius: var(--radius); }
.table-scroll th:first-child, .table-scroll td:first-child {
  position: sticky;
  left: 0;
  background: var(--bg-raised);
  z-index: 1;
  min-width: 210px;
}
.table-scroll th:first-child { background: var(--bg-sunken); }
.table-scroll tbody tr:hover td:first-child { background: var(--bg-inset); }

.stars { white-space: nowrap; letter-spacing: 1px; font-size: 0.9em; }
.stars i { color: var(--line-strong); font-style: normal; }
.stars i.on { color: #f5a524; }
.col-us { background: color-mix(in oklab, var(--brand) 6%, transparent); }
th.col-us { background: color-mix(in oklab, var(--brand) 12%, var(--bg-sunken)); }

.score-cards { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.score-card { text-align: center; padding: var(--sp-5); }
.score-card .rank {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--fg-faint);
}
.score-card .num {
  font-size: var(--step-3);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--fg-strong);
  line-height: 1.1;
}
.score-card.us { border-color: var(--brand); box-shadow: var(--shadow-glow); }
.score-card.us .num { color: var(--brand-ink); }

.price-card { display: flex; flex-direction: column; }
.price-card .price {
  font-size: var(--step-2);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--fg-strong);
  margin: var(--sp-2) 0 0;
}
.price-card .per { font-size: var(--step--1); color: var(--fg-muted); margin-bottom: var(--sp-4); }

/* --------------------------------------------------------------------------
   13. Misc components
   -------------------------------------------------------------------------- */

.logo-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-5) var(--sp-7);
  align-items: center;
  justify-content: center;
  opacity: 0.75;
  font-size: var(--step--1);
  color: var(--fg-muted);
}

.stat-strip {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-raised);
  padding: var(--sp-5);
  box-shadow: var(--shadow-1);
}
.stat { text-align: center; }
.stat strong {
  display: block;
  font-size: var(--step-2);
  letter-spacing: -0.03em;
  color: var(--fg-strong);
  line-height: 1.15;
}
.stat span { font-size: var(--step--1); color: var(--fg-muted); }

.kv { display: grid; gap: 0; }
.kv > div {
  display: grid;
  grid-template-columns: minmax(140px, 30%) 1fr;
  gap: var(--sp-4);
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--step--1);
}
.kv > div:last-child { border-bottom: 0; }
.kv dt { color: var(--fg-muted); margin: 0; }
.kv dd { margin: 0; color: var(--fg-strong); }

.copy-wrap { position: relative; }
.copy-btn {
  position: absolute;
  top: 10px; right: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #cfd8ec;
  border-radius: 8px;
  padding: 0.3rem 0.55rem;
  font-size: 0.72rem;
  font-family: var(--font-sans);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease;
}
.copy-wrap:hover .copy-btn, .copy-btn:focus { opacity: 1; }
.copy-btn:hover { background: rgba(255, 255, 255, 0.16); }
.copy-btn.done { color: #43d391; border-color: rgba(67, 211, 145, 0.5); }

.cta-band {
  position: relative;
  border-radius: var(--radius-xl);
  padding: clamp(2.2rem, 5vw, 3.6rem);
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--line);
  background: var(--bg-raised);
  text-align: center;
}
.cta-band::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 100% at 12% 0%, var(--mesh-1) 0%, transparent 60%),
    radial-gradient(60% 100% at 88% 100%, var(--mesh-2) 0%, transparent 60%);
}
.cta-band h2 { margin-bottom: var(--sp-3); }
.cta-band .lead { margin-inline: auto; margin-bottom: var(--sp-5); }

/* Only hide things when scripting is on, so a reader without JavaScript still
   sees every card rather than a page full of gaps. */
html.js .reveal { opacity: 0; transform: translateY(16px); }
html.js .reveal.in { opacity: 1; transform: none; transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
@media (prefers-reduced-motion: reduce) { html.js .reveal { opacity: 1; transform: none; } }

.anchor-link {
  color: var(--fg-faint);
  text-decoration: none;
  margin-left: 0.4rem;
  opacity: 0;
  font-weight: 400;
}
h2:hover .anchor-link, h3:hover .anchor-link { opacity: 1; }

.faq-item { border-bottom: 1px solid var(--line); }
.faq-item > summary {
  cursor: pointer;
  list-style: none;
  padding: var(--sp-4) 0;
  font-weight: 600;
  color: var(--fg-strong);
  display: flex;
  gap: var(--sp-4);
  align-items: flex-start;
}
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::after {
  content: "+";
  margin-left: auto;
  color: var(--fg-faint);
  font-size: 1.3rem;
  line-height: 1;
  flex: none;
}
.faq-item[open] > summary::after { content: "\2013"; }
.faq-answer { padding-bottom: var(--sp-5); color: var(--fg-muted); font-size: var(--step--1); }
.faq-answer > :last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   14. Footer
   -------------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-sunken);
  padding-block: var(--sp-8) var(--sp-6);
  margin-top: var(--sp-8);
  font-size: var(--step--1);
}
.footer-grid {
  display: grid;
  gap: var(--sp-6);
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-bottom: var(--sp-7);
}
.footer-brand { grid-column: 1 / -1; }
@media (min-width: 900px) { .footer-brand { grid-column: span 2; max-width: 320px; } }
.footer-grid h4 {
  font-size: var(--step--2);
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--fg-faint);
  margin-bottom: var(--sp-3);
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 0.38rem; }
.footer-grid a { color: var(--fg-muted); text-decoration: none; }
.footer-grid a:hover { color: var(--brand-ink); }

.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: var(--sp-5);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  justify-content: space-between;
  align-items: center;
  color: var(--fg-faint);
  font-size: var(--step--2);
}
.footer-bottom p { margin: 0; max-width: 70ch; }

/* --------------------------------------------------------------------------
   15. Print
   -------------------------------------------------------------------------- */

@media print {
  .site-header, .site-footer, .player-controls, .nav-tools, .mobile-nav,
  .doc-side, .toc, .cta-band { display: none !important; }
  body { background: #fff; color: #000; }
  .howto[open] .howto-body, .howto-body { display: block !important; }
  a { color: #000; text-decoration: underline; }
}
