/* kspect.dev — design system
   Palette: deep blue-graphite base, phosphor-amber accent (VT220 heritage),
   semantic pass/fail/unknown drawn from the tool's own table output. */

:root {
  --bg: #0b0e14;
  --bg-2: #10141c;
  --bg-3: #151b26;
  --line: #1f2734;
  --line-2: #2b3648;
  --text: #cbd3df;
  --dim: #8b96a5;
  --faint: #5f6a7a;
  --amber: #ffb454;
  --amber-hi: #ffcf8a;
  --amber-dim: rgba(255, 180, 84, 0.12);
  --pass: #4cc38a;
  --fail: #f0555c;
  --unk: #7c8ba1;
  --med: #e0913d;
  --radius: 10px;
  --sans: "Archivo", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --w: 1120px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--amber); color: #1a1206; }

a { color: var(--amber); text-decoration: none; }
a:hover { color: var(--amber-hi); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 2px; }

.skip {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--amber); color: #1a1206; padding: 10px 16px;
  font: 600 14px var(--mono);
}
.skip:focus { left: 12px; top: 12px; }

.wrap { max-width: var(--w); margin: 0 auto; padding: 0 24px; }

/* ---------- typography ---------- */
h1, h2, h3 { font-family: var(--sans); letter-spacing: -0.02em; text-wrap: balance; }
h1 {
  font-size: clamp(2.3rem, 5.4vw, 3.9rem);
  font-weight: 750; line-height: 1.04;
  font-variation-settings: "wdth" 118;
  color: #e8edf4;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  font-weight: 700; line-height: 1.12;
  font-variation-settings: "wdth" 114;
  color: #e3e9f1;
}
h3 { font-size: 1.05rem; font-weight: 650; color: #dde3ec; }
p { max-width: 68ch; }
.lede { font-size: clamp(1.02rem, 1.6vw, 1.2rem); color: var(--dim); }
strong { color: #e3e9f1; font-weight: 600; }
code, .mono { font-family: var(--mono); }
p code, li code, td code {
  font-size: 0.86em; background: var(--bg-3);
  border: 1px solid var(--line); border-radius: 5px; padding: 0.1em 0.38em;
  color: var(--amber-hi); white-space: nowrap;
}

/* eyebrow: real repo paths — every section maps to an artifact */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font: 500 12.5px/1 var(--mono); letter-spacing: 0.02em;
  color: var(--amber); margin-bottom: 18px;
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--amber); opacity: 0.65; }

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-head .wrap { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font: 650 17px var(--mono); color: #e8edf4; }
.brand svg { display: block; }
.brand .v { color: var(--faint); font-weight: 450; font-size: 12.5px; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  color: var(--dim); font-size: 14px; font-weight: 500;
  padding: 7px 11px; border-radius: 7px;
}
.nav a:hover { color: var(--text); background: var(--bg-3); }
.gh-btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line-2); border-radius: 8px;
  padding: 7px 14px; color: var(--text); font-size: 14px; font-weight: 550;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.gh-btn:hover { border-color: var(--amber); color: var(--amber-hi); background: var(--amber-dim); }
.menu-btn { display: none; margin-left: auto; background: none; border: 1px solid var(--line-2); border-radius: 8px; color: var(--text); padding: 8px 10px; cursor: pointer; }

