/* SpecTrace — audit-grade dark. Ink base, amber accent, status colors. */
:root {
  --bg: #07090d;
  --bg-elev: #0c1016;
  --surface: #10151d;
  --surface-2: #141b25;
  --border: #1c2432;
  --border-hi: #2a3547;
  --text: #e8edf4;
  --muted: #8b95a5;
  --faint: #5b6575;
  --accent: #f5a623;
  --accent-hi: #fbbf24;
  --accent-dim: rgba(245, 166, 35, 0.14);
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --sans: "Inter", system-ui, sans-serif;
  --disp: "Space Grotesk", var(--sans);
  --r: 10px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100dvh;
}
::selection { background: var(--accent-dim); color: var(--accent-hi); }
a { color: inherit; }
button { font: inherit; cursor: pointer; }

/* ambient background */
.ambient {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(245, 166, 35, 0.07), transparent 60%),
    radial-gradient(700px 420px at -10% 110%, rgba(56, 130, 246, 0.05), transparent 60%),
    var(--bg);
}
.ambient::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: 0.12;
  mask-image: radial-gradient(1000px 600px at 50% 0%, #000 0%, transparent 75%);
}
.scanline {
  position: absolute; left: 0; right: 0; height: 120px; top: -140px;
  background: linear-gradient(to bottom, transparent,
    rgba(245, 166, 35, 0.05) 55%, rgba(245, 166, 35, 0.12) 85%, transparent);
  animation: sweep 9s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes sweep { 0% { top: -140px; } 62% { top: 110%; } 100% { top: 110%; } }
@media (prefers-reduced-motion: reduce) {
  .scanline { display: none; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

.wrap { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* nav */
nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(7, 9, 13, 0.8);
  border-bottom: 1px solid var(--border);
}
.nav-in { display: flex; align-items: center; gap: 20px; height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--disp); font-weight: 700; font-size: 18px; letter-spacing: 0.2px; }
.brand svg { flex: 0 0 auto; }
.brand b { color: var(--accent); font-weight: 700; }
.nav-links { display: flex; gap: 4px; margin-left: 8px; }
.nav-links a {
  text-decoration: none; color: var(--muted); font-size: 13.5px; font-weight: 500;
  padding: 7px 12px; border-radius: 8px; transition: color 0.18s, background 0.18s;
}
.nav-links a:hover { color: var(--text); background: var(--surface); }
.nav-links a.on { color: var(--accent-hi); background: var(--accent-dim); }
.nav-dl { margin-left: auto; display: flex; gap: 8px; }
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--border-hi); background: var(--surface);
  color: var(--text); font-size: 12.5px; font-weight: 600;
  padding: 7px 13px; border-radius: 8px; text-decoration: none;
  transition: border-color 0.18s, background 0.18s, transform 0.15s;
}
.btn:hover { border-color: var(--accent); background: var(--surface-2); }
.btn:active { transform: scale(0.97); }
.btn.solid { background: var(--accent); border-color: var(--accent); color: #14100a; }
.btn.solid:hover { background: var(--accent-hi); }
.btn svg { opacity: 0.75; }

/* hero */
header.hero { padding: 46px 0 26px; }
.kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 1.6px;
  text-transform: uppercase; color: var(--accent);
  border: 1px solid rgba(245, 166, 35, 0.3); background: var(--accent-dim);
  padding: 5px 12px; border-radius: 999px; margin-bottom: 18px;
}
.kicker .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }
h1 { font-family: var(--disp); font-size: clamp(30px, 4.4vw, 46px); line-height: 1.08; letter-spacing: -0.5px; max-width: 800px; }
h1 em { font-style: normal; color: var(--accent); }
.sub { color: var(--muted); max-width: 720px; margin-top: 14px; font-size: 16px; }
.sub code { font-family: var(--mono); font-size: 13px; color: var(--accent-hi); background: var(--accent-dim); padding: 2px 7px; border-radius: 6px; }

