/* Layout concept: calm product page. Soft slate surfaces, one blue accent, generous spacing,
   a live audit feed as the single focal point. Light and dark themes share one token set. */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --line: #dce1e9;
  --line-soft: #e7ebf0;
  --fg: #1a2230;
  --muted: #55627a;
  --faint: #76839a;
  --accent: #2b5fd6;
  --accent-ink: #ffffff;
  --accent-soft: rgba(43, 95, 214, .09);
  --ok: #14785a;
  --danger: #bf3a2c;
  --shadow: 0 1px 2px rgba(20, 32, 56, .05), 0 12px 32px rgba(20, 32, 56, .07);
  --font-display: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --surface: #0a0a0a;
    --surface-2: #101010;
    --line: #232323;
    --line-soft: #161616;
    --fg: #f2f2f2;
    --muted: #a8a8a8;
    --faint: #777;
    --accent: #ff4d73;
    --accent-ink: #12000a;
    --accent-soft: rgba(255, 77, 115, .12);
    --ok: #5ccaa0;
    --danger: #ff9a5c;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000;
  --surface: #0a0a0a;
  --surface-2: #101010;
  --line: #232323;
  --line-soft: #161616;
  --fg: #f2f2f2;
  --muted: #a8a8a8;
  --faint: #777;
  --accent: #ff4d73;
  --accent-ink: #12000a;
  --accent-soft: rgba(255, 77, 115, .12);
  --ok: #5ccaa0;
  --danger: #ff9a5c;
  --shadow: none;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color .2s, color .2s;
}
/* paints the phone's top inset so nothing scrolls into view above the sticky header */
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  background: var(--bg); z-index: 30;
}
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }

a { color: var(--accent); text-underline-offset: 3px; }
code, kbd, .mono { font-family: var(--font-mono); }
h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 800; text-wrap: balance; letter-spacing: -.02em; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: 1160px; margin-inline: auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
section { padding-block: clamp(60px, 9vw, 112px); scroll-margin-top: 100px; }
.eyebrow {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px; font-weight: 500;
}
.h2 { font-size: clamp(1.9rem, 4.2vw, 2.9rem); line-height: 1.1; }
.lede { color: var(--muted); font-size: 1.0625rem; max-width: 56ch; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--fg); font: 600 15px/1 var(--font-body);
  text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { border-color: var(--faint); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 86%, var(--fg)); border-color: transparent; }
.btn.small { min-height: 38px; padding: 0 16px; font-size: 14px; }
.btn[disabled] { opacity: .6; cursor: default; }

