/* ==========================================================================
   InfinitySniper HFX — Website
   The palette is the console application's own theme system. Four themes
   ship in core/ui.js (guardian / navy / emerald / classic) and all four are
   reproduced here token-for-token, so the site wears the same skin the app
   does. Surfaces get lighter as they come forward: bg -> surface -> card ->
   raised, exactly like the Launcher Edition.
   ========================================================================== */

/* ------------------------------- tokens ---------------------------------- */

:root,
:root[data-theme="guardian"] {
  --bg: #0b0d13;
  --surface: #11141d;
  --card: #161a26;
  --card-hi: #1b2030;
  --raised: #202535;
  --console: #090b10;

  --border: #262c3f;
  --border-hi: #3a425c;
  --line: rgba(255, 255, 255, 0.055);

  --text: #e8eaf6;
  --muted: #8f96b2;
  --faint: #606780;

  --accent: #8b5cf6;
  --accent-hi: #a78bfa;
  --accent-2: #e879f9;
  --accent-deep: #6d28d9;
  --accent-soft: rgba(139, 92, 246, 0.14);
  --glow: rgba(139, 92, 246, 0.38);

  --ok: #4ade80;
  --warn: #fbbf24;
  --err: #f87171;

  --halo-1: rgba(139, 92, 246, 0.17);
  --halo-2: rgba(232, 121, 249, 0.10);
}

:root[data-theme="navy"] {
  --bg: #0a0e1a;
  --surface: #0f1524;
  --card: #141c2f;
  --card-hi: #1a2439;
  --raised: #1f2a42;
  --console: #070b14;

  --border: #23304a;
  --border-hi: #3a4d70;
  --line: rgba(255, 255, 255, 0.055);

  --text: #e2e8f0;
  --muted: #93a3bd;
  --faint: #5f7191;

  --accent: #2d60b2;
  --accent-hi: #508cdc;
  --accent-2: #ffc83c;
  --accent-deep: #1e468c;
  --accent-soft: rgba(80, 140, 220, 0.15);
  --glow: rgba(45, 96, 178, 0.45);

  --ok: #ffe500;
  --warn: #ffbb50;
  --err: #ef4444;

  --halo-1: rgba(80, 140, 220, 0.18);
  --halo-2: rgba(255, 200, 60, 0.08);
}

:root[data-theme="emerald"] {
  --bg: #081410;
  --surface: #0c1c17;
  --card: #10251e;
  --card-hi: #142d24;
  --raised: #19372c;
  --console: #050f0c;

  --border: #1d3d32;
  --border-hi: #2f5a4a;
  --line: rgba(255, 255, 255, 0.055);

  --text: #e2e8f0;
  --muted: #94a3b8;
  --faint: #5f7d70;

  --accent: #10b981;
  --accent-hi: #34d399;
  --accent-2: #bef264;
  --accent-deep: #047857;
  --accent-soft: rgba(52, 211, 153, 0.14);
  --glow: rgba(16, 185, 129, 0.36);

  --ok: #4ade80;
  --warn: #fde047;
  --err: #f87171;

  --halo-1: rgba(16, 185, 129, 0.18);
  --halo-2: rgba(190, 242, 100, 0.09);
}

:root[data-theme="classic"] {
  --bg: #0c0c0c;
  --surface: #121212;
  --card: #171717;
  --card-hi: #1d1d1d;
  --raised: #232323;
  --console: #000000;

  --border: #2e2e2e;
  --border-hi: #454545;
  --line: rgba(255, 255, 255, 0.06);

  --text: #f2f2f2;
  --muted: #a0a0a0;
  --faint: #6e6e6e;

  --accent: #00a8a8;
  --accent-hi: #00ffff;
  --accent-2: #ff55ff;
  --accent-deep: #007878;
  --accent-soft: rgba(0, 255, 255, 0.12);
  --glow: rgba(0, 255, 255, 0.28);

  --ok: #35ff35;
  --warn: #ffff55;
  --err: #ff5555;

  --halo-1: rgba(0, 255, 255, 0.12);
  --halo-2: rgba(255, 85, 255, 0.06);
}

