:root {
  --bg: #0f0f14;
  --panel: #15151f;
  --primary: #a277ff;
  --accent: #f59e0b;
  --text: #e6e6f0;
  --muted: #9a9ab4;
  --border: rgba(230, 230, 240, 0.14);
  /* Sealed-record geometry. Small radii read as a stamp, not a dashboard;
     large radii are the single strongest tell of the generic dev-tool look. */
  --radius-card: 2px;
  --radius-btn: 2px;
  --radius-code: 2px;
  --font-display: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", Consolas, "Courier New", monospace;
  /* Type scale. Every size in this file resolves to one of these. */
  --fs-micro: 10px;
  --fs-meta: 12px;
  --fs-small: 14px;
  --fs-body: 16px;
  --fs-h3: 17px;
  --fs-h2: 24px;
  --fs-h1: clamp(38px, 5.6vw, 52px);
  --fs-page: clamp(30px, 4vw, 40px);
  /* Spacing scale, 4px base. */
  --sp-1: 4px;  --sp-2: 8px;   --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px;  --sp-7: 48px; --sp-8: 64px; --sp-9: 96px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(162, 119, 255, 0.4); background: color-mix(in srgb, var(--primary) 40%, transparent); color: var(--text); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--sp-5); }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--primary); color: #0f0f14;
  padding: 8px 16px; border-radius: 0 0 var(--radius-btn) 0; z-index: 100;
}
.skip-link:focus { left: 0; }