/* header: floating pill */
.site-header {
  position: fixed; z-index: 40; top: calc(env(safe-area-inset-top, 0px) + 14px);
  left: max(14px, env(safe-area-inset-left, 0px)); right: max(14px, env(safe-area-inset-right, 0px));
  max-width: 1160px; margin-inline: auto;
  background: rgba(8, 8, 8, .78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: 16px;
  animation: hdrIn .8s 3.3s cubic-bezier(.2, .7, .2, 1) both;
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 62px; max-width: none; padding-inline: 22px; }
.brand { display: inline-flex; align-items: center; }
.brand img { width: 40px; height: 40px; object-fit: contain; display: block; }
.nav { display: flex; align-items: center; gap: 26px; }
.nav a:not(.btn) { color: var(--fg); text-decoration: none; font-family: var(--font-mono); font-size: 12.5px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; padding: 6px 0; border-bottom: 1px solid transparent; }
.nav a:not(.btn):hover { border-bottom-color: var(--faint); }
.nav a.on:not(.btn) { border-bottom-color: var(--fg); }
@keyframes hdrIn { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
.theme-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer;
}
.theme-btn:hover { color: var(--fg); border-color: var(--faint); }
.theme-btn svg { width: 19px; height: 19px; }
.theme-btn .i-sun { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun { display: block; }
:root[data-theme="dark"] .theme-btn .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-btn .i-sun { display: block; }
  :root:not([data-theme]) .theme-btn .i-moon { display: none; }
}
@media (max-width: 760px) { .nav a:not(.btn) { display: none; } .nav { gap: 10px; } }

/* hero */
.hero { padding-top: clamp(120px, 12vw, 168px); padding-bottom: clamp(52px, 8vw, 104px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(36px, 5vw, 72px); align-items: center; }
@media (max-width: 960px) { .hero-grid { grid-template-columns: minmax(0, 1fr); } }
.hero h1 { font-weight: 800; font-size: clamp(2.7rem, 6.2vw, 4.7rem); line-height: 1.03; letter-spacing: -.035em; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lede { margin-top: 22px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-meta { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 8px 22px; font-family: var(--font-mono); font-size: 12.5px; color: var(--faint); }
.hero-meta span::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: .1em; }

/* audit feed */
.feed { border: 1px solid var(--line); background: var(--surface); border-radius: 14px; overflow: hidden; min-width: 0; box-shadow: var(--shadow); }
.feed-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; padding: 13px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.feed-title { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.feed-controls { display: grid; gap: 16px; padding: 16px; border-bottom: 1px solid var(--line); }
.ctl { display: grid; gap: 8px; }
.ctl-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button {
  font: 500 13.5px/1 var(--font-body); color: var(--muted); background: transparent;
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 13px; cursor: pointer; min-height: 38px;
}
.seg button:hover { color: var(--fg); border-color: var(--faint); }
.seg button[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); border-color: var(--accent); font-weight: 600; }
.feed-run { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.feed-log { margin: 0; padding: 14px 16px; list-style: none; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.6; min-height: 300px; }
.feed-log li { display: grid; grid-template-columns: 46px 62px minmax(0, 1fr); gap: 4px 10px; padding: 3px 0; }
.feed-log li.new { animation: lineIn .22s ease-out; }
@keyframes lineIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .feed-log li.new { animation: none; } }
.t { color: var(--faint); }
.tag { font-weight: 500; letter-spacing: .04em; }
.tag.audit { color: var(--muted); }
.tag.guard { color: var(--faint); }
.tag.revert { color: var(--ok); }
.tag.ban { color: var(--danger); font-weight: 600; }
.tag.skip { color: var(--accent); }
.msg { color: var(--fg); overflow-wrap: anywhere; }
.msg.dim { color: var(--muted); }
.feed-sum { padding: 14px 16px; border-top: 1px solid var(--line); font-size: 14.5px; background: var(--surface-2); min-height: 54px; }
.feed-sum strong { color: var(--accent); font-weight: 600; }

/* guards */
.guards { border-top: 1px solid var(--line-soft); }
.guards-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
@media (max-width: 960px) { .guards-grid { grid-template-columns: minmax(0, 1fr); } }
.guards-copy .lede { margin-top: 20px; }
.facts { margin: 30px 0 0; display: grid; }
.facts div { padding: 16px 0; border-top: 1px solid var(--line); }
.facts dt { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--fg); margin-bottom: 4px; letter-spacing: -.01em; }
.facts dd { margin: 0; color: var(--muted); font-size: 15px; }
.facts dd code, .rows p code, .steps code { color: var(--fg); background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 5px; padding: 1px 6px; font-size: 13px; }
.mods { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
@media (max-width: 640px) { .mods { grid-template-columns: minmax(0, 1fr); } }
.mods li { padding: 18px 20px 20px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); min-width: 0; }
.mods li:nth-child(2n) { border-right: 0; }
.mods li:nth-last-child(-n+2) { border-bottom: 0; }
@media (max-width: 640px) { .mods li { border-right: 0; } .mods li:nth-last-child(2) { border-bottom: 1px solid var(--line-soft); } }
.mods .name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-family: var(--font-mono); font-size: 13.5px; font-weight: 500; }
.mods .desc { margin-top: 6px; color: var(--muted); font-size: 14.5px; line-height: 1.55; }
.badge { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--danger); background: color-mix(in srgb, var(--danger) 11%, transparent); border-radius: 5px; padding: 2px 7px; font-weight: 500; }

