/* ==========================================================================
   Sieve — shared design system
   Ported from the Claude Design .dc sources (Sieve.dc.html / Sieve Docs.dc.html).
   Self-hosted fonts only. Zero external dependencies / no http(s) links.
   ========================================================================== */

/* ---------------------------------------------------------------------------
   @font-face  (11 self-hosted woff2, font-display:swap)
   --------------------------------------------------------------------------- */
@font-face { font-family:'JetBrains Mono'; font-style:normal; font-weight:400; font-display:swap; src:url('./fonts/jetbrains-mono-400.woff2') format('woff2'); }
@font-face { font-family:'JetBrains Mono'; font-style:normal; font-weight:500; font-display:swap; src:url('./fonts/jetbrains-mono-500.woff2') format('woff2'); }
@font-face { font-family:'JetBrains Mono'; font-style:normal; font-weight:600; font-display:swap; src:url('./fonts/jetbrains-mono-600.woff2') format('woff2'); }
@font-face { font-family:'JetBrains Mono'; font-style:normal; font-weight:700; font-display:swap; src:url('./fonts/jetbrains-mono-700.woff2') format('woff2'); }

@font-face { font-family:'IBM Plex Sans'; font-style:normal; font-weight:400; font-display:swap; src:url('./fonts/ibm-plex-sans-400.woff2') format('woff2'); }
@font-face { font-family:'IBM Plex Sans'; font-style:normal; font-weight:500; font-display:swap; src:url('./fonts/ibm-plex-sans-500.woff2') format('woff2'); }
@font-face { font-family:'IBM Plex Sans'; font-style:normal; font-weight:600; font-display:swap; src:url('./fonts/ibm-plex-sans-600.woff2') format('woff2'); }
@font-face { font-family:'IBM Plex Sans'; font-style:normal; font-weight:700; font-display:swap; src:url('./fonts/ibm-plex-sans-700.woff2') format('woff2'); }

@font-face { font-family:'IBM Plex Mono'; font-style:normal; font-weight:400; font-display:swap; src:url('./fonts/ibm-plex-mono-400.woff2') format('woff2'); }
@font-face { font-family:'IBM Plex Mono'; font-style:normal; font-weight:500; font-display:swap; src:url('./fonts/ibm-plex-mono-500.woff2') format('woff2'); }
@font-face { font-family:'IBM Plex Mono'; font-style:normal; font-weight:600; font-display:swap; src:url('./fonts/ibm-plex-mono-600.woff2') format('woff2'); }

/* ---------------------------------------------------------------------------
   Font-family aliases  (CJK fallbacks appended; CN has no matching glyphs)
   --------------------------------------------------------------------------- */
:root {
  --ff-display: 'JetBrains Mono', 'PingFang SC', 'Microsoft YaHei', monospace;  /* headings / brand / code */
  --ff-body:    'IBM Plex Sans', 'PingFang SC', 'Microsoft YaHei', sans-serif;  /* body copy */
  --ff-mono:    'IBM Plex Mono', 'PingFang SC', 'Microsoft YaHei', monospace;   /* labels / nav / mono UI */
}

/* ---------------------------------------------------------------------------
   Theme tokens  (mounted on <html data-theme=...>; default = system/dark)
   Sequence-diagram colors: GREEN=var(--accent), BLUE=#5fa8ff, RED=#ef6f6f
   --------------------------------------------------------------------------- */
html,
html[data-theme="dark"],
html[data-theme="system"] {
  --bg:#070b08; --bg2:#0a100c; --surface:#0c1410; --surface2:#0e1813;
  --border:#17251b; --border2:#243a2b;
  --text:#e9f4eb; --text2:#90a596; --text3:#5f7466;
  --shadow:rgba(0,0,0,.45); --grid:rgba(255,255,255,.025); --term:#0b120d;
  --tt:#e9f4eb; --tt2:#90a596; --tt3:#5f7466;
  --seq-blue:#5fa8ff; --seq-red:#ef6f6f; --warn:#ef9a3d;
}
html[data-theme="light"] {
  --bg:#eef2ee; --bg2:#ffffff; --surface:#ffffff; --surface2:#f4f7f4;
  --border:#e0e6e1; --border2:#cfdad1;
  --text:#0b130d; --text2:#48564d; --text3:#7c8980;
  --shadow:rgba(20,45,28,.10); --grid:rgba(0,40,15,.03); --term:#0c1410;
  --tt:#e9f4eb; --tt2:#90a596; --tt3:#5f7466;
  --seq-blue:#5fa8ff; --seq-red:#ef6f6f; --warn:#ef9a3d;
}
@media (prefers-color-scheme: light) {
  html[data-theme="system"] {
    --bg:#eef2ee; --bg2:#ffffff; --surface:#ffffff; --surface2:#f4f7f4;
    --border:#e0e6e1; --border2:#cfdad1;
    --text:#0b130d; --text2:#48564d; --text3:#7c8980;
    --shadow:rgba(20,45,28,.10); --grid:rgba(0,40,15,.03); --term:#0c1410;
  }
}

/* ---------------------------------------------------------------------------
   Accent tokens
   --------------------------------------------------------------------------- */