/* Scrollbar: the default light track is the last unthemed pixel on the page. */
* { scrollbar-color: color-mix(in srgb, var(--text) 22%, transparent) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--text) 20%, transparent); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--text) 32%, transparent); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 64px; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand img { border-radius: var(--radius-btn); display: block; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: 0.01em; }
.nav-links { display: flex; align-items: center; gap: var(--sp-4); }
.nav-links a:not(.btn) { color: var(--muted); text-decoration: none; font-size: var(--fs-small); }
.nav-links a:not(.btn):hover { color: var(--text); }
.nav-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: var(--radius-btn); padding: 10px; cursor: pointer; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--text); margin: 4px 0; }
.nav-toggle span:first-child { margin-top: 0; }
.nav-toggle span:last-child { margin-bottom: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; text-decoration: none; cursor: pointer;
  font-size: var(--fs-small); font-weight: 600;
  border-radius: var(--radius-btn); padding: 12px 22px;
  border: 1px solid transparent;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn:focus-visible, a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.btn-primary { background: var(--primary); color: #0f0f14; border-color: var(--primary); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--text); }
.btn-sm { padding: 8px 14px; font-size: var(--fs-meta); }
.btn:active { transform: translateY(1px); }
button.btn { font-family: inherit; }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-7);
  align-items: center; padding-top: var(--sp-9); padding-bottom: var(--sp-9);
}
.eyebrow {
  font-family: var(--font-mono); font-size: var(--fs-meta); letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted);
  display: flex; align-items: center; gap: var(--sp-2); margin: 0 0 var(--sp-4);
}
.tick { width: 6px; height: 6px; background: var(--primary); border-radius: 1px; flex: none; }
.eyebrow-amber .tick { background: var(--accent); }
.hero h1, h2 {
  font-family: var(--font-display);
  margin: 0 0 var(--sp-4); line-height: 1.05;
}
.hero h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
.lede { color: var(--text); max-width: 68ch; margin: 0 0 var(--sp-6); }
.hero-ctas { display: flex; gap: var(--sp-4); flex-wrap: wrap; margin-bottom: var(--sp-5); }
.micro { font-size: var(--fs-meta); color: var(--muted); font-family: var(--font-mono); margin: 0 0 var(--sp-5); }
.guard-line { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.chip {
  font-family: var(--font-mono); font-size: var(--fs-small); color: var(--primary);
  border: 1px solid var(--primary); border-radius: var(--radius-code); padding: 6px 12px;
}
.guard-seal {
  font-family: var(--font-mono); font-size: var(--fs-micro); letter-spacing: 0.08em;
  color: var(--accent); border: 2px solid var(--accent);
  border-radius: var(--radius-code); padding: 3px 10px; white-space: nowrap;
}
.guard-seal-warn { border-style: dashed; }

.hero-visual { min-width: 0; }
.hero-copy { min-width: 0; }
.guard-stage {
  position: relative; margin: 0; max-width: 520px; overflow: hidden;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: var(--sp-5);
}
.guard-stage noscript img { display: block; width: 100%; height: auto; border-radius: var(--radius-card); }
.pipeline { position: relative; list-style: none; margin: 0; padding: 0; display: flex; align-items: center; }
.station {
  flex: none; display: flex; align-items: center; gap: var(--sp-2);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: var(--sp-3);
}
.station-proposal .chip { font-size: var(--fs-meta); }
.station-gate { border: 2px solid var(--accent); color: var(--accent); }
.shield { width: 28px; height: 28px; flex: none; }
.check { font-family: var(--font-mono); font-size: var(--fs-small); color: var(--accent); }
.track { position: relative; flex: 1 1 32px; min-width: 28px; }
.track-live { border-top: 2px dotted rgba(162, 119, 255, 0.9); border-top: 2px dotted color-mix(in srgb, var(--primary) 90%, transparent); }
.track-gated { border-top: 2px dashed rgba(245, 158, 11, 0.75); border-top: 2px dashed color-mix(in srgb, var(--accent) 75%, transparent); }
.track-gated::after {
  content: ""; position: absolute; top: -2px; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent));
  box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 45%, transparent);
  transform: scaleX(0); transform-origin: left center; opacity: 0;
}
.station-result { flex-direction: column; align-items: stretch; gap: var(--sp-2); font-family: var(--font-mono); font-size: var(--fs-micro); line-height: 1.5; }
.mini-head { color: var(--primary); letter-spacing: 0.06em; }
.mini-row { display: flex; align-items: center; gap: var(--sp-2); color: var(--muted); white-space: nowrap; }
.mini-row i { width: 5px; height: 5px; border-radius: 1px; background: var(--primary); flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Checkpoint motion: desktop with motion preference only; static otherwise. */
@media (min-width: 1024px) and (prefers-reduced-motion: no-preference) {
  .track-live::after {
    content: ""; position: absolute; top: -2px; left: 0; right: 0; height: 2px;
    background-image: radial-gradient(circle, var(--primary) 1.5px, transparent 1.6px);
    background-size: 12px 2px; background-repeat: repeat-x;
    animation: drift 2.4s linear infinite;
  }
  .station-gate .guard-seal { animation: seal-breathe 3s ease-in-out infinite; }
  .track-gated::after { animation: beam-run 4.5s ease-out infinite; }
  .station-result .mini-row { opacity: 0.45; animation: row-lit 4.5s ease-out infinite; }
  .guard-stage:hover *, .guard-stage:hover *::before, .guard-stage:hover *::after,
  .guard-stage:focus-within *, .guard-stage:focus-within *::before, .guard-stage:focus-within *::after {
    animation-play-state: paused;
  }
}
@keyframes drift { to { transform: translateX(12px); } }
@keyframes seal-breathe { 0%, 100% { opacity: 0.75; } 50% { opacity: 1; } }
@keyframes beam-run { 0% { transform: scaleX(0); opacity: 0; } 4% { opacity: 1; } 20% { transform: scaleX(1); opacity: 1; } 24%, 100% { transform: scaleX(1); opacity: 0; } }
@keyframes row-lit { 0%, 18% { opacity: 0.45; } 45%, 70% { opacity: 1; } 92%, 100% { opacity: 0.45; } }

@media (prefers-reduced-motion: reduce) {
  .guard-stage *, .guard-stage *::before, .guard-stage *::after { animation: none; }
  .track-gated { border-top-style: solid; }
  .station-result .mini-row { opacity: 1; }
}
@media (max-width: 1023px) and (min-width: 860px) {
  .guard-stage { padding: var(--sp-4); }
  .station { padding: var(--sp-3); }
}
@media (max-width: 859px) {
  .guard-stage { max-width: 100%; }
  .pipeline { flex-direction: column; align-items: stretch; }
  .track { flex: none; min-width: 0; min-height: var(--sp-6); width: 2px; margin: 0 auto; border-top: 0; }
  .track-live { border-left: 2px dotted rgba(162, 119, 255, 0.9); border-left: 2px dotted color-mix(in srgb, var(--primary) 90%, transparent); }
  .track-gated { border-left: 2px dashed rgba(245, 158, 11, 0.75); border-left: 2px dashed color-mix(in srgb, var(--accent) 75%, transparent); }
  .station { justify-content: center; }
}

/* ---------- Sections ---------- */

/* ---------- Guard flow ---------- */
.flow { list-style: none; margin: var(--sp-6) 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
.flow li { border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--panel); padding: var(--sp-5); }
.flow-num { font-family: var(--font-mono); font-size: var(--fs-meta); color: var(--primary); letter-spacing: 0.14em; margin: 0 0 var(--sp-3); }
.dl-panel { border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--panel); padding: var(--sp-5); margin-bottom: var(--sp-6); }
.dl-panel .codeblock { margin: var(--sp-3) 0; }
.flow h3 { margin: 0 0 var(--sp-2); font-size: var(--fs-h3); }
.flow p:last-child { margin: 0; color: var(--muted); font-size: var(--fs-small); line-height: 1.6; }
.section { padding-top: var(--sp-9); padding-bottom: var(--sp-9); border-top: 1px solid var(--border); }
.shot-full { margin: var(--sp-6) 0; }
.shot-full img, .theme-grid img {
  width: 100%; height: auto; display: block;
  border: 1px solid var(--border); border-radius: var(--radius-card);
  background: var(--panel);
}
figcaption { font-size: var(--fs-small); color: var(--muted); margin-top: var(--sp-2); }
.theme-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-6); margin-top: var(--sp-6); }
.theme-grid figure { margin: 0; }

