/* ForgeSight showcase. Surfaces borrow from the subject: asphalt, concrete, lane paint. */
:root {
  --asphalt: #2b2e33;
  --asphalt-2: #383c42;
  --asphalt-line: #50555d;
  --concrete: #e4e6e8;
  --paper: #f5f6f6;
  --ink: #15171a;
  --ink-2: #454a52;
  --ink-3: #69707a;
  --rule: #c7cbd0;
  --lane: #f2b90c;
  --on-dark: #f1f2f3;
  --on-dark-2: #b9bec5;
  /* categorical data colours (validated set, fixed order: wheel, seat, exhaust) */
  --c1: #2a78d6;
  --c2: #eb6834;
  --c3: #1baf7a;
  --c1-dark: #3987e5;
  --c2-dark: #d95926;
  --c3-dark: #199e70;
  --good: #1f8a4c;
  --bad: #c7362f;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --text: "Barlow", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --rail: 76px;
  --measure: 68ch;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--concrete);
  color: var(--ink);
  font: 400 17px/1.55 var(--text);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--lane); outline-offset: 2px; }
code, pre { font-family: var(--mono); font-size: 0.86em; }
p { margin: 0 0 1em; max-width: var(--measure); }
h1, h2, h3 { font-family: var(--display); margin: 0; line-height: 1; }
button { font: inherit; color: inherit; }