.doc-card {
  margin-top: 26px; display: flex; flex-wrap: wrap; gap: 14px 26px; align-items: center;
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  background: linear-gradient(180deg, var(--surface), var(--bg-elev));
  border-radius: var(--r); padding: 15px 20px;
}
.doc-card .dc-name { font-weight: 600; font-size: 14.5px; }
.doc-card .dc-meta { font-family: var(--mono); font-size: 12px; color: var(--muted); display: flex; gap: 18px; flex-wrap: wrap; }
.doc-card .dc-meta span b { color: var(--text); font-weight: 600; }

/* stat tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 22px 0 8px; }
.tile {
  border: 1px solid var(--border); background: var(--surface);
  border-radius: var(--r); padding: 16px 18px 14px;
  position: relative; overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}
.tile:hover { border-color: var(--border-hi); transform: translateY(-2px); }
.tile .t-num { font-family: var(--disp); font-size: 30px; font-weight: 700; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; }
.tile .t-num small { font-size: 16px; color: var(--muted); font-weight: 500; }
.tile .t-lbl { font-size: 11.5px; letter-spacing: 1.1px; text-transform: uppercase; color: var(--faint); margin-top: 3px; font-weight: 600; }
.tile.hot { border-color: rgba(245, 166, 35, 0.4); background: linear-gradient(180deg, rgba(245, 166, 35, 0.08), var(--surface)); }
.tile.hot .t-num { color: var(--accent-hi); }
.tile .t-sub { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 4px; }
.tile a { color: var(--accent); text-decoration: none; }
.tile a:hover { text-decoration: underline; }

/* controls */
.controls {
  position: sticky; top: 58px; z-index: 40;
  background: rgba(7, 9, 13, 0.88); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 12px 0; margin-top: 18px;
}
.ctrl-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.search {
  flex: 1 1 240px; display: flex; align-items: center; gap: 9px;
  border: 1px solid var(--border-hi); background: var(--surface);
  border-radius: 9px; padding: 8px 13px;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.search input { flex: 1; background: none; border: 0; outline: 0; color: var(--text); font: inherit; font-size: 14px; }
.search input::placeholder { color: var(--faint); }
.search svg { color: var(--faint); flex: 0 0 auto; }
.seg { display: inline-flex; border: 1px solid var(--border-hi); border-radius: 9px; overflow: hidden; background: var(--surface); }
.seg button {
  background: none; border: 0; color: var(--muted); font-size: 12.5px; font-weight: 600;
  padding: 8px 13px; transition: background 0.15s, color 0.15s;
  border-right: 1px solid var(--border);
}
.seg button:last-child { border-right: 0; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--accent-dim); color: var(--accent-hi); }
.toggle {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--border-hi); background: var(--surface);
  border-radius: 9px; padding: 8px 13px; font-size: 12.5px; font-weight: 600; color: var(--muted);
  transition: border-color 0.18s, color 0.18s, background 0.18s;
}
.toggle .sw { width: 26px; height: 15px; border-radius: 999px; background: var(--border-hi); position: relative; transition: background 0.18s; }
.toggle .sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%; background: var(--muted); transition: transform 0.18s, background 0.18s; }
.toggle.on { border-color: rgba(251, 191, 36, 0.5); color: var(--warn); background: rgba(251, 191, 36, 0.07); }
.toggle.on .sw { background: rgba(251, 191, 36, 0.35); }
.toggle.on .sw::after { transform: translateX(11px); background: var(--warn); }

.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--border-hi); background: var(--surface);
  color: var(--muted); font-size: 12px; font-weight: 600;
  padding: 5.5px 11px; border-radius: 999px;
  transition: border-color 0.15s, color 0.15s, background 0.15s, transform 0.12s;
}
.chip:active { transform: scale(0.96); }
.chip .sw { width: 8px; height: 8px; border-radius: 3px; background: var(--tc, var(--faint)); opacity: 0.85; }
.chip .n { font-family: var(--mono); font-size: 10.5px; color: var(--faint); }
.chip.on { border-color: var(--tc, var(--accent)); color: var(--text); background: color-mix(in srgb, var(--tc, var(--accent)) 12%, transparent); }
.chip.on .n { color: var(--text); }