/* what else */
.else { background: var(--surface); border-block: 1px solid var(--line-soft); }
.else-head { margin-bottom: clamp(28px, 5vw, 44px); }
.rows { margin: 0; padding: 0; list-style: none; }
.rows li { display: grid; grid-template-columns: minmax(0, 280px) minmax(0, 1fr); gap: 6px 40px; padding: 24px 0; border-top: 1px solid var(--line); }
.rows li:last-child { border-bottom: 1px solid var(--line); }
@media (max-width: 720px) { .rows li { grid-template-columns: minmax(0, 1fr); } }
.rows h3 { font-size: 1.2rem; line-height: 1.3; font-weight: 700; }
.rows p { color: var(--muted); max-width: 64ch; }

/* command browser */
.cmds-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 30px; }
.cmd-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.field { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 0 12px; min-height: 44px; }
.field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.field input { background: transparent; border: 0; outline: 0; color: var(--fg); font: 500 15px var(--font-mono); width: 100%; min-width: 0; padding: 10px 0; }
.field.search { width: min(340px, 100%); }
.field.prefix { width: 108px; }
.field input::placeholder { color: var(--faint); }
.browser { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
@media (max-width: 860px) { .browser { grid-template-columns: minmax(0, 1fr); } }
.cats { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 84px; }
@media (max-width: 860px) { .cats { position: static; flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 6px; } }
.cats button {
  display: flex; justify-content: space-between; align-items: center; gap: 14px; white-space: nowrap;
  background: transparent; border: 0; border-radius: 8px; color: var(--muted);
  font: 500 14.5px var(--font-body); text-align: left; padding: 9px 12px; cursor: pointer;
}
.cats button:hover { color: var(--fg); background: var(--surface-2); }
.cats button[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.cats button .n { font-family: var(--font-mono); font-size: 11.5px; color: var(--faint); }
@media (max-width: 860px) { .cats button { border: 1px solid var(--line); background: var(--surface); } .cats button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); } }
.count { font-family: var(--font-mono); font-size: 12px; color: var(--faint); margin-bottom: 10px; min-height: 18px; }
.list { border-top: 1px solid var(--line); min-width: 0; }
.cmd { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 20px; padding: 18px 0; border-bottom: 1px solid var(--line-soft); }
.cmd-main { min-width: 0; }
.cmd-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.cmd-name b { font-family: var(--font-mono); font-size: 15px; font-weight: 500; color: var(--accent); }
.alias { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); background: var(--surface-2); border-radius: 5px; padding: 1px 7px; }
.cat-tag { font-family: var(--font-mono); font-size: 11px; color: var(--faint); letter-spacing: .06em; text-transform: uppercase; }
.cmd-desc { color: var(--muted); font-size: 14.5px; margin-top: 3px; overflow-wrap: anywhere; }
.cmd-use { display: block; margin-top: 9px; font-size: 12.5px; color: var(--fg); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; overflow-x: auto; white-space: nowrap; width: fit-content; max-width: 100%; }
.cmd-subs { margin-top: 8px; font-size: 12.5px; color: var(--faint); font-family: var(--font-mono); overflow-wrap: anywhere; }
.copy { align-self: start; font: 500 12.5px var(--font-body); color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; cursor: pointer; min-width: 66px; }
.copy:hover { color: var(--fg); border-color: var(--faint); }
.copy.done { color: var(--ok); border-color: var(--ok); }
.empty { padding: 36px 0; color: var(--muted); }

/* setup */
.setup { background: var(--surface); border-block: 1px solid var(--line-soft); }
.steps { list-style: none; margin: clamp(28px, 5vw, 44px) 0 0; padding: 0; counter-reset: step; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 2px 20px; padding: 22px 0; border-top: 1px solid var(--line); }
.steps li:last-child { border-bottom: 1px solid var(--line); }
.steps li::before { content: counter(step); grid-row: 1 / span 2; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; }
.steps h3, .steps p { grid-column: 2; }
.steps h3 { font-size: 1.15rem; line-height: 1.35; font-weight: 700; padding-top: 6px; }
.steps p { color: var(--muted); max-width: 62ch; }
@media (max-width: 520px) { .steps li { grid-template-columns: 40px minmax(0, 1fr); gap: 2px 14px; } }