/* ---------- hero ---------- */
.hero { position: relative; padding: clamp(64px, 9vw, 120px) 0 72px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(560px 300px at 78% 8%, rgba(255, 180, 84, 0.07), transparent 65%),
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: auto, 44px 44px, 44px 44px;
  mask-image: radial-gradient(900px 560px at 30% 0%, #000 40%, transparent 80%);
  opacity: 0.5;
}
.hero .wrap { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 560px); gap: 56px; align-items: center; }
.hero h1 .a { color: var(--amber); }
.hero .lede { margin: 22px 0 30px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  border-radius: 9px; padding: 12px 20px; font-size: 15px; font-weight: 600;
  transition: transform 0.18s var(--ease), background 0.18s var(--ease), border-color 0.18s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-amber { background: var(--amber); color: #1d1305; }
.btn-amber:hover { background: var(--amber-hi); color: #1d1305; }
.btn-ghost { border: 1px solid var(--line-2); color: var(--text); }
.btn-ghost:hover { border-color: var(--amber); color: var(--amber-hi); }
.install-line {
  display: flex; align-items: center; gap: 12px; margin-top: 26px;
  font: 450 13.5px var(--mono); color: var(--dim);
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--bg-2); padding: 11px 14px; max-width: 560px;
}
.install-line .p { color: var(--amber); }
.install-line code { background: none; border: 0; padding: 0; color: var(--text); white-space: nowrap; overflow-x: auto; scrollbar-width: none; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 20px; font: 450 12.5px var(--mono); color: var(--faint); }
.hero-meta span::before { content: "▸ "; color: var(--amber); }

/* terminal window — the signature */
.term {
  border: 1px solid var(--line-2); border-radius: 12px; background: #0d1119;
  box-shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 180, 84, 0.04);
  overflow: hidden; font: 450 12.5px/1.62 var(--mono);
}
.term-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--bg-2);
  color: var(--faint); font-size: 12px;
}
.term-bar .dots { display: flex; gap: 6px; }
.term-bar .dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.term-bar .title { margin: 0 auto; }
.term-body { padding: 16px 18px 18px; min-height: 340px; white-space: pre-wrap; word-break: break-word; color: #b9c2cf; }
.term-body .c-p { color: var(--amber); }
.term-body .c-cmd { color: #e8edf4; }
.term-body .c-fail { color: var(--fail); font-weight: 600; }
.term-body .c-pass { color: var(--pass); font-weight: 600; }
.term-body .c-unk { color: var(--unk); font-weight: 600; }
.term-body .c-sev { color: var(--med); }
.term-body .c-dim { color: var(--faint); }
.term-body .c-fix { color: var(--pass); }
.caret { display: inline-block; width: 8px; height: 15px; background: var(--amber); vertical-align: -2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* posture bar */
.posture { margin-top: 14px; }
.posture .bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--bg-3); }
.posture .bar i { display: block; height: 100%; transition: width 0.9s var(--ease); width: 0; }
.posture .bar .f { background: var(--fail); }
.posture .bar .p { background: var(--pass); }
.posture .bar .u { background: var(--unk); opacity: 0.55; }
.posture .legend { display: flex; gap: 18px; margin-top: 9px; font: 450 11.5px var(--mono); color: var(--dim); }
.posture .legend b { color: var(--text); font-weight: 600; }
.posture .legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }

/* ---------- shared section chrome ---------- */
section { padding: clamp(64px, 8vw, 104px) 0; border-top: 1px solid var(--line); }
section.no-line { border-top: 0; }
.sec-head { max-width: 760px; margin-bottom: clamp(32px, 5vw, 56px); }
.sec-head p { margin-top: 14px; color: var(--dim); }

.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* trust strip */
.strip { border-top: 1px solid var(--line); background: var(--bg-2); }
.strip .wrap { display: grid; grid-template-columns: repeat(4, 1fr); }
.strip .cell { padding: 26px 22px; border-left: 1px solid var(--line); }
.strip .cell:first-child { border-left: 0; }
.strip .n { font: 650 26px var(--mono); color: var(--amber); letter-spacing: -0.02em; }
.strip .l { margin-top: 4px; font-size: 13px; color: var(--dim); }

/* cards */
.grid { display: grid; gap: 18px; }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
.card {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  padding: 24px; transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.card .ic { color: var(--amber); margin-bottom: 14px; }
.card h3 { margin-bottom: 8px; }
.card p { font-size: 14.5px; color: var(--dim); }
.card .path { display: block; margin-top: 14px; font: 450 11.5px var(--mono); color: var(--faint); }

/* steps */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; counter-reset: step; }
.step { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: var(--bg-2); position: relative; }
.step::before {
  counter-increment: step; content: "0" counter(step);
  font: 650 12px var(--mono); color: var(--amber);
  display: inline-block; margin-bottom: 12px;
  border: 1px solid var(--line-2); border-radius: 6px; padding: 4px 8px;
}
.step h3 { font-size: 0.98rem; margin-bottom: 6px; }
.step p { font-size: 13.5px; color: var(--dim); }
.step code { font-size: 0.82em; }

