@font-face { font-family: 'Geist'; src: url('/assets/fonts/geist-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Geist'; src: url('/assets/fonts/geist-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('/assets/fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('/assets/fonts/jetbrains-mono-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }

/* Shape rule: containers, inputs and bar buttons use --radius (8px); legend chips and the floating Ko-fi button are pills. */
:root {
  color-scheme: light dark;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #111827;
  --muted: #4b5563;
  --line: #d6dae1;
  --accent: #0e7490;
  --accent-fill: #06b6d4;
  --band-all: rgba(6, 182, 212, 0.14);
  --band-mid: rgba(6, 182, 212, 0.32);
  --model: #9ca3af;
  --term-bg: #0b1120;
  --term-text: #e2e8f0;
  --term-line: #1f2a44;
  --radius: 8px;
  --sans: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120;
    --surface: #111a2e;
    --text: #e5e7eb;
    --muted: #94a3b8;
    --line: #1f2a44;
    --accent: #22d3ee;
    --band-all: rgba(6, 182, 212, 0.16);
    --band-mid: rgba(6, 182, 212, 0.36);
    --model: #64748b;
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--sans); }
a { color: var(--accent); }
.wrap { width: min(100% - 32px, 960px); margin-inline: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 14px max(16px, calc((100% - 960px) / 2)); border-bottom: 1px solid var(--line); }
.brand { font: 700 1.1rem var(--mono); color: var(--text); text-decoration: none; }
.search { display: flex; gap: 8px; flex: 1 1 260px; }
.search input { flex: 1; min-width: 0; font: inherit; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.search input::placeholder { color: var(--muted); }
.search button, .copy { font: 600 0.9rem var(--sans); padding: 8px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.help-link { font-size: 0.9rem; }
.search button:active, .copy:active, .kofi:active, .legend-item:active { transform: translateY(1px); }
input:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent-fill); outline-offset: 2px; }

.place { font-size: clamp(1.5rem, 4vw, 2.1rem); line-height: 1.15; letter-spacing: -0.01em; margin: 28px 0 16px; }

.terminal { background: var(--term-bg); color: var(--term-text); border: 1px solid var(--term-line); border-radius: var(--radius); overflow: hidden; }
.terminal-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--term-line); font: 0.85rem var(--mono); }
.terminal-bar code { overflow-x: auto; white-space: nowrap; }
.terminal .copy { background: transparent; color: var(--term-text); border-color: var(--term-line); }
.terminal-body { margin: 0; padding: 14px 16px; overflow-x: auto; font: 13px/1.35 var(--mono); }

.chart, .try { margin-top: 40px; }
h2 { font-size: 1.2rem; margin: 0 0 6px; }
.note { color: var(--muted); margin: 0 0 12px; max-width: 65ch; }

.fan { width: 100%; height: auto; display: block; }
.fan .grid { stroke: var(--line); stroke-width: 1; }
.fan .tick { fill: var(--muted); font: 11px var(--mono); }
.fan .band-all { fill: var(--band-all); }
.fan .band-mid { fill: var(--band-mid); }
.fan .model { fill: none; stroke: var(--model); stroke-width: 1; opacity: 0.55; }
.fan .median { fill: none; stroke: var(--accent-fill); stroke-width: 2.5; }
.fan.has-active .model { opacity: 0.15; }
.fan .model.is-active { stroke: var(--text); stroke-width: 2; opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .fan .model { transition: opacity 0.2s ease, stroke-width 0.2s ease; }
}

.legend { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.legend-item { font: 0.85rem var(--mono); padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.legend-item[aria-pressed='true'] { border-color: var(--accent-fill); }
.attrib { font-size: 0.85rem; color: var(--muted); }

.try ul { padding-left: 1.1rem; }
.try code { font-family: var(--mono); font-size: 0.9rem; overflow-wrap: anywhere; }

.foot { margin-top: 56px; padding-block: 24px 96px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }

.kofi { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px 10px 12px; border-radius: 999px; border: 0; background: var(--accent-fill); color: #082f38; font: 600 0.92rem var(--sans); cursor: pointer; box-shadow: 0 6px 20px rgba(6, 182, 212, 0.25); }
.kofi img { display: block; }
.kofi-panel { position: fixed; right: max(12px, env(safe-area-inset-right)); bottom: calc(max(16px, env(safe-area-inset-bottom)) + 56px); width: min(380px, calc(100vw - 24px)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; display: grid; gap: 8px; }
.kofi-panel[hidden] { display: none; }
.kofi-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.kofi-close { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--bg); color: var(--text); cursor: pointer; }
.kofi-panel iframe { border: 0; width: 100%; height: min(600px, calc(100vh - 180px)); height: min(600px, calc(100dvh - 180px)); border-radius: var(--radius); background: #f9f9f9; }
.kofi-note { margin: 0; font-size: 0.78rem; color: var(--muted); }

@media (max-width: 520px) {
  .terminal-body { font-size: 11px; }
  .kofi span { font-size: 0.85rem; }
  .fan { overflow: visible; }
  .fan .tick { font-size: 22px; }
}

.hood { margin-top: 36px; }
.hood ol, .hood ul { padding-left: 1.2rem; max-width: 75ch; }
.hood li { margin: 6px 0; }
.hood code { font-family: var(--mono); font-size: 0.9em; overflow-wrap: anywhere; }
.table-wrap { overflow-x: auto; }
.hood table { border-collapse: collapse; min-width: 100%; font-size: 0.95rem; }
.hood th, .hood td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
