@font-face {
  font-family: Geist;
  src: url("./geist-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: Geist Mono;
  src: url("./geist-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --night: #090f20;
  --panel: #0d172c;
  --ink: #f9f1dc;
  --muted: #adbdd8;
  --cyan: #83e1f5;
  --yellow: #ffdd40;
  --line: #2b405e;
  --mono: "Geist Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--night); color: var(--ink); font: 16px/1.5 Geist, system-ui, sans-serif; }
a { color: var(--cyan); text-underline-offset: .24em; }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 4px; }

.site-head, main { width: min(1100px, calc(100% - 64px)); margin-inline: auto; }
.site-head { display: flex; min-height: 65px; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.brand, .site-link { display: inline-flex; min-height: 44px; align-items: center; gap: 9px; color: inherit; font-size: 14px; font-weight: 650; text-decoration: none; }
.brand img { display: block; width: 38px; height: auto; }
.site-link { color: var(--cyan); }
.brand:hover, .site-link:hover { text-decoration: underline; }

main { padding-block: clamp(30px, 6vw, 59px) 60px; }
.intro { margin-bottom: clamp(20px, 3vw, 32px); }
h1, h2, p, figure { margin: 0; }
h1 { font-size: clamp(38px, 8.1vw, 91px); font-weight: 760; line-height: .98; letter-spacing: -.074em; }
h1 span { color: var(--cyan); }
.intro p { max-width: 660px; margin-block-start: 16px; color: var(--muted); font-size: clamp(15px, 2vw, 19px); }

.instrument { display: grid; grid-template-columns: 1fr 1.1fr; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.controls { display: flex; min-width: 0; flex-direction: column; justify-content: space-between; padding: clamp(18px, 3.6vw, 40px); }
.eyebrow { color: var(--cyan); font: 630 12px/1.35 var(--mono); letter-spacing: .07em; text-transform: uppercase; }
.density { margin-top: 8px; display: grid; gap: 2px; }
.density output { display: block; color: var(--yellow); font-size: clamp(37px, 4.6vw, 69px); font-weight: 760; line-height: 1.05; letter-spacing: -.065em; font-variant-numeric: tabular-nums; }
.density span { color: var(--muted); font-family: var(--mono); font-size: 13px; }
#context { min-height: 3em; margin-top: 12px; color: var(--ink); }
.dial { margin-top: 23px; }
.dial-label, .dial-scale, .volume-header, .comparison-header { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.dial-label output { color: var(--ink); font: 650 15px/1.3 var(--mono); white-space: nowrap; }
.dial input { width: 100%; min-height: 30px; margin: 4px 0 0; accent-color: var(--cyan); cursor: pointer; }
.dial-scale { color: var(--muted); font: 11px/1.3 var(--mono); }
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.presets button { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 5px; background: transparent; color: var(--ink); font: 650 13px/1.25 Geist, system-ui, sans-serif; cursor: pointer; }
.presets button:hover, .presets button[aria-pressed="true"] { color: var(--cyan); border-color: var(--cyan); background: #122942; }

.volume { position: relative; display: grid; grid-template-rows: auto 1fr auto; min-width: 0; min-height: 356px; overflow: hidden; border-left: 1px solid var(--line); background: radial-gradient(ellipse at 50% 55%, #132e50, #0a1428 70%); }
.volume::before { position: absolute; inset: 0; background-image: linear-gradient(#a4cafa09 1px, transparent 1px), linear-gradient(90deg, #a4cafa09 1px, transparent 1px); background-size: 28px 28px; pointer-events: none; content: ""; }
.volume-header, .volume figcaption { position: relative; padding-inline: 22px; }
.volume-header { padding-top: 15px; color: var(--muted); font: 600 12px/1.35 var(--mono); }
.volume canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.volume figcaption { grid-row: 3; padding-block: 6px 13px; color: var(--muted); font-size: 12px; }

.comparison { margin-top: 31px; }
.comparison-header h2 { font-size: clamp(21px, 3.2vw, 31px); letter-spacing: -.04em; }
.comparison-header .eyebrow { color: var(--muted); text-align: right; }
.references { list-style: none; margin: 10px 0 0; padding: 0; border-block: 1px solid var(--line); }
.references li { display: grid; grid-template-columns: minmax(165px, 1.3fr) 4fr minmax(128px, .9fr); align-items: center; gap: 14px; min-height: 43px; }
.references li + li { border-top: 1px solid var(--line); }
.references strong { font: 650 13px/1.3 var(--mono); text-align: right; }
.references meter { display: block; width: 100%; height: 8px; }
.references meter::-webkit-meter-bar { border: 0; border-radius: 2px; background: #182942; }
.references meter::-webkit-meter-optimum-value { background: #5d8eac; border-radius: 2px; }
.references meter::-moz-meter-bar { background: #5d8eac; border-radius: 2px; }
.references .current strong { color: var(--yellow); }
.references .current meter::-webkit-meter-optimum-value { background: var(--cyan); }
.references .current meter::-moz-meter-bar { background: var(--cyan); }
.comparison-note, .notes p, .notes li { color: var(--muted); }
.comparison-note { margin-top: 9px; font-size: 13px; }
.notes { margin-top: 21px; border-top: 1px solid var(--line); }
.notes summary { padding-block: 12px; font-weight: 700; cursor: pointer; }
.notes p { max-width: 78ch; margin-bottom: 10px; }
.notes li { margin-block: 3px; }
.noscript { margin-bottom: 14px; color: var(--yellow); }

@media (max-width: 740px) {
  .site-head, main { width: calc(100% - 32px); }
  .instrument { grid-template-columns: 1fr; }
  .volume { min-height: clamp(275px, 60vw, 370px); border-top: 1px solid var(--line); border-left: 0; }
  #context { min-height: 0; }
  .references li { grid-template-columns: minmax(0, 1.75fr) minmax(44px, 1fr) minmax(84px, 1fr); gap: 8px; font-size: 13px; }
  .references strong { font-size: 12px; }
}

@media (max-width: 385px) {
  .site-link { font-size: 12px; }
  .brand { font-size: 13px; }
  .presets { gap: 6px; }
  .presets button { padding-inline: 7px; font-size: 12px; }
  .comparison-header .eyebrow { font-size: 10px; }
}
