/* ==========================================================================
   Code4X — AI-Era Website Health Audit System
   Design system: instrument panel. Light canvas, ink, pass/warn/fail semantics.
   Rule: pass/warn/fail colours are NEVER decorative. Green means a check passed.
   ========================================================================== */

/* --------------------------------------------------------------- 1. Tokens */
:root {
  --ink:        #0B1014;
  --ink-70:     rgba(11, 16, 20, .70);
  --ink-50:     rgba(11, 16, 20, .50);
  --ink-30:     rgba(11, 16, 20, .28);
  --ink-12:     rgba(11, 16, 20, .12);
  --ink-06:     rgba(11, 16, 20, .06);

  --canvas:     #EDF0F2;
  --surface:    #FFFFFF;
  --surface-2:  #F6F8F9;

  --pass:       #0F8B54;
  --warn:       #B87503;
  --fail:       #C8322B;
  --signal:     #2536E8;

  --pass-bg:    rgba(15, 139, 84, .10);
  --warn-bg:    rgba(184, 117, 3, .10);
  --fail-bg:    rgba(200, 50, 43, .10);
  --signal-bg:  rgba(37, 54, 232, .08);

  --display: 'Archivo', system-ui, sans-serif;
  --body:    'Public Sans', system-ui, sans-serif;
  --mono:    'JetBrains Mono', ui-monospace, monospace;

  --dur-1: 120ms;
  --dur-2: 240ms;
  --dur-3: 400ms;
  --dur-4: 900ms;
  --ease-enter: cubic-bezier(.2, .7, .2, 1);
  --ease-move:  cubic-bezier(.4, 0, .2, 1);

  --gutter: 24px;
  --maxw: 1200px;
  --rule: 1px solid var(--ink-12);

  /* v2 Dark Tokens (instrument panel hero and footer) */
  --v2-canvas:    #0B1014;
  --v2-surface:   #12181D;
  --v2-ink:       #EDF0F2;
  --v2-ink-70:    rgba(237, 240, 242, .70);
  --v2-ink-50:    rgba(237, 240, 242, .50);
  --v2-ink-30:    rgba(237, 240, 242, .28);
  --v2-rule:      1px solid rgba(255, 255, 255, .12);
  --v2-rule-2:    1px solid rgba(255, 255, 255, .20);
  --v2-rule-c:    rgba(255, 255, 255, .14);
  --v2-signal:    #4E61F6;
  --v2-signal-lt: #6879F8;
  --v2-signal-bg: rgba(78, 97, 246, .22);
  --v2-pass:      #4ADE80;
  --v2-pass-bd:   rgba(74, 222, 128, .40);
  --v2-warn:      #FBBF24;
  --v2-warn-bd:   rgba(251, 191, 36, .40);
  --v2-fail:      #F98A84;
}

/* ----------------------------------------------------------- 2. Foundation */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }

a { color: var(--signal); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

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

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

/* ------------------------------------------------------------ 3. Typography */
h1, h2, h3, h4 {
  font-family: var(--display);
  font-stretch: 118%;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.06;
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: clamp(2.7rem, 6.2vw, 4.9rem); letter-spacing: -.035em; }
h2 { font-size: clamp(1.85rem, 3.5vw, 2.9rem); letter-spacing: -.028em; }
h3 { font-size: clamp(1.15rem, 1.7vw, 1.4rem); font-stretch: 108%; letter-spacing: -.015em; }
h4 { font-size: 1.02rem; font-stretch: 105%; font-weight: 700; letter-spacing: -.01em; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.lede { font-size: clamp(1.08rem, 1.6vw, 1.32rem); line-height: 1.5; color: var(--ink-70); max-width: 62ch; }
.tight { max-width: 68ch; }

/* Rule: machine values are mono. Human values are Public Sans. */
.mono, code, kbd, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.eyebrow {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-50);
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::after { content: ""; flex: 1; height: 1px; background: var(--ink-12); }

.dim-id {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .06em;
  color: var(--signal);
  background: var(--signal-bg);
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
}

/* ---------------------------------------------------------------- 4. Layout */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

.section { padding: clamp(56px, 8vw, 104px) 0; border-top: var(--rule); }
.section--flush { border-top: 0; }
.section--ink { background: var(--ink); color: #DDE4E9; border-top: 0; }
.section--ink h2, .section--ink h3, .section--ink h4 { color: #fff; }
.section--ink .eyebrow { color: rgba(255,255,255,.5); }
.section--ink .eyebrow::after { background: rgba(255,255,255,.16); }
.section--ink .lede { color: rgba(255,255,255,.68); }

.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: start; }
.head-block { margin-bottom: clamp(32px, 4vw, 52px); }

@media (max-width: 900px) {
  .grid-3, .grid-4, .split, .grid-2 { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- 5. Header */
.hdr {
  position: sticky; top: 0; z-index: 60;
  background: rgba(237, 240, 242, .88);
  backdrop-filter: blur(10px);
  border-bottom: var(--rule);
}
.hdr-in {
  max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter);
  height: 62px; display: flex; align-items: center; gap: 22px;
}
.logo {
  font-family: var(--display); font-stretch: 125%; font-weight: 700;
  font-size: 1.02rem; letter-spacing: -.02em; color: var(--ink);
  text-decoration: none; display: flex; align-items: center; gap: 8px;
}
.logo-mark,
.hdr .logo-mark,
.hdr.v2 .logo-mark,
.ftr .logo-mark,
.ftr.v2 .logo-mark,
.logo .logo-mark {
  width: 24px !important;
  height: 24px !important;
  background: url('/favicon.svg') no-repeat center / contain !important;
  border: none !important;
  display: inline-block !important;
  flex-shrink: 0;
  border-radius: 4px;
  vertical-align: middle;
}

.nav { display: flex; gap: 20px; margin-left: 8px; }
.nav a {
  font-size: .87rem; color: var(--ink-70); text-decoration: none;
  transition: color var(--dur-1) var(--ease-move);
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); text-decoration: none; }
.nav a[aria-current="page"] { font-weight: 600; }

/* Navigation dropdown (Resources -> Blogs, Tools, etc.) */
.nav-item { position: relative; display: inline-flex; align-items: center; }
.nav-link { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.nav-caret { font-size: .68rem; transition: transform var(--dur-1) var(--ease-move); display: inline-block; }
.nav-item:hover .nav-caret,
.nav-item:focus-within .nav-caret { transform: rotate(180deg); }

.nav-dropdown {
  position: absolute; top: calc(100% + 8px); left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--surface); border: 1px solid var(--ink-12);
  border-radius: 6px; box-shadow: 0 10px 28px rgba(11,16,20,.10);
  padding: 6px; min-width: 250px;
  display: none; flex-direction: column; gap: 1px;
  z-index: 100; pointer-events: none; opacity: 0;
  transition: opacity var(--dur-2) var(--ease-enter), transform var(--dur-2) var(--ease-enter);
}
.nav-dropdown::before {
  content: ""; position: absolute; top: -10px; left: 0; right: 0; height: 10px;
}
.nav-item:hover .nav-dropdown,
.nav-item:focus-within .nav-dropdown,
.nav-item.is-open .nav-dropdown {
  display: flex; pointer-events: auto; opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.dropdown-item {
  display: flex !important; flex-direction: column;
  padding: 8px 12px !important; border-radius: 4px;
  text-decoration: none !important; transition: background var(--dur-1) var(--ease-move);
}
.dropdown-item:hover { background: var(--surface-2) !important; }
.dropdown-item strong { font-size: .85rem; color: var(--ink); font-weight: 600; }
.dropdown-item span { font-size: .72rem; color: var(--ink-50); margin-top: 1px; font-weight: 400; }

.hdr.v2 .nav a { color: var(--v2-ink-70); }
.hdr.v2 .nav a:hover,
.hdr.v2 .nav a[aria-current="page"] { color: var(--v2-ink); }
.hdr.v2 .agent-toggle { color: var(--v2-ink-70); border-color: var(--v2-rule); }
.hdr.v2 .agent-toggle:hover { color: var(--v2-ink); border-color: var(--v2-ink-30); }
.hdr.v2 .score-chip { color: var(--v2-ink-70); background: var(--v2-surface); border-color: var(--v2-rule); }

.hdr-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

/* live self-score chip — the boot audit docks into this */
.score-chip {
  display: flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: .72rem; letter-spacing: .02em;
  border: 1px solid var(--ink-12); background: var(--surface);
  padding: 5px 9px; border-radius: 4px; color: var(--ink-70);
  text-decoration: none;
  opacity: 0; transform: translateY(-4px);
  transition: opacity var(--dur-3) var(--ease-enter), transform var(--dur-3) var(--ease-enter);
}
.score-chip.is-docked { opacity: 1; transform: none; }
.score-chip:hover { text-decoration: none; border-color: var(--ink-30); }
.score-chip b { color: var(--pass); font-weight: 700; }
.pulse-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--pass);
  box-shadow: 0 0 0 0 rgba(15,139,84,.5); animation: pulse 2.6s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(15,139,84,.45); }
  70%  { box-shadow: 0 0 0 7px rgba(15,139,84,0); }
  100% { box-shadow: 0 0 0 0 rgba(15,139,84,0); }
}

.agent-toggle {
  font-family: var(--mono); font-size: .72rem;
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--ink-12); background: transparent;
  padding: 5px 9px; border-radius: 4px; cursor: pointer; color: var(--ink-70);
  transition: border-color var(--dur-1), background var(--dur-1);
}
.agent-toggle:hover { border-color: var(--ink-30); }
.agent-toggle[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.toggle-track {
  width: 22px; height: 12px; border-radius: 7px; background: var(--ink-12);
  position: relative; transition: background var(--dur-2);
}
.toggle-track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--ink-50);
  transition: transform var(--dur-2) var(--ease-move), background var(--dur-2);
}
.agent-toggle[aria-pressed="true"] .toggle-track { background: rgba(255,255,255,.28); }
.agent-toggle[aria-pressed="true"] .toggle-track::after { transform: translateX(10px); background: #fff; }

@media (max-width: 860px) {
  .nav { display: none; }
  .agent-toggle span:not(.toggle-track) { display: none; }
  .agent-toggle .toggle-track { display: inline-block !important; }
}
/* Mobile menu toggle */
.nav-burger {
  display: none;
  background: transparent;
  border: 1px solid var(--ink-12);
  border-radius: 4px;
  padding: 6px 8px;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
}
.nav-burger span {
  display: block; width: 16px; height: 2px;
  background: var(--ink); border-radius: 1px;
  transition: transform var(--dur-2), opacity var(--dur-2);
}
.hdr.v2 .nav-burger span { background: var(--v2-ink); }
.hdr.v2 .nav-burger { border-color: var(--v2-rule); }
body.agent-view .nav-burger span { background: #C9D4DC; }
body.agent-view .nav-burger { border-color: rgba(255,255,255,.2); }

@media (max-width: 860px) {
  .nav-burger { display: flex; }
  .agent-toggle span:not(.toggle-track) { display: none; }
  .agent-toggle .toggle-track { display: inline-block !important; }
  .nav {
    display: none;
    position: absolute;
    top: 62px; left: 0; right: 0;
    background: var(--surface);
    border-bottom: var(--rule);
    box-shadow: 0 12px 30px rgba(11,16,20,.12);
    flex-direction: column;
    padding: 16px var(--gutter);
    gap: 12px;
    z-index: 90;
    margin-left: 0;
  }
  .hdr.v2 .nav {
    background: var(--v2-surface);
    border-bottom: var(--v2-rule);
  }
  body.agent-view .nav {
    background: #0B1014;
    border-bottom: 1px dashed rgba(255,255,255,.2);
  }
  .nav.is-mobile-open {
    display: flex;
  }
  .nav a {
    font-size: 1rem;
    padding: 6px 0;
  }
  .nav-item.has-dropdown {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }
  .nav-dropdown {
    position: static;
    transform: none;
    box-shadow: none;
    border: none;
    padding: 4px 0 4px 14px;
    background: transparent !important;
    display: flex;
    opacity: 1;
    pointer-events: auto;
    width: 100%;
    min-width: 0;
  }
  .dropdown-item {
    padding: 6px 0 !important;
  }
}

/* --------------------------------------------------------------- 6. Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--body); font-size: .93rem; font-weight: 600;
  padding: 12px 20px; border-radius: 5px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none; line-height: 1;
  transition: transform var(--dur-1) var(--ease-move), background var(--dur-1), border-color var(--dur-1);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--signal); color: #fff; }
.btn-primary:hover { background: #1B29C4; }
.btn-ghost { border-color: var(--ink-30); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--ink); background: var(--ink-06); }
.btn-onink { background: #fff; color: var(--ink); }
.btn-onink-ghost { border-color: rgba(255,255,255,.32); color: #fff; }
.btn-onink-ghost:hover { background: rgba(255,255,255,.1); }
.btn .arw { transition: transform var(--dur-2) var(--ease-move); }
.btn:hover .arw { transform: translateX(3px); }

/* ----------------------------------------------------------------- 7. Cards */
.card {
  background: var(--surface);
  border: var(--rule);
  border-radius: 6px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--dur-2) var(--ease-move);
}
.card:hover { border-color: var(--ink-30); }

/* Motion primitive 2 — Sweep: a 1px scanline crosses the card on hover */
.card::before {
  content: "";
  position: absolute; inset: 0 auto 0 -2px; width: 1px;
  background: var(--signal); opacity: 0;
  pointer-events: none;
}
.card:hover::before { animation: sweep var(--dur-3) var(--ease-move) forwards; }
@keyframes sweep {
  0%   { opacity: .55; transform: translateX(0); }
  100% { opacity: 0;   transform: translateX(var(--sweep-x, 460px)); }
}

.card-ink { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.14); }
.card-ink:hover { border-color: rgba(255,255,255,.34); }