:root {
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --display: "Segoe UI Variable Display", "Segoe UI Semibold", "Segoe UI", system-ui, sans-serif;
  --mono: "Cascadia Mono", "Cascadia Code", Consolas, "Lucida Console", ui-monospace, monospace;

  --r: 12px;
  --r-lg: 18px;
  --nav-h: 62px;
  --page: 1180px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ------------------------------- reset ----------------------------------- */

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(1200px 700px at 78% -12%, var(--halo-1), transparent 62%),
    radial-gradient(900px 560px at 4% 22%, var(--halo-2), transparent 60%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input { font: inherit; color: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

::selection { background: var(--accent); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent-hi);
  outline-offset: 3px;
  border-radius: 6px;
}

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb {
  background: var(--border); border: 3px solid transparent;
  background-clip: content-box; border-radius: 9px;
}
::-webkit-scrollbar-thumb:hover { background: var(--border-hi); background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.skip {
  position: fixed; top: 8px; left: 8px; z-index: 200;
  padding: 10px 16px; border-radius: 9px; font-size: 13px; font-weight: 600;
  background: var(--accent); color: #fff; transform: translateY(-200%);
}
.skip:focus { transform: none; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------- layout ---------------------------------- */

.wrap { width: 100%; max-width: var(--page); margin: 0 auto; padding: 0 24px; }

section { position: relative; }

.band { padding: 92px 0; }
.band.tight { padding: 64px 0; }
.band.alt { background: linear-gradient(180deg, transparent, var(--surface) 12%, var(--surface) 88%, transparent); }

.rule { height: 1px; background: linear-gradient(90deg, transparent, var(--border), transparent); }

/* ------------------------------ typography -------------------------------- */

h1, h2, h3, h4 { font-family: var(--display); line-height: 1.18; letter-spacing: -0.015em; font-weight: 700; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: 2.2px; text-transform: uppercase;
  color: var(--accent-hi);
}
.eyebrow::before {
  content: ""; width: 22px; height: 1px; background: currentColor; opacity: 0.6;
}

.h-sec { font-size: clamp(27px, 3.4vw, 38px); margin: 14px 0 0; }
.h-sub { margin-top: 14px; font-size: 16px; color: var(--muted); max-width: 62ch; }

.sec-head { margin-bottom: 40px; }
.sec-head.center { text-align: center; }
.sec-head.center .h-sub { margin-left: auto; margin-right: auto; }
.sec-head.center .eyebrow::before { display: none; }

.grad {
  background: linear-gradient(100deg, var(--accent-hi), var(--accent-2) 92%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ------------------------------ primitives -------------------------------- */

.card {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.30);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 12px 22px; border-radius: 11px;
  font-size: 14px; font-weight: 650; letter-spacing: 0.1px; white-space: nowrap;
  border: 1px solid var(--border); background: var(--raised); color: var(--text);
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease),
              transform 0.16s var(--ease), filter 0.16s var(--ease);
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:hover { border-color: var(--border-hi); background: var(--card-hi); transform: translateY(-1px); }
.btn:active { transform: none; }
.btn.primary {
  color: #fff; border-color: transparent;
  background: linear-gradient(180deg, var(--accent-hi), var(--accent) 58%, var(--accent-deep));
  box-shadow: 0 10px 26px var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.26);
}
.btn.primary:hover { filter: brightness(1.09); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 8px 14px; font-size: 12.5px; border-radius: 9px; }
.btn.lg { padding: 14px 28px; font-size: 15px; }
.btn.block { width: 100%; }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  font-size: 12px; letter-spacing: 0.3px; color: var(--muted);
  border: 1px solid var(--border); background: rgba(0, 0, 0, 0.28);
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 9px var(--ok); }
.pill b { color: var(--text); font-weight: 650; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 9.5px; font-weight: 700; letter-spacing: 1.1px; text-transform: uppercase;
  padding: 4px 8px; border-radius: 6px;
  color: var(--muted); background: rgba(255, 255, 255, 0.05); border: 1px solid transparent;
}
.badge.accent { color: var(--accent-hi); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.badge.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, transparent); border-color: color-mix(in srgb, var(--ok) 28%, transparent); }
.badge.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, transparent); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.badge.err { color: var(--err); background: color-mix(in srgb, var(--err) 10%, transparent); border-color: color-mix(in srgb, var(--err) 30%, transparent); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 15px; border-radius: 999px; font-size: 12.5px; color: var(--muted);
  border: 1px solid var(--border); background: rgba(0, 0, 0, 0.22);
  transition: color 0.14s, border-color 0.14s, background 0.14s;
}
.chip:hover { color: var(--text); border-color: var(--border-hi); }
.chip.on {
  color: #fff; border-color: transparent;
  background: linear-gradient(180deg, var(--accent-hi), var(--accent));
  box-shadow: 0 6px 16px var(--glow);
}
.chip i { font-style: normal; opacity: 0.62; margin-left: 6px; font-size: 11px; }

/* -------------------------------- navbar ---------------------------------- */

.nav {
  position: sticky; top: 0; z-index: 90; height: var(--nav-h);
  border-bottom: 1px solid transparent;
  transition: background 0.22s var(--ease), border-color 0.22s var(--ease), backdrop-filter 0.22s;
}
.nav.stuck {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(16px) saturate(1.4);
  border-bottom-color: var(--line);
}
.nav-in { height: 100%; display: flex; align-items: center; gap: 14px; }

.brand { display: flex; align-items: center; gap: 11px; margin-right: 8px; }
.brand-mark {
  width: 34px; height: 34px; flex: none; display: grid; place-items: center;
  color: #fff; border-radius: 10px;
  background: linear-gradient(140deg, var(--accent-hi), var(--accent) 55%, var(--accent-deep));
  box-shadow: 0 8px 20px var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-txt b {
  display: block; font-family: var(--display); font-size: 13px;
  letter-spacing: 1.7px; line-height: 1.25;
}
.brand-txt span { font-size: 10.5px; color: var(--faint); letter-spacing: 0.7px; }

.nav-links { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav-links a {
  padding: 8px 13px; border-radius: 9px; font-size: 13.5px; color: var(--muted);
  transition: color 0.14s, background 0.14s;
}
.nav-links a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.nav-links a.here { color: var(--text); background: var(--accent-soft); }

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

.icon-btn {
  width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center;
  color: var(--muted); border: 1px solid var(--border); background: rgba(0, 0, 0, 0.22);
  transition: color 0.14s, border-color 0.14s, background 0.14s;
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { color: var(--text); border-color: var(--border-hi); background: var(--card-hi); }

.kbd-btn {
  display: flex; align-items: center; gap: 9px; height: 36px; padding: 0 12px;
  border-radius: 9px; font-size: 12.5px; color: var(--faint);
  border: 1px solid var(--border); background: rgba(0, 0, 0, 0.22);
  transition: color 0.14s, border-color 0.14s;
}
.kbd-btn svg { width: 15px; height: 15px; }
.kbd-btn:hover { color: var(--muted); border-color: var(--border-hi); }
.kbd-btn kbd { font-family: var(--mono); font-size: 10.5px; }

kbd {
  display: inline-block; padding: 2px 6px; border-radius: 5px;
  font-family: var(--mono); font-size: 11px; line-height: 1.5;
  color: var(--muted); background: var(--raised);
  border: 1px solid var(--border); border-bottom-width: 2px;
}

/* theme menu */
.theme-wrap { position: relative; }
.theme-menu {
  position: absolute; right: 0; top: calc(100% + 9px); z-index: 95; width: 216px;
  padding: 7px; border-radius: 13px;
  border: 1px solid var(--border); background: var(--surface);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.5);
}
.theme-menu[hidden] { display: none; }
.theme-menu .lbl {
  padding: 7px 10px 8px; font-size: 9.5px; letter-spacing: 1.7px;
  text-transform: uppercase; color: var(--faint);
}
.theme-menu button {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 9px 10px; border-radius: 9px; font-size: 13px; color: var(--muted);
  transition: color 0.13s, background 0.13s;
}
.theme-menu button:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.theme-menu button[aria-checked="true"] { color: var(--text); background: var(--accent-soft); }
.theme-menu button::after {
  content: ""; margin-left: auto; width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid var(--border-hi);
}
.theme-menu button[aria-checked="true"]::after {
  border-color: var(--accent-hi);
  background: radial-gradient(circle, var(--accent-hi) 42%, transparent 46%);
}
.swatch { width: 17px; height: 17px; border-radius: 5px; flex: none; border: 1px solid rgba(255, 255, 255, 0.14); }
.swatch.guardian { background: linear-gradient(135deg, #a78bfa, #8b5cf6 52%, #e879f9); }
.swatch.navy { background: linear-gradient(135deg, #508cdc, #2d60b2 52%, #ffc83c); }
.swatch.emerald { background: linear-gradient(135deg, #34d399, #10b981 52%, #bef264); }
.swatch.classic { background: linear-gradient(135deg, #00ffff, #0c0c0c 52%, #ff55ff); }

/* mobile nav */
.burger { display: none; }
@media (max-width: 940px) {
  .nav-links {
    position: fixed; inset: var(--nav-h) 0 auto 0; flex-direction: column; align-items: stretch;
    gap: 3px; padding: 14px 20px 20px; margin: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    box-shadow: 0 22px 44px rgba(0, 0, 0, 0.45);
    transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: opacity 0.18s, transform 0.18s;
  }
  .nav-links.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-links a { padding: 12px 14px; font-size: 15px; }
  .burger { display: grid; margin-left: auto; }
  .nav-tools { margin-left: 0; }
  .kbd-btn kbd { display: none; }
}

/* --------------------------------- hero ----------------------------------- */

.hero { padding: 74px 0 84px; overflow: hidden; }
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.06fr);
  gap: 54px; align-items: center;
}

.hero h1 {
  margin-top: 22px;
  font-size: clamp(38px, 5.4vw, 62px);
  letter-spacing: -0.028em;
}
.hero-lede { margin-top: 20px; font-size: 17px; color: var(--muted); max-width: 52ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-meta {
  display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 26px;
  font-size: 12.5px; color: var(--faint);
}
.hero-meta span { display: inline-flex; align-items: center; gap: 7px; }
.hero-meta svg { width: 14px; height: 14px; color: var(--ok); }

/* terminal */
.term {
  border-radius: 14px; overflow: hidden; border: 1px solid var(--border);
  background: var(--console);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
}
.term-bar {
  display: flex; align-items: center; gap: 9px; padding: 9px 13px;
  background: linear-gradient(180deg, var(--card-hi), var(--card));
  border-bottom: 1px solid var(--line);
}
.term-dots { display: flex; gap: 6px; }
.term-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-hi); }
.term-dots i:nth-child(1) { background: #ff5f57; }
.term-dots i:nth-child(2) { background: #febc2e; }
.term-dots i:nth-child(3) { background: #28c840; }
.term-title {
  margin-left: 4px; font-family: var(--mono); font-size: 11.5px; color: var(--faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.term-tag { margin-left: auto; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--faint); }

.term-body {
  margin: 0; padding: 18px 16px 20px;
  font-family: var(--mono); font-size: 12.4px; line-height: 1.5;
  color: var(--text); white-space: pre; overflow-x: auto;
  min-height: 466px;
  tab-size: 4;
}
.term-body::-webkit-scrollbar { height: 8px; }

.c-frame { color: var(--accent); }
.c-title { color: #fff; font-weight: 600; }
.c-key { color: var(--warn); }
.c-ok { color: var(--ok); }
.c-warn { color: var(--warn); }
.c-err { color: var(--err); }
.c-dim { color: var(--faint); }
.c-label { color: var(--muted); }
.c-accent { color: var(--accent-2); }

.caret {
  display: inline-block; width: 8px; height: 15px; vertical-align: -3px;
  background: var(--accent-2); animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

@media (max-width: 1000px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero { padding: 48px 0 60px; }
  .term-body { min-height: 0; font-size: 11.2px; }
}

/* -------------------------------- stats ----------------------------------- */

.stats {
  display: grid; grid-template-columns: repeat(5, 1fr);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--card), var(--surface));
  overflow: hidden;
}
.stat { padding: 24px 20px; text-align: center; border-left: 1px solid var(--line); }
.stat:first-child { border-left: none; }
.stat b {
  display: block; font-family: var(--display); font-size: 30px; font-weight: 700;
  letter-spacing: -0.02em; line-height: 1.1;
  background: linear-gradient(180deg, var(--text), var(--muted));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat span {
  display: block; margin-top: 6px; font-size: 11px; letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--faint);
}
@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat { border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
  .stat:nth-child(odd) { border-left: none; }
  .stat:nth-child(-n+2) { border-top: none; }
  .stat:last-child { grid-column: 1 / -1; }
}

/* ------------------------------- feature grid ----------------------------- */

.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 980px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 660px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }

.feat {
  position: relative; padding: 26px 24px 28px; overflow: hidden;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), background 0.2s var(--ease);
}
.feat::after {
  content: ""; position: absolute; inset: -1px -1px auto -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-hi), transparent);
  opacity: 0; transition: opacity 0.25s;
}
.feat:hover { transform: translateY(-3px); border-color: var(--border-hi); background: var(--card-hi); }
.feat:hover::after { opacity: 0.8; }
.feat-ico {
  width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center;
  color: var(--accent-hi); background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
}
.feat-ico svg { width: 21px; height: 21px; }
.feat h3 { margin: 17px 0 8px; font-size: 16.5px; }
.feat p { font-size: 14px; color: var(--muted); }
.feat .badge { margin-top: 14px; }

/* ------------------------------- editions --------------------------------- */

.ed { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.ed-top { padding: 26px 24px 22px; border-bottom: 1px solid var(--line); }
.ed.hot { border-color: color-mix(in srgb, var(--accent) 46%, transparent); box-shadow: 0 18px 46px var(--glow); }
.ed.hot .ed-top { background: linear-gradient(180deg, var(--accent-soft), transparent); }
.ed-head { display: flex; align-items: center; gap: 11px; }
.ed-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--accent-hi); background: var(--accent-soft); }
.ed-ico svg { width: 20px; height: 20px; }
.ed-head h3 { font-size: 17px; }
.ed-head .badge { margin-left: auto; }
.ed-top p { margin-top: 14px; font-size: 13.5px; color: var(--muted); }
.ed-list { padding: 20px 24px; flex: 1; display: flex; flex-direction: column; gap: 11px; }
.ed-list li { display: flex; gap: 10px; font-size: 13.5px; color: var(--muted); }
.ed-list svg { width: 15px; height: 15px; flex: none; margin-top: 4px; color: var(--ok); }
.ed-foot { padding: 0 24px 24px; }
.ed-req {
  margin-top: 12px; font-size: 11.5px; color: var(--faint); text-align: center;
}

/* ------------------------------- compare ---------------------------------- */

.tbl-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--card); }
table.cmp { width: 100%; border-collapse: collapse; min-width: 640px; font-size: 13.5px; }
table.cmp th, table.cmp td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--line); }
table.cmp thead th {
  font-family: var(--display); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--faint); background: var(--surface); white-space: nowrap;
}
table.cmp tbody tr:last-child td { border-bottom: none; }
table.cmp tbody tr:hover td { background: rgba(255, 255, 255, 0.022); }
table.cmp td:first-child { color: var(--text); font-weight: 550; }
table.cmp td { color: var(--muted); }
table.cmp .yes { color: var(--ok); }
table.cmp .no { color: var(--faint); }
table.cmp svg { width: 16px; height: 16px; vertical-align: -3px; }

/* ------------------------------- explorer --------------------------------- */

.exp-bar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  margin-bottom: 20px;
}
.search {
  display: flex; align-items: center; gap: 11px; flex: 1; min-width: 260px;
  height: 46px; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--border); background: rgba(0, 0, 0, 0.3);
  transition: border-color 0.16s, box-shadow 0.16s;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search svg { width: 17px; height: 17px; color: var(--faint); flex: none; }
.search input { flex: 1; min-width: 0; background: none; border: none; outline: none; font-size: 14.5px; }
.search input::placeholder { color: var(--faint); }
.search kbd { flex: none; }

.exp-count { font-size: 12.5px; color: var(--faint); margin-left: auto; white-space: nowrap; }

.fn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 14px; }