/* architecture svg */
.arch-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.arch-svg { width: 100%; height: auto; display: block; }
.arch-svg .node { cursor: pointer; }
.arch-svg .node rect { fill: var(--bg-2); stroke: var(--line-2); stroke-width: 1.25; rx: 10; transition: stroke 0.18s, fill 0.18s; }
.arch-svg .node text { fill: var(--text); font: 600 13px var(--mono); }
.arch-svg .node .sub { fill: var(--faint); font-weight: 450; font-size: 10.5px; }
.arch-svg .node:hover rect, .arch-svg .node.on rect { stroke: var(--amber); fill: #161207; }
.arch-svg .node:hover text, .arch-svg .node.on text { fill: var(--amber-hi); }
.arch-svg .node:hover .sub, .arch-svg .node.on .sub { fill: var(--amber); }
.arch-svg .flow { stroke: var(--line-2); stroke-width: 1.25; fill: none; marker-end: url(#arr); }
.arch-svg .src text { fill: var(--faint); font: 450 10.5px var(--mono); }
.arch-svg .src line { stroke: var(--line); }
.arch-panel {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-2); padding: 20px; position: sticky; top: 88px;
}
.arch-panel h3 { font: 600 14px var(--mono); color: var(--amber); margin-bottom: 8px; }
.arch-panel p { font-size: 13.5px; color: var(--dim); }
.arch-panel .k { margin-top: 12px; font: 450 11.5px var(--mono); color: var(--faint); }

/* three-state */
.tri { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.tri .card { border-top: 3px solid var(--line-2); }
.tri .card.pass { border-top-color: var(--pass); }
.tri .card.fail { border-top-color: var(--fail); }
.tri .card.unk { border-top-color: var(--unk); }
.tri .tag { font: 650 12px var(--mono); letter-spacing: 0.04em; }
.tri .pass .tag { color: var(--pass); } .tri .fail .tag { color: var(--fail); } .tri .unk .tag { color: var(--unk); }
.callout {
  margin-top: 22px; border: 1px solid var(--line-2); border-left: 3px solid var(--amber);
  border-radius: 8px; background: var(--amber-dim); padding: 16px 20px;
  font-size: 14.5px; color: var(--text); max-width: 820px;
}

/* tabs (workflow + install) */
.tabs { border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; background: #0d1119; }
.tablist { display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.tablist button {
  appearance: none; background: none; border: 0; cursor: pointer;
  font: 500 13px var(--mono); color: var(--dim);
  padding: 12px 18px; border-right: 1px solid var(--line);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tablist button[aria-selected="true"] { color: var(--amber); border-bottom-color: var(--amber); background: #0d1119; }
.tablist button:hover { color: var(--text); }
.tabpanel { padding: 18px 20px; font: 450 12.5px/1.62 var(--mono); overflow-x: auto; }
.tabpanel[hidden] { display: none; }
.tabpanel pre { white-space: pre; color: #b9c2cf; }
.copy-btn {
  float: right; appearance: none; cursor: pointer;
  background: var(--bg-3); border: 1px solid var(--line-2); border-radius: 6px;
  color: var(--dim); font: 500 11px var(--mono); padding: 5px 10px;
}
.copy-btn:hover { color: var(--amber); border-color: var(--amber); }

/* two-col prose (security/threat) */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.duo h3 { margin: 22px 0 8px; font-size: 1rem; }
.duo h3:first-of-type { margin-top: 0; }
.duo ul { list-style: none; }
.duo li { position: relative; padding: 7px 0 7px 22px; font-size: 14.5px; color: var(--dim); border-bottom: 1px dashed var(--line); }
.duo li::before { content: "▸"; position: absolute; left: 0; color: var(--amber); }
.duo li b { color: var(--text); font-weight: 600; }

/* surface map */
.surface-svg { width: 100%; height: auto; }
.surface-svg text { font-family: var(--mono); }
.surface-svg .lbl { fill: var(--text); font-size: 12.5px; font-weight: 500; }
.surface-svg .pathlbl { fill: var(--faint); font-size: 11px; }
.surface-svg .cnt { fill: var(--amber); font-size: 12.5px; font-weight: 650; }
.surface-svg .track { fill: var(--bg-3); }
.surface-svg .fillbar { fill: var(--amber); opacity: 0.85; }

/* perf */
.perf { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.perf .card { text-align: left; }
.perf .n { font: 700 clamp(1.7rem, 3vw, 2.3rem) var(--mono); color: var(--amber); letter-spacing: -0.03em; }
.perf .n small { font-size: 0.5em; color: var(--dim); font-weight: 500; }
.perf .why { margin-top: 8px; font-size: 13.5px; color: var(--dim); }

/* comparison table */
.cmp-scroll { overflow-x: auto; border: 1px solid var(--line-2); border-radius: 12px; }
table.cmp { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 720px; background: var(--bg-2); }
.cmp th, .cmp td { padding: 13px 16px; border-bottom: 1px solid var(--line); text-align: left; }
.cmp thead th { font: 600 12px var(--mono); color: var(--dim); background: var(--bg-3); }
.cmp thead th:first-child { color: var(--faint); }
.cmp tbody th { font-weight: 500; color: var(--text); font-size: 13.5px; }
.cmp td { color: var(--dim); }
.cmp td.y { color: var(--pass); font-weight: 600; }
.cmp td.n { color: var(--faint); }
.cmp td.p { color: var(--med); }
.cmp .hl { background: rgba(255, 180, 84, 0.05); border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.cmp-note { margin-top: 14px; font-size: 13px; color: var(--faint); }

/* use cases */
.uses { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.uses .card pre {
  margin-top: 14px; font: 450 12px/1.6 var(--mono); color: #aeb8c6;
  background: #0d1119; border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 14px; overflow-x: auto;
}
.uses .card pre .c-p { color: var(--amber); }

/* faq */
.faq { max-width: 820px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; padding: 18px 0;
  font-weight: 600; color: #dde3ec; display: flex; justify-content: space-between; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--amber); font: 500 20px var(--mono); }
.faq details[open] summary::after { content: "–"; }
.faq details p { padding: 0 0 18px; color: var(--dim); font-size: 14.5px; }

/* roadmap */
.road { position: relative; margin-left: 8px; padding-left: 28px; border-left: 1px solid var(--line-2); max-width: 780px; }
.road .rel { position: relative; padding: 0 0 30px; }
.road .rel::before {
  content: ""; position: absolute; left: -33px; top: 7px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--amber);
}
.road .rel.dim::before { border-color: var(--line-2); }
.road .rel h3 { font: 600 14px var(--mono); color: var(--amber); margin-bottom: 8px; }
.road .rel.dim h3 { color: var(--dim); }
.road .rel p { font-size: 14.5px; color: var(--dim); }

/* contribute / footer */
.contrib .grid.c3 .card p { min-height: 0; }
.foot { border-top: 1px solid var(--line); background: var(--bg-2); padding: 44px 0 36px; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; }
.foot .cols { display: flex; gap: 40px; flex-wrap: wrap; }
.foot h4 { font: 600 12px var(--mono); color: var(--faint); margin-bottom: 10px; letter-spacing: 0.05em; }
.foot ul { list-style: none; }
.foot li { margin: 6px 0; }
.foot a { color: var(--dim); font-size: 14px; }
.foot a:hover { color: var(--amber); }
.foot .fine { width: 100%; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--faint); font-size: 13px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 40px; }
  .arch-wrap { grid-template-columns: 1fr; }
  .arch-panel { position: static; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .grid.c3 { grid-template-columns: repeat(2, 1fr); }
  .perf { grid-template-columns: repeat(2, 1fr); }
  .strip .wrap { grid-template-columns: repeat(2, 1fr); }
  .strip .cell:nth-child(3) { border-left: 0; }
  .strip .cell { border-top: 1px solid var(--line); }
  .strip .cell:nth-child(-n + 2) { border-top: 0; }
}
@media (max-width: 720px) {
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--bg-2); border-bottom: 1px solid var(--line); flex-direction: column; padding: 10px 16px 16px; }
  .nav.open { display: flex; }
  .menu-btn { display: block; }
  .site-head .gh-btn { display: none; }
  .grid.c3, .grid.c2, .tri, .uses, .duo, .steps, .perf { grid-template-columns: 1fr; }
  .term-body { min-height: 300px; font-size: 11.5px; }
}