/* -------------------------------------------------- 8. Panels / code / data */
.panel {
  background: var(--ink); color: #C9D4DC; border-radius: 6px;
  font-family: var(--mono); font-size: .8rem; line-height: 1.75;
  padding: 18px 20px; overflow-x: auto;
}
.panel-bar {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: .7rem; letter-spacing: .1em;
  text-transform: uppercase; color: rgba(255,255,255,.44);
  padding-bottom: 12px; margin-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,.13);
}
.panel-bar .sp { flex: 1; }
.panel .c-pass { color: #4ADE80; }
.panel .c-fail { color: #F98A84; }
.panel .c-warn { color: #F0B429; }
.panel .c-dim  { color: rgba(255,255,255,.42); }
.panel .c-sig  { color: #93A0FF; }

.kv { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: var(--rule); }
.kv:last-child { border-bottom: 0; }
.kv dt { color: var(--ink-70); font-size: .9rem; }
.kv dd { margin: 0; font-family: var(--mono); font-size: .85rem; }

/* stat block — Rollup primitive target */
.stat { border-top: 3px solid var(--ink); padding-top: 18px; }
.stat-num {
  font-family: var(--display); font-stretch: 125%; font-weight: 700;
  font-size: clamp(2.7rem, 5.6vw, 4rem); line-height: .95; letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
}
.stat-num.is-fail { color: var(--fail); }
.stat-num.is-warn { color: var(--warn); }
.stat-label { font-size: .96rem; margin-top: 12px; max-width: 30ch; }
.stat-src { font-family: var(--mono); font-size: .68rem; color: var(--ink-50); margin-top: 12px; }

/* status pills */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: .68rem; letter-spacing: .05em;
  padding: 3px 8px; border-radius: 3px; text-transform: uppercase;
}
.pill-pass { background: var(--pass-bg); color: var(--pass); }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
.pill-fail { background: var(--fail-bg); color: var(--fail); }
.pill-sig  { background: var(--signal-bg); color: var(--signal); }
.pill-mute { background: var(--ink-06); color: var(--ink-50); }

/* ------------------------------------------------- 9. Motion: Tick + Rollup */
.tick { stroke-dasharray: 22; stroke-dashoffset: 22; }
.tick.is-on { animation: tick-draw var(--dur-2) var(--ease-enter) forwards; }
@keyframes tick-draw { to { stroke-dashoffset: 0; } }

/* Reveal: fires once via IntersectionObserver, transform+opacity only (CLS 0) */
[data-reveal] { opacity: 0; transform: translateY(14px); }
[data-reveal].is-in {
  opacity: 1; transform: none;
  transition: opacity var(--dur-3) var(--ease-enter), transform var(--dur-3) var(--ease-enter);
  transition-delay: var(--d, 0ms);
}

/* ------------------------------------------------------- 10. Motion: Beacon */
.beacon { offset-rotate: 0deg; animation: beacon-run 4s linear infinite; }
@keyframes beacon-run { from { offset-distance: 0%; } to { offset-distance: 100%; } }
.diagram-wrap:hover .beacon { animation-play-state: paused; }

/* -------------------------------------------------------- 11. Motion: Drift */
.spark-line { stroke-dasharray: 620; stroke-dashoffset: 620; }
.spark-line.is-on { animation: spark-draw var(--dur-4) var(--ease-move) forwards; }
@keyframes spark-draw { to { stroke-dashoffset: 0; } }

/* ---------------------------------------------------------- 12. Motion: Arc */
.arc-val { transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset var(--dur-4) var(--ease-move); }

/* --------------------------------------------------------- 13. Motion: Diff */
.diff { font-family: var(--mono); font-size: .78rem; line-height: 1.8; }
.diff-row { display: block; padding: 0 10px; border-radius: 3px; white-space: pre; }
.diff-row.del { background: rgba(200,50,43,.16); color: #F98A84; }
.diff-row.add {
  background: rgba(15,139,84,.18); color: #4ADE80;
  max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height var(--dur-3) var(--ease-move), opacity var(--dur-3) var(--ease-move);
}
.diff.is-on .diff-row.add { max-height: 34px; opacity: 1; }
.diff.is-on .diff-row.del { opacity: .38; }

/* --------------------------------------------------------- 14. Motion: Tail */
.tail { font-family: var(--mono); font-size: .76rem; line-height: 2; height: 160px; overflow: hidden; }
.tail-row { display: grid; grid-template-columns: 66px 118px 1fr 46px 34px; gap: 14px; color: rgba(255,255,255,.72); }
.tail-row.is-new { animation: tail-in var(--dur-3) var(--ease-enter); }
@keyframes tail-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.tail-row .ua { color: #93A0FF; }
.tail-row .st { color: #4ADE80; }
.tail-row .fmt { color: rgba(255,255,255,.4); }
@media (max-width: 700px) {
  .tail-row { grid-template-columns: 60px 1fr 40px; }
  .tail-row .path, .tail-row .fmt { display: none; }
}

/* ------------------------------------------------------- 15. Motion: Cursor */
.form-demo { position: relative; }
.agent-cursor {
  position: absolute; width: 15px; height: 21px; z-index: 5; pointer-events: none;
  opacity: 0; transition: transform 620ms var(--ease-move), opacity var(--dur-2);
}
.agent-cursor.is-on { opacity: 1; }
.fld {
  border: 1px solid var(--ink-12); background: var(--surface-2); border-radius: 4px;
  padding: 10px 12px; font-family: var(--mono); font-size: .8rem; min-height: 40px;
  transition: border-color var(--dur-2), background var(--dur-2);
}
.fld.is-active { border-color: var(--signal); background: var(--signal-bg); }
.fld.is-done { border-color: var(--pass); }
.fld-label { font-family: var(--mono); font-size: .67rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-50); margin-bottom: 6px; display: block; }
.caret { display: inline-block; width: 7px; background: var(--signal); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* -------------------------------------------------------------- 16. Tables */
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th, .tbl td { text-align: left; padding: 14px 16px; border-bottom: var(--rule); vertical-align: top; }
.tbl thead th {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-50); font-weight: 500; border-bottom: 2px solid var(--ink);
}
.tbl tbody tr { transition: background var(--dur-1); }
.tbl tbody tr:hover { background: var(--ink-06); }
.tbl .is-us { background: var(--signal-bg); }
.tbl .is-us:hover { background: rgba(37,54,232,.12); }
.tbl-scroll { overflow-x: auto; }
.tbl-scroll .tbl { min-width: 720px; }

/* --------------------------------------------------------------- 17. Footer */
.ftr { background: var(--ink); color: rgba(255,255,255,.62); padding: 68px 0 34px; }
.ftr h4 { color: #fff; font-size: .74rem; font-family: var(--mono); font-weight: 500; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 16px; }
.ftr a { color: rgba(255,255,255,.62); font-size: .88rem; display: block; padding: 4px 0; }
.ftr a:hover { color: #fff; }
.ftr-machine a { font-family: var(--mono); font-size: .78rem; }
.ftr-machine a::after { content: " 200"; color: #4ADE80; font-size: .68rem; margin-left: 6px; }
.ftr-base { border-top: 1px solid rgba(255,255,255,.13); margin-top: 44px; padding-top: 22px; display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; font-family: var(--mono); font-size: .7rem; color: rgba(255,255,255,.4); }

/* Footer v2 — Standardized 4-column layout */
.ftr.v2 {
  background: var(--ink); border-top: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.70); padding: 60px 0 30px;
}
.ftr.v2 h4 {
  color: rgba(255,255,255,.50); font-size: .66rem; letter-spacing: .14em;
  font-family: var(--mono); text-transform: uppercase; margin-bottom: 14px;
}
.ftr.v2 a { color: rgba(255,255,255,.70); text-decoration: none; }
.ftr.v2 a:hover { color: #fff; }
.ftr.v2 .logo { display: inline-flex; color: #fff; }
.ftr-grid {
  display: grid; gap: clamp(32px, 5vw, 64px);
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
}
@media (max-width: 860px) { .ftr-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .ftr-grid { grid-template-columns: 1fr; } }
.ftr-tag { max-width: 32ch; margin: 18px 0 22px; font-size: .92rem; line-height: 1.5; color: rgba(255,255,255,.70); }
.ftr.v2 .ftr-base {
  border-top: 1px solid rgba(255,255,255,.12); color: rgba(255,255,255,.50);
  margin-top: 46px; padding-top: 22px;
  display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between;
  font-family: var(--mono); font-size: .7rem;
}
.ftr-chip { display: inline-flex; cursor: default; }

/* ------------------------------------------------- 18. Forms / demo shells */
.demo-bar { display: flex; gap: 10px; flex-wrap: wrap; }
.inp {
  flex: 1; min-width: 240px;
  font-family: var(--mono); font-size: .88rem;
  padding: 12px 14px; border: 1px solid var(--ink-30); border-radius: 5px;
  background: var(--surface); color: var(--ink);
}
.inp:focus { outline: 2px solid var(--signal); outline-offset: 1px; border-color: transparent; }
.inp::placeholder { color: var(--ink-30); }

.notice {
  font-family: var(--mono); font-size: .72rem; color: var(--warn);
  background: var(--warn-bg); border-left: 2px solid var(--warn);
  padding: 9px 12px; border-radius: 0 4px 4px 0; margin-top: 14px;
}

/* --------------------------------------------------------- 19. Agent view */
/* Flip primitive. Renders the page roughly as an agent parses it: mono only,
   heading level exposed, link targets exposed for editorial links, decoration collapsed. */
body.agent-view {
  --ink:        #EDF0F2;
  --ink-90:     #E6EDF2;
  --ink-70:     rgba(237, 240, 242, .75);
  --ink-50:     rgba(237, 240, 242, .55);
  --ink-30:     rgba(237, 240, 242, .30);
  --ink-12:     rgba(255, 255, 255, .15);
  --ink-06:     rgba(255, 255, 255, .08);

  --canvas:     #06090B;
  --surface:    #0B1014;
  --surface-2:  #11171C;

  --rule:       1px dashed rgba(255, 255, 255, .18);

  --pass:       #4ADE80;
  --warn:       #FBBF24;
  --fail:       #F87171;
  --signal:     #818CF8;

  --pass-bg:    rgba(74, 222, 128, .12);
  --warn-bg:    rgba(251, 191, 36, .12);
  --fail-bg:    rgba(248, 113, 113, .12);
  --signal-bg:  rgba(129, 140, 248, .12);

  background: #06090B !important;
  color: #C9D4DC !important;
  font-family: var(--mono) !important;
  font-size: 14.5px;
}
body.agent-view * {
  font-family: var(--mono) !important;
  letter-spacing: 0 !important;
}
body.agent-view h1,
body.agent-view h2,
body.agent-view h3,
body.agent-view h4 {
  font-stretch: normal;
  font-weight: 700;
  color: #FFFFFF !important;
  font-size: 1.05rem !important;
  line-height: 1.5;
}
body.agent-view h1::before { content: "# "; color: #93A0FF; }
body.agent-view h2::before { content: "## "; color: #93A0FF; }
body.agent-view h3::before { content: "### "; color: #93A0FF; }
body.agent-view h4::before { content: "#### "; color: #93A0FF; }
body.agent-view .ftr h4::before,
body.agent-view .ftr.v2 h4::before {
  content: "" !important;
}

body.agent-view .lede,
body.agent-view p,
body.agent-view td,
body.agent-view dd {
  color: #C9D4DC;
  font-size: .86rem;
}
body.agent-view a {
  color: #93A0FF;
}

/* Expose link targets only for inline prose/content links */
body.agent-view main p a[href]:not(.btn):not(.pill):not(.score-chip)::after,
body.agent-view main li a[href]:not(.btn):not(.pill):not(.score-chip)::after,
body.agent-view main td a[href]:not(.btn):not(.pill):not(.score-chip)::after,
body.agent-view .article a[href]:not(.btn):not(.pill):not(.score-chip)::after {
  content: " (" attr(href) ")";
  color: rgba(255, 255, 255, .4);
  font-size: .74rem;
}

/* Strictly suppress link targets on UI, buttons, cards, headers, footers */
body.agent-view .hdr a::after,
body.agent-view .logo::after,
body.agent-view .nav a::after,
body.agent-view .nav-dropdown a::after,
body.agent-view .dropdown-item::after,
body.agent-view .score-chip::after,
body.agent-view .btn::after,
body.agent-view .hdr-cta::after,
body.agent-view .ftr a::after,
body.agent-view .ftr.v2 a::after,
body.agent-view .blog-card::after,
body.agent-view .tool-card::after,
body.agent-view .card[href]::after,
body.agent-view a.card::after,
body.agent-view .filter-btn::after,
body.agent-view .chip::after,
body.agent-view .pill::after,
body.agent-view .expander::after,
body.agent-view .agent-toggle::after,
body.agent-view .tbl a::after,
body.agent-view .fc-row a::after,
body.agent-view .rd-cohort a::after,
body.agent-view .skip-link::after {
  content: "" !important;
  display: none !important;
}

body.agent-view [data-decor] { display: none !important; }
body.agent-view .agent-toggle .toggle-track { display: inline-block !important; }

/* Structural cards and panels */
body.agent-view .card,
body.agent-view .panel,
body.agent-view .stat,
body.agent-view .blog-card,
body.agent-view .tool-card,
body.agent-view .gate,
body.agent-view .rd-card,
body.agent-view .diff {
  background: rgba(255, 255, 255, .02) !important;
  border: 1px dashed rgba(255, 255, 255, .18) !important;
  border-radius: 0 !important;
  color: #C9D4DC !important;
}
body.agent-view .blog-card:hover,
body.agent-view .tool-card:hover {
  border-color: rgba(255, 255, 255, .45) !important;
  transform: none !important;
}
body.agent-view .blog-title { color: #FFFFFF !important; }
body.agent-view .blog-summary { color: #A9B6C0 !important; }
body.agent-view .stat-num { font-size: 1.4rem; color: #FFFFFF !important; }
body.agent-view .section { border-top: 1px dashed rgba(255, 255, 255, .18); }
body.agent-view .section--ink { background: transparent !important; }

/* Header and Navigation */
body.agent-view .hdr {
  background: rgba(6, 9, 11, .95) !important;
  backdrop-filter: blur(12px);
  border-bottom: 1px dashed rgba(255, 255, 255, .2) !important;
}
body.agent-view .logo {
  color: #FFFFFF !important;
}
body.agent-view .logo-mark {
  display: inline-block !important;
}
body.agent-view .hdr .nav a {
  color: #C9D4DC !important;
}
body.agent-view .hdr .nav a:hover,
body.agent-view .hdr .nav a[aria-current="page"] {
  color: #FFFFFF !important;
}
body.agent-view .nav-dropdown {
  background: #0B1014 !important;
  border: 1px dashed rgba(255, 255, 255, .25) !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .8) !important;
}
body.agent-view .dropdown-item strong { color: #FFFFFF !important; }
body.agent-view .dropdown-item span { color: #A9B6C0 !important; }
body.agent-view .dropdown-item:hover {
  background: rgba(255, 255, 255, .08) !important;
}

/* Score Chip & Agent Toggle */
body.agent-view .score-chip {
  background: rgba(255, 255, 255, .06) !important;
  border: 1px dashed rgba(255, 255, 255, .25) !important;
  color: #C9D4DC !important;
}
body.agent-view .score-chip b {
  color: #4ADE80 !important;
}
body.agent-view .agent-toggle {
  border: 1px dashed rgba(255, 255, 255, .25) !important;
  background: rgba(255, 255, 255, .04) !important;
  color: #C9D4DC !important;
}
body.agent-view .agent-toggle:hover {
  border-color: rgba(255, 255, 255, .5) !important;
  color: #FFFFFF !important;
}
body.agent-view .agent-toggle[aria-pressed="true"] {
  background: rgba(78, 97, 246, .22) !important;
  border-color: #6879F8 !important;
  color: #FFFFFF !important;
}
body.agent-view .agent-toggle[aria-pressed="true"] .toggle-track {
  background: #4E61F6 !important;
  display: inline-block !important;
}
body.agent-view .agent-toggle[aria-pressed="true"] .toggle-track::after {
  transform: translateX(10px);
  background: #FFFFFF !important;
}

/* Buttons */
body.agent-view .btn {
  background: rgba(255, 255, 255, .04) !important;
  border: 1px dashed rgba(255, 255, 255, .35) !important;
  color: #FFFFFF !important;
  border-radius: 0 !important;
}
body.agent-view .btn:hover {
  background: rgba(255, 255, 255, .12) !important;
  border-color: rgba(255, 255, 255, .6) !important;
}
body.agent-view .btn-primary,
body.agent-view .hdr-cta {
  background: rgba(78, 97, 246, .28) !important;
  border: 1px dashed #6879F8 !important;
  color: #FFFFFF !important;
}
body.agent-view .btn-primary:hover,
body.agent-view .hdr-cta:hover {
  background: rgba(78, 97, 246, .48) !important;
  border-color: #93A0FF !important;
}

/* Inputs, Textareas, Selects & Labels */
body.agent-view .inp,
body.agent-view select.inp,
body.agent-view textarea.inp {
  background: rgba(255, 255, 255, .05) !important;
  border: 1px dashed rgba(255, 255, 255, .25) !important;
  border-radius: 0 !important;
  color: #FFFFFF !important;
}
body.agent-view .inp::placeholder {
  color: rgba(255, 255, 255, .45) !important;
}
body.agent-view .inp:focus,
body.agent-view select.inp:focus,
body.agent-view textarea.inp:focus {
  outline: 1px solid #6879F8 !important;
  border-color: #6879F8 !important;
}
body.agent-view .fld-label,
body.agent-view label {
  color: rgba(255, 255, 255, .75) !important;
}

/* Tables and Filters */
body.agent-view .tbl th,
body.agent-view table th,
body.agent-view thead th {
  background: rgba(255, 255, 255, .06) !important;
  color: #FFFFFF !important;
  border-bottom: 1px dashed rgba(255, 255, 255, .3) !important;
}
body.agent-view .tbl td,
body.agent-view table td {
  color: #C9D4DC !important;
  border-bottom: 1px dashed rgba(255, 255, 255, .15) !important;
}
body.agent-view .filter-btn,
body.agent-view .chip,
body.agent-view .f-btn {
  background: rgba(255, 255, 255, .04) !important;
  border: 1px dashed rgba(255, 255, 255, .25) !important;
  color: #C9D4DC !important;
}
body.agent-view .filter-btn.is-active,
body.agent-view .chip.is-active,
body.agent-view .f-btn.is-active,
body.agent-view .filter-btn[aria-pressed="true"],
body.agent-view .chip[aria-pressed="true"] {
  background: rgba(78, 97, 246, .25) !important;
  border-color: #6879F8 !important;
  color: #FFFFFF !important;
}

body.agent-view .dim-row.is-head {
  background: #0B1014 !important;
  color: #FFFFFF !important;
  border-bottom: 1px dashed rgba(255, 255, 255, .3) !important;
}
body.agent-view .dim-row:hover {
  background: rgba(255, 255, 255, .04) !important;
}
body.agent-view .agent-pane {
  background: #0B1014 !important;
  border: 1px dashed rgba(255, 255, 255, .18) !important;
  color: #C9D4DC !important;
}
body.agent-view .agent-pane.is-html {
  color: rgba(255, 255, 255, .5) !important;
}
body.agent-view .pane-label {
  color: rgba(255, 255, 255, .65) !important;
}

/* Footer */
body.agent-view .ftr,
body.agent-view .ftr.v2 {
  background: transparent !important;
  border-top: 1px dashed rgba(255, 255, 255, .18) !important;
}
body.agent-view .ftr a,
body.agent-view .ftr.v2 a {
  color: #A9B6C0 !important;
}
body.agent-view .ftr a:hover,
body.agent-view .ftr.v2 a:hover {
  color: #FFFFFF !important;
}

/* Muted & Semantic Spans */
body.agent-view span.u-dim,
body.agent-view span.stat-src,
body.agent-view span.dim-id,
body.agent-view .u-dim,
body.agent-view .u-small,
body.agent-view .eyebrow,
body.agent-view .fc-name,
body.agent-view .fc-pct,
body.agent-view .rd-legend,
body.agent-view .rd-cap,
body.agent-view .meta-item,
body.agent-view .blog-date,
body.agent-view .blog-read,
body.agent-view .kv dt,
body.agent-view .step-n,
body.agent-view [style*="var(--ink-50)"],
body.agent-view [style*="var(--ink-70)"] {
  color: rgba(255, 255, 255, .72) !important;
}
body.agent-view [style*="var(--ink)"] {
  color: #FFFFFF !important;
}
body.agent-view .fc-bar {
  background: #F87171 !important;
}
body.agent-view .fc-track {
  background: rgba(255, 255, 255, .08) !important;
  border: 1px dashed rgba(255, 255, 255, .2) !important;
}
body.agent-view .dim-id {
  color: #93A0FF !important;
  background: rgba(147, 160, 255, .15) !important;
  border: 1px dashed rgba(147, 160, 255, .3) !important;
}

/* Pills & Semantic Badges */
body.agent-view .pill {
  background: rgba(255, 255, 255, .06) !important;
  border: 1px dashed rgba(255, 255, 255, .25) !important;
  color: #C9D4DC !important;
}
body.agent-view .pill-pass {
  color: #4ADE80 !important;
  border-color: rgba(74, 222, 128, .4) !important;
  background: rgba(74, 222, 128, .12) !important;
}
body.agent-view .pill-warn {
  color: #FBBF24 !important;
  border-color: rgba(251, 191, 36, .4) !important;
  background: rgba(251, 191, 36, .12) !important;
}
body.agent-view .pill-fail {
  color: #F87171 !important;
  border-color: rgba(248, 113, 113, .4) !important;
  background: rgba(248, 113, 113, .12) !important;
}
body.agent-view .pill-sig {
  color: #93A0FF !important;
  border-color: rgba(147, 160, 255, .4) !important;
  background: rgba(147, 160, 255, .12) !important;
}

/* SVG Text / Gauges */
body.agent-view svg text {
  fill: #FFFFFF !important;
}
body.agent-view svg circle[stroke*="var(--ink-12)"] {
  stroke: rgba(255, 255, 255, .15) !important;
}

/* Agent note banner */
body.agent-view .agent-note { display: block; }
.agent-note {
  display: none; font-family: var(--mono); font-size: .74rem;
  color: #4ADE80; border: 1px dashed rgba(74,222,128,.4);
  padding: 10px 14px; margin-bottom: 28px;
}

/* --------------------------------------------------- 20. Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .beacon, .pulse-dot, .caret { animation: none !important; }
  .diff .diff-row.add { max-height: 34px; opacity: 1; }
}

/* ------------------------------------------------------------ 21. Utilities */
.u-mt-s { margin-top: 12px; }
.u-mt-m { margin-top: 24px; }
.u-mt-l { margin-top: 44px; }
.u-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.u-dim { color: var(--ink-50); }
.u-small { font-size: .84rem; }
.u-center { text-align: center; }
.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;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 4px;
  font-size: .85rem; transition: top var(--dur-2);
}
.skip-link:focus { top: 12px; }
