/* SPDX-License-Identifier: AGPL-3.0-or-later
   Copyright (C) 2026 Sean Snaider

   bellydsp.com: the app's look (docs/ui/amp-ui-handoff/UI_HANDOFF.md, "Design tokens"). Dark, 1px
   hairlines, Geist, and one accent: emerald means active, on, or correct, never decoration. */

@font-face { font-family: "Geist"; src: url("../fonts/Geist-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist"; src: url("../fonts/Geist-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist"; src: url("../fonts/Geist-SemiBold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  --bg: #0b0c0c;
  --surface: #111313;
  --line: #1e2221;
  --line-2: #2a2f2d;
  --ink: #e6ebe9;
  --ink-dim: #8a938f;      /* 6.4:1 on --bg: fine for body text */
  --ink-faint: #525a57;    /* 2.7:1: decoration and hairline-ish labels only, never content */
  --accent: #34d399;
  --accent-dim: rgba(52, 211, 153, 0.14);
  --radius: 10px;
  --gutter: 16px;
  --max: 1120px;
  color-scheme: dark;
}
@media (min-width: 720px) { :root { --gutter: 32px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 "Geist", Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink-dim); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
code, kbd, pre { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.875em; }
code { background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; overflow-wrap: anywhere; }
pre { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; overflow-x: auto; margin: 12px 0; }
pre code { background: none; border: 0; padding: 0; }
.num { font-variant-numeric: tabular-nums; }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 6px; z-index: 10; }
.skip:focus { left: 8px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ---- Top bar, like the app's ---------------------------------------------------------------- */
.top { border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 24px; min-height: 56px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; text-decoration: none; color: var(--ink); }
.brand::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.nav { display: flex; gap: 4px 20px; margin-left: auto; flex-wrap: wrap; font-size: 14px; }
.nav a { color: var(--ink-dim); text-decoration: none; padding: 16px 0 14px; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
@media (max-width: 479px) {
  .top .wrap { gap: 0 16px; }
  .nav { margin-left: 0; width: 100%; gap: 0 18px; }
  .nav a { padding: 6px 0 10px; }
}

/* ---- Type and sections ------------------------------------------------------------------------ */
h1, h2, h3, h4, h5 { font-weight: 600; line-height: 1.2; margin: 0 0 12px; letter-spacing: -0.01em; }
h1 { font-size: clamp(36px, 7vw, 56px); letter-spacing: -0.025em; }
h2 { font-size: clamp(24px, 3.4vw, 30px); }
h3 { font-size: 18px; }
h4 { font-size: 15px; }
p { margin: 0 0 12px; }
.lead { font-size: clamp(17px, 2.2vw, 20px); color: var(--ink-dim); max-width: 46em; }
.dim { color: var(--ink-dim); }
.small { font-size: 14px; }
.eyebrow { font-size: 13px; font-weight: 500; color: var(--ink-dim); margin-bottom: 10px; }
section { padding: 56px 0; border-top: 1px solid var(--line); }
section:first-of-type { border-top: 0; }
@media (min-width: 720px) { section { padding: 80px 0; } }
.section-head { max-width: 46em; margin-bottom: 32px; }
ul.plain { list-style: none; padding: 0; margin: 0; }

/* ---- Buttons ---------------------------------------------------------------------------------- */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 0; }
.btn {
  display: inline-flex; flex-direction: column; justify-content: center; gap: 2px;
  min-height: 44px; padding: 10px 18px; border-radius: 6px;
  border: 1px solid var(--line-2); background: transparent; color: var(--ink);
  font-weight: 500; font-size: 15px; text-decoration: none; line-height: 1.3;
}
.btn:hover { background: var(--surface); border-color: var(--ink-faint); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { background: #ffffff; }
.btn .meta { font-size: 12px; font-weight: 400; color: var(--ink-dim); }
.btn.primary .meta { color: #3b4240; }

/* ---- Overview --------------------------------------------------------------------------------- */
.hero { padding: 56px 0 40px; }
@media (min-width: 720px) { .hero { padding: 88px 0 56px; } }
.hero h1 { max-width: 14em; }
.shot {
  margin: 40px 0 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg);
}
.shot img { width: 100%; aspect-ratio: 1280 / 760; }
figcaption { font-size: 13px; color: var(--ink-dim); padding: 10px 2px 0; }
.version-line { font-size: 13px; color: var(--ink-dim); margin-top: 16px; }

.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
.grid > *, .gallery > *, .charts > * { min-width: 0; }
@media (min-width: 720px) { .grid.two { grid-template-columns: 1fr 1fr; } .grid.three { grid-template-columns: repeat(3, 1fr); } }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; background: var(--bg); }
.card h3 { font-size: 16px; margin-bottom: 8px; }
.card p, .card li { color: var(--ink-dim); font-size: 15px; }
.card ul { margin: 0; padding-left: 18px; }
.card li { margin: 4px 0; }

.gallery { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .gallery { grid-template-columns: 1fr 1fr; } }
.gallery figure { margin: 0; }
.gallery a { display: block; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.gallery a:hover { border-color: var(--line-2); }
.gallery img { width: 100%; aspect-ratio: 1280 / 760; }

.chain { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 32px; font-size: 14px; }
.chain span { border: 1px solid var(--line-2); border-radius: 6px; padding: 6px 12px; }
.chain i { width: 14px; height: 1px; background: var(--line-2); display: inline-block; }

dl.credits { display: grid; grid-template-columns: 1fr; gap: 4px 24px; margin: 0; }
@media (min-width: 720px) { dl.credits { grid-template-columns: 220px 1fr; } }
dl.credits dt { font-weight: 500; padding-top: 12px; }
dl.credits dd { margin: 0; color: var(--ink-dim); padding-top: 12px; border-top: 1px solid var(--line); }
@media (min-width: 720px) { dl.credits dt { border-top: 1px solid var(--line); } }
@media (max-width: 719px) { dl.credits dd { border-top: 0; padding-top: 0; } dl.credits dt { border-top: 1px solid var(--line); } }

/* ---- Download --------------------------------------------------------------------------------- */
.dl-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.dl-buttons .btn { min-width: 240px; padding: 14px 20px; }
.dl-buttons .btn.detected { order: -1; }
.os-note { font-size: 14px; color: var(--ink-dim); margin-top: 14px; min-height: 1.6em; }
.os-note .on { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: 1px; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps > li { counter-increment: step; position: relative; padding: 0 0 18px 40px; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--line-2); color: var(--ink-dim); font-size: 13px; display: grid; place-items: center;
}
.steps li li { color: var(--ink-dim); }
.req { width: 100%; border-collapse: collapse; font-size: 15px; }
.req th, .req td { text-align: left; padding: 12px 12px 12px 0; border-top: 1px solid var(--line); vertical-align: top; }
.req th { font-weight: 500; width: 34%; }
.req td { color: var(--ink-dim); }
.changelog article { border-top: 1px solid var(--line); padding: 20px 0; }
.changelog article:first-child { border-top: 0; padding-top: 0; }
.changelog h3 { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.changelog h3 .dim { font-size: 13px; font-weight: 400; }
.changelog ul { padding-left: 18px; margin: 8px 0; }
.changelog li, .changelog p { color: var(--ink-dim); }
.notice { border: 1px solid var(--line-2); border-radius: var(--radius); padding: 12px 16px; font-size: 14px; color: var(--ink-dim); margin: 16px 0 0; }

/* ---- Stats ------------------------------------------------------------------------------------ */
.tiles { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { background: var(--bg); padding: 18px 20px; }
.tile .label { font-size: 13px; color: var(--ink-dim); }
.tile .value { font-size: clamp(26px, 4vw, 34px); font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.tile .sub { font-size: 12px; color: var(--ink-dim); }
.charts { display: grid; gap: 16px; grid-template-columns: 1fr; margin-top: 16px; }
@media (min-width: 900px) { .charts { grid-template-columns: 1fr 1fr; } }
.chart { position: relative; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 8px; }
.chart h3 { font-size: 15px; font-weight: 500; margin-bottom: 4px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart svg:focus-visible { outline-offset: 6px; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis-label { fill: var(--ink-dim); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .series { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .gap-mark { fill: none; stroke: var(--ink-dim); stroke-width: 2; stroke-dasharray: 2 4; stroke-linecap: round; }
.chart .crosshair { stroke: var(--ink-faint); stroke-width: 1; }
.chart .dot { fill: var(--ink); stroke: var(--bg); stroke-width: 2; }
.tooltip {
  position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--line-2); border-radius: 6px;
  padding: 6px 10px; font-size: 12px; color: var(--ink-dim); white-space: nowrap; transform: translate(-50%, -100%);
}
.tooltip strong { color: var(--ink); font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; display: block; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 10px 12px 10px 0; border-top: 1px solid var(--line); text-align: right; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data thead th { font-weight: 500; color: var(--ink-dim); font-size: 13px; border-top: 0; }
.table-scroll { overflow-x: auto; }
details { margin-top: 16px; }
summary { cursor: pointer; color: var(--ink-dim); font-size: 14px; }
summary:hover { color: var(--ink); }

/* ---- Footer ----------------------------------------------------------------------------------- */
footer { border-top: 1px solid var(--line); padding: 32px 0 48px; font-size: 13px; color: var(--ink-dim); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; }
footer a { color: var(--ink-dim); }
footer .spacer { flex: 1; }

@media (prefers-reduced-motion: no-preference) {
  .btn, .nav a, .gallery a, a { transition: background-color 120ms, border-color 120ms, color 120ms, text-decoration-color 120ms; }
}
@media (forced-colors: active) {
  .brand::before, .os-note .on { forced-color-adjust: none; }
  .chart .series { stroke: CanvasText; }
}
.spaced { margin-top: 24px; }
.nowrap { white-space: nowrap; }
