:root {
  --bg: #050505; --bg-raised: #0c0c0c; --ink: #fafafa; --ink-dim: #a6a6a6;
  --ink-faint: #4a4a4a; --rule: #1f1f1f; --red: #fb2c36; --red-deep: #8f1820;
  --sans: 'Inter', system-ui, sans-serif; --mono: 'JetBrains Mono', monospace;
  --serif: 'Fraunces', serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-family: var(--sans); min-height: 100vh; -webkit-font-smoothing: antialiased; }
body::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse 80% 50% at 50% -5%, rgba(251,44,54,0.06), transparent 60%);
}
nav {
  padding: 20px 32px; display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono); font-size: 11px; color: var(--ink-dim);
  letter-spacing: 0.08em; text-transform: uppercase;
}
nav .brand { color: var(--ink); font-weight: 500; }
nav .brand em { color: var(--red); font-style: normal; font-weight: 500; }
nav .breadcrumb { color: var(--ink-faint); }
nav .breadcrumb span { margin: 0 8px; }
nav a { color: var(--ink-dim); text-decoration: none; }
nav a:hover { color: var(--red); }

.opening { max-width: 720px; margin: 40px auto; padding: 0 32px; position: relative; z-index: 2; }
.chapter {
  font-family: var(--mono); font-size: 11px; color: var(--red);
  letter-spacing: 0.25em; text-transform: uppercase; margin-bottom: 20px;
}
h1 {
  font-weight: 300; font-size: clamp(40px, 6vw, 64px);
  line-height: 0.98; letter-spacing: -0.03em; margin-bottom: 24px;
}
h1 em { font-family: var(--serif); font-style: italic; color: var(--red); font-weight: 300; }
.opening p { font-size: 16px; color: var(--ink-dim); line-height: 1.7; margin-bottom: 14px; }
.opening em { font-style: italic; color: var(--ink); }
.opening code { font-family: var(--mono); font-size: 14px; color: var(--ink); background: #141414; padding: 1px 6px; border-radius: 3px; }

.controls { max-width: 720px; margin: 0 auto 24px; padding: 0 32px; position: relative; z-index: 2; }
.ctrl-row {
  display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap;
  padding: 14px; background: var(--bg-raised); border: 1px solid var(--rule); border-radius: 8px;
}
.ctrl-row label {
  display: flex; flex-direction: column; gap: 5px;
  font-family: var(--mono); font-size: 10px; color: var(--ink-faint);
  letter-spacing: 0.15em; text-transform: uppercase;
  flex: 1; min-width: 140px;
}
.ctrl-row input {
  background: #08080a; border: 1px solid var(--rule); color: var(--ink);
  padding: 9px 11px; border-radius: 4px;
  font-family: var(--mono); font-size: 13px;
  outline: none; transition: border-color 0.2s;
}
.ctrl-row input:focus { border-color: var(--red-deep); }
.ctrl-row button {
  background: var(--red); color: var(--bg); border: none;
  padding: 10px 18px; border-radius: 4px; font-family: var(--mono);
  font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase;
  cursor: pointer; transition: filter 0.2s;
  height: 38px;
}
.ctrl-row button:hover { filter: brightness(1.15); }
.ctrl-hint {
  margin-top: 10px; font-family: var(--mono); font-size: 11px;
  color: var(--ink-faint); letter-spacing: 0.06em;
}

.readout {
  max-width: 720px; margin: 0 auto 40px; padding: 0 32px;
  display: grid; grid-template-columns: 1fr 260px; gap: 16px;
  position: relative; z-index: 2;
}
.panel {
  background: var(--bg-raised); border: 1px solid var(--rule); border-radius: 8px;
  padding: 16px;
}
.panel-label {
  font-family: var(--mono); font-size: 10px; color: var(--red);
  letter-spacing: 0.2em; text-transform: uppercase; margin-bottom: 14px;
}
.metric-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
}
.metric {
  padding: 10px 12px; background: #08080a; border: 1px solid var(--rule);
  border-radius: 6px;
}
.m-k {
  font-family: var(--mono); font-size: 9.5px; color: var(--ink-faint);
  letter-spacing: 0.15em; text-transform: uppercase; margin-bottom: 4px;
}
.m-v {
  font-size: 20px; font-weight: 300; color: var(--ink); letter-spacing: -0.01em;
}
.m-sub {
  font-family: var(--mono); font-size: 10px; color: var(--ink-faint); margin-top: 2px;
}
.wind-display { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.wind-svg { width: 160px; height: 160px; }
.wind-svg line, .wind-svg polygon { transition: all 0.4s ease; }
.wind-meta { width: 100%; font-family: var(--mono); font-size: 11px; }
.wm-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--rule); }
.wm-row:last-child { border-bottom: none; }
.wm-row span:first-child { color: var(--ink-faint); letter-spacing: 0.08em; text-transform: uppercase; }
.wm-row span:last-child { color: var(--ink); }

.notes { max-width: 720px; margin: 0 auto 48px; padding: 0 32px; position: relative; z-index: 2; }
.notes ul { list-style: none; margin-top: 16px; }
.notes li {
  font-size: 14px; color: var(--ink-dim); line-height: 1.6;
  padding-left: 18px; position: relative; margin-bottom: 8px;
}
.notes li::before { content: '—'; position: absolute; left: 0; color: var(--red); }
.notes code { font-family: var(--mono); font-size: 12px; color: var(--ink); background: #141414; padding: 1px 5px; border-radius: 3px; }
.notes em { font-style: italic; color: var(--ink); }

footer {
  max-width: 720px; margin: 32px auto 0; padding: 24px 32px 40px;
  border-top: 1px solid var(--rule);
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 10px; color: var(--ink-faint);
  letter-spacing: 0.08em; text-transform: uppercase;
  position: relative; z-index: 2;
}
footer a { color: var(--ink-faint); text-decoration: none; }
footer a:hover { color: var(--red); }

@media (max-width: 640px) {
  .readout { grid-template-columns: 1fr; }
  .wind-svg { width: 140px; height: 140px; }
}