/* ==========================================================================
   Companion Brand Engine — Shared Dark Technical UI
   Zero build step · Strict square corners
   ========================================================================== */

/* ---------- 1. Tokens ---------------------------------------------------- */
:root {
  --bg: #000000;
  --panel: #0c0c0f;
  --panel-2: #121218;
  --line: #23232c;
  --line-strong: #3a3a48;
  --text: #f2efe9;
  --muted: #a8a6b0;
  --dim: #73717d;
  --peri: #8a8dff;
  --peri-deep: #5f63f2;
  --peri-glint: #c9cbff;
  --green: #a8ffc4;
  --coral: #ff5a3c;

  --display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --body-font: "Inter", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;

  --h1: clamp(2.4rem, 5.2vw, 4.5rem);
  --h2: clamp(2rem, 4.1vw, 3.35rem);
  --h3: clamp(1.2rem, 1.6vw, 1.5rem);
  --body: clamp(1rem, 1.15vw, 1.125rem);
  --small: 0.75rem;

  --gutter: clamp(18px, 4vw, 56px);
  --section: clamp(80px, 10vw, 152px);
  --header-h: 56px;
}

/* ---------- 2. Base ------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; border-radius: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 24px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body-font);
  font-size: var(--body);
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
h1, h2, h3, h4, p, ol, ul, figure, dl, dd, blockquote { margin: 0; padding: 0; }
ol, ul { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; border-radius: 0; }
canvas, svg { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--peri); outline-offset: 2px; }
::selection { background: var(--peri); color: #000000; }

.wrap { width: 100%; max-width: 1440px; margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--text); color: #000000; padding: 8px 12px; font: 500 var(--small) var(--mono); z-index: 200; }
.skip:focus { left: 8px; }

/* display type */
.h1, .h2, .h3 { font-family: var(--display); font-weight: 400; letter-spacing: -0.04em; line-height: 1.04; }
.h1 { font-size: var(--h1); text-transform: lowercase; text-wrap: balance; }
.h2 { font-size: var(--h2); text-transform: lowercase; text-wrap: balance; }
.h3 { font-size: var(--h3); letter-spacing: -0.025em; }

/* [ bracket overline ] */
.overline { font: 400 var(--small)/1.4 var(--mono); letter-spacing: 0.04em; color: var(--green); text-transform: lowercase; margin-bottom: 18px; }
.overline::before { content: "[ "; }
.overline::after { content: " ]"; }

.mono { font-family: var(--mono); letter-spacing: 0; }
.caption { font: 400 var(--small)/1.5 var(--mono); color: var(--dim); letter-spacing: 0.02em; }

/* section scaffold */
.section { padding-block: var(--section); }
.section + .section { border-top: 1px solid var(--line); }
.section-head { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 28px 48px; align-items: end; margin-bottom: clamp(36px, 5vw, 72px); }
.section-note { color: var(--muted); max-width: 44ch; justify-self: end; font-size: 1rem; line-height: 1.55; }
@media (max-width: 820px) {
  .section-head { grid-template-columns: 1fr; }
  .section-note { justify-self: start; max-width: none; }
}

/* text CTA */
.cta { display: inline-flex; align-items: center; gap: 10px; font: 500 0.8125rem/1 var(--mono); letter-spacing: 0.02em; color: var(--text); padding: 14px 0; position: relative; }
.cta::after { content: ""; position: absolute; left: 0; right: 0; bottom: 8px; height: 1px; background: var(--peri); transform: scaleX(0); transform-origin: left; transition: transform 0.3s cubic-bezier(.2,.7,.2,1); }
.cta:hover::after, .cta:focus-visible::after { transform: scaleX(1); }
.cta .arrow { color: var(--peri); transition: transform 0.25s; }
.cta:hover .arrow { transform: translateX(4px); }
.section-cta { margin-top: clamp(28px, 4vw, 48px); display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; }

