/* Wave Bench site: hub, player, stats, prompt. Typography follows evgenyosipchuk.com
   (Newsreader + JetBrains Mono), on a dark stage because every build draws on one.
   No inline styles anywhere: the page CSP is style-src 'self'. */

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/fonts/Newsreader-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 400 600;
  font-display: swap;
  src: url("/fonts/Newsreader-Italic-latin.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/fonts/JetBrainsMono-latin.woff2") format("woff2");
}

:root {
  --bg: oklch(16% 0.012 240);
  --bg-raised: oklch(20% 0.014 240);
  --bg-sunken: oklch(13% 0.01 240);
  --fg: oklch(94% 0.008 80);
  --fg-muted: oklch(80% 0.01 80);
  --fg-subtle: oklch(66% 0.012 80);
  --fg-faint: oklch(48% 0.01 80);
  --rule: oklch(30% 0.012 240);
  --rule-strong: oklch(40% 0.014 240);
  --accent: oklch(74% 0.1 175);
  --accent-tint: oklch(74% 0.1 175 / 0.14);
  --bar: oklch(70% 0.09 200);
  --font-serif: "Newsreader", Charter, Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 10px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---------- header / footer ---------- */

.site-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0;
  border-bottom: 1px solid var(--rule);
}
.brand {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.site-nav { display: flex; gap: 20px; font-family: var(--font-mono); font-size: 13px; }
.site-nav a { color: var(--fg-subtle); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--fg); }
.site-nav a[aria-current] { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 6px; }

.site-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 64px;
  padding: 20px 0 32px;
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-faint);
}
.site-foot a { color: var(--fg-subtle); }

/* ---------- hero ---------- */

.hero { padding: 56px 0 36px; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}
.hero .eyebrow { margin-bottom: 20px; }
h1 {
  font-size: clamp(34px, 6vw, 56px);
  line-height: 1.05;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
  text-wrap: balance;
}
.dek {
  max-width: 660px;
  margin: 0;
  color: var(--fg-muted);
  font-size: 19px;
  text-wrap: pretty;
}
h2 { font-weight: 500; letter-spacing: -0.01em; }

/* ---------- cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.card {
  display: flex;
  flex-direction: column;
  background: var(--bg-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s;
}
.card:hover { border-color: var(--rule-strong); }
.card-shot { display: block; aspect-ratio: 16 / 10; background: var(--bg-sunken); overflow: hidden; }
.card-shot img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.card:hover .card-shot img { transform: scale(1.02); }
.card-noimg { width: 100%; height: 100%; }
.card-body { display: flex; flex-direction: column; flex: 1; padding: 20px 22px 22px; }
.card-title { font-size: 28px; line-height: 1.15; margin: 8px 0 2px; }
.card-title a { text-decoration: none; }
.card-title a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.card-app { margin: 0 0 12px; font-style: italic; color: var(--fg-muted); }
.card-solver { margin: 0 0 6px; font-family: var(--font-mono); font-size: 12px; line-height: 1.5; color: var(--fg-subtle); }
.card-notes { margin: 0 0 16px; font-size: 16px; line-height: 1.5; color: var(--fg-subtle); }
.card-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: auto 0 18px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
}
.card-stats dt { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-faint); }
.card-stats dd { margin: 2px 0 0; font-family: var(--font-mono); font-size: 14px; color: var(--fg); font-variant-numeric: tabular-nums; }
.run {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 13px;
  text-decoration: none;
  color: var(--bg);
  background: var(--accent);
  padding: 9px 14px;
  border-radius: 7px;
}
.run:hover { filter: brightness(1.08); }
.more { margin: 32px 0 0; font-family: var(--font-mono); font-size: 13px; }
.more a { color: var(--accent); text-decoration: none; }
.more a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- player ---------- */

body.player { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: #05080c; }
.bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 14px;
  height: 44px;
  background: var(--bg-sunken);
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 12px;
}
.bar .brand { font-size: 12px; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.tabs a {
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: 6px;
  color: var(--fg-subtle);
  text-decoration: none;
  white-space: nowrap;
}
.tabs a:hover { color: var(--fg); background: var(--bg-raised); }
.tabs a[aria-current] { color: var(--fg); background: var(--accent-tint); box-shadow: inset 0 0 0 1px var(--accent); }
.bar-meta { margin-left: auto; color: var(--fg-faint); white-space: nowrap; }
.bar-link { color: var(--fg-subtle); text-decoration: none; white-space: nowrap; }
.bar-link:hover { color: var(--fg); }
.stage { flex: 1; width: 100%; border: 0; display: block; background: #05080c; }

/* ---------- stats ---------- */

.charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.chart {
  margin: 0;
  padding: 18px 20px 14px;
  background: var(--bg-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.chart figcaption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin-bottom: 12px; }
.chart figcaption b { font-weight: 500; font-size: 19px; }
.chart figcaption span { font-family: var(--font-mono); font-size: 11px; color: var(--fg-faint); }
.bar-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 76px;
  align-items: center;
  gap: 12px;
  padding: 5px 0;
  font-family: var(--font-mono);
  font-size: 12px;
}
.bar-label { color: var(--fg-muted); white-space: nowrap; }
.bar-track { display: block; width: 100%; height: 12px; overflow: visible; }
.bar-track rect { fill: var(--bar); }
.bar-row:hover .bar-track rect { fill: var(--accent); }
.bar-value { text-align: right; color: var(--fg); font-variant-numeric: tabular-nums; }

.table-wrap, .notes { margin-top: 56px; }
.table-wrap h2, .notes h2 { font-size: 26px; margin: 0 0 16px; }
.scroll { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 12.5px; font-variant-numeric: tabular-nums; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: top; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
thead th { color: var(--fg); font-weight: 600; background: var(--bg-raised); white-space: nowrap; }
thead th a { text-decoration: none; }
thead th a:hover { text-decoration: underline; }
tbody th { color: var(--fg-subtle); font-weight: 400; white-space: nowrap; }
td { color: var(--fg-muted); min-width: 150px; }

.notes ul { margin: 0 0 40px; padding-left: 20px; color: var(--fg-muted); max-width: 760px; }
.notes-p { margin: 0 0 14px; color: var(--fg-muted); max-width: 760px; }
.notes strong, .prose strong { color: var(--fg); font-weight: 600; }
.notes code { font-family: var(--font-mono); font-size: 0.8em; color: var(--fg); }
.notes li { margin-bottom: 8px; }

/* ---------- prompt ---------- */

.prose { max-width: 700px; color: var(--fg-muted); }
.prose h2 { font-size: 26px; color: var(--fg); margin: 48px 0 12px; }
.prose h3 { font-size: 21px; color: var(--fg); margin: 32px 0 8px; }
.prose p { margin: 0 0 14px; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 22px; }
.prose li { margin-bottom: 2px; }
.prose strong { color: var(--fg); font-weight: 600; }

/* ---------- small screens ---------- */

@media (max-width: 820px) {
  .cards, .charts { grid-template-columns: 1fr; }
  .bar-meta { display: none; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .site-head { flex-wrap: wrap; gap: 10px 16px; }
  .hero { padding: 36px 0 28px; }
  .site-nav { gap: 14px; }
  .card-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bar { gap: 10px; padding: 0 10px; }
  .bar .brand { display: none; }
  .bar-link[target] { display: none; }
  .bar-row { grid-template-columns: 78px minmax(0, 1fr) 64px; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .card-shot img { transition: none; }
}