/* type hues */
.t-functional { --tc: #2dd4bf; }
.t-technical { --tc: #60a5fa; }
.t-security-privacy { --tc: #a78bfa; }
.t-submission { --tc: #f5a623; }
.t-evaluation { --tc: #a3e635; }
.t-contractual { --tc: #94a3b8; }
.t-staffing { --tc: #f472b6; }
.t-schedule { --tc: #22d3ee; }

/* table */
.matrix-zone { padding: 18px 0 60px; }
.count-line { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.count-line b { color: var(--accent-hi); }
.tbl { border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; background: var(--bg-elev); }
.tbl-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 980px; }
thead th {
  text-align: left; font-size: 10.5px; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--faint); font-weight: 700; padding: 11px 14px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
}
tbody tr { border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.13s; }
tbody tr:last-child { border-bottom: 0; }
tbody tr:hover { background: var(--surface); }
tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
tbody tr.review-row { box-shadow: inset 3px 0 0 var(--warn); }
td { padding: 12px 14px; vertical-align: top; }
td.c-id { font-family: var(--mono); font-size: 12px; color: var(--accent-hi); white-space: nowrap; width: 84px; }
td.c-text { font-size: 13.5px; line-height: 1.5; color: var(--text); max-width: 560px; }
td.c-text .dupe-tag { font-family: var(--mono); font-size: 10px; color: var(--faint); border: 1px solid var(--border-hi); padding: 1px 6px; border-radius: 5px; margin-left: 8px; white-space: nowrap; }
td.c-type { white-space: nowrap; width: 130px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.3px;
  color: var(--tc, var(--muted));
  background: color-mix(in srgb, var(--tc, var(--muted)) 11%, transparent);
  border: 1px solid color-mix(in srgb, var(--tc, var(--muted)) 30%, transparent);
  padding: 3px 9px; border-radius: 999px;
}
td.c-page { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; width: 76px; }
td.c-conf { width: 120px; }
.conf { display: flex; align-items: center; gap: 8px; }
.conf .bar { flex: 1; height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; min-width: 44px; }
.conf .bar i { display: block; height: 100%; border-radius: 2px; background: var(--ok); }
.conf.mid .bar i { background: var(--warn); }
.conf.low .bar i { background: var(--bad); }
.conf .v { font-family: var(--mono); font-size: 11.5px; color: var(--muted); width: 30px; text-align: right; font-variant-numeric: tabular-nums; }
td.c-ground { width: 92px; white-space: nowrap; }
.gr { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.gr i { width: 7px; height: 7px; border-radius: 50%; }
.gr.verbatim i { background: var(--ok); box-shadow: 0 0 6px rgba(52, 211, 153, 0.6); }
.gr.close i { background: var(--warn); }
.gr.weak i { background: var(--bad); box-shadow: 0 0 6px rgba(248, 113, 113, 0.6); }
.empty-state { padding: 60px 20px; text-align: center; color: var(--muted); }
.empty-state b { color: var(--text); }

/* drawer */
.drawer-scrim {
  position: fixed; inset: 0; z-index: 90; background: rgba(4, 5, 8, 0.6);
  opacity: 0; pointer-events: none; transition: opacity 0.22s;
}
.drawer-scrim.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 91;
  width: min(480px, 94vw);
  background: var(--bg-elev); border-left: 1px solid var(--border-hi);
  transform: translateX(102%); transition: transform 0.26s cubic-bezier(0.32, 0.72, 0.28, 1);
  display: flex; flex-direction: column;
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.5);
}
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.drawer-head .rid { font-family: var(--mono); font-size: 14px; color: var(--accent-hi); font-weight: 700; }
.drawer-head .x {
  margin-left: auto; background: var(--surface); border: 1px solid var(--border-hi);
  color: var(--muted); border-radius: 8px; width: 32px; height: 32px;
  display: grid; place-items: center; transition: color 0.15s, border-color 0.15s;
}
.drawer-head .x:hover { color: var(--text); border-color: var(--accent); }
.drawer-body { padding: 22px; overflow-y: auto; flex: 1; }
.drawer-body .req-text {
  font-size: 15px; line-height: 1.65; color: var(--text);
  border-left: 3px solid var(--accent); padding: 4px 0 4px 16px; margin-bottom: 24px;
}
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 10px 14px; font-size: 13px; }
.kv dt { color: var(--faint); font-weight: 600; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; padding-top: 2px; }
.kv dd { color: var(--text); }
.kv dd.mono { font-family: var(--mono); font-size: 12.5px; }
.review-note {
  margin-top: 24px; border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.07); border-radius: 9px; padding: 13px 15px;
  font-size: 12.5px; color: var(--warn); display: flex; gap: 9px; line-height: 1.5;
}
.ok-note {
  margin-top: 24px; border: 1px solid rgba(52, 211, 153, 0.3);
  background: rgba(52, 211, 153, 0.06); border-radius: 9px; padding: 13px 15px;
  font-size: 12.5px; color: var(--ok); display: flex; gap: 9px; line-height: 1.5;
}

/* methodology page */
.method { padding: 40px 0 80px; max-width: 860px; }
.method h2 { font-family: var(--disp); font-size: 26px; margin: 42px 0 14px; letter-spacing: -0.3px; }
.method h2:first-of-type { margin-top: 26px; }
.method p { color: var(--muted); margin: 10px 0; font-size: 15px; }
.method p b, .method li b { color: var(--text); }
.method code { font-family: var(--mono); font-size: 12.5px; color: var(--accent-hi); background: var(--accent-dim); padding: 2px 7px; border-radius: 6px; }
.method ul, .method ol { color: var(--muted); margin: 10px 0 10px 22px; font-size: 15px; }
.method li { margin: 7px 0; }

.recall-hero {
  display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: center;
  border: 1px solid var(--border); border-radius: 14px;
  background: linear-gradient(150deg, rgba(245, 166, 35, 0.08), var(--surface) 55%);
  padding: 28px; margin: 24px 0;
}
.ring-wrap { position: relative; width: 200px; height: 200px; }
.ring-wrap svg { transform: rotate(-90deg); }
.ring-wrap .ring-txt {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
}
.ring-txt .big { font-family: var(--disp); font-size: 42px; font-weight: 700; color: var(--accent-hi); letter-spacing: -1px; }
.ring-txt .lbl { font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--faint); font-weight: 700; margin-top: 2px; }
.recall-facts { display: grid; gap: 12px; }
.rf { display: flex; gap: 12px; align-items: baseline; }
.rf .rf-n { font-family: var(--mono); font-size: 17px; font-weight: 700; color: var(--text); min-width: 84px; }
.rf .rf-t { color: var(--muted); font-size: 13.5px; }

.pipe { display: grid; gap: 10px; margin: 18px 0; }
.pipe-step {
  display: flex; gap: 16px; border: 1px solid var(--border); border-radius: var(--r);
  background: var(--surface); padding: 15px 18px; align-items: flex-start;
  transition: border-color 0.2s, transform 0.2s;
}
.pipe-step:hover { border-color: var(--border-hi); transform: translateX(4px); }
.pipe-step .pn {
  font-family: var(--mono); font-weight: 700; font-size: 13px; color: var(--accent);
  border: 1px solid rgba(245, 166, 35, 0.35); background: var(--accent-dim);
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: 0 0 auto;
}
.pipe-step h3 { font-size: 14.5px; font-weight: 700; margin-bottom: 3px; font-family: var(--disp); }
.pipe-step p { font-size: 13px; margin: 0; }

.miss-list { border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; margin: 14px 0; }
.miss {
  display: grid; grid-template-columns: 64px 1fr; gap: 12px;
  padding: 13px 16px; border-bottom: 1px solid var(--border);
  background: var(--bg-elev); font-size: 13px;
}
.miss:last-child { border-bottom: 0; }
.miss .mp { font-family: var(--mono); font-size: 11.5px; color: var(--bad); }
.miss .mt { color: var(--muted); }

footer {
  border-top: 1px solid var(--border); padding: 26px 0 34px;
  color: var(--faint); font-size: 12.5px;
}
.foot-in { display: flex; flex-wrap: wrap; gap: 10px 26px; align-items: center; }
.foot-in .mono { font-family: var(--mono); font-size: 11.5px; }
footer a { color: var(--muted); }
footer a:hover { color: var(--accent); }

@media (max-width: 760px) {
  .nav-links { display: none; }
  .recall-hero { grid-template-columns: 1fr; justify-items: center; }
  .kv { grid-template-columns: 110px 1fr; }
  td.c-text { max-width: none; }
}

/* entrance */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.rise { animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.3, 1) both; }