/* hard-shadow button */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  background: var(--peri);
  color: #0b0b0e;
  border: 1px solid var(--peri);
  font: 500 var(--small)/1 var(--mono);
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: background 0.15s, box-shadow 0.15s, transform 0.15s;
}
.btn-primary:hover, .btn-primary:focus-visible {
  background: var(--peri-glint);
  border-color: var(--text);
  box-shadow: 3px 3px 0 var(--peri-deep);
  transform: translate(-1px, -1px);
}
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line-strong);
  font: 400 var(--small)/1 var(--mono);
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.btn-secondary:hover, .btn-secondary:focus-visible {
  border-color: var(--text);
  background: var(--panel-2);
  box-shadow: 3px 3px 0 var(--peri-deep);
}

/* scroll reveal */
.js [data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity 0.55s ease, transform 0.55s cubic-bezier(.2,.7,.2,1); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- 3. Sticky Header & Polished Dropdowns ------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand-link { display: inline-flex; align-items: center; flex: none; padding: 4px 0; }
.wordmark { height: 22px; width: auto; color: var(--text); }

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  font: 400 var(--small)/1 var(--mono);
  letter-spacing: 0.03em;
}
.nav-item { position: relative; }
.nav-trigger,
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  color: var(--text);
  border: 1px solid transparent;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.nav-trigger:hover,
.nav-link:hover,
.nav-item.is-open > .nav-trigger {
  color: var(--green);
  border-color: var(--line-strong);
  background: var(--panel);
}
.nav-link.is-active {
  color: var(--peri);
}
.nav-caret {
  display: inline-block;
  font-size: 0.6875rem;
  color: var(--dim);
  transition: transform 0.15s, color 0.15s;
}
.nav-item.is-open > .nav-trigger .nav-caret {
  transform: rotate(180deg);
  color: var(--peri);
}

.nav-dropdown-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: min(580px, calc(100vw - 2 * var(--gutter)));
  background: var(--panel);
  border: 1px solid var(--line-strong);
  box-shadow: 3px 3px 0 var(--peri-deep);
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  z-index: 90;
}
.nav-dropdown-panel[hidden] { display: none; }
.nav-dd-link {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--bg);
  transition: border-color 0.15s, background 0.15s;
}
.nav-dd-link:hover,
.nav-dd-link:focus-visible {
  border-color: var(--peri);
  background: var(--panel-2);
}
.nav-dd-title {
  font: 500 var(--small)/1.3 var(--mono);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.nav-dd-title .dd-arrow { color: var(--peri); }
.nav-dd-desc {
  font: 400 0.78rem/1.45 var(--body-font);
  color: var(--muted);
}

.header-actions { display: flex; gap: 10px; align-items: center; flex: none; }
.menu-btn {
  display: none;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  align-items: center;
  justify-content: center;
}
.menu-btn svg { width: 16px; height: 12px; }
.mobile-nav-cta { display: none; }

@media (max-width: 900px) {
  .nav {
    display: none;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line-strong);
    padding: 8px var(--gutter) 24px;
    z-index: 85;
  }
  .nav.is-open { display: flex; }
  .nav-item { border-bottom: 1px solid var(--line); }
  .nav-trigger,
  .nav-link {
    width: 100%;
    height: auto;
    justify-content: space-between;
    padding: 14px 4px;
    font-size: 0.875rem;
    border: 0;
  }
  .nav-dropdown-panel {
    position: static;
    width: 100%;
    box-shadow: none;
    border: 0;
    border-top: 1px solid var(--line);
    grid-template-columns: 1fr;
    padding: 8px 0 12px 0;
    background: var(--bg);
  }
  .menu-btn { display: inline-flex; }
  .header-cta-desktop { display: none; }
  .mobile-nav-cta {
    display: flex;
    justify-content: center;
    margin-top: 16px;
    width: 100%;
  }
}