html,
html[data-accent="green"]  { --accent:#27d27f; --accent-fg:#04130a; }
html[data-accent="indigo"] { --accent:#5b6cf0; --accent-fg:#ffffff; }
html[data-accent="amber"]  { --accent:#ef9a3d; --accent-fg:#1c1206; }
html[data-accent="violet"] { --accent:#8b5cf6; --accent-fg:#ffffff; }

/* ---------------------------------------------------------------------------
   Base / reset / typography
   --------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing:border-box; }

html { scroll-behavior:smooth; -webkit-text-size-adjust:100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior:auto; } }

body {
  margin:0;
  min-height:100vh;
  position:relative;
  font-family:var(--ff-body);
  font-size:16px;
  line-height:1.5;
  background:var(--bg);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  text-rendering:optimizeLegibility;
}

a { color:inherit; text-decoration:none; }
img, svg { display:block; max-width:100%; }
h1, h2, h3, h4, p { margin:0; }
button { font:inherit; }

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

a:focus-visible,
button:focus-visible {
  outline:2px solid var(--accent); outline-offset:3px; border-radius:4px;
}

/* backdrop grid (fixed, behind everything) */
.bg-grid {
  position:fixed; inset:0; pointer-events:none; z-index:0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size:64px 64px;
}

/* page content sits above the grid */
.page { position:relative; z-index:1; }

/* shared content wrapper */
.wrap { max-width:1160px; margin:0 auto; padding:0 32px; }

/* ---------------------------------------------------------------------------
   Header / nav / controls
   --------------------------------------------------------------------------- */
.site-header {
  position:sticky; top:0; z-index:40;
  backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px);
  background:color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom:1px solid var(--border);
}
.site-header__inner {
  max-width:1160px; margin:0 auto; padding:14px 32px;
  display:flex; align-items:center; justify-content:space-between; gap:24px;
}

.brand {
  display:flex; align-items:center; gap:10px;
  font-family:var(--ff-display); font-size:17px; font-weight:700;
  letter-spacing:-.01em; color:var(--text);
}
.brand__dot {
  width:11px; height:11px; flex:none;
  background:var(--accent); border-radius:2px;
  box-shadow:0 0 12px var(--accent);
}
.brand__suffix { color:var(--text3); font-weight:400; }

.site-nav {
  display:flex; align-items:center; gap:26px;
  font-family:var(--ff-mono); font-size:13px; color:var(--text2);
}
.site-nav a { transition:color .15s; }
.site-nav a:hover { color:var(--text); }

.header-right { display:flex; align-items:center; gap:14px; }

/* segmented controls (built by app.js into [data-controls]) */
.controls { display:flex; align-items:center; gap:10px; }
.seg {
  display:flex; align-items:center; gap:2px;
  border:1px solid var(--border2); border-radius:6px; padding:2px;
}
.seg__btn {
  cursor:pointer; font-family:var(--ff-mono); font-size:12px;
  padding:5px 10px; border-radius:4px; line-height:1;
  transition:all .15s; color:var(--text2);
  background:transparent; font-weight:400;
  border:none; -webkit-appearance:none; appearance:none;
}
.seg__btn--icon { font-size:13px; padding:4px 9px; }
.seg__btn.is-active { color:var(--accent-fg); background:var(--accent); font-weight:600; }

/* mobile menu toggle (hidden on desktop) */
.nav-toggle {
  display:none; cursor:pointer;
  font-family:var(--ff-mono); font-size:18px; line-height:1;
  color:var(--text); background:transparent;
  border:1px solid var(--border2); border-radius:6px;
  padding:6px 11px; -webkit-appearance:none; appearance:none;
}

/* ---------------------------------------------------------------------------
   Section scaffolding
   --------------------------------------------------------------------------- */
.section { border-top:1px solid var(--border); }
.section--alt { background:var(--bg2); }
.section__inner { max-width:1160px; margin:0 auto; padding:80px 32px; }

.kicker {
  font-family:var(--ff-mono); font-size:12px; letter-spacing:.14em;
  color:var(--accent); margin-bottom:18px;
}
.h2 {
  font-family:var(--ff-display); font-size:34px; line-height:1.18;
  font-weight:700; letter-spacing:-.02em; margin:0 0 22px; max-width:780px;
}
.section__lead {
  font-size:17px; line-height:1.65; color:var(--text2);
  max-width:680px; margin:0 0 48px;
}

/* ---------------------------------------------------------------------------
   Hero
   --------------------------------------------------------------------------- */
.hero { position:relative; max-width:1160px; margin:0 auto; padding:88px 32px 64px; overflow-x:clip; }
.hero__glow {
  position:absolute; top:40px; left:50%; transform:translateX(-50%);
  width:560px; height:360px; pointer-events:none; filter:blur(30px);
  background:radial-gradient(ellipse at center, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%);
}
.hero__main {
  position:relative; display:grid; grid-template-columns:1fr 1fr;
  gap:56px; align-items:end;
}
.hero__body { position:relative; min-width:0; }
.hero__aside { display:flex; flex-direction:column; gap:18px; min-width:0; }

.badge {
  position:relative;
  display:inline-flex; align-items:center; gap:8px;
  font-family:var(--ff-mono); font-size:11px; letter-spacing:.04em;
  color:var(--accent); border:1px solid var(--border2);
  border-radius:999px; padding:6px 13px; margin-bottom:34px;
}
.badge__dot {
  width:6px; height:6px; border-radius:50%; background:var(--accent);
  animation:pulse 1.8s infinite;
}

.hero__title {
  font-family:var(--ff-display); font-size:52px; line-height:1.05;
  margin:0 0 24px; font-weight:700; letter-spacing:-.03em;
}
.hero__title-accent { color:var(--accent); }
.hero__sub {
  font-size:17px; line-height:1.6; color:var(--text2);
  margin:0 0 34px;
}

.cta-row { display:flex; gap:13px; flex-wrap:wrap; }
.btn {
  font-family:var(--ff-mono); font-size:14px; font-weight:500;
  padding:13px 22px; border-radius:4px;
  display:inline-flex; align-items:center; gap:9px;
  transition:filter .15s, border-color .15s, color .15s;
  cursor:pointer;
}
.btn--primary { font-weight:600; color:var(--accent-fg); background:var(--accent); }
.btn--primary:hover { filter:brightness(1.06); }
.btn--primary .btn__sigil { opacity:.6; }
.btn--ghost { color:var(--text); border:1px solid var(--border2); }
.btn--ghost:hover { border-color:var(--accent); color:var(--accent); }

/* ---------------------------------------------------------------------------
   Terminal block (hero proof + get-started)
   --------------------------------------------------------------------------- */
.terminal {
  position:relative; max-width:680px;
  background:var(--term); border:1px solid var(--border2); border-radius:6px;
  box-shadow:0 24px 60px -20px var(--shadow); overflow:hidden;
}
.terminal__bar {
  display:flex; align-items:center; gap:7px;
  padding:12px 15px; border-bottom:1px solid var(--border);
}
.terminal__dot { width:11px; height:11px; border-radius:50%; flex:none; }
.terminal__dot--r { background:#ff5f57; }
.terminal__dot--y { background:#febc2e; }
.terminal__dot--g { background:#28c840; }
.terminal__title {
  margin-left:10px; font-family:var(--ff-mono); font-size:11px; color:var(--tt3);
}
.terminal__body {
  padding:18px 20px;
  font-family:var(--ff-display); font-size:13px; line-height:1.95; color:var(--tt2);
}
.terminal__body .t-line { color:var(--tt); }
.t-prompt { color:var(--tt3); }
.t-ok, .t-pass { color:var(--accent); }
.t-warn { color:var(--warn); }
.t-block { color:var(--seq-red); font-weight:600; }
.t-dim { color:var(--tt3); }
.t-gap { margin-top:6px; }
.cursor {
  display:inline-block; width:8px; height:15px; vertical-align:-2px;
  background:var(--accent); animation:blink 1.1s step-end infinite;
}

/* ---------------------------------------------------------------------------
   Stat strip (hero)
   --------------------------------------------------------------------------- */
.stats {
  display:grid; grid-template-columns:repeat(4,1fr); gap:1px;
  background:var(--border); border:1px solid var(--border); border-radius:6px;
  overflow:hidden;
}
.stat { background:var(--surface); padding:16px 14px; }
.stat__v {
  font-family:var(--ff-display); font-size:20px; font-weight:700;
  color:var(--text); letter-spacing:-.02em;
}
.stat__l {
  font-family:var(--ff-mono); font-size:10.5px; color:var(--text3);
  margin-top:5px; line-height:1.4;
}

/* Hero stacks to a single column on narrow viewports: copy first, then the
   terminal + stats aside beneath it. */
@media (max-width: 880px) {
  .hero__main { grid-template-columns:1fr; gap:36px; align-items:stretch; }
  .terminal { max-width:none; }
}

/* ---------------------------------------------------------------------------
   Zero Trust Gateway — converging pipeline
   (untrusted inputs ▶ glowing SIEVE gate ▶ guarded actions)
   Ported from the .dc design (.s-pipe / .s-gate / scanY); inline colors mapped
   to site tokens, the danger red mapped to --seq-red (#ef6f6f).
   --------------------------------------------------------------------------- */
.pipe { display:flex; align-items:stretch; gap:0; }

/* input / action columns ------------------------------------------------- */
.pipe-col {
  flex:1; min-width:0; overflow:hidden;
  border:1px solid var(--border); border-radius:11px; background:var(--surface);
}
.pipe-col--in {
  border-color:color-mix(in srgb, var(--seq-red) 30%, var(--border));
  background:color-mix(in srgb, var(--seq-red) 4%, var(--surface));
}
.pipe-col--out {
  border-color:color-mix(in srgb, var(--accent) 30%, var(--border));
  background:color-mix(in srgb, var(--accent) 4%, var(--surface));
}

.pipe-col__head { padding:14px 17px; border-bottom:1px solid var(--border); }
.pipe-col--in  .pipe-col__head { border-bottom-color:color-mix(in srgb, var(--seq-red) 22%, var(--border)); }
.pipe-col--out .pipe-col__head { border-bottom-color:color-mix(in srgb, var(--accent) 22%, var(--border)); }

.pipe-col__title { display:flex; align-items:center; gap:9px; margin-bottom:6px; }
.pipe-col__dot {
  flex:none; width:7px; height:7px; border-radius:50%;
  background:var(--seq-red); box-shadow:0 0 9px var(--seq-red);
  animation:pulse 1.6s infinite;
}
.pipe-col__check { flex:none; font-family:var(--ff-display); font-size:12px; font-weight:700; color:var(--accent); }
.pipe-col__label {
  flex:1; min-width:0;
  font-family:var(--ff-mono); font-size:11px; letter-spacing:.12em;
  text-transform:uppercase; font-weight:600;
}
.pipe-col--in  .pipe-col__label { color:var(--seq-red); }
.pipe-col--out .pipe-col__label { color:var(--accent); }
.pipe-col__count {
  flex:none; font-family:var(--ff-mono); font-size:9.5px;
  color:var(--text3); white-space:nowrap;
}
.pipe-col__hint { font-size:11.5px; line-height:1.45; color:var(--text3); }

.pipe-row {
  display:flex; align-items:center; gap:11px;
  padding:9px 17px; border-top:1px solid var(--border); transition:background .15s;
}
.pipe-col--in  .pipe-row { border-top-color:color-mix(in srgb, var(--seq-red) 11%, var(--border)); }
.pipe-col--out .pipe-row { border-top-color:color-mix(in srgb, var(--accent) 11%, var(--border)); }
.pipe-col--in  .pipe-row:hover { background:color-mix(in srgb, var(--seq-red) 8%, transparent); }
.pipe-col--out .pipe-row:hover { background:color-mix(in srgb, var(--accent) 8%, transparent); }

.pipe-row__c {
  flex:none; width:42px;
  font-family:var(--ff-mono); font-size:9px; font-weight:600; letter-spacing:.03em;
  color:var(--seq-red);
}
.pipe-row__t {
  flex:1; min-width:0; font-size:13px; color:var(--text); font-weight:500;
}
.pipe-row--act .pipe-row__t {
  display:flex; align-items:center; gap:9px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.pipe-row__i { flex:none; font-family:var(--ff-display); font-size:11px; color:var(--accent); }
.pipe-row__r {
  flex:none; font-family:var(--ff-mono); font-size:9px; letter-spacing:.03em; color:var(--text3);
}

.pipe-col__flow {
  padding:11px 17px; border-top:1px solid var(--border);
  font-family:var(--ff-mono); font-size:9.5px; letter-spacing:.05em; color:var(--text3);
}
.pipe-col__flow--in  { border-top-color:color-mix(in srgb, var(--seq-red) 20%, var(--border)); }
.pipe-col__flow--out { border-top-color:color-mix(in srgb, var(--accent) 20%, var(--border)); }

/* converging arrows ------------------------------------------------------ */
.pipe-arrow {
  flex:none; display:flex; align-items:center; justify-content:center;
  padding:0 12px; font-size:14px;
}
.pipe-arrow--in  { color:var(--seq-red); }
.pipe-arrow--out { color:var(--accent); }

/* the glowing gate ------------------------------------------------------- */
.pipe-gate {
  flex:none; width:208px; position:relative; overflow:hidden;
  border:1px solid var(--accent); border-radius:13px; background:var(--term);
  box-shadow:0 0 52px -14px var(--accent);
  display:flex; flex-direction:column;
}
.pipe-gate__dots {
  position:absolute; inset:0; pointer-events:none; opacity:.26;
  background-image:radial-gradient(color-mix(in srgb, var(--accent) 40%, transparent) 1px, transparent 1.4px);
  background-size:12px 12px;
}
.pipe-gate__scan {
  position:absolute; left:0; right:0; height:18%; pointer-events:none;
  background:linear-gradient(180deg, transparent, color-mix(in srgb, var(--accent) 22%, transparent), transparent);
  animation:scanY 2.8s linear infinite;
}
.pipe-gate__inner {
  position:relative; flex:1;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  text-align:center; gap:16px; padding:26px 20px;
}
.pipe-gate__checkpoint {
  display:inline-flex; align-items:center; gap:6px;
  font-family:var(--ff-mono); font-size:9px; letter-spacing:.18em; color:var(--accent);
}
.pipe-gate__cp-dot {
  width:5px; height:5px; border-radius:50%;
  background:var(--accent); box-shadow:0 0 8px var(--accent);
  animation:pulse 1.6s infinite;
}
.pipe-gate__name {
  font-family:var(--ff-display); font-size:20px; line-height:1.12; font-weight:700;
  color:var(--accent); letter-spacing:.02em; white-space:normal;
  text-shadow:0 0 22px color-mix(in srgb, var(--accent) 65%, transparent);
}
.pipe-gate__mech { font-size:12.5px; line-height:1.5; color:var(--text2); }
.pipe-gate__verdicts {
  display:flex; flex-direction:column; gap:7px; align-items:stretch; padding-top:4px;
}
.pipe-gate__allow,
.pipe-gate__block {
  display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:4px 7px;
  font-family:var(--ff-mono); font-size:11px; line-height:1.5; white-space:normal;
}
.pipe-gate__allow { color:var(--accent); }
.pipe-gate__block { color:var(--seq-red); }
.pipe-gate__mark { font-weight:700; }

/* problem-solved closing strip ------------------------------------------- */
.pipe-problem {
  margin-top:26px; display:flex; align-items:flex-start; gap:12px;
  padding:16px 18px; background:var(--surface);
  border:1px solid var(--border); border-left:2px solid var(--accent); border-radius:8px;
}
.pipe-problem__sigil {
  flex:none; font-family:var(--ff-display); font-size:13px; color:var(--accent); padding-top:1px;
}
.pipe-problem__t { font-size:14px; line-height:1.55; color:var(--text); font-weight:500; }

/* Narrow viewports keep the pipeline HORIZONTAL (design's mobile stacks it
   vertically; per requirement we compress in place instead of column-stacking). */
@media (max-width: 760px) {
  .pipe-gate { width:138px; }
  .pipe-gate__inner { gap:11px; padding:20px 10px; }
  .pipe-gate__name { font-size:15px; }
  .pipe-gate__mech { font-size:11px; }
  .pipe-gate__allow, .pipe-gate__block { font-size:10px; gap:5px; white-space:normal; }
  .pipe-arrow { padding:0 6px; font-size:12px; }
  .pipe-col__head { padding:11px 12px; }
  .pipe-col__title { gap:6px; }
  .pipe-col__count { display:none; }
  .pipe-col__hint { font-size:10.5px; }
  .pipe-col__label { font-size:10px; letter-spacing:.07em; }
  .pipe-row { padding:8px 12px; gap:8px; }
  .pipe-row__c { width:34px; font-size:8.5px; }
  .pipe-row__t { font-size:12px; }
  .pipe-row--act .pipe-row__t { gap:7px; }
  .pipe-row__r { display:none; }
  .pipe-col__flow { font-size:8.5px; padding:9px 12px; }
}
@media (max-width: 440px) {
  .pipe-gate { width:84px; }
  .pipe-gate__inner { gap:8px; padding:14px 5px; }
  .pipe-gate__checkpoint { font-size:8px; letter-spacing:.1em; gap:4px; }
  .pipe-gate__name { font-size:11.5px; }
  .pipe-gate__mech { display:none; }
  .pipe-gate__allow, .pipe-gate__block { font-size:8.5px; gap:4px; }
  .pipe-arrow { padding:0 3px; font-size:10px; }
  .pipe-col__head { padding:9px 8px; }
  .pipe-col__hint { display:none; }
  .pipe-col__label { font-size:8.5px; letter-spacing:.04em; }
  .pipe-row { padding:7px 8px; gap:6px; }
  .pipe-row__c { display:none; }
  .pipe-row__t { font-size:10.5px; line-height:1.35; }
  .pipe-row--act .pipe-row__t { white-space:normal; }
  .pipe-row__i { font-size:9.5px; }
  .pipe-col__flow { display:none; }
}

/* ---------------------------------------------------------------------------
   Problem cards (3-up)
   --------------------------------------------------------------------------- */
.grid-3 {
  display:grid; grid-template-columns:repeat(3,1fr); gap:1px;
  background:var(--border); border:1px solid var(--border); border-radius:6px; overflow:hidden;
}
.prob { background:var(--surface); padding:26px 24px; }
.prob__n { font-family:var(--ff-display); font-size:13px; color:var(--accent); margin-bottom:14px; }
.prob__t { font-size:15px; line-height:1.55; color:var(--text); }

/* ---------------------------------------------------------------------------
   How it works — sequence diagram (rendered by app.js into [data-how-diagram])
   --------------------------------------------------------------------------- */
.diagram__bar {
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom:18px; gap:16px; flex-wrap:wrap;
}
.diagram__caption { display:flex; align-items:center; gap:10px; min-height:20px; }
.diagram__caption-dot {
  width:7px; height:7px; border-radius:50%; flex:none;
  background:var(--accent); transition:background .35s;
}
.diagram__caption-text {
  font-family:var(--ff-mono); font-size:13px; color:var(--accent); transition:color .35s;
}
.diagram__replay {
  cursor:pointer; font-family:var(--ff-mono); font-size:12px; color:var(--text2);
  background:none; border:1px solid var(--border2); border-radius:5px; padding:7px 14px;
  transition:color .15s, border-color .15s;
}
.diagram__replay:hover { color:var(--accent); border-color:var(--accent); }
.diagram__stage {
  position:relative; height:560px;
  background:var(--surface2); border:1px solid var(--border); border-radius:10px;
  overflow:hidden;
}

.seq-node {
  position:absolute; top:14px; width:190px;
  transform:translateX(-50%);
  border:1px solid var(--border2); border-radius:8px;
  padding:12px 10px 11px; text-align:center; background:var(--surface);
  transition:border-color .35s, box-shadow .35s, background .35s;
}
.seq-node.is-hot {
  border-color:var(--accent);
  background:color-mix(in srgb, var(--accent) 10%, var(--surface));
  box-shadow:0 0 26px -10px var(--accent);
}
.seq-node__t { font-family:var(--ff-display); font-size:15px; font-weight:700; color:var(--text); }
.seq-node.is-hot .seq-node__t { color:var(--accent); }
.seq-node__s { font-family:var(--ff-mono); font-size:11px; color:var(--text3); margin-top:4px; }

.seq-lifeline {
  position:absolute; top:92px; height:452px;
  border-left:1px dashed var(--border2); opacity:.4;
}
.seq-lifeline.is-hot { border-left-color:var(--accent); opacity:.6; }

.seq-arrow {
  position:absolute; height:2px; opacity:.38;
  background:var(--arrow-color);
  background-size:16px 2px;
  transition:opacity .35s ease, height .2s ease, filter .35s ease;
}
.seq-arrow.is-dashed {
  background:repeating-linear-gradient(90deg, var(--arrow-color) 0 8px, transparent 8px 16px);
  background-size:16px 2px;
}
.seq-arrow.is-active {
  opacity:1; height:3px; background-size:16px 3px;
  filter:drop-shadow(0 0 5px var(--arrow-color));
}
.seq-arrow.is-active.dir-r { animation:flowR .55s linear infinite; }
.seq-arrow.is-active.dir-l { animation:flowL .55s linear infinite; }

.seq-head {
  position:absolute; width:0; height:0;
  border-top:5px solid transparent; border-bottom:5px solid transparent;
  opacity:.38; transition:opacity .35s ease, filter .35s ease;
}
.seq-head.dir-r { transform:translate(-100%,-50%); border-left:9px solid var(--arrow-color); }
.seq-head.dir-l { transform:translate(0,-50%); border-right:9px solid var(--arrow-color); }
.seq-head.is-active { opacity:1; filter:drop-shadow(0 0 4px var(--arrow-color)); border-top-width:6px; border-bottom-width:6px; }
.seq-head.is-active.dir-r { border-left-width:11px; }
.seq-head.is-active.dir-l { border-right-width:11px; }

.seq-label {
  position:absolute; text-align:center; white-space:nowrap;
  font-family:var(--ff-mono); font-size:12.5px; font-weight:500;
  color:var(--arrow-color); opacity:.5; transition:opacity .35s ease;
}
.seq-label.is-active { font-weight:700; opacity:1; }

.seq-box {
  position:absolute; left:50%; transform:translateX(-50%);
  border:1px solid var(--box-color); border-radius:8px;
  background:color-mix(in srgb, var(--box-color) 8%, var(--surface));
  padding:8px 16px 9px; text-align:center; min-width:210px; opacity:.5;
  transition:opacity .35s ease, box-shadow .35s ease, border-color .35s ease, background .35s ease;
}
.seq-box.is-active {
  opacity:1; border-width:1.5px;
  background:color-mix(in srgb, var(--box-color) 15%, var(--surface));
  box-shadow:0 0 0 4px color-mix(in srgb, var(--box-color) 20%, transparent), 0 0 24px -6px var(--box-color);
}
.seq-box__t { font-family:var(--ff-display); font-size:13px; font-weight:700; color:var(--box-color); letter-spacing:.02em; }
.seq-box__s { font-family:var(--ff-mono); font-size:11px; color:var(--text2); margin-top:2px; }

/* ---------------------------------------------------------------------------
   Detection cards (3-up, free gap)
   --------------------------------------------------------------------------- */
.cards-3 { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; }
.detect {
  background:var(--surface); border:1px solid var(--border); border-radius:6px;
  padding:22px 22px 24px; transition:border-color .2s, transform .2s;
}
.detect:hover { border-color:var(--accent); transform:translateY(-2px); }
.detect__k { font-family:var(--ff-display); font-size:12px; color:var(--accent); margin-bottom:14px; }
.detect__t { font-size:16px; font-weight:600; color:var(--text); margin-bottom:7px; }
.detect__d { font-size:13.5px; line-height:1.55; color:var(--text2); }

/* ---------------------------------------------------------------------------
   Verify (2-col)
   --------------------------------------------------------------------------- */
.grid-2 {
  display:grid; grid-template-columns:1fr 1fr; gap:1px;
  background:var(--border); border:1px solid var(--border); border-radius:6px; overflow:hidden;
}
.verify {
  background:var(--surface); padding:30px 28px;
  display:flex; gap:18px; align-items:flex-start;
}
.verify__n { font-family:var(--ff-display); font-size:13px; color:var(--accent); flex:none; padding-top:2px; }
.verify__t { font-size:17px; font-weight:600; color:var(--text); margin-bottom:8px; }
.verify__d { font-size:14px; line-height:1.6; color:var(--text2); }

/* ---------------------------------------------------------------------------
   Get started — step terminal
   --------------------------------------------------------------------------- */
.steps {
  max-width:720px; background:var(--term);
  border:1px solid var(--border2); border-radius:6px; overflow:hidden;
  box-shadow:0 24px 60px -24px var(--shadow);
}
.step {
  padding:20px 22px; border-bottom:1px solid var(--border);
  display:flex; gap:16px; align-items:flex-start;
}
.step__n { font-family:var(--ff-display); font-size:12px; color:var(--accent); flex:none; padding-top:3px; }
.step__main { flex:1; min-width:0; }
.step__cmd {
  font-family:var(--ff-display); font-size:13.5px; color:var(--tt);
  white-space:pre-wrap; word-break:break-word;
}
.step__cmd .t-prompt { color:var(--tt3); }
.step__note { font-size:13px; color:var(--tt2); margin-top:8px; line-height:1.5; }
.step__cmd--soon { color:var(--tt2); }
.step__soon {
  display:inline-block; margin-left:10px; vertical-align:middle;
  font-family:var(--ff-mono); font-size:10px; letter-spacing:.04em;
  color:var(--tt3); border:1px solid var(--border2); border-radius:999px;
  padding:2px 8px;
}
.steps__foot { padding:18px 22px; display:flex; gap:12px; align-items:center; flex-wrap:wrap; }
.steps__foot-note { font-family:var(--ff-mono); font-size:12px; color:var(--tt3); }

/* ---------------------------------------------------------------------------
   NOTES (glossary footnotes) — kicker on the left, two-column term list
   --------------------------------------------------------------------------- */
#glossary .section__inner { padding-top:34px; padding-bottom:34px; }
.gloss { display:flex; gap:30px; align-items:flex-start; flex-wrap:wrap; }
.gloss__kicker {
  flex:none; padding-top:3px;
  font-family:var(--ff-mono); font-size:11px; letter-spacing:.16em; color:var(--text3);
}
.gloss__grid {
  flex:1; min-width:260px;
  display:grid; grid-template-columns:1fr 1fr; gap:9px 36px;
}
.gloss__item { font-size:12.5px; line-height:1.55; color:var(--text3); }
.gloss__term { font-family:var(--ff-display); font-weight:600; color:var(--text2); }
.gloss__sep { color:var(--text3); }

@media (max-width: 560px) {
  .gloss__grid { grid-template-columns:1fr; }
}

/* ---------------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------------- */
.site-footer { border-top:1px solid var(--border); background:var(--bg); }
.site-footer__inner {
  max-width:1160px; margin:0 auto; padding:44px 32px;
  display:flex; align-items:center; justify-content:space-between; gap:24px; flex-wrap:wrap;
}
.site-footer__brand {
  display:flex; align-items:center; gap:10px;
  font-family:var(--ff-display); font-size:15px; font-weight:700; color:var(--text);
}
.site-footer__brand .brand__dot { box-shadow:none; width:10px; height:10px; }
.site-footer__meta { font-family:var(--ff-mono); font-size:12px; color:var(--text3); }

/* ---------------------------------------------------------------------------
   Docs — two-column layout
   --------------------------------------------------------------------------- */
.docs-layout {
  max-width:1160px; margin:0 auto; padding:0 32px;
  display:grid; grid-template-columns:220px 1fr; gap:48px;
}
.docs-aside { padding:48px 0; position:sticky; top:60px; align-self:start; height:max-content; }
.docs-nav-group { margin-bottom:26px; }
.docs-nav-group__title {
  font-family:var(--ff-mono); font-size:11px; letter-spacing:.12em;
  text-transform:uppercase; color:var(--text3); margin-bottom:11px;
}
.docs-nav-group a {
  display:block; font-size:14px; color:var(--text2); padding:5px 0; transition:color .15s;
}
.docs-nav-group a:hover { color:var(--accent); }

.docs-main { padding:48px 0 80px; min-width:0; }
.docs-kicker { font-family:var(--ff-mono); font-size:12px; letter-spacing:.14em; color:var(--accent); margin-bottom:16px; }
.docs-title { font-family:var(--ff-display); font-size:40px; line-height:1.1; margin:0 0 18px; font-weight:700; letter-spacing:-.02em; }
.docs-intro { font-size:17px; line-height:1.65; color:var(--text2); max-width:640px; margin:0 0 40px; }

/* quickstart callout */
.callout {
  background:var(--surface2); border:1px solid var(--border); border-radius:8px;
  padding:26px 28px; margin-bottom:48px;
}
.callout__title { font-family:var(--ff-display); font-size:14px; font-weight:600; margin-bottom:16px; }
.callout__body { font-family:var(--ff-display); font-size:13.5px; line-height:2.1; color:var(--text2); }
.callout__body .t-prompt { color:var(--text3); }
.callout__body .t-accent { color:var(--accent); }

/* hub cards (2-up) */
.hub-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.hub-card {
  display:block; background:var(--surface); border:1px solid var(--border); border-radius:8px;
  padding:24px 24px 26px; transition:border-color .2s, transform .2s;
}
.hub-card:hover { border-color:var(--accent); transform:translateY(-2px); }
.hub-card__top { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.hub-card__tag { font-family:var(--ff-display); font-size:12px; color:var(--accent); }
.hub-card__arrow { color:var(--text3); }
.hub-card__t { font-size:17px; font-weight:600; color:var(--text); margin-bottom:8px; }
.hub-card__d { font-size:13.5px; line-height:1.55; color:var(--text2); }

/* ---------------------------------------------------------------------------
   Keyframes
   --------------------------------------------------------------------------- */
@keyframes blink  { 0%,49%{opacity:1} 50%,100%{opacity:0} }
@keyframes pulse  { 0%,100%{opacity:.35} 50%{opacity:1} }
@keyframes flowR  { to { background-position:16px 0 } }
@keyframes flowL  { to { background-position:-16px 0 } }
@keyframes scanY  { 0%{ top:-12% } 100%{ top:112% } }
@keyframes fadeUp { from{opacity:0; transform:translateY(14px)} to{opacity:1; transform:none} }

/* scroll reveal — initial hidden state is gated behind html.js so content
   stays visible when JS is off / fails (progressive enhancement). */
html.js .reveal { opacity:0; }
.reveal.in { animation:fadeUp .7s cubic-bezier(.2,.7,.2,1) forwards; }

/* ---------------------------------------------------------------------------
   Language toggle  (default EN; .lang-zh hidden until html[data-lang="zh"])
   display:revert keeps inline/block elements correct in both states.
   --------------------------------------------------------------------------- */
.lang-zh { display:none; }
.lang-en { display:revert; }
html[data-lang="zh"] .lang-en { display:none; }
html[data-lang="zh"] .lang-zh { display:revert; }

/* ---------------------------------------------------------------------------
   Responsive  (design is 1160px desktop-first)
   --------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .docs-layout { grid-template-columns:1fr; gap:0; }
  .docs-aside {
    position:static; padding:32px 0 0; height:auto;
    display:flex; flex-wrap:wrap; gap:0 36px;
  }
  .docs-nav-group { margin-bottom:20px; }
  .docs-main { padding:32px 0 64px; }
  .docs-title { font-size:32px; }

  .hub-grid { grid-template-columns:1fr; }
}

@media (max-width: 820px) {
  .site-nav {
    display:none;
    position:absolute; top:100%; left:0; right:0;
    flex-direction:column; align-items:flex-start; gap:0;
    padding:8px 32px 16px;
    background:color-mix(in srgb, var(--bg) 96%, transparent);
    border-bottom:1px solid var(--border);
    backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px);
  }
  .site-nav a { padding:10px 0; width:100%; font-size:14px; }
  .site-header.is-open .site-nav { display:flex; }
  .nav-toggle { display:inline-flex; }
  .site-header__inner { flex-wrap:wrap; }
}

@media (max-width: 760px) {
  .wrap, .section__inner, .docs-layout { padding-left:20px; padding-right:20px; }
  .site-header__inner, .hero, .site-footer__inner { padding-left:20px; padding-right:20px; }
  .hero { padding-top:64px; padding-bottom:48px; }
  .section__inner { padding-top:60px; padding-bottom:60px; }

  .hero__title { font-size:clamp(34px, 11vw, 52px); }
  .h2 { font-size:clamp(26px, 7vw, 32px); }
  .hero__sub { font-size:16px; }

  .stats { grid-template-columns:repeat(2,1fr); }
  .grid-3, .cards-3 { grid-template-columns:1fr; }
  .grid-2 { grid-template-columns:1fr; }

  .diagram__stage { height:auto; min-height:540px; }
  /* lock caption height: its text wraps to 1 or 2 lines depending on the step,
     and a changing height made the whole diagram jump on every animation tick */
  .diagram__caption { width:100%; min-height:42px; align-items:flex-start; }
  .diagram__caption-dot { margin-top:5px; }

  /* sequence diagram -> compact: shrink the three lifeline nodes so they stop
     overlapping on phones, hide each node's subtitle and the inline arrow
     labels (the caption bar above the stage already shows the active step's
     full text), and let the inspect/redact boxes wrap. Animation preserved. */
  .seq-node { width:clamp(82px, 26vw, 104px); padding:9px 4px 8px; }
  .seq-node__t { font-size:clamp(10px, 2.85vw, 12.5px); white-space:nowrap; }
  .seq-node__s { display:none; }
  .seq-label { display:none; }
  .seq-box { min-width:0; max-width:190px; padding:7px 13px 8px; }
  .seq-box__t { font-size:12px; }
  .seq-box__s { font-size:10.5px; line-height:1.4; }

  /* larger touch targets for the header controls */
  .seg__btn { padding:7px 12px; }
  .seg__btn--icon { padding:6px 11px; }
  .nav-toggle { padding:8px 13px; font-size:19px; }
}

@media (max-width: 560px) {
  .cta-row .btn { width:100%; justify-content:center; }
  .hub-grid { grid-template-columns:1fr; }
}

/* ---------------------------------------------------------------------------
   Reduced motion — disable non-essential animation
   --------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .badge__dot,
  .cursor,
  .seq-arrow.is-active.dir-r,
  .seq-arrow.is-active.dir-l { animation:none !important; }
  .reveal { opacity:1 !important; }
  .reveal.in { animation:none !important; }
  *, *::before, *::after { transition-duration:.001ms !important; }
}
