@font-face {
  font-family: "Newsreader";
  src: url("fonts/Newsreader.ttf") format("truetype");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("fonts/Newsreader-Italic.ttf") format("truetype");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/AtkinsonHyperlegible-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/AtkinsonHyperlegible-Italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/AtkinsonHyperlegible-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/JetBrainsMono.ttf") format("truetype");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #07090f;
  --ink-2: #10151f;
  --glass: rgba(186, 214, 255, 0.06);
  --glass-2: rgba(186, 214, 255, 0.1);
  --line: rgba(186, 214, 255, 0.16);
  --aqua: #3ee0c3;
  --aqua-deep: #149e88;
  --amber: #ffb020;
  --coral: #ff5a6a;
  --text: #e8eef7;
  --muted: #93a0b5;
  --paper: #f3eee3;
  --sys: #7aa2ff;
  --chunk: #3ee0c3;
  --question: #c4a5ff;
  --shadow: 0 30px 60px rgba(0, 0, 0, 0.35);
  --radius: 22px;
  --max: 1120px;
  --font: "Atkinson Hyperlegible", "Segoe UI", sans-serif;
  --display: "Newsreader", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; max-width: 100%; overflow-x: hidden; }
html { background: var(--ink); color: var(--text); }
body {
  font-family: var(--font);
  line-height: 1.5;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(62, 224, 195, 0.09), transparent 55%),
    radial-gradient(900px 500px at -10% 20%, rgba(255, 176, 32, 0.06), transparent 50%),
    linear-gradient(180deg, #0b0f18 0%, var(--ink) 40%, #080b12 100%);
}
img, svg, video { max-width: 100%; }
button, input { font: inherit; color: inherit; }
code { font-family: var(--mono); font-size: 0.9em; }

.skip {
  position: absolute;
  left: 12px; top: -40px;
  background: var(--aqua);
  color: #04241e;
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 20;
}
.skip:focus { top: 12px; }

.top, .hero, .presets, .workspace, .foot {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}
.top {
  display: grid;
  gap: 16px;
  padding: 28px 0 8px;
}
.brand { display: flex; gap: 14px; align-items: center; }
.mark { color: var(--aqua); flex: 0 0 auto; }
.eyebrow {
  margin: 0;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.7rem;
  color: var(--aqua);
}
h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 650;
  font-size: clamp(2.1rem, 6vw, 3.4rem);
  letter-spacing: -0.03em;
  line-height: 1;
}
.lede {
  margin: 0;
  max-width: 38rem;
  color: var(--muted);
  font-size: 1.05rem;
}
.top-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ghost, .action, .preset, .model-chip, .sample-chip {
  border: 1px solid var(--line);
  background: var(--glass);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}
.ghost:hover, .action:hover, .preset:hover, .model-chip:hover, .sample-chip:hover {
  border-color: rgba(62, 224, 195, 0.55);
  transform: translateY(-1px);
}
.action {
  background: var(--aqua);
  color: #04241e;
  border-color: transparent;
  font-weight: 700;
  margin-top: 8px;
}
.action.is-on { background: var(--amber); color: #2a1a00; }

.hero { padding: 12px 0 8px; }
.hero-board {
  display: grid;
  grid-template-columns: auto 1fr 1fr;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(16, 21, 31, 0.9), rgba(7, 9, 15, 0.75));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  animation: rise 700ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
.dial-wrap { position: relative; width: 168px; height: 168px; }
.dial {
  width: 100%; height: 100%;
  border-radius: 50%;
  background: conic-gradient(var(--aqua) 0 0deg, rgba(243, 238, 227, 0.08) 0 360deg);
  mask: radial-gradient(farthest-side, transparent calc(100% - 16px), #000 calc(100% - 15px));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 16px), #000 calc(100% - 15px));
  filter: drop-shadow(0 0 12px rgba(62, 224, 195, 0.3));
  transition: background 80ms linear;
}
.dial-label {
  position: absolute; inset: 0;
  display: grid; place-content: center; text-align: center;
}
.dial-label strong {
  font-family: var(--mono);
  font-size: 1.6rem;
  font-weight: 600;
}
.kicker {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.metrics { display: grid; gap: 10px; align-content: center; }
.metric {
  padding: 8px 4px;
  border-bottom: 1px solid var(--line);
}
.metric:last-child { border-bottom: 0; }
.metric strong, .dial-label strong {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}
.metric strong {
  display: block;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.15;
}
.metric-find strong { color: var(--amber); }
.sub { color: var(--muted); font-size: 0.86rem; }
.per-call {
  display: inline;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "zero" 0, "calt" 0, "liga" 0, "tnum" 1;
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text);
  white-space: nowrap;
}
.curve-card h2 {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0;
}
.curve-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.status {
  margin: 0;
  font-size: 0.8rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--aqua);
}
.status.is-bad { color: var(--coral); border-color: rgba(255, 90, 106, 0.4); }
.curve { width: 100%; height: auto; display: block; overflow: visible; }
.footnote { color: var(--muted); font-size: 0.86rem; margin: 8px 0 0; }
.depth-live { margin-top: 10px; }
.depth-live input[type="range"] { width: 100%; }


.presets {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 18px 0 8px;
}
.preset.is-active, .model-chip.is-active, .sample-chip.is-active {
  background: var(--text);
  color: #0b0f18;
  border-color: transparent;
}

.workspace { display: grid; gap: 16px; padding: 8px 0 48px; }
.panel {
  border: 1px solid var(--line);
  background: var(--glass);
  border-radius: 18px;
  padding: 18px 18px 16px;
}
.panel h2 {
  font-family: var(--display);
  font-size: 1.45rem;
  margin: 0 0 6px;
}
.hint { margin: 0 0 12px; color: var(--muted); }
.model-row, .sample-row { display: flex; flex-wrap: wrap; gap: 8px; }
.model-chip small { display: block; font-size: 0.72rem; opacity: 0.75; }

.sliders { display: grid; gap: 14px; }
.slider { display: grid; gap: 6px; }
.slider span { display: flex; justify-content: space-between; gap: 8px; }
.slider em { font-style: normal; font-family: var(--mono); color: var(--aqua); }
.slider small { color: var(--muted); }
.slider input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(186, 214, 255, 0.12);
  outline: none;
}
.slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--amber);
  border: 2px solid #2a1a00;
  box-shadow: 0 0 0 3px rgba(255, 176, 32, 0.25);
  cursor: pointer;
}