/* ---------- 4. [01] Hero ------------------------------------------------- */
.hero { position: relative; padding-top: clamp(44px, 7vw, 88px); overflow: hidden; }
.hero .h1 { display: grid; gap: 4px; }
.hero .h1 .l { justify-self: start; }
.hero .h1 .r { justify-self: end; text-align: right; }
.hero-rot { display: inline-block; color: var(--peri); min-height: 1em; padding-right: 5px; border-right: 3px solid var(--peri); vertical-align: baseline; animation: caret-blink 0.9s steps(1, end) infinite; }
@keyframes caret-blink { 0%, 49% { border-right-color: var(--peri); } 50%, 100% { border-right-color: transparent; } }

.hero-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto);
  gap: 28px 48px;
  align-items: start;
  margin-top: clamp(24px, 3.2vw, 40px);
}
.hero-copy { min-width: 0; }
.hero-sub { color: var(--muted); max-width: 48ch; font-size: clamp(1rem, 1.25vw, 1.15rem); line-height: 1.55; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; margin-top: 22px; }
.hero-install { justify-self: end; text-align: right; min-width: 0; max-width: 100%; }
@media (max-width: 900px) {
  .hero .h1 .r { justify-self: start; text-align: left; }
  .hero-row { grid-template-columns: minmax(0, 1fr); }
  .hero-install { justify-self: stretch; text-align: left; }
}

