/*
 * One stylesheet for the whole site.
 *
 * Light first, dark designed rather than inverted, following the system. The
 * player is used on a phone propped on a music stand or held in one hand, so
 * every control is at least 48 px tall and the transport is the biggest thing
 * on the page.
 */
:root {
  color-scheme: light;
  --ink: #161a2b;
  --bg: #f6f7fb;
  --panel: #ffffff;
  --raise: #eceff7;
  --line: #dde1ee;
  --muted: #5d6479;
  --accent: #2f4fb3;
  --accent-ink: #ffffff;
  --soft: #e3e9fb;
  --gold: #b07a00;
  --good: #1d7a43;
  --good-soft: #e0f2e6;
  --bad: #b3261e;
  --bad-soft: #fbe3e0;
  --warn: #8a5a00;
  --warn-soft: #fbf0d6;
  --radius: 14px;
  --tap: 48px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ink: #e9ecf7;
    --bg: #10131d;
    --panel: #181c29;
    --raise: #212637;
    --line: #2f3549;
    --muted: #a0a7bd;
    --accent: #8ea8ff;
    --accent-ink: #0e1430;
    --soft: #222c4d;
    --gold: #ffd166;
    --good: #7fcf9a;
    --good-soft: #1b3123;
    --bad: #f08f86;
    --bad-soft: #3d1f1c;
    --warn: #f0c76a;
    --warn-soft: #3a2f14;
  }
}

* { box-sizing: border-box; }
/* `hidden` must win over every display rule below. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); }
h1 { font-size: clamp(26px, 5vw, 40px); letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 10px; }
h2 { font-size: 20px; margin: 28px 0 10px; letter-spacing: -0.01em; }
h3 { font-size: 16px; margin: 0 0 6px; }
p { margin: 0 0 12px; }
.lede { font-size: 18px; color: var(--muted); max-width: 60ch; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.error { color: var(--bad); }
.ok { color: var(--good); }
.warn { color: var(--warn); }
code { background: var(--raise); padding: 1px 6px; border-radius: 6px; font-size: 0.92em; }

/* ── Frame ──────────────────────────────────────────────────────────── */

