/* Halfwave. A white tool page: serif start screen over a half-wave of dashes, a mixed-type list,
   a grotesk project page. Orange is attention, indigo is adoption; everything else is grey.
   Light theme only, by choice (D031). */

@font-face { font-family: "Newsreader"; src: url("/static/fonts/newsreader.woff2") format("woff2");
  font-weight: 400 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("/static/fonts/instrument-sans.woff2") format("woff2");
  font-weight: 400 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url("/static/fonts/hanken-grotesk.woff2") format("woff2");
  font-weight: 400 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/static/fonts/geist-mono.woff2") format("woff2");
  font-weight: 400 500; font-style: normal; font-display: swap; }

:root {
  --bg: #ffffff;
  --ink: #16161a;
  --ink-2: #50505a;
  --ink-3: #6f6f79;
  --line: #e6e6ea;
  --line-2: #d3d3d9;
  --wash: #f6f6f8;
  --att: #d9622b;
  --ad: #4f5bd5;
  --att-wash: #fbefe8;
  --ad-wash: #eeeffb;
  --bar: #c6c6ce;
  --serif: "Newsreader", Georgia, serif;
  --f-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --f-display: var(--serif);
  --f-text: var(--serif);
  --f-num: var(--serif);
  --display-weight: 400;
  --display-track: -0.015em;
  --text-size: 17px;
  color-scheme: light;
}
body[data-font="grotesk"] {
  --f-display: "Instrument Sans", system-ui, sans-serif;
  --f-text: "Instrument Sans", system-ui, sans-serif;
  --f-num: "Instrument Sans", system-ui, sans-serif;
  --display-weight: 500;
  --display-track: -0.025em;
  --text-size: 16px;
}
body[data-font="mixed"] {
  --f-display: "Hanken Grotesk", system-ui, sans-serif;
  --f-text: "Hanken Grotesk", system-ui, sans-serif;
  --f-num: var(--serif);
  --display-weight: 500;
  --display-track: -0.025em;
  --text-size: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--f-text); font-size: var(--text-size); line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bg); }
[hidden] { display: none !important; }
.wrap { max-width: 1120px; margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ad); outline-offset: 2px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.muted { color: var(--ink-3); }

/* ---------- header ---------- */
.head { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; border-bottom: 1px solid transparent; transition: background .25s, border-color .25s; }
.head.solid { background: rgba(255,255,255,.94); border-bottom-color: var(--line); -webkit-backdrop-filter: saturate(1.2) blur(8px); backdrop-filter: saturate(1.2) blur(8px); }
.head .wrap { display: flex; align-items: center; gap: 20px; height: 60px; }
.brand { display: flex; align-items: center; gap: 9px; font-family: var(--serif); font-size: 21px; letter-spacing: -0.015em; text-decoration: none; }
.brand svg { display: block; }
.head .spacer { flex: 1; }
.stamp { white-space: nowrap; }
.search { position: relative; margin: 0; }
.search input { font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.04em; width: 210px; height: 34px; padding: 0 30px 0 12px;
  border: 1px solid var(--line-2); background: var(--bg); color: var(--ink); border-radius: 0; -webkit-appearance: none; appearance: none; }
.search input::placeholder { color: var(--ink-3); }
.search kbd { position: absolute; right: 8px; top: 8px; font-family: var(--f-mono); font-size: 11px; color: var(--ink-3); border: 1px solid var(--line-2); padding: 0 5px; line-height: 16px; }
.nav { display: flex; gap: 18px; }
.nav a { font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); text-decoration: none; }
.nav a:hover { color: var(--ink); }

/* ---------- start screen ---------- */
.hero { position: relative; overflow: hidden; margin-top: -60px; padding-top: 60px; transition: opacity .28s ease; }
.hero.leaving { opacity: 0; }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.glow { position: absolute; inset: -10% -5% auto; height: 120%; pointer-events: none; filter: blur(36px); opacity: .28;
  background:
    radial-gradient(42% 48% at 50% 0%, rgba(217, 98, 43, .50), transparent 72%),
    radial-gradient(34% 46% at 6% 36%, rgba(79, 91, 213, .30), transparent 72%),
    radial-gradient(34% 46% at 94% 36%, rgba(79, 91, 213, .30), transparent 72%); }