/* copy box */
.copybox { display: inline-flex; align-items: stretch; background: var(--text); color: #0b0b0e; padding: 4px; max-width: 100%; min-width: 0; border: 1px solid var(--text); }
.copybox.demo-box { padding: 0; background: var(--text); border: 1px solid var(--text); transition: box-shadow 0.15s, transform 0.15s; }
.copybox.demo-box:hover { box-shadow: 3px 3px 0 var(--peri-deep); transform: translate(-1px, -1px); }
.copybox code { font: 500 clamp(0.75rem, 1.05vw, 0.92rem)/1.2 var(--mono); padding: 13px 16px; white-space: nowrap; overflow-x: auto; scrollbar-width: none; display: flex; align-items: center; min-width: 0; flex: 1; }
.copybox code::-webkit-scrollbar { display: none; }
.copybox .prompt { color: #666670; margin-right: 0.6em; flex: none; }
.copybtn { flex: none; width: 42px; min-height: 42px; background: var(--peri); display: grid; place-items: center; transition: background 0.15s; }
.copybtn:hover { background: var(--peri-glint); }
.copybtn:active { background: var(--peri-deep); }
.copybtn svg { width: 18px; height: 18px; color: #0b0b0e; }
.copybtn.is-copied { background: var(--green); }
.copy-note { margin-top: 10px; }
.copy-note a { color: var(--muted); border-bottom: 1px solid var(--line-strong); }
.copy-note a:hover { color: var(--text); border-color: var(--text); }
@media (max-width: 900px) { .copybox { display: flex; width: 100%; } .copybox code { flex: 1; } }

.scan { display: block; width: 100%; max-width: none; }
.hero-scan { height: clamp(200px, 34vh, 380px); margin-top: clamp(36px, 5vw, 60px); }

/* ---------- 5. [02] Statement / Gap -------------------------------------- */
.gap { padding-block: clamp(88px, 12vw, 180px); }
.gap-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.9fr); gap: 48px; align-items: center; }
.statement { font-family: var(--display); font-size: var(--h2); font-weight: 400; letter-spacing: -0.04em; line-height: 1.1; text-transform: lowercase; max-width: 17ch; }
.statement .line { display: block; }
.statement .line.r { text-align: right; }
.js .statement .w { color: #454552; transition: color 0.3s; }
.js .statement .w.is-lit { color: var(--text); }
.tldr { margin-top: 28px; padding: 18px 20px; background: var(--panel); border: 1px solid var(--line-strong); color: var(--muted); font-size: 0.98rem; line-height: 1.6; max-width: 60ch; }
.tldr b { display: inline-block; font: 500 var(--small)/1 var(--mono); color: var(--green); text-transform: lowercase; margin-right: 10px; letter-spacing: 0.04em; }
.glyph-scan { width: min(240px, 60%); aspect-ratio: 7 / 9; justify-self: center; }
@media (max-width: 820px) {
  .gap-grid { grid-template-columns: 1fr; }
  .glyph-scan { width: 140px; justify-self: start; order: -1; }
  .statement { max-width: none; }
  .statement .line.r { text-align: left; }
}

/* ---------- 6. Layers / Capabilities Grid -------------------------------- */
.ticks { --p: 68%; position: relative; height: 22px; margin-bottom: clamp(36px, 5vw, 56px);
  background: repeating-linear-gradient(90deg, var(--line-strong) 0 1px, transparent 1px 7px); }
.ticks::after { content: ""; position: absolute; inset: 0; width: var(--p);
  background: linear-gradient(90deg, var(--peri-deep), var(--peri) 70%, var(--green));
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 2px, transparent 2px 7px);
          mask: repeating-linear-gradient(90deg, #000 0 2px, transparent 2px 7px);
  transition: width 0.2s linear; }
.layers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.layer { border-left: 1px solid var(--line); padding: 20px 22px 24px; background: var(--bg); transition: background 0.2s, opacity 0.3s; }
.layer:first-child { border-left: 0; }
.layer:hover { background: var(--panel); }
.layer .num { font: 400 var(--small)/1 var(--mono); color: var(--green); letter-spacing: 0.04em; }
.layer h3 { font-family: var(--display); font-size: var(--h3); font-weight: 400; letter-spacing: -0.03em; text-transform: lowercase; margin: clamp(32px, 4vw, 56px) 0 12px; color: var(--text); }
.layer p { color: var(--muted); font-size: 0.96rem; line-height: 1.55; }
@media (max-width: 900px) {
  .layers { grid-template-columns: 1fr 1fr; }
  .layer:nth-child(odd) { border-left: 0; }
  .layer { border-bottom: 1px solid var(--line); }
}
@media (max-width: 520px) {
  .layers { grid-template-columns: 1fr; }
  .layer { border-left: 0; padding: 20px 0; }
}

/* ---------- 7. Interactive Code / Receipt Showcase ----------------------- */
.editor-stage { position: relative; padding-bottom: clamp(52px, 7vw, 96px); }
.editor-stage .scan { position: absolute; left: calc(var(--gutter) * -1); width: calc(100% + var(--gutter) * 2); bottom: 0; height: 56%; z-index: 0; }
.editor { position: relative; z-index: 1; max-width: 1020px; margin-inline: auto; background: var(--panel); border: 1px solid var(--line-strong); box-shadow: 3px 3px 0 var(--line); }
.editor-tabs { display: flex; border-bottom: 1px solid var(--line-strong); overflow-x: auto; scrollbar-width: none; background: var(--panel-2); }
.editor-tab { font: 400 var(--small)/1 var(--mono); color: var(--muted); padding: 13px 16px; border-right: 1px solid var(--line-strong); white-space: nowrap; background: var(--panel-2); }
.editor-tab[aria-selected="true"] { background: var(--panel); color: var(--text); box-shadow: inset 0 2px 0 var(--peri); }
.editor-tab:hover { color: var(--text); }
.editor-pane { margin: 0; padding: 18px 0; font: 400 clamp(0.7rem, 1.02vw, 0.82rem)/1.75 var(--mono); overflow-x: auto; min-height: 310px; }
.editor-pane[hidden] { display: none; }
.editor-pane .ln { display: inline-block; width: 100%; vertical-align: top; position: relative; padding: 0 20px 0 54px; white-space: pre; }
.editor-pane .ln::before { content: attr(data-n); position: absolute; left: 0; width: 40px; color: var(--dim); text-align: right; }
.editor-pane .add { background: rgba(168, 255, 196, 0.08); box-shadow: inset 2px 0 0 var(--green); }
.tok-k { color: var(--peri); }
.tok-s { color: var(--green); }
.tok-c { color: var(--dim); }
.tok-v { color: #ffd9a0; }
.tok-f { color: var(--coral); }
.badge { display: inline-block; font: 700 0.6875rem/1 var(--mono); letter-spacing: 0.06em; padding: 3px 6px; background: var(--green); color: #0b0b0e; }
.badge.is-fail { background: var(--coral); color: #0b0b0e; }
.cursor { color: var(--peri); animation: blink 1s steps(2) infinite; }
@media (max-width: 760px) {
  .editor-pane { min-height: 0; }
  .editor-pane .ln { white-space: pre-wrap; overflow-wrap: anywhere; padding: 0 12px 0 38px; }
  .editor-pane .ln::before { width: 26px; }
}
.editor-foot { display: flex; justify-content: space-between; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line-strong); }

.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: clamp(40px, 5vw, 68px); border-top: 1px solid var(--line); }
.step { padding: 22px 24px 0 0; }
.step .verb { font: 400 var(--small)/1 var(--mono); color: var(--green); letter-spacing: 0.04em; display: flex; gap: 10px; align-items: center; }
.step .verb::before { content: ""; width: 7px; height: 7px; background: var(--green); flex: none; }
.step p { color: var(--muted); font-size: 0.96rem; margin-top: 12px; line-height: 1.55; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr 1fr; row-gap: 16px; } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } .step { padding-right: 0; } }

/* ---------- 8. Cards, Panels, Data Tables -------------------------------- */
.panel { background: var(--panel); border: 1px solid var(--line-strong); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-strong); font: 400 var(--small)/1.3 var(--mono); color: var(--muted); letter-spacing: 0.03em; }
.panel-head b { color: var(--text); font-weight: 500; }