.fn {
  position: relative; padding: 18px 19px 17px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--card);
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease), background 0.18s var(--ease);
}
.fn:hover { border-color: var(--border-hi); background: var(--card-hi); transform: translateY(-2px); }
.fn-top { display: flex; align-items: flex-start; gap: 11px; }
.fn-num {
  flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--accent-hi);
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.fn h3 { font-size: 14.5px; line-height: 1.35; letter-spacing: -0.005em; }
.fn-cat { display: block; margin-top: 3px; font-size: 11px; letter-spacing: 0.6px; color: var(--faint); }
.fn p { margin-top: 12px; font-size: 13px; color: var(--muted); }
.fn-flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; }
.fn-cmd {
  display: flex; align-items: center; gap: 8px; margin-top: 13px;
  padding: 8px 10px; border-radius: 8px; background: var(--console);
  border: 1px solid var(--line);
  font-family: var(--mono); font-size: 11.5px; color: var(--muted);
  overflow: hidden;
}
.fn-cmd span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fn-cmd .c-dim { color: var(--faint); }
.fn-cmd button { flex: none; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; color: var(--faint); }
.fn-cmd button:hover { color: var(--accent-hi); background: rgba(255, 255, 255, 0.06); }
.fn-cmd svg { width: 13px; height: 13px; }