.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); margin-top: var(--sp-6); }
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: var(--sp-6);
}
.card h3 { font-family: var(--font-display); font-size: var(--fs-h3); margin: 0 0 var(--sp-2); }
.card p { margin: 0; color: var(--muted); font-size: var(--fs-small); }

/* ---------- Safety ---------- */
.safety {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: var(--sp-7);
}
.safety-list { list-style: none; margin: var(--sp-6) 0 0; padding: 0; display: grid; gap: var(--sp-4); }
.safety-list li { display: flex; align-items: flex-start; gap: var(--sp-3); font-size: var(--fs-small); }
.safety-list .guard-seal { flex: none; margin-top: var(--sp-1); }

/* ---------- Install ---------- */
.steps { list-style: none; margin: var(--sp-6) 0 0; padding: 0; display: grid; gap: var(--sp-6); }
.step-label { font-weight: 600; margin: 0 0 var(--sp-2); font-size: var(--fs-small); }
.codeblock {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-code); padding: var(--sp-3) var(--sp-4);
}
/* min-width:0 lets the flex item shrink below its content width, so the long
   git clone URL scrolls inside the block instead of pushing the page wide. */
.codeblock code { min-width: 0; font-family: var(--font-mono); font-size: var(--fs-small); color: var(--text); overflow-x: auto; }
.copy {
  flex: none; font-family: var(--font-mono); font-size: var(--fs-meta);
  background: transparent; color: var(--muted); cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius-btn); padding: 6px 12px;
}
.copy:hover { color: var(--text); border-color: var(--text); }
.copy:active { transform: translateY(1px); }
.copy.is-copied { color: var(--accent); border-color: var(--accent); pointer-events: none; }