.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.card > div { min-width: 0; }
.card:hover {
  border-color: var(--peri);
  background: var(--panel-2);
  box-shadow: 3px 3px 0 var(--peri-deep);
}
.card-meta { font: 400 var(--small)/1.3 var(--mono); color: var(--green); display: flex; justify-content: space-between; gap: 12px; }
.card-meta .tag { color: var(--peri); }
.card h3 { font-family: var(--display); font-size: clamp(1.15rem, 1.5vw, 1.38rem); font-weight: 400; letter-spacing: -0.025em; line-height: 1.2; color: var(--text); }
.card p { color: var(--muted); font-size: 0.95rem; line-height: 1.55; }
.card-foot { font: 500 var(--small)/1 var(--mono); color: var(--text); padding-top: 12px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.card-foot .arrow { color: var(--peri); }
@media (max-width: 960px) { .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .card-grid, .card-grid.cols-2 { grid-template-columns: 1fr; } }

.table-scroll { width: 100%; overflow-x: auto; border: 1px solid var(--line-strong); background: var(--panel); }
.data-table { width: 100%; border-collapse: collapse; font: 400 0.82rem/1.5 var(--mono); min-width: 640px; }
.data-table th { text-align: left; font-weight: 500; color: var(--dim); padding: 13px 16px; border-bottom: 1px solid var(--line-strong); background: var(--panel-2); white-space: nowrap; }
.data-table td { padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--muted); vertical-align: top; }
.data-table td:first-child { color: var(--text); font-weight: 500; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table td a { color: var(--text); border-bottom: 1px solid var(--line-strong); }
.data-table td a:hover { color: var(--green); border-color: var(--green); }
.status-live { color: var(--green); white-space: nowrap; }

/* ---------- 9. Interactive Loop / Egress / Infra Controls ---------------- */
.loop-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .loop-grid { grid-template-columns: 1fr; } }
.change { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 20px; padding: 18px 16px; border-bottom: 1px solid var(--line); align-items: center; }
.change:last-child { border-bottom: 0; }
.change .kind { font: 400 var(--small)/1 var(--mono); color: var(--peri); letter-spacing: 0.04em; }
.change .what { margin: 8px 0 6px; font-size: 1rem; color: var(--text); }
.change .why { font: 400 var(--small)/1.5 var(--mono); color: var(--muted); }
.change .why span { color: var(--text); }
.change-actions { display: flex; gap: 6px; }
.btn { font: 500 var(--small)/1 var(--mono); padding: 10px 12px; background: var(--panel-2); color: var(--text); border: 1px solid var(--line-strong); }
.btn:hover { border-color: var(--text); }
.btn-approve { background: var(--green); color: #0b0b0e; border-color: var(--green); }
.btn-approve:hover { background: #c6ffd9; }
.change.is-approved { background: rgba(168, 255, 196, 0.06); }
.change.is-rejected { opacity: 0.6; }
.change .verdict { display: none; font: 700 0.6875rem/1 var(--mono); letter-spacing: 0.06em; padding: 5px 8px; }
.change.is-approved .verdict { display: inline-block; background: var(--green); color: #0b0b0e; }
.change.is-rejected .verdict { display: inline-block; background: var(--panel-2); color: var(--peri); border: 1px solid var(--peri); }
.change.is-approved .change-actions, .change.is-rejected .change-actions { display: none; }
@media (max-width: 560px) { .change { grid-template-columns: 1fr; } }

.spend { padding: 18px 16px 20px; }
.spend-figure { font-family: var(--display); font-size: clamp(2rem, 3.6vw, 3rem); letter-spacing: -0.04em; line-height: 1; color: var(--green); }
.spend-figure small { font: 400 var(--small)/1 var(--mono); color: var(--muted); margin-left: 8px; }
.spend-bar { height: 22px; margin: 18px 0 10px; position: relative; background: repeating-linear-gradient(90deg, var(--line-strong) 0 1px, transparent 1px 7px); }
.spend-bar.is-zero::after { display: none; }
.spend-rows { margin-top: 18px; border-top: 1px solid var(--line); }
.spend-rows div { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font: 400 var(--small)/1.2 var(--mono); color: var(--muted); }
.spend-rows dd { color: var(--text); }

.modes { display: flex; flex-wrap: wrap; border: 1px solid var(--line-strong); width: fit-content; max-width: 100%; margin-bottom: 14px; }
.mode { font: 400 var(--small)/1 var(--mono); padding: 12px 16px; color: var(--muted); border-right: 1px solid var(--line-strong); background: var(--panel); }
.mode:last-child { border-right: 0; }
.mode:hover { color: var(--text); }
.mode[aria-selected="true"] { background: var(--text); color: #0b0b0e; font-weight: 500; }
.mode-line { color: var(--muted); max-width: 60ch; margin-bottom: 24px; }

.infra-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 900px) { .infra-grid { grid-template-columns: 1fr; } }
.topo { padding: 26px 18px 18px; display: flex; flex-direction: column; gap: 16px; }
.boundary { position: relative; border: 1px dashed var(--peri); padding: 30px 14px 14px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.boundary-label { position: absolute; top: -10px; left: 12px; background: var(--panel); padding: 0 8px; font: 400 var(--small)/1.4 var(--mono); color: var(--peri); }
.node { border: 1px solid var(--line-strong); background: var(--bg); padding: 12px; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; }
.node b { font: 500 var(--small)/1.3 var(--mono); color: var(--text); }
.node span { font: 400 0.7rem/1.35 var(--mono); color: var(--muted); }
.node.is-model { grid-column: 1 / -1; flex-direction: row; align-items: center; }
.wire { grid-column: 1 / -1; height: 1px; background: var(--line-strong); position: relative; margin: 2px 0; }
.wire::after { content: ""; position: absolute; top: -2px; left: 0; width: 5px; height: 5px; background: var(--peri); animation: packet 3.2s linear infinite; }
@keyframes packet { from { left: 0; } to { left: calc(100% - 5px); } }
.egress { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; font: 400 var(--small)/1.3 var(--mono); color: var(--muted); }
.egress .blocked { height: 1px; background: repeating-linear-gradient(90deg, var(--coral) 0 4px, transparent 4px 8px); position: relative; }
.egress .blocked::after { content: "×"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -54%); color: var(--coral); background: var(--panel); padding: 0 6px; font-size: 1rem; }
@media (max-width: 520px) { .boundary { grid-template-columns: 1fr; } }

/* ---------- 10. FAQ ------------------------------------------------------ */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { display: grid; grid-template-columns: 56px minmax(0, 1fr) 30px; gap: 12px; align-items: center; padding: 22px 0; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq .num { font: 400 var(--small)/1 var(--mono); color: var(--green); }
.faq .q { font-family: var(--display); font-size: clamp(1.0625rem, 1.7vw, 1.4rem); letter-spacing: -0.025em; color: var(--text); }
.faq .pm { width: 30px; height: 30px; border: 1px solid var(--line-strong); display: grid; place-items: center; }
.faq summary:hover .pm { border-color: var(--text); }
.faq .pm svg { width: 12px; height: 12px; }
.faq details[open] .pm { background: var(--text); color: #0b0b0e; border-color: var(--text); }
.faq details[open] .pm .v { opacity: 0; }
.faq .a { padding: 0 42px 24px 68px; color: var(--muted); max-width: 78ch; font-size: 0.98rem; line-height: 1.65; }
.faq .a a { color: var(--text); border-bottom: 1px solid var(--line-strong); }
.faq .a code { font: 400 0.875em var(--mono); color: var(--text); }
@media (max-width: 560px) {
  .faq summary { grid-template-columns: 40px minmax(0, 1fr) 30px; }
  .faq .a { padding: 0 0 22px 52px; }
}

/* ---------- 11. Closing Scan & Footer ------------------------------------ */
.start { padding-bottom: 0; overflow: hidden; }
.start-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) auto; gap: 32px 48px; align-items: end; }
@media (max-width: 860px) { .start-grid { grid-template-columns: minmax(0, 1fr); } }
.mark-scan { height: clamp(120px, 24vw, 340px); margin-top: clamp(48px, 7vw, 96px); }

.site-footer { border-top: 1px solid var(--line); padding-block: 48px 56px; background: var(--bg); }
.footer-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) repeat(3, minmax(0, 1fr)); gap: 32px 40px; }
.footer-brand p { margin-top: 14px; color: var(--muted); font-size: 0.9rem; max-width: 38ch; line-height: 1.55; }
.footer-col h4 { font: 500 var(--small)/1.2 var(--mono); color: var(--green); margin-bottom: 14px; letter-spacing: 0.04em; text-transform: lowercase; }
.footer-col ul { display: flex; flex-direction: column; gap: 10px; font: 400 var(--small)/1.4 var(--mono); color: var(--muted); }
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  font: 400 var(--small)/1.4 var(--mono);
  color: var(--dim);
}
@media (max-width: 860px) { .footer-layout { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-layout { grid-template-columns: 1fr; } }

/* ---------- 12. Subpages: /resources, /blog, /blog/<slug> ---------------- */
.page-hero { padding-block: clamp(48px, 7vw, 88px) clamp(36px, 5vw, 56px); border-bottom: 1px solid var(--line); }
.page-hero h1 { font-family: var(--display); font-size: clamp(2rem, 4.4vw, 3.5rem); font-weight: 400; letter-spacing: -0.04em; line-height: 1.06; text-transform: lowercase; max-width: 24ch; }
.page-hero p.lead { margin-top: 18px; color: var(--muted); max-width: 60ch; font-size: 1.06rem; line-height: 1.6; }

.resource-section { padding-block: clamp(48px, 6vw, 80px); border-bottom: 1px solid var(--line); }
.resource-section:last-of-type { border-bottom: 0; }
.resource-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px 24px; margin-bottom: 24px; }
.resource-head h2 { font-family: var(--display); font-size: clamp(1.5rem, 2.6vw, 2.1rem); font-weight: 400; letter-spacing: -0.03em; text-transform: lowercase; }