.empty { padding: 60px 20px; text-align: center; color: var(--faint); }
.empty svg { width: 34px; height: 34px; margin-bottom: 14px; color: var(--border-hi); }

.cat-block { margin-top: 34px; }
.cat-block:first-child { margin-top: 0; }
.cat-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 15px;
  padding-bottom: 11px; border-bottom: 1px solid var(--line);
}
.cat-head h3 { font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.cat-head .n {
  font-family: var(--mono); font-size: 11px; color: var(--accent-hi);
  padding: 2px 8px; border-radius: 5px; background: var(--accent-soft);
}
.cat-head .rest { flex: 1; height: 1px; background: var(--line); }

/* -------------------------------- safety ---------------------------------- */

.safe-grid { display: grid; grid-template-columns: 0.95fr 1.05fr; gap: 34px; align-items: start; }
@media (max-width: 940px) { .safe-grid { grid-template-columns: 1fr; } }

.safe-list { display: flex; flex-direction: column; gap: 2px; }
.safe-row {
  display: grid; grid-template-columns: 26px 1fr; gap: 14px;
  padding: 15px 16px; border-radius: 11px;
  transition: background 0.15s;
}
.safe-row:hover { background: rgba(255, 255, 255, 0.03); }
.safe-row svg { width: 19px; height: 19px; margin-top: 2px; color: var(--ok); }
.safe-row b { display: block; font-size: 14px; font-weight: 650; }
.safe-row span { display: block; margin-top: 3px; font-size: 13px; color: var(--muted); }

/* --------------------------------- code ----------------------------------- */

.code {
  position: relative; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--border); background: var(--console);
}
.code-bar {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px 9px 14px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.code-bar .name { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.code-bar .lang { margin-left: auto; font-size: 9.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--faint); }
.copy {
  width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px;
  color: var(--faint); transition: color 0.14s, background 0.14s;
}
.copy:hover { color: var(--accent-hi); background: rgba(255, 255, 255, 0.06); }
.copy svg { width: 14px; height: 14px; }
.copy.done { color: var(--ok); }

.code pre {
  margin: 0; padding: 17px 18px; overflow-x: auto;
  font-family: var(--mono); font-size: 12.6px; line-height: 1.62; color: var(--text);
  tab-size: 2;
}
.tok-c { color: var(--faint); font-style: italic; }
.tok-k { color: var(--accent-2); }
.tok-s { color: var(--ok); }
.tok-f { color: var(--accent-hi); }
.tok-n { color: var(--warn); }
.tok-p { color: var(--muted); }

.steps { counter-reset: s; display: flex; flex-direction: column; gap: 20px; }
.step { display: grid; grid-template-columns: 34px 1fr; gap: 16px; align-items: start; }
.step::before {
  counter-increment: s; content: counter(s);
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--accent-hi);
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
}
.step h4 { font-size: 15px; }
.step p { margin-top: 5px; font-size: 13.5px; color: var(--muted); }
.step .code { margin-top: 12px; }