/* footer */
.cta .h2 { font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.08; max-width: 18ch; }
.cta .hero-cta { margin-top: 26px; }
.foot { border-top: 1px solid var(--line-soft); padding-block: 28px; color: var(--faint); font-size: 13px; }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; }

/* intro: the logo is drawn as an outline, the artwork fades in inside it, then the whole screen fades out */
.intro { position: fixed; inset: 0; z-index: 100; background: #000; display: grid; place-items: center; animation: introOut .8s 3.2s ease forwards; }
.intro-logo { position: relative; width: min(46vmin, 280px); aspect-ratio: 1; animation: introZoom 4s ease-out both; }
.intro-img, .intro-logo svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.intro-img { opacity: 0; animation: introFill 1s 1.6s ease forwards; }
.intro-line { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1;
  filter: drop-shadow(0 0 6px rgba(255, 77, 115, .8)); animation: introDraw 1.8s .2s cubic-bezier(.65, 0, .35, 1) forwards, introLineOut .6s 2.2s ease forwards; }
@keyframes introDraw { to { stroke-dashoffset: 0; } }
@keyframes introFill { to { opacity: 1; } }
@keyframes introLineOut { to { opacity: 0; } }
@keyframes introZoom { from { transform: scale(.94); } to { transform: scale(1.03); } }
@keyframes introOut { to { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .intro { display: none; } .site-header { animation: none; } }

/* ===== v2 overrides: pure black, floating words, small command text, working header ===== */
:root, :root[data-theme="dark"] {
  --bg: #000;
  --surface: transparent;
  --surface-2: rgba(255, 255, 255, .03);
  --line: #1f1f1f;
  --line-soft: #141414;
  --fg: #e8e8e8;
  --muted: #9a9a9a;
  --faint: #6a6a6a;
}
html, body { background: #000; }
body { position: relative; }
body::before { background: #000; }

/* floating words */
.floaters { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.fw {
  position: absolute; font-family: var(--font-mono); font-weight: 400; color: #fff; white-space: nowrap;
  opacity: var(--o, .3); user-select: none;
  animation: fwDrift 24s ease-in-out infinite alternate, fwPulse 8s ease-in-out infinite alternate;
}
@keyframes fwDrift { from { transform: translate(0, 0); } to { transform: translate(var(--dx), var(--dy)); } }
@keyframes fwPulse { from { opacity: calc(var(--o) * .35); } to { opacity: var(--o); } }
@media (prefers-reduced-motion: reduce) { .fw { animation: none; } }
main, .foot { position: relative; z-index: 1; }

/* every section sits on the same black so the words show through */
.else, .setup, .guards, .foot { background: transparent; }
.feed, .mods { background: rgba(0, 0, 0, .55); }
.feed-bar, .feed-sum { background: rgba(255, 255, 255, .03); }
.btn { background: rgba(0, 0, 0, .5); }
.btn.primary { background: var(--accent); }
.field { background: rgba(0, 0, 0, .55); }

/* header: sits above everything, clickable, appears when the intro is done */
.site-header { z-index: 60; background: rgba(0, 0, 0, .82); animation: none; }
.js:not(.ready) .site-header { opacity: 0; pointer-events: none; transform: translateY(-14px); }
.js.ready .site-header { opacity: 1; transform: none; transition: opacity .5s ease, transform .5s ease; }
.nav a:not(.btn) { position: relative; z-index: 1; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .js:not(.ready) .site-header { opacity: 1; pointer-events: auto; transform: none; } }

/* commands: small and mono */
.cmds-head { margin-bottom: 20px; }
.cats button { font: 400 12px var(--font-mono); padding: 6px 10px; }
.cats button .n { font-size: 10.5px; }
.count { font-size: 11px; }
.cmd { padding: 11px 0; gap: 4px 16px; }
.cmd-name { gap: 4px 8px; }
.cmd-name b { font-size: 12.5px; font-weight: 500; }
.alias { font-size: 10.5px; padding: 0 6px; }
.cat-tag { font-size: 10px; }
.cmd-desc { font: 400 12px/1.5 var(--font-mono); margin-top: 2px; color: var(--muted); }
.cmd-use { font-size: 11px; margin-top: 6px; padding: 4px 8px; background: transparent; }
.cmd-subs { font-size: 11px; margin-top: 5px; }
.copy { font: 400 11px var(--font-mono); padding: 4px 9px; min-width: 56px; }
.field label { font-size: 10px; }
.field input { font-size: 13px; }
.field { min-height: 38px; }

/* ===== v3: hero sits in the middle of the screen (horizontally and vertically) ===== */
.hero {
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center; justify-content: center;
  padding-top: calc(env(safe-area-inset-top, 0px) + 96px);
  padding-bottom: 32px;
}
.hero .wrap { margin-inline: auto; }
.hero-grid { align-items: center; }
.hero h1 { font-size: clamp(2.5rem, 5.2vw, 4.2rem); }
/* compact feed so the whole block fits on one screen */
.feed-controls { gap: 10px; padding: 12px 14px; }
.ctl { gap: 6px; }
.seg button { min-height: 32px; padding: 7px 11px; font-size: 13px; }
.feed-run .btn { min-height: 34px; }
.feed-log { min-height: 0; padding: 10px 14px; font-size: 12px; line-height: 1.45; }
.feed-log li { padding: 1px 0; }
.feed-sum { min-height: 0; padding: 11px 14px; font-size: 13.5px; }
@media (max-width: 960px) { .hero { min-height: 0; display: block; padding-top: 120px; } }

/* ===== v4: nothing selectable or draggable (fields still work) ===== */
html, body, body * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-user-drag: none; }
input, textarea { -webkit-user-select: text; user-select: text; }
img, a { -webkit-user-drag: none; }

/* ===== v5: one page per section, no long scroll; status page ===== */
.seen .intro { display: none; }
.foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 2; border: 0; padding: 0 var(--gutter-r) calc(env(safe-area-inset-bottom, 0px) + 12px) var(--gutter-l);
  display: flex; justify-content: center; gap: 10px 22px; flex-wrap: wrap; font: 400 11px var(--font-mono); color: var(--faint); pointer-events: none; }

/* header nav with icons */
.nav { gap: 6px; }
.nav a.nl { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border: 1px solid transparent; border-radius: 10px;
  color: var(--muted); text-decoration: none; font: 500 13px var(--font-body); letter-spacing: 0; text-transform: none; transition: color .15s, background .15s; }
.nav a.nl:hover { color: var(--fg); background: rgba(255, 255, 255, .04); }
.nav a.nl.on { color: var(--accent); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 28%, transparent); }
.nav .btn { margin-left: 8px; gap: 7px; }
.ico { width: 16px; height: 16px; flex: none; }
.nav a.nl .dot { margin-left: 2px; }
.menu-btn { display: none; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--fg); cursor: pointer; }
.menu-btn .ico { width: 20px; height: 20px; }
@media (max-width: 960px) {
  .nav { position: absolute; top: calc(100% + 8px); left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 2px; padding: 10px;
    background: rgba(0, 0, 0, .94); border: 1px solid var(--line); border-radius: 16px; display: none; }
  .site-header.nav-open .nav { display: flex; }
  .nav a.nl { padding: 12px 14px; font-size: 15px; }
  .nav .btn { margin: 6px 0 0; min-height: 44px; }
  .menu-btn { display: grid; }
}

/* status dots */
[data-state="ok"] { --st: var(--ok); }
[data-state="warn"] { --st: #f5b84a; }
[data-state="bad"] { --st: var(--accent); }
[data-state="unk"] { --st: var(--faint); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--st, var(--faint)); flex: none; }
[data-state="ok"] > .dot, .sys[data-state="ok"] .sys-title .dot { box-shadow: 0 0 0 3px color-mix(in srgb, var(--st) 22%, transparent); }

/* page shell: fills the screen, panels scroll inside it if they have to */
.page { height: 100vh; height: 100svh; padding: calc(env(safe-area-inset-top, 0px) + 100px) 0 44px; display: flex; position: relative; z-index: 1; }
.page > .wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.page-head { flex: none; display: flex; align-items: center; flex-wrap: wrap; gap: 16px; padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line-soft); }
.tile { width: 52px; height: 52px; flex: none; display: grid; place-items: center; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); color: var(--accent); }
.tile .ico { width: 22px; height: 22px; }
.page-head h1 { font-size: 1.85rem; line-height: 1.1; }
.sub { margin-top: 4px; font: 400 12.5px var(--font-mono); color: var(--muted); }
.sub b { color: var(--fg); font-weight: 500; }
.page-head .cmd-tools { margin-left: auto; }
.scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #2a2a2a transparent; }
.scroll::-webkit-scrollbar, .cats::-webkit-scrollbar, .list::-webkit-scrollbar { width: 6px; height: 6px; }
.scroll::-webkit-scrollbar-thumb, .cats::-webkit-scrollbar-thumb, .list::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 3px; }