/* ---------- 404 ---------- */
.error-page {
  display: flex; flex-direction: column; align-items: flex-start;
  min-height: 60vh; justify-content: center;
  padding-top: var(--sp-9); padding-bottom: var(--sp-9);
}
.error-page h1 {
  font-family: var(--font-display); font-size: var(--fs-page);
  margin: 0 0 var(--sp-4); line-height: 1.1; max-width: 20ch;
}
.error-page .lede { margin-bottom: var(--sp-6); }
.error-page .guard-line { margin-top: var(--sp-6); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: var(--sp-6) 0 var(--sp-8); }
.footer-inner { display: grid; gap: var(--sp-1); }
.footer p { margin: 0; font-size: var(--fs-small); }
.footer a { color: var(--primary); text-decoration: none; font-size: var(--fs-small); }
.footer a:hover { text-decoration: underline; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: var(--sp-8); padding-bottom: var(--sp-8); gap: var(--sp-6); }
  .hero h1 { font-size: var(--fs-h1); }
  .cards { grid-template-columns: 1fr; }
  .flow { grid-template-columns: 1fr; }
  .theme-grid { grid-template-columns: 1fr; }
  .section { padding-top: var(--sp-8); padding-bottom: var(--sp-8); }
  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: var(--sp-1);
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: var(--sp-3) var(--sp-5) var(--sp-5);
  }
  .nav-links.open { display: flex; }
  .nav { position: sticky; }
  .safety { padding: var(--sp-5); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ---------- Engines ---------- */
.engines { border-top: 1px solid var(--border); padding-top: var(--sp-6); padding-bottom: var(--sp-6); }
.eng-label {
  text-align: center; font-family: var(--font-mono); font-size: var(--fs-meta);
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 0 0 var(--sp-4);
}
.eng-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-2);
}
.eng-chip {
  display: inline-flex; align-items: center; gap: var(--sp-2); white-space: nowrap;
  font-family: var(--font-mono); font-size: var(--fs-small); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-card);
  background: var(--panel); padding: var(--sp-2) var(--sp-4);
}
.eng-chip::before {
  content: ""; width: 5px; height: 5px; background: var(--accent);
  border-radius: 1px; flex: none;
}

/* ---------- Guard rail ----------
   The hero's pipeline does not stop at the hero: it continues down the page as a
   single 2-pixel rule in the left margin. Dotted violet where the AI proposes,
   dashed amber from the gate onward. Deliberately static: a pulse would read as
   a scroll progress bar; a frozen rule reads as a boundary, which is the claim.
   --rail-out is how far an eyebrow sits from its section's left edge, so each
   station node lands on the rail at any nesting depth. */
.railed { position: relative; --rail-out: var(--sp-5); }
#safety.railed { --rail-out: calc(var(--sp-5) + var(--sp-7)); }
@media (min-width: 1280px) {
  .railed::before {
    content: ""; position: absolute; top: 0; bottom: 0; left: 0; margin-left: -34px;
    border-left: 2px dotted rgba(162, 119, 255, 0.9);
    border-left: 2px dotted color-mix(in srgb, var(--primary) 90%, transparent);
  }
  .railed.gated::before {
    border-left-style: dashed;
    border-left-color: rgba(245, 158, 11, 0.75);
    border-left-color: color-mix(in srgb, var(--accent) 75%, transparent);
  }
  /* Terminal node: the rail stops where the guard stops covering you. */
  .railed.ends::after {
    content: ""; position: absolute; left: 0; margin-left: -39px; bottom: 0;
    width: 12px; height: 2px;
    background: rgba(245, 158, 11, 0.75);
    background: color-mix(in srgb, var(--accent) 75%, transparent);
  }
  .eyebrow { position: relative; }
  /* The tick leaves the flow to sit on the rail, so the label would lose the
     14px the tick used to occupy (6px dot + 8px gap). Padding restores it. */
  .railed .eyebrow { padding-left: calc(6px + var(--sp-2)); }
  .railed .eyebrow .tick {
    position: absolute; left: 0; top: 2px; margin-left: calc(-39px - var(--rail-out));
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--bg); border: 2px solid var(--primary);
  }
  .railed.gated .eyebrow .tick { border-color: var(--accent); }
}

/* ---------- Closing ---------- */
.closing {
  border-top: 1px solid var(--border);
  padding-top: var(--sp-9); padding-bottom: var(--sp-9);
  text-align: center;
}
.closing h2 { font-family: var(--font-display); font-size: var(--fs-h2); margin: 0 0 var(--sp-3); }
.closing .lede { margin: 0 auto var(--sp-6); }
.closing .hero-ctas { justify-content: center; margin-bottom: 0; }