/* ---------------------------------- faq ----------------------------------- */

.faq { display: grid; gap: 10px; max-width: 860px; margin: 0 auto; }
.qa {
  border: 1px solid var(--border); border-radius: 13px; background: var(--card);
  overflow: hidden; transition: border-color 0.16s, background 0.16s;
}
.qa[open] { border-color: var(--border-hi); background: var(--card-hi); }
.qa summary {
  display: flex; align-items: center; gap: 14px; padding: 17px 20px;
  font-size: 15px; font-weight: 600; cursor: pointer; list-style: none;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after {
  content: ""; margin-left: auto; flex: none; width: 9px; height: 9px;
  border-right: 2px solid var(--faint); border-bottom: 2px solid var(--faint);
  transform: rotate(45deg) translate(-2px, -2px); transition: transform 0.2s var(--ease);
}
.qa[open] summary::after { transform: rotate(225deg) translate(-2px, -2px); }
.qa summary:hover { color: var(--accent-hi); }
.qa .a { padding: 0 20px 19px 20px; font-size: 14px; color: var(--muted); }
.qa .a p + p { margin-top: 10px; }
.qa .a code { font-family: var(--mono); font-size: 12.5px; color: var(--accent-hi); background: var(--accent-soft); padding: 1px 6px; border-radius: 5px; }

/* ---------------------------------- cta ----------------------------------- */

.cta {
  position: relative; overflow: hidden; text-align: center;
  padding: 62px 30px; border-radius: 22px;
  border: 1px solid color-mix(in srgb, var(--accent) 36%, transparent);
  background:
    radial-gradient(700px 320px at 50% -30%, var(--accent-soft), transparent 70%),
    linear-gradient(180deg, var(--card), var(--surface));
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.4);
}
.cta h2 { font-size: clamp(26px, 3.6vw, 38px); }
.cta p { margin: 15px auto 0; max-width: 54ch; color: var(--muted); font-size: 16px; }
.cta .hero-cta { justify-content: center; }