.window-map {
  display: flex;
  height: 42px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0a0d14;
}
.window-map .seg {
  height: 100%;
  min-width: 2px;
  transition: flex-basis 180ms ease;
}
.swatch, .window-map .seg { display: inline-block; }
.swatch { width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }
.sys, .seg.sys { background: var(--sys); }
.chunk, .seg.chunk { background: rgba(62, 224, 195, 0.45); }
.needle, .seg.needle { background: var(--amber); }
.question, .seg.question { background: var(--question); }
.dropped, .seg.dropped { background: repeating-linear-gradient(45deg, #2a3140, #2a3140 4px, #161b24 4px, #161b24 8px); }
.legend { display: flex; flex-wrap: wrap; gap: 10px 16px; list-style: none; padding: 12px 0 0; margin: 0; color: var(--muted); font-size: 0.86rem; }
.legend li { display: flex; align-items: center; }

.compare { display: grid; gap: 14px; margin-top: 12px; }
.compare-col h3 { margin: 0 0 6px; font-size: 0.95rem; }
.compare-col .count { font-family: var(--mono); color: var(--aqua); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip {
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.2;
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(62, 224, 195, 0.12);
  border: 1px solid rgba(62, 224, 195, 0.18);
  white-space: pre;
}
.chip:nth-child(3n) { background: rgba(122, 162, 255, 0.12); border-color: rgba(122, 162, 255, 0.2); }
.chip:nth-child(3n+1) { background: rgba(196, 165, 255, 0.12); border-color: rgba(196, 165, 255, 0.2); }
.chip.is-needle { background: rgba(255, 176, 32, 0.18); border-color: rgba(255, 176, 32, 0.45); }

.claims { display: grid; gap: 8px; }
.claim {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
}
.claim.supported { border-color: rgba(62, 224, 195, 0.5); }
.claim.weak { border-color: rgba(255, 176, 32, 0.5); }
.claim.unsupported { border-color: rgba(255, 90, 106, 0.5); }
.claim b { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; }
.claim.supported b { color: var(--aqua); }
.claim.weak b { color: var(--amber); }
.claim.unsupported b { color: var(--coral); }
.claim p { margin: 4px 0 0; }

.foot {
  padding: 8px 0 48px;
  color: var(--muted);
  font-size: 0.9rem;
}
.foot a { color: var(--aqua); }

dialog {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  max-width: min(720px, 100%);
}
dialog::backdrop { background: rgba(3, 5, 10, 0.72); }
.dialog-card {
  background: #121826;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 22px 16px;
  max-height: min(80vh, 900px);
  overflow: auto;
  box-shadow: var(--shadow);
}
.dialog-card h2 { font-family: var(--display); margin-top: 0; }
.dialog-card h3 { margin-bottom: 0.3rem; }
.dialog-card a { color: var(--aqua); }
.icon-close {
  float: right;
  border: 1px solid var(--line);
  background: var(--glass);
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
}

#titlecard {
  position: fixed; inset: 0;
  background: #07090f;
  z-index: 40;
  display: none;
  place-items: center;
  color: var(--text);
}
#titlecard:not([hidden]) {
  display: grid;
}

@media (max-width: 860px) {
  .hero-board { grid-template-columns: 1fr; }
  .dial-wrap { margin: 0 auto; }
  .top, .hero, .presets, .workspace, .foot { width: min(var(--max), calc(100% - 24px)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