.prose { max-width: 72ch; min-width: 0; font-size: 1.05rem; line-height: 1.72; color: var(--muted); }
.prose h2 { font-family: var(--display); font-size: clamp(1.45rem, 2.4vw, 1.95rem); font-weight: 400; color: var(--text); letter-spacing: -0.03em; margin: 44px 0 14px; text-transform: lowercase; }
.prose h3 { font-family: var(--display); font-size: 1.25rem; font-weight: 500; color: var(--text); margin: 32px 0 10px; }
.prose p { margin-bottom: 18px; }
.prose strong { color: var(--text); font-weight: 600; }
.prose a { color: var(--text); border-bottom: 1px solid var(--peri); }
.prose a:hover { color: var(--green); border-color: var(--green); }
.prose ul, .prose ol { margin: 0 0 22px 0; padding-left: 22px; }
.prose ul { list-style: square; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: 8px; }
.prose code { font: 400 0.88em var(--mono); color: var(--green); background: var(--panel-2); padding: 2px 6px; border: 1px solid var(--line); overflow-wrap: anywhere; }
.prose pre { margin: 24px 0; padding: 18px; background: var(--panel); border: 1px solid var(--line-strong); max-width: 100%; overflow-x: auto; font: 400 0.82rem/1.65 var(--mono); color: var(--text); }
.prose pre code { background: none; border: 0; padding: 0; color: inherit; overflow-wrap: normal; }
.prose blockquote { margin: 24px 0; padding: 14px 18px; border-left: 3px solid var(--peri); background: var(--panel); color: var(--text); }
.prose table { width: 100%; border-collapse: collapse; margin: 24px 0; font: 400 0.84rem/1.5 var(--mono); border: 1px solid var(--line-strong); }
.prose th, .prose td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.prose th { background: var(--panel-2); color: var(--text); }