/* -------------------------------- footer ---------------------------------- */

.foot { border-top: 1px solid var(--line); padding: 52px 0 34px; margin-top: 20px; }
.foot-grid { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 34px; }
@media (max-width: 800px) { .foot-grid { grid-template-columns: 1fr 1fr; gap: 28px; } }
.foot-brand p { margin-top: 15px; font-size: 13.5px; color: var(--muted); max-width: 36ch; }
.foot h4 { font-size: 11px; letter-spacing: 1.7px; text-transform: uppercase; color: var(--faint); margin-bottom: 14px; }
.foot li { margin-bottom: 9px; }
.foot li a { font-size: 13.5px; color: var(--muted); transition: color 0.14s; }
.foot li a:hover { color: var(--accent-hi); }
.foot-bar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--faint);
}
.foot-bar .sp { margin-left: auto; }

/* ------------------------------ docs layout ------------------------------- */

.doc { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 46px; align-items: start; padding: 44px 0 80px; }
@media (max-width: 980px) { .doc { grid-template-columns: 1fr; gap: 22px; } }

.toc { position: sticky; top: calc(var(--nav-h) + 22px); max-height: calc(100vh - var(--nav-h) - 44px); overflow-y: auto; padding-right: 6px; }
@media (max-width: 980px) {
  .toc { position: static; max-height: none; border: 1px solid var(--border); border-radius: 13px; padding: 14px; background: var(--card); }
}
.toc .lbl { font-size: 9.5px; letter-spacing: 1.8px; text-transform: uppercase; color: var(--faint); margin: 20px 0 9px 12px; }
.toc .lbl:first-child { margin-top: 0; }
.toc a {
  display: block; padding: 7px 12px; border-radius: 8px; font-size: 13px; color: var(--muted);
  border-left: 2px solid transparent; transition: color 0.13s, background 0.13s, border-color 0.13s;
}
.toc a:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.toc a.here { color: var(--accent-hi); background: var(--accent-soft); border-left-color: var(--accent-hi); }