/* ---------- hero (asphalt band) ---------- */
.hero { background: var(--asphalt); color: var(--on-dark); padding: 28px clamp(16px, 4vw, 56px) 56px; }
.topline { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; font-size: 15px; color: var(--on-dark-2); }
.topline nav { display: flex; gap: 22px; flex-wrap: wrap; }
.hero h1 {
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.005em;
  font-size: clamp(4.2rem, 15vw, 13rem); line-height: 0.8; margin: 34px 0 0 -0.04em;
}
.hero h1 .cut { color: var(--asphalt); -webkit-text-stroke: 2px var(--lane); }
.lede { font-size: clamp(1.15rem, 1.9vw, 1.5rem); line-height: 1.35; max-width: 34em; margin: 22px 0 34px; color: var(--on-dark); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 28px; align-items: start; }
.viewer { position: relative; background: #1d1f22; line-height: 0; }
.viewer img { width: 100%; height: auto; }
.viewer svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.viewer .box { fill: none; stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.viewer .box.halo { stroke: rgba(0, 0, 0, 0.55); stroke-width: 5; }
.viewer .box.teacher { stroke-dasharray: 7 5; }
.viewer .box.weak { stroke-width: 2; stroke-dasharray: 1.5 4; stroke-linecap: round; }
.viewer .box.halo.weak { stroke-width: 4; stroke-dasharray: none; stroke: rgba(0, 0, 0, 0.35); }
.viewer .tag.weak { font-weight: 500; fill: #e6e9ec; }
.viewer .box.ignore { stroke: #d5d8dc; stroke-width: 1.5; stroke-dasharray: 2 4; }
.viewer .box.raw { stroke: #ffffff; stroke-width: 1.2; opacity: 0.75; }
.viewer .box.dim { opacity: 0.18; }
.viewer .tag { font: 600 13px var(--text); fill: #fff; paint-order: stroke; stroke: rgba(0, 0, 0, 0.75); stroke-width: 3px; }
.credit { font-size: 13px; color: var(--on-dark-2); line-height: 1.4; margin-top: 8px; }
.stage .credit { color: var(--ink-3); }

.parts { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--asphalt-line); }
.parts li { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: baseline; padding: 9px 4px; border-bottom: 1px solid var(--asphalt-line); cursor: default; }
.parts li:hover, .parts li.on { background: var(--asphalt-2); }
.parts .idx { font: 600 1.15rem var(--display); color: var(--on-dark-2); }
.parts .name { font-weight: 500; }
.parts .name i { display: inline-block; width: 11px; height: 11px; margin-right: 8px; border-radius: 2px; vertical-align: 0; }
.parts .nums { font-size: 14px; color: var(--on-dark-2); text-align: right; font-variant-numeric: tabular-nums; }
.parts-note { font-size: 14px; color: var(--on-dark-2); margin-top: 12px; }
.parts-note .unseen { color: var(--lane); font-weight: 600; }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .parts-note .unseen { -webkit-text-fill-color: transparent; background-image: linear-gradient(100deg, var(--lane) 44%, #fff6cf 50%, var(--lane) 56%);
    background-repeat: no-repeat; background-size: 250% 100%; background-position: 100% 0;
    -webkit-background-clip: text; background-clip: text; -webkit-box-decoration-break: clone; box-decoration-break: clone;
    animation: unseen-shine 5s ease-in-out infinite; }
}
@keyframes unseen-shine { 0% { background-position: 100% 0; } 30%, 100% { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .parts-note .unseen { animation: none; background: none; -webkit-text-fill-color: currentColor; } }
@media (forced-colors: active) { .parts-note .unseen { -webkit-text-fill-color: currentColor; background: none; } }

.seg { display: inline-flex; border: 1px solid var(--asphalt-line); margin: 0 0 14px; }
.seg button { background: transparent; border: 0; padding: 7px 14px; cursor: pointer; color: var(--on-dark-2); }
.seg button[aria-pressed="true"] { background: var(--lane); color: #17140a; font-weight: 600; }
.stage .seg { border-color: var(--rule); }
.stage .seg button { color: var(--ink-2); }
.stage .seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; margin-top: 40px; border-top: 1px solid var(--asphalt-line); }
.facts div { padding: 14px 16px 0 0; }
.facts b { display: block; font: 600 2.4rem/1 var(--display); font-variant-numeric: tabular-nums; }
.facts span { font-size: 14px; color: var(--on-dark-2); }

/* ---------- lane rail + stages ---------- */
.road { position: relative; padding-left: var(--rail); }
.lane { position: absolute; left: 0; top: 0; bottom: 0; width: var(--rail); }
.lane::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 6px; margin-left: -3px;
  background: repeating-linear-gradient(to bottom, var(--lane) 0 34px, transparent 34px 64px); }
.lane ol { position: sticky; top: 18px; margin: 0; padding: 18px 0; list-style: none; display: grid; gap: 10px; justify-items: center; }
.lane a { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--concrete); border: 2px solid var(--ink);
  font: 600 1.2rem var(--display); text-decoration: none; }
.lane a[aria-current="true"] { background: var(--ink); color: var(--lane); }

.stage { padding: 64px clamp(16px, 4vw, 56px) 56px 12px; border-bottom: 1px solid var(--rule); }
.stage > header { display: grid; grid-template-columns: auto 1fr; column-gap: 18px; align-items: end; margin-bottom: 28px; }
.stage h2 { font-weight: 600; font-size: clamp(2.6rem, 6vw, 4.6rem); text-transform: uppercase; }
.stage .claim { grid-column: 1 / -1; font-size: 1.3rem; line-height: 1.35; font-weight: 500; max-width: 36em; margin: 12px 0 0; }
.stage h3 { font-weight: 600; font-size: 1.7rem; margin: 40px 0 12px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 32px 40px; align-items: start; }
.cols.wide-left { grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); }
figure { margin: 0; }
figcaption { font-size: 14px; color: var(--ink-3); margin-top: 8px; max-width: var(--measure); line-height: 1.45; }
.note { border-left: 4px solid var(--lane); padding: 4px 0 4px 16px; color: var(--ink-2); max-width: var(--measure); }
.plain { margin: 0; padding-left: 1.1em; max-width: var(--measure); }
.plain li { margin-bottom: 0.5em; }

/* bars */
.bars { display: grid; gap: 7px; font-size: 15px; }
.bar { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 12px; align-items: center; }
.bar .bar-label { color: var(--ink-2); overflow-wrap: anywhere; }
.bar .track { position: relative; height: 22px; }
.bar .fill { position: absolute; left: 0; top: 3px; bottom: 3px; background: var(--ink-2); border-radius: 0 4px 4px 0; min-width: 2px; }
.bar .val { position: absolute; top: 0; line-height: 22px; padding-left: 8px; font-variant-numeric: tabular-nums; font-weight: 500; white-space: nowrap; }
.bar.keep .fill { background: var(--good); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--ink-2); margin: 0 0 10px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.legend i.line { height: 0; border-top: 3px solid; border-radius: 0; vertical-align: 4px; width: 18px; }
.legend i.dash { height: 0; border-top: 3px dashed; border-radius: 0; vertical-align: 4px; width: 18px; background: none !important; }

/* tables */
table { border-collapse: collapse; width: 100%; font-size: 15px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 7px 14px 7px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-weight: 600; color: var(--ink-2); }
td.num, th.num { text-align: right; padding-left: 14px; }
td:last-child, th:last-child { padding-right: 0; }
.scroll { overflow: auto; max-height: 420px; }
.scroll-x { overflow-x: auto; }
.try-or { margin: 16px 0 8px; font-size: 14px; color: var(--ink-3); }
.try-more { display: flex; align-items: center; gap: 8px; margin: 14px 0 6px; font-size: 15px; cursor: pointer; }
.try-more input { width: 16px; height: 16px; accent-color: var(--ink); }
#eval-table th:first-child, #eval-table td:first-child { min-width: 300px; }
#eval-table td:not(:first-child) { white-space: nowrap; }
#eval-table th:not(:first-child) { min-width: 64px; }

/* thumbs */
.thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; }
.thumbs button { flex: 0 0 auto; padding: 0; border: 3px solid transparent; background: none; cursor: pointer; line-height: 0; }
.thumbs button[aria-pressed="true"] { border-color: var(--ink); }
.thumbs img { height: 68px; width: auto; max-width: none; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0 0 12px; font-size: 15px; }
.checks label { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }

/* charts */
/* Charts sit on the light paper surface the palette was validated against. */
.chart { position: relative; background: var(--paper); padding: 14px 12px 6px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--rule); stroke-width: 1; }
.chart .axis text { font: 13px var(--text); fill: var(--ink-3); }
.chart .series { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .cross { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .best { stroke: var(--ink); stroke-width: 1; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--paper); font-size: 13px; line-height: 1.4; padding: 7px 10px; border-radius: 4px; white-space: nowrap; transform: translate(12px, -50%); z-index: 3; }
.tip[hidden] { display: none; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); border-top: 2px solid var(--ink); margin: 0 0 14px; }
.stat-row div { padding: 12px 14px 12px 0; border-bottom: 1px solid var(--rule); }
.stat-row b { display: block; font: 600 2.6rem/1 var(--display); font-variant-numeric: tabular-nums; }
.stat-row span { font-size: 14px; color: var(--ink-3); }

/* geometry lab */
.lab { display: grid; grid-template-columns: minmax(0, 448px) minmax(260px, 1fr); gap: 28px; align-items: start; }
.lab canvas { width: 100%; height: auto; background: #727272; display: block; }
.sliders { display: grid; gap: 10px; }
.sliders label { display: grid; grid-template-columns: 96px 1fr 64px; gap: 10px; align-items: center; font-size: 15px; }
.sliders output { font-variant-numeric: tabular-nums; text-align: right; color: var(--ink-2); }
.sliders input[type="range"] { width: 100%; accent-color: var(--ink); }
.matrix { font: 13px/1.5 var(--mono); background: var(--paper); padding: 10px 12px; margin: 14px 0 0; white-space: pre; overflow-x: auto; }
.btn { background: var(--ink); color: var(--paper); border: 0; padding: 8px 14px; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--ink); }

/* architecture */
.arch { display: grid; gap: 8px; }
.arch .row { display: grid; grid-template-columns: 150px 1fr; gap: 12px; align-items: center; font-size: 15px; }
.arch .blk { background: var(--paper); border-left: 5px solid var(--ink); padding: 8px 12px; }
.arch .blk b { font-weight: 600; }
.arch .blk span { color: var(--ink-3); font-size: 14px; margin-left: 8px; }
.formula { font: 15px/1.7 var(--mono); background: var(--paper); padding: 14px 16px; overflow-x: auto; white-space: pre; }

/* auditor */
.trace { background: var(--paper); padding: 22px clamp(14px, 3vw, 28px); }
.trace .q { font-size: 1.2rem; font-weight: 500; margin: 0 0 16px; max-width: 46em; }
.call { border-left: 4px solid var(--ink); background: #fff; margin: 0 0 10px; }
.call summary { cursor: pointer; padding: 9px 12px; font: 14px var(--mono); overflow-wrap: anywhere; list-style-position: inside; }
.call pre { margin: 0; padding: 10px 12px 12px; border-top: 1px solid var(--rule); max-height: 300px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12.5px; line-height: 1.5; }
.call.err { border-left-color: var(--bad); }
.answer { white-space: pre-wrap; margin: 16px 0 14px; max-width: 46em; }
.verdict { font-size: 14px; color: var(--ink-2); border-top: 1px solid var(--rule); padding-top: 10px; display: flex; flex-wrap: wrap; gap: 6px 22px; }
.ok::before { content: "\2713\00a0"; color: var(--good); font-weight: 700; }
.no::before { content: "\2717\00a0"; color: var(--bad); font-weight: 700; }
.replay { background: var(--lane); color: #17140a; font-weight: 600; padding: 8px 14px; display: inline-block; margin: 0 0 16px; font-size: 15px; }

.cmd { background: var(--asphalt); color: var(--on-dark); padding: 14px 16px; overflow-x: auto; font-size: 13.5px; line-height: 1.65; margin: 0 0 14px; }
details.more > summary { cursor: pointer; font-weight: 500; margin: 14px 0 8px; }
footer { padding: 34px clamp(16px, 4vw, 56px) 60px calc(var(--rail) + 12px); font-size: 14px; color: var(--ink-3); }
.missing { color: var(--ink-3); font-style: italic; }

/* ---------- try it: the in-browser detector demo ---------- */
.hero-cta { margin: 0 0 34px; }
.lede + .hero-cta { margin-top: -12px; }
.hero-cta a { display: inline-block; background: var(--lane); color: #17140a; font-weight: 600; padding: 9px 16px; text-decoration: none; }
.hero-cta a:hover { text-decoration: underline; text-decoration-thickness: 2px; }

.try-file { display: inline-block; position: relative; cursor: pointer; }
.try-file input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.try-file:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; }
.try-file.busy { opacity: 0.5; cursor: default; }

.try-view { border: 2px solid transparent; }
.try-view.empty { aspect-ratio: 4 / 3; display: grid; place-items: center; border-style: dashed; border-color: var(--asphalt-line); }
.try-view.dragging { border-style: solid; border-color: var(--lane); }
.try-view.dragging > * { pointer-events: none; }
.try-prompt { margin: 0; padding: 24px; max-width: 22em; text-align: center; color: var(--on-dark-2); font-size: 16px; line-height: 1.45; }
.try-status { margin: 10px 0 0; min-height: 1.5em; font-size: 15px; color: var(--ink-2); }
.try-rule { margin: 16px 0 0; font-size: 15px; color: var(--ink-2); }

.try-samples { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 12px; }
.try-samples button { padding: 0; border: 3px solid transparent; background: none; cursor: pointer; line-height: 0; }
.try-samples button[aria-pressed="true"] { border-color: var(--ink); }
.try-samples button:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.try-samples button:disabled { opacity: 0.5; cursor: default; }
.try-samples img { width: 96px; height: 64px; object-fit: cover; }

/* the hero list's pattern, on the light stage surface */
.stage .parts { border-top-color: var(--rule); }
.stage .parts li { border-bottom-color: var(--rule); }
.stage .parts li:hover, .stage .parts li:focus-visible { background: var(--paper); }
.stage .parts li:focus-visible { outline: 3px solid var(--ink); outline-offset: -3px; }
.stage .parts .idx { color: var(--ink-3); }
.stage .parts .nums { color: var(--ink-2); }

@media (max-width: 900px) {
  :root { --rail: 0px; }
  .lane { display: none; }
  .stage { padding-left: clamp(16px, 4vw, 56px); }
  .hero-grid, .cols.wide-left, .lab { grid-template-columns: minmax(0, 1fr); }
  footer { padding-left: clamp(16px, 4vw, 56px); }
  .topline { flex-direction: column; gap: 10px; }
  .topline nav { gap: 6px 16px; }
  /* wide tables scroll inside themselves instead of widening the page */
  .stage table { display: block; max-width: 100%; overflow-x: auto; }
  .seg { flex-wrap: wrap; }
}