.masthead {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 18px; border-bottom: 1px solid var(--line); background: var(--panel);
  position: sticky; top: 0; z-index: 10;
}
.wordmark { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; font-size: 18px; }
.wordmark img { width: 28px; height: 28px; }
.masthead nav { margin-left: auto; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.masthead nav a { color: var(--muted); text-decoration: none; padding: 10px 12px; border-radius: 10px; font-weight: 600; }
.masthead nav a[aria-current="page"], .masthead nav a:hover { color: var(--ink); background: var(--raise); }

main { max-width: 760px; margin: 0 auto; padding: 24px 18px 40px; }
main.wide { max-width: 1180px; }

.tabbar { display: none; }
@media (max-width: 760px) {
  .masthead nav.app { display: none; }
  body.app { padding-bottom: 72px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(2, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: var(--panel); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: 60px; color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 600;
  }
  .tabbar a span { font-size: 20px; line-height: 1; }
  .tabbar a[aria-current="page"] { color: var(--accent); }
}

.siteftr { border-top: 1px solid var(--line); padding: 22px 18px 30px; color: var(--muted); font-size: 14px; text-align: center; }
.siteftr nav { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin: 8px 0; }

.crumbs { font-size: 14px; margin-bottom: 6px; }
.crumbs a { color: var(--muted); }

/* ── Controls ───────────────────────────────────────────────────────── */

label { display: block; font-weight: 600; margin: 14px 0 6px; }
label .hint { display: block; font-weight: 400; color: var(--muted); font-size: 14px; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px; min-height: var(--tap);
}
input[type="checkbox"], input[type="radio"] { width: 22px; height: 22px; min-height: 0; accent-color: var(--accent); vertical-align: middle; }
input[type="range"] { padding: 0; border: 0; background: none; accent-color: var(--accent); min-height: 36px; }
input[type="file"] { padding: 10px; }
label.check { display: flex; gap: 10px; align-items: center; font-weight: 500; margin: 8px 0; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 18px; border-radius: 12px; border: 0;
  background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 750;
  cursor: pointer; text-decoration: none; touch-action: manipulation;
}
button.quiet, .button.quiet { background: var(--raise); color: var(--ink); border: 1px solid var(--line); }
button.danger { background: var(--bad-soft); color: var(--bad); border: 1px solid var(--bad); }
button.small, .button.small { min-height: 38px; padding: 0 12px; font-size: 14px; }
button:disabled { opacity: .55; cursor: default; }
button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 16px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 12px 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .two { grid-template-columns: 1fr; } }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* ── Lists ──────────────────────────────────────────────────────────── */

.list { list-style: none; padding: 0; margin: 0; }
.list > li {
  display: flex; gap: 12px; align-items: center; padding: 12px 14px; min-height: 60px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px;
}
.list > li a.fill { color: inherit; text-decoration: none; flex: 1; min-width: 0; }
.list .title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .sub { color: var(--muted); font-size: 14px; }

.pill { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 13px; font-weight: 700; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pill.good { color: var(--good); border-color: var(--good); background: var(--good-soft); }
.pill.warn { color: var(--warn); border-color: var(--warn); background: var(--warn-soft); }
.pill.bad { color: var(--bad); border-color: var(--bad); background: var(--bad-soft); }
.pill.accent { color: var(--accent); border-color: var(--accent); background: var(--soft); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 12px 0; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat .n { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat .k { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }

.empty { color: var(--muted); padding: 18px; text-align: center; border: 1px dashed var(--line); border-radius: 12px; }

table.plain { width: 100%; border-collapse: collapse; }
table.plain th, table.plain td { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.plain th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
table.plain input, table.plain select { min-height: 40px; padding: 6px 10px; }

/* ── The player ─────────────────────────────────────────────────────── */

.roll { display: block; width: 100%; height: 220px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
@media (max-width: 640px) { .roll { height: 180px; } }

.transport { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
.transport .play { min-width: 140px; min-height: 64px; font-size: 20px; border-radius: 16px; }
.transport .where { font-variant-numeric: tabular-nums; font-weight: 700; }
.seek { width: 100%; }

.mixer { display: grid; grid-template-columns: minmax(110px, 1fr) 3fr 44px; gap: 6px 12px; align-items: center; }
.mixer .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mixer .name.mine { color: var(--accent); }
.mixer output { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; text-align: right; }
.presets { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.presets button { min-height: 40px; }

.loopset { display: grid; grid-template-columns: auto 90px auto 90px; gap: 8px; align-items: center; }
.loopset input { min-height: 40px; padding: 6px 10px; }

.self { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── The readiness view ─────────────────────────────────────────────── */

.matrix-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table.matrix { border-collapse: separate; border-spacing: 0; min-width: 100%; font-size: 14px; }
table.matrix th, table.matrix td { padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.matrix thead th { position: sticky; top: 0; background: var(--panel); text-align: left; vertical-align: bottom; }
table.matrix th.who { position: sticky; left: 0; background: var(--panel); text-align: left; font-weight: 600; z-index: 1; }
table.matrix tr.group th { background: var(--raise); text-transform: uppercase; letter-spacing: .06em; font-size: 12px; color: var(--muted); }
table.matrix td.cell { text-align: center; min-width: 96px; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line); vertical-align: middle; }
.dot.learning { background: var(--warn-soft); border-color: var(--warn); }
.dot.confident { background: var(--good); border-color: var(--good); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; color: var(--muted); margin: 8px 0; }
.bar { height: 8px; border-radius: 99px; background: var(--raise); overflow: hidden; display: flex; }
.bar span.c { background: var(--good); }
.bar span.l { background: var(--warn); }

/* ── The marketing page ─────────────────────────────────────────────── */

.hero { padding: 24px 0 8px; }
.hero h1 { font-size: clamp(32px, 6vw, 52px); }
.cta { font-size: 18px; min-height: 56px; padding: 0 24px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 16px 0; }
.features .panel { margin: 0; }
.steps { padding-left: 20px; }
.steps li { margin-bottom: 8px; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .compare { grid-template-columns: 1fr; } }
.compare .panel h3 { margin-bottom: 8px; }
.compare ul { margin: 0; padding-left: 20px; }
.lines { display: block; width: 100%; max-width: 520px; height: auto; margin: 8px 0 4px; }