.prose { max-width: 780px; }
.prose > section { scroll-margin-top: calc(var(--nav-h) + 22px); padding-bottom: 42px; }
.prose h2 { font-size: 26px; margin-bottom: 8px; padding-top: 8px; }
.prose h3 { font-size: 17px; margin: 30px 0 10px; }
.prose h4 { font-size: 14.5px; margin: 22px 0 8px; color: var(--accent-hi); }
.prose p { margin: 12px 0; color: var(--muted); font-size: 14.8px; }
.prose ul.bul { margin: 14px 0; display: flex; flex-direction: column; gap: 9px; }
.prose ul.bul li { position: relative; padding-left: 20px; font-size: 14.5px; color: var(--muted); }
.prose ul.bul li::before {
  content: ""; position: absolute; left: 3px; top: 10px; width: 6px; height: 6px;
  border-radius: 2px; background: var(--accent);
}
.prose code:not(pre code) {
  font-family: var(--mono); font-size: 12.8px; color: var(--accent-hi);
  background: var(--accent-soft); padding: 1.5px 6px; border-radius: 5px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}
.prose .code { margin: 16px 0; }
.prose .tbl-wrap { margin: 18px 0; }
.prose strong { color: var(--text); font-weight: 650; }
.prose a:not(.btn):not(.toc a) { color: var(--accent-hi); border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.prose a:not(.btn):hover { border-bottom-color: var(--accent-hi); }

.note {
  display: grid; grid-template-columns: 20px 1fr; gap: 13px;
  margin: 18px 0; padding: 15px 17px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--card);
  border-left: 3px solid var(--accent);
}
.note svg { width: 18px; height: 18px; margin-top: 2px; color: var(--accent-hi); }
.note p { margin: 0; font-size: 13.8px; }
.note.warn { border-left-color: var(--warn); }
.note.warn svg { color: var(--warn); }