.article-meta { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 18px; font: 400 var(--small)/1.4 var(--mono); color: var(--dim); }
.article-layout { padding-block: clamp(48px, 6vw, 84px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 320px); gap: 48px; align-items: start; }
.article-layout > * { min-width: 0; }
.article-aside { position: sticky; top: calc(var(--header-h) + 24px); padding: 20px; background: var(--panel); border: 1px solid var(--line-strong); }
.article-aside h3 { font: 500 var(--small)/1.3 var(--mono); color: var(--green); margin-bottom: 12px; }
.article-aside p { color: var(--muted); font-size: 0.92rem; line-height: 1.55; margin-bottom: 18px; }
@media (max-width: 960px) { .article-layout { grid-template-columns: 1fr; } .article-aside { position: static; } }

/* ---------- 13. /bench Leaderboard --------------------------------------- */
.lb-scroll { overflow-x: auto; max-width: 100%; min-width: 0; }
.lb-table { width: 100%; border-collapse: collapse; font: 400 var(--small)/1.45 var(--mono); }
.lb-table th { text-align: left; font-weight: 400; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.lb-table td { padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--text); vertical-align: top; }
.lb-table tr:last-child td { border-bottom: 0; }
.lb-table .num { text-align: right; white-space: nowrap; }
.lb-table .lb-val { color: var(--green); font-weight: 500; }
.lb-table .lb-empty { color: var(--muted); }
.lb-table a { color: var(--text); border-bottom: 1px solid var(--line-strong); }
.lb-table a:hover { color: var(--green); border-color: var(--green); }
.lb-ev { white-space: nowrap; }
.lb-sub { border-top: 1px solid var(--line-strong); }
.lb-table td.lb-gate-listed { color: var(--green); }
.lb-table td.lb-gate-notify_vendor_first, .lb-table td.lb-gate-terms_unchecked { color: var(--peri); }
.lb-table td.lb-gate-excluded { color: var(--muted); }
#lb-sessions td, #lb-sessions th, #lb-boot td, #lb-boot th { white-space: nowrap; }

/* ---------- 14. Reduced Motion ------------------------------------------- */
@keyframes blink { 50% { opacity: 0.2; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .hero-rot { border-right: 0; padding-right: 0; }
  .js [data-reveal] { opacity: 1 !important; transform: none !important; }
  .js .statement .w { color: var(--text) !important; }
  .wire::after { left: 50%; }
}