/* anti-nuke */
.split { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(24px, 4vw, 56px); }
.split .scroll { padding-right: 4px; }
.guards-copy .lede { font-size: 1rem; }
.guards-copy .facts { margin-top: 18px; }
.guards-copy .facts div { padding: 13px 0; }

/* features */
.cards { list-style: none; margin: 0; padding: 0 4px 0 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.cards li { border: 1px solid var(--line); border-radius: 14px; padding: 15px 18px 17px; background: rgba(0, 0, 0, .55); }
.cards h3 { font-size: 1rem; line-height: 1.3; font-weight: 700; }
.cards p { margin-top: 5px; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.cards code, .stepgrid code { color: var(--fg); background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 5px; padding: 1px 6px; font-size: 12px; }

/* commands */
.browser { flex: 1; min-height: 0; grid-template-columns: 220px minmax(0, 1fr); }
.browser .cats { position: static; height: 100%; overflow-y: auto; align-self: stretch; scrollbar-width: thin; scrollbar-color: #2a2a2a transparent; }
.listcol { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.listcol .list { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #2a2a2a transparent; padding-right: 6px; }
.listcol .count { flex: none; }

/* setup */
.stepgrid { list-style: none; margin: 0; padding: 0 4px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stepgrid li { border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px 20px; background: rgba(0, 0, 0, .55); }
.stepgrid .num { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font: 800 .95rem var(--font-display); margin-bottom: 12px; }
.stepgrid h3 { font-size: 1.05rem; line-height: 1.3; font-weight: 700; }
.stepgrid p { margin-top: 6px; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.setup-cta { margin-top: 18px; padding-bottom: 4px; }

/* status */
.sys { border: 1px solid var(--line); border-radius: 18px; background: rgba(255, 255, 255, .025); padding: 22px 24px 24px; }
.sys-title { display: flex; align-items: center; gap: 10px; font: 700 1.1rem var(--font-display); color: var(--st); letter-spacing: -.01em; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.stat { border: 1px solid var(--line); border-radius: 14px; background: rgba(0, 0, 0, .45); padding: 16px 18px 18px; display: grid; gap: 6px; min-width: 0; }
.stat .k { font: 500 10.5px var(--font-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }
.stat .v { font: 500 1.7rem/1.1 var(--font-mono); color: var(--fg); overflow-wrap: anywhere; }
.stat .v-accent { color: var(--accent); }
.stat .v-ok { color: var(--ok); }
.sys-note { margin-top: 14px; font: 400 12.5px var(--font-mono); color: var(--muted); }
.label { margin: 24px 0 10px 4px; font: 500 11px var(--font-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--faint); }
.svcs { list-style: none; margin: 0; padding: 4px 22px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255, 255, 255, .025); }
.svc { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.svc:last-child { border-bottom: 0; }
.svc-ic { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent); color: var(--accent); }
.svc-t { display: grid; min-width: 0; flex: 1; }
.svc-t b { font: 700 14.5px var(--font-display); letter-spacing: -.01em; }
.svc-t span { font: 400 12px var(--font-mono); color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 8px; flex: none; font: 500 12px var(--font-mono); color: var(--st);
  background: color-mix(in srgb, var(--st) 10%, transparent); border: 1px solid color-mix(in srgb, var(--st) 34%, transparent); border-radius: 999px; padding: 5px 13px; }
.pill .dot { width: 6px; height: 6px; box-shadow: none; }

/* small screens: the page flows and scrolls like normal */
@media (max-width: 960px) {
  .page { height: auto; min-height: 100vh; min-height: 100svh; padding-bottom: 64px; }
  .scroll, .listcol .list, .browser .cats { overflow: visible; }
  .browser .cats { height: auto; overflow-x: auto; }
  .listcol { height: auto; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .cards { grid-template-columns: minmax(0, 1fr); padding: 0; }
  .stepgrid { grid-template-columns: minmax(0, 1fr); padding: 0; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-head .cmd-tools { margin-left: 0; width: 100%; }
  .field.search { flex: 1; width: auto; }
  .hero .hero-cta .btn { flex: 1 1 auto; }
  .foot { position: static; padding: 8px 16px 20px; margin-top: -40px; }
}
@media (max-width: 520px) { .stat .v { font-size: 1.35rem; } .svc-t span { font-size: 11px; } .pill { padding: 4px 10px; } .page-head h1 { font-size: 1.5rem; } }

/* v5 tuning: fit a ~780px-tall window without inner scrolling */
.page { padding-top: calc(env(safe-area-inset-top, 0px) + 94px); padding-bottom: 38px; }
.page-head { padding-bottom: 14px; margin-bottom: 14px; }
.page-head .field.search { width: 300px; }
.mods li { padding: 12px 16px 13px; }
.mods .desc { margin-top: 3px; font-size: 13px; line-height: 1.45; }
.mods .name { font-size: 13px; }
.guards-copy .lede { font-size: .95rem; line-height: 1.55; }
.guards-copy .facts { margin-top: 12px; }
.guards-copy .facts div { padding: 10px 0; }
.guards-copy .facts dd { font-size: 14px; line-height: 1.5; }
.cards { gap: 10px; }
.cards li { padding: 11px 16px 13px; }
.cards p { font-size: 13px; line-height: 1.5; margin-top: 3px; }
.svc { padding: 11px 0; }
.sys { padding: 18px 22px 20px; }
.label { margin-top: 18px; }
@media (max-width: 960px) { .page-head .field.search { width: auto; } }
@media (max-width: 960px) {
  .browser { grid-template-columns: minmax(0, 1fr); flex: none; gap: 14px; }
  .browser .cats { flex-direction: row; gap: 6px; padding-bottom: 8px; }
  .browser .cats button { flex: none; }
  .listcol .list { padding-right: 0; }
}

/* ===== v6: content block sits in the middle of the screen, clear of the header ===== */
.page { padding-top: calc(env(safe-area-inset-top, 0px) + 112px); padding-bottom: 56px; }
.page > .wrap { flex: 0 1 auto; margin-block: auto; max-height: 100%; }
.page .scroll { flex: 0 1 auto; }
.split { flex: 0 1 auto; grid-template-rows: minmax(0, 1fr); }
.split > .scroll { min-height: 0; }
.browser { flex: 0 1 auto; height: 540px; max-height: 100%; grid-template-rows: minmax(0, 1fr); }
@media (max-width: 960px) {
  .page { padding-top: calc(env(safe-area-inset-top, 0px) + 104px); }
  .page > .wrap { margin-block: 0; max-height: none; }
  .split, .browser { height: auto; grid-template-rows: none; }
}

/* ===== v7: single file, one view at a time ===== */
.view[hidden] { display: none; }

/* v8: the intro swallows every click and key until it ends */
.intro { pointer-events: auto; cursor: default; }