.page-head { padding: 46px 0 8px; }
.page-head h1 { font-size: clamp(32px, 4.4vw, 46px); margin-top: 16px; }
.page-head p { margin-top: 15px; font-size: 16.5px; color: var(--muted); max-width: 66ch; }

/* ------------------------------- palette ---------------------------------- */

.pal-back {
  position: fixed; inset: 0; z-index: 120; display: grid; place-items: start center;
  padding: 12vh 20px 20px;
  background: rgba(0, 0, 0, 0.62); backdrop-filter: blur(5px);
  animation: fade 0.14s var(--ease);
}
.pal-back[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }

.pal {
  width: 100%; max-width: 620px; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--border-hi); background: var(--surface);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.65);
  animation: rise 0.18s var(--ease);
}
@keyframes rise { from { transform: translateY(-10px); opacity: 0; } }
.pal-in { display: flex; align-items: center; gap: 13px; padding: 0 18px; height: 56px; border-bottom: 1px solid var(--line); }
.pal-in svg { width: 18px; height: 18px; color: var(--faint); flex: none; }
.pal-in input { flex: 1; min-width: 0; background: none; border: none; outline: none; font-size: 15.5px; }
.pal-in input::placeholder { color: var(--faint); }
.pal-res { max-height: 52vh; overflow-y: auto; padding: 7px; }
.pal-res .grp { padding: 11px 12px 6px; font-size: 9.5px; letter-spacing: 1.7px; text-transform: uppercase; color: var(--faint); }
.pal-res a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px;
  color: var(--muted); cursor: pointer;
}
.pal-res a .ic { width: 17px; height: 17px; flex: none; color: var(--faint); }
.pal-res a b { font-size: 13.5px; font-weight: 550; color: var(--text); }
.pal-res a i { font-style: normal; font-size: 12px; color: var(--faint); margin-left: auto; padding-left: 12px; white-space: nowrap; }
.pal-res a.sel, .pal-res a:hover { background: var(--accent-soft); }
.pal-res a.sel .ic, .pal-res a:hover .ic { color: var(--accent-hi); }
.pal-none { padding: 34px 20px; text-align: center; font-size: 13.5px; color: var(--faint); }
.pal-foot {
  display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line);
  font-size: 11.5px; color: var(--faint); background: rgba(0, 0, 0, 0.2);
}
.pal-foot span { display: inline-flex; align-items: center; gap: 6px; }

/* -------------------------------- toasts ---------------------------------- */

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 150; display: flex; flex-direction: column; gap: 9px; align-items: flex-end; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 11px;
  font-size: 13px; color: var(--text);
  border: 1px solid var(--border-hi); background: var(--card);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.5);
  animation: toast-in 0.2s var(--ease);
}
.toast svg { width: 15px; height: 15px; color: var(--ok); }
.toast.out { animation: toast-out 0.22s var(--ease) forwards; }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } }
@keyframes toast-out { to { transform: translateY(6px); opacity: 0; } }

/* ------------------------------- reveal ----------------------------------- */

/* Hidden only once the head script has confirmed scripting is live, so a
   visitor without JavaScript gets the whole page instead of an empty one. */
html.js .rv { opacity: 0; transform: translateY(16px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
html.js .rv.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
  .rv { opacity: 1; transform: none; }
}