.hero-inner { position: relative; text-align: center; padding-block: 104px 56px; }
.hero h1 { font-family: var(--f-display); font-weight: var(--display-weight); letter-spacing: var(--display-track);
  font-size: clamp(31px, 4vw, 52px); line-height: 1.08; margin: 0 auto; max-width: 15em; text-wrap: balance; }
.hero .sub { margin: 18px auto 0; color: var(--ink-2); font-size: calc(var(--text-size) + 1px); max-width: 34em; text-wrap: balance; }
.tiles { margin: 52px auto 0; max-width: 1040px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line-2); border: 1px solid var(--line-2); text-align: left; }
.tile { background: var(--bg); padding: 20px 20px 22px; display: grid; gap: 14px; align-content: start; transition: background .15s; min-width: 0; text-decoration: none; }
.tile:hover { background: var(--wash); }
.tile .row { display: flex; align-items: flex-end; justify-content: space-between; }
.tile .count { font-family: var(--f-num); font-size: 46px; line-height: .9; letter-spacing: -0.02em; }
.tile .arrow { font-size: 18px; color: var(--ink-2); transition: transform .15s; }
.tile:hover .arrow { transform: translate(2px, -2px); color: var(--ink); }
.tile .names { font-size: 14px; color: var(--ink-2); line-height: 1.4; }
.tally { margin-top: 22px; font-size: 14px; color: var(--ink-2); display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.tally a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.tally a:hover { text-decoration-color: var(--ink); }

/* ---------- list ---------- */
.entering { animation: rise .35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.list-head { padding-top: 40px; display: grid; gap: 14px; }
.list-head h2, .proj h1, .faq h2, .sec h3, .err h1 { font-family: var(--f-display); font-weight: var(--display-weight); letter-spacing: var(--display-track); margin: 0; }
.list-head h2 { font-size: clamp(28px, 3vw, 38px); line-height: 1.1; }
.held { font-size: 15px; color: var(--ink-2); display: grid; gap: 4px; }
.controls { display: flex; flex-wrap: wrap; gap: 10px 28px; padding: 14px 0; border-block: 1px solid var(--line); margin-top: 18px; }
.ctl { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ctl .opts { display: flex; flex-wrap: wrap; gap: 4px 0; }
.ctl .opts a, .ctl .opts button { font: 12px/1.5 var(--f-mono); letter-spacing: .04em; color: var(--ink-3); padding: 2px 0;
  text-decoration: none; background: none; border: 0; cursor: pointer; }
.ctl .opts > * + *::before { content: "·"; display: inline-block; color: var(--line-2); margin: 0 9px; }
.ctl .opts [aria-current="true"], .ctl .opts [aria-pressed="true"] { color: var(--ink); text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.ctl .opts a:hover, .ctl .opts button:hover { color: var(--ink); }
.rows { margin-top: 6px; }
.grid-row { display: grid; grid-template-columns: minmax(0, 1.25fr) 92px minmax(0, 1.05fr) minmax(0, 1.5fr) minmax(0, 1.15fr); gap: 20px; align-items: start; }
.colhead { padding: 14px 0 10px; border-bottom: 1px solid var(--line); }
.colhead .mono { font-size: 10.5px; }
.prow { padding: 18px 0; border-bottom: 1px solid var(--line); transition: background .15s; text-decoration: none; }
.prow:hover { background: linear-gradient(90deg, transparent, var(--wash) 8%, var(--wash) 92%, transparent); }
.c-name { min-width: 0; }
.pname { font-family: var(--f-display); font-size: 21px; font-weight: var(--display-weight); letter-spacing: var(--display-track); line-height: 1.15; }
.prow .handle { margin-top: 3px; font-family: var(--f-mono); font-size: 11.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.badge { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .03em; color: var(--ink-2); border: 1px solid var(--line-2); padding: 1px 6px; white-space: nowrap; }
.badge.ctrl { border-color: var(--ink-2); color: var(--ink); }
.big { font-family: var(--f-num); font-size: 26px; line-height: 1; letter-spacing: -0.01em; }
.unit { font-family: var(--f-mono); font-size: 10.5px; color: var(--ink-3); letter-spacing: .06em; margin-top: 6px; }
.metric { display: grid; grid-template-columns: 96px 1fr; gap: 4px 12px; align-items: center; }
.metric + .metric { margin-top: 10px; }
.metric svg { display: block; }
.mval { font-size: 15px; line-height: 1.25; font-variant-numeric: tabular-nums; }
.mval .lbl { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .08em; color: var(--ink-3); text-transform: uppercase; margin-right: 6px; }
.delta { white-space: nowrap; font-variant-numeric: tabular-nums; }
.delta .tri { font-size: .78em; margin-right: 2px; }
.delta.att .tri { color: var(--att); }
.delta.ad .tri { color: var(--ad); }
.weak { color: var(--ink-3); }
.delta.weak .tri { color: var(--ink-3); }
.chips { display: grid; gap: 8px; justify-items: start; }
.chip { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; line-height: 1.25; padding: 4px 9px 4px 8px; border: 1px solid var(--line-2); background: var(--bg); }
.chip .px { font-family: var(--f-mono); font-size: 10px; letter-spacing: .08em; color: var(--ink-3); text-transform: uppercase; }
.chip .dots { display: inline-flex; gap: 3px; }
.chip .d { width: 7px; height: 7px; border-radius: 50%; }
.chip.aw { background: var(--att-wash); border-color: #f0c9b4; }
.chip.dw { background: var(--ad-wash); border-color: #c9cdf2; }
.chip.aw .a, .chip.br .a { background: var(--att); }
.chip.aw .b, .chip.bf .b { border: 1.5px solid var(--ad); }
.chip.dw .a, .chip.bf .a { border: 1.5px solid var(--att); }
.chip.dw .b, .chip.br .b { background: var(--ad); }
.chip.nd .d { background: #b9b9c2; }
.chip.id .d { border: 1.5px solid #9a9aa4; }
.chip.nd, .chip.id { color: var(--ink-2); }
.chip.id { border-style: dashed; }
.none { font-size: 14px; color: var(--ink-3); }
.empty { padding: 40px 0; color: var(--ink-2); }

/* ---------- project ---------- */
.proj { padding-top: 34px; }
.back { font-family: var(--f-mono); font-size: 12px; color: var(--ink-2); letter-spacing: .04em; text-decoration: none; }
.back:hover { color: var(--ink); }
.proj .eyebrow { margin-top: 26px; }
.proj h1 { font-size: clamp(36px, 5vw, 60px); line-height: 1.02; margin-top: 10px; }
.links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 14px; font-size: 15px; }
.links a, .err a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.links a:hover, .err a:hover { text-decoration-color: var(--ink); }
.chiprow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 34px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat { padding: 22px 20px 22px 0; display: grid; gap: 10px; align-content: start; min-width: 0; }
.stat + .stat { border-left: 1px solid var(--line); padding-left: 20px; }
.stat .v { font-family: var(--f-num); font-size: clamp(36px, 4.4vw, 54px); line-height: .95; letter-spacing: -0.02em; display: flex; align-items: flex-start; gap: 3px; }
.stat .v sup { font-family: var(--f-mono); font-size: 13px; letter-spacing: 0; color: var(--ink-2); margin-top: 6px; }
.stat .sd { font-size: 14px; color: var(--ink-2); }
.stat .key { display: flex; align-items: center; gap: 7px; }
.key-line { width: 14px; height: 2px; display: inline-block; }
.key-line.att { background: var(--att); }
.key-line.ad { background: var(--ad); }
.sec { margin-top: 52px; }
.sec h3 { font-size: 28px; line-height: 1.15; }
.sec .note { font-size: 15px; color: var(--ink-2); margin-top: 6px; max-width: 46em; }
.chart-ctl { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 18px; padding-block: 12px; border-block: 1px solid var(--line); }
.chart-ctl:empty { display: none; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 16px; font-size: 14px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend .miss { width: 3px; height: 9px; background: #9a9aa4; display: inline-block; }
.chart { position: relative; margin-top: 8px; touch-action: pan-y; min-height: 260px; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart text { font-family: var(--f-mono); font-size: 10.5px; fill: var(--ink-3); }
.tip { position: absolute; top: 0; pointer-events: none; background: var(--bg); border: 1px solid var(--line-2); padding: 9px 11px; min-width: 170px; font-size: 13px; box-shadow: 0 6px 24px rgba(22,22,26,.07); }
.tip .t-date { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .08em; color: var(--ink-3); text-transform: uppercase; margin-bottom: 6px; }
.tip .t-row { display: grid; grid-template-columns: 14px 1fr auto; gap: 8px; align-items: center; }
.tip .t-row + .t-row { margin-top: 4px; }
.tip .t-row b { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.tip .t-row span { color: var(--ink-2); }
.hist { display: grid; gap: 10px; margin-top: 18px; }
.hist-row { display: grid; grid-template-columns: 70px 1fr; gap: 12px; align-items: center; }
.ticks { display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); gap: 3px; max-width: 560px; }
.ticks i, .hist-legend i { display: block; background: var(--line); }
.ticks i { height: 18px; }
.ticks .aw, .hist-legend .aw { background: var(--att); }
.ticks .dw, .hist-legend .dw { background: var(--ad); }
.ticks .br, .hist-legend .br { background: var(--ink); }
.ticks .bf, .hist-legend .bf { background: var(--ink-3); }
.ticks .id, .hist-legend .id { background: repeating-linear-gradient(135deg, var(--line-2) 0 2px, transparent 2px 5px); }
.hist-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink-2); margin-top: 10px; }
.hist-legend span { display: inline-flex; align-items: center; gap: 6px; }
.hist-legend i { width: 10px; height: 10px; }
.acts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; margin-top: 20px; }
.act .big { font-size: 30px; margin-top: 6px; }
.act svg { display: block; width: 100%; margin-top: 10px; }
.act rect { fill: var(--bar); }
.act rect.last { fill: var(--ink-2); }
.act rect:hover { fill: var(--ink); }
.notes { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 56px; }
.notes p { margin: 8px 0 0; max-width: 34em; color: var(--ink-2); }
.notes ul { margin: 8px 0 0; padding-left: 18px; color: var(--ink-2); }
.notes li + li { margin-top: 4px; }

/* ---------- error ---------- */
.err { padding-block: 96px 40px; }
.err h1 { font-size: clamp(32px, 4vw, 48px); margin-top: 10px; }
.err p { color: var(--ink-2); max-width: 34em; }

/* ---------- questions + footer ---------- */
.faq { display: grid; grid-template-columns: 1fr 1.6fr; gap: 40px; margin-top: 88px; padding-top: 40px; border-top: 1px solid var(--line); scroll-margin-top: 80px; }
.faq h2 { font-size: clamp(28px, 3vw, 38px); line-height: 1.1; margin-top: 10px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 20px; padding: 16px 0; font-size: calc(var(--text-size) + 2px); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--f-mono); color: var(--ink-2); }
.faq details[open] summary::after { content: "×"; }
.faq details p { margin: 0 0 18px; color: var(--ink-2); max-width: 36em; }
.foot { margin-top: 64px; padding-block: 20px 28px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.foot a { color: var(--ink-2); }

@media (max-width: 900px) {
  .grid-row { grid-template-columns: minmax(0, 1fr) 80px minmax(0, 1fr); }
  .grid-row .c-ad, .grid-row .c-read { grid-column: 1 / -1; }
  .colhead .c-ad, .colhead .c-read { display: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-left: 0; padding-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .acts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stamp, .nav { display: none; }
}
@media (max-width: 640px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .tile { padding: 16px; }
  .tile .count { font-size: 38px; }
  .hero-inner { padding-block: 72px 40px; }
  .grid-row { grid-template-columns: minmax(0, 1fr) 72px; gap: 14px; }
  .grid-row .c-att { grid-column: 1 / -1; }
  .colhead { display: none; }
  .search input { width: 150px; }
  .search kbd { display: none; }
  .notes, .faq { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 400px) {
  .head .wrap { gap: 12px; }
  .search input { width: 132px; }
}
@media (prefers-reduced-motion: reduce) {
  .entering { animation: none; }
  .hero, .tile .arrow, .head { transition: none; }
}
