:root {
  color-scheme: light;
  --paper: #fbfbf8;
  --wash: #f1f2ec;
  --ink: #141512;
  --soft: #4d4f48;
  --muted: #6f716a;
  --line: #dedfd9;
  --blue: #2864ff;
  --on-blue: #ffffff;
  /* Piano-roll marks. Validated for color-blind separation on this surface. */
  --hit: #2864ff;
  --off: #e39a00;
  --extra: #d03b3b;
  --screen: #0e0f0d;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #121311;
    --wash: #1b1c19;
    --ink: #f0efec;
    --soft: #c9cac2;
    --muted: #979990;
    --line: #2d2e2a;
    --blue: #6b97ff;
    --on-blue: #0b0c0a;
    --hit: #5b85f5;
    --off: #c98500;
    --extra: #d03b3b;
    --screen: #050505;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #121311;
  --wash: #1b1c19;
  --ink: #f0efec;
  --soft: #c9cac2;
  --muted: #979990;
  --line: #2d2e2a;
  --blue: #6b97ff;
  --on-blue: #0b0c0a;
  --hit: #5b85f5;
  --off: #c98500;
  --extra: #d03b3b;
  --screen: #050505;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 20px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button, select, input { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
h1, h2, h3, p, dl, dd, ul { margin: 0; }
ul { padding: 0; list-style: none; }

.top, footer { display: flex; align-items: center; gap: 28px; padding: 0 max(16px, 5vw); }
.top { height: 72px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 600; letter-spacing: .21em; }
.brand svg { width: 34px; height: 38px; flex: none; }
.top nav { display: flex; gap: 26px; margin-left: auto; font-size: 13px; }
.top nav a:hover { color: var(--blue); }

main { max-width: 1360px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 40px); }
section { padding: 38px 0; border-top: 1px solid var(--line); }
section.hero { border-top: 0; }

.eyebrow { font: 12px/1.5 var(--mono); letter-spacing: .08em; color: var(--muted); margin-bottom: 12px; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); margin-right: 8px; }
.fine { font-size: 12px; line-height: 1.6; color: var(--muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* introduction */
.hero { padding: 30px 0 24px; }
h1 { font-size: clamp(30px, 3vw, 40px); line-height: 1.1; font-weight: 550; letter-spacing: -.04em; }
.lede { margin-top: 12px; font-size: 16px; color: var(--soft); }
.meta { margin-top: 16px; font: 12px/1.6 var(--mono); color: var(--muted); }
.skip-link { position: absolute; left: 16px; top: -100px; z-index: 30; padding: 10px; background: var(--paper); }
.skip-link:focus { top: 12px; }

/* section heads */
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 20px; }
h2 { font-size: 25px; font-weight: 500; letter-spacing: -.035em; line-height: 1.15; }
h3 { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.aside { max-width: 420px; font-size: 13px; color: var(--muted); }

/* leaderboard */
.table-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
table { border-collapse: collapse; width: 100%; }
.board { min-width: 980px; }
.board td:nth-child(2) { min-width: 185px; }
.board th, .board td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.board thead th { font: 12px/1.4 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); text-align: left; font-weight: 500; white-space: nowrap; }
.board thead th.num, .board thead th.lvl { text-align: right; }
.board thead th.lvl { text-align: center; }
.board tbody tr.playable { cursor: pointer; }
.board tbody tr.playable:hover { background: var(--wash); }
.board tbody tr.anchor { color: var(--muted); }
.board td.rank { width: 34px; color: var(--muted); }
.sys-name { font-weight: 600; font-size: 15px; }
.system-link { padding: 0; background: none; border: 0; text-align: left; }
.system-link:hover { color: var(--blue); }
.why-col { min-width: 230px; }
.why-cell { max-width: 290px; font-size: 14px; line-height: 1.5; color: var(--soft); }
.board-guide { margin: -8px 0 18px; }
.board-guide summary { width: fit-content; font-size: 14px; cursor: pointer; color: var(--soft); }
.board-guide p { font-size: 16px; max-width: 900px; margin-top: 10px; color: var(--soft); }
.sys-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.tag { font: 10px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; padding: 4px 6px; border: 1px solid var(--line); color: var(--muted); border-radius: 3px; }
.sys-note { font-weight: 400; font-size: 12px; color: var(--muted); margin-top: 6px; max-width: 360px; }
.score-col { min-width: 190px; }
.score-cell { display: grid; grid-template-columns: 54px minmax(0, 1fr); align-items: center; gap: 12px; }
.score-value { font-size: 24px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; text-align: right; }
.bar { position: relative; height: 22px; }
.bar .track { position: absolute; left: 0; right: 0; top: 8px; height: 6px; background: var(--line); border-radius: 0 4px 4px 0; }
.bar .fill { position: absolute; left: 0; top: 8px; height: 6px; background: var(--blue); border-radius: 0 4px 4px 0; }
.bar .whisker { position: absolute; top: 3px; height: 2px; background: var(--ink); opacity: .55; }
.bar .whisker::before, .bar .whisker::after { content: ""; position: absolute; top: -3px; width: 2px; height: 8px; background: var(--ink); }
.bar .whisker::before { left: 0; }
.bar .whisker::after { right: 0; }
.interval { grid-column: 2; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; margin-top: -4px; }
td.lvl { padding: 6px 3px; text-align: center; }
.heat { display: block; min-width: 46px; padding: 9px 0; border-radius: 3px; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--ink); }
.heat.pass { box-shadow: inset 0 0 0 2px var(--ink); }
.board td.num { font-size: 14px; }
#board-note { margin-top: 14px; }

/* supporting detail */
.disclosure { border-top: 1px solid var(--line); margin-top: 20px; }
.disclosure summary { padding: 15px 0; cursor: pointer; font-size: 14px; font-weight: 500; }
.disclosure[open] { padding-bottom: 8px; }
.disclosure > .fine { max-width: 850px; }
.subhead { font-size: 12px; margin-left: 6px; color: var(--muted); }
#system-details { min-width: 680px; }
#system-details th:first-child { min-width: 260px; }

/* viewer */
.viewer { max-width: 900px; margin: 0 auto; }
.stage { min-width: 0; }
.stage-top { display: flex; justify-content: space-between; gap: 24px; align-items: end; margin-bottom: 18px; }
.stage-top h3 { font-size: 22px; font-weight: 500; letter-spacing: -.03em; line-height: 1.15; }
.piece-about { font-size: 13px; color: var(--muted); margin-top: 6px; max-width: 520px; }
.piece-score { text-align: right; white-space: nowrap; }
.piece-score .big { font-size: 44px; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.piece-score .unit { font-size: 13px; color: var(--muted); margin-left: 4px; }
.piece-score .runs { display: block; font-size: 12px; color: var(--muted); margin-top: 6px; }
.controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: end; margin-bottom: 24px; }
.select-field, .field-label { display: block; min-width: 0; font-size: 14px; color: var(--muted); }
.select-field select { display: block; width: 100%; height: 42px; margin-top: 6px; padding: 0 28px 0 10px; border: 1px solid var(--line); border-radius: 3px; background: var(--paper); color: var(--ink); font-size: 14px; text-overflow: ellipsis; appearance: none; }
.field-label { margin-bottom: 6px; }
#seek { min-width: 40px; flex: 1; accent-color: var(--blue); }
.play:disabled { opacity: .55; cursor: wait; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 3px; background: var(--wash); padding: 3px; border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; padding: 7px 12px; font-size: 14px; color: var(--soft); }
.seg button.active { background: var(--ink); color: var(--paper); }
.seg button:disabled { opacity: .4; cursor: not-allowed; }
.screen { position: relative; background: var(--screen); aspect-ratio: 16 / 9; }
.screen video { display: block; width: 100%; height: 100%; object-fit: contain; }
.specialist-page { max-width: 980px; }
.specialist-page section > :is(p, .table-wrap, video) { margin-top: 14px; }
.specialist-page video { width: 100%; max-height: 60vh; background: var(--screen); }
.specialist-page .fine a, .specialist-link a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.media-caption { position: absolute; top: 12px; left: 12px; right: 12px; width: fit-content; padding: 6px 10px; background: #101010e6; color: #f5f5f5; font-size: 12px; pointer-events: none; }
.no-video { position: absolute; inset: 0; display: grid; place-items: center; color: #c5c7bd; font-size: 13px; padding: 20px; text-align: center; }
.transport { display: flex; align-items: center; gap: 16px; padding: 12px 0; }
.play { min-width: 76px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); padding: 9px 14px; font-size: 14px; }
.play.playing { background: var(--blue); border-color: var(--blue); color: var(--on-blue); }
.time { font: 12px var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.sounding { font-size: 12px; color: var(--muted); margin-left: auto; }
.roll-wrap { border: 1px solid var(--line); background: var(--paper); }
#roll { display: block; width: 100%; height: 240px; cursor: crosshair; touch-action: none; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 12px; font-size: 12px; color: var(--soft); }
.legend li { display: flex; align-items: center; gap: 7px; }
.key { display: inline-block; width: 22px; height: 9px; border-radius: 2px; }
.key.target { border: 1px solid var(--muted); }
.key.hit { background: var(--hit); }
.key.off { background: var(--off); }
.key.extra { background: var(--extra); }
.key.missed { border: 1px dashed var(--extra); }
.breakdown { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; margin-top: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.breakdown div { padding: 14px 12px 14px 0; }
.breakdown dt { font: 12px/1.5 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.breakdown dd { font-size: 20px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.breakdown dd small { font-size: 12px; color: var(--muted); letter-spacing: 0; }

/* method */
.method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
.method-grid h3 { margin: 22px 0 6px; }
.method-grid h3:first-child { margin-top: 0; }
.method-grid p { font-size: 16px; color: var(--soft); margin-bottom: 10px; max-width: 560px; }
.parts { margin: 8px 0 14px; }
.parts th, .parts td { padding: 9px 12px 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; text-align: left; vertical-align: top; }
.parts thead th { font: 12px/1.4 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.parts td.num, .parts th.num { text-align: right; }
.credits { margin: 0 0 14px; max-width: 900px; }
.method-intro { max-width: 700px; color: var(--soft); font-size: 16px; margin-bottom: 18px; }
.scoring { max-width: 760px; }
#source-list { font-size: 12px; color: var(--muted); }
#source-list p { margin: 9px 0; }
#source-list a { margin-left: 8px; text-decoration: underline; text-underline-offset: 3px; }

footer { justify-content: space-between; padding-top: 32px; padding-bottom: 32px; background: var(--wash); border-top: 1px solid var(--line); flex-wrap: wrap; }
footer > p { font-family: var(--serif); font-style: italic; font-size: 20px; }

.tip { position: fixed; z-index: 20; pointer-events: none; background: var(--ink); color: var(--paper); font-size: 12px; line-height: 1.45; padding: 8px 10px; border-radius: 3px; max-width: 260px; }
.tip b { font-weight: 600; }

@media (max-width: 1000px) {
  .method-grid { grid-template-columns: 1fr; gap: 20px; }
  .controls { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .select-field:first-child { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  .top { height: 64px; gap: 14px; }
  .top nav { gap: 14px; font-size: 12px; }
  .brand span { display: none; }
  section { padding: 28px 0; }
  .hero { padding: 32px 0 26px; }
  .section-head { gap: 12px; align-items: baseline; flex-wrap: wrap; }
  .stage-top { gap: 12px; align-items: start; }
  .stage-top h3 { font-size: 19px; }
  .piece-score .big { font-size: 32px; }
  .piece-score .runs { max-width: 100px; white-space: normal; }
  .breakdown { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .transport { gap: 10px; flex-wrap: wrap; }
  .sounding { display: none; }
  .time { font-size: 12px; }
  .play { min-width: 62px; padding: 8px 10px; }
  #roll { height: 200px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* One comparison surface; the full tables are optional detail. */
.comparison-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 30px; align-items: start; }
.controls { margin-bottom: 20px; }
.select-field { position: relative; }
.select-field::after { content: ""; position: absolute; width: 7px; height: 7px; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); right: 13px; bottom: 18px; pointer-events: none; }
.mobile-system { display: none; }
.systems-panel { border-left: 1px solid var(--line); padding-left: 24px; }
.systems-panel h2 { font-size: 18px; letter-spacing: -.02em; }
.systems-panel .section-head { margin-bottom: 12px; }
.system-chooser { font-size: 14px; }
.system-chooser thead th { color: var(--muted); font-size: 12px; font-weight: 400; padding: 8px 6px; white-space: nowrap; }
.system-chooser thead th:first-child { text-align: left; }
.system-chooser tbody th { text-align: left; font-weight: 500; }
.system-chooser td, .system-chooser tbody th { border-top: 1px solid var(--line); padding: 11px 6px; vertical-align: middle; }
.system-chooser tbody tr { cursor: pointer; }
.system-chooser tbody tr:hover { background: var(--wash); }
.system-chooser tbody tr.selected { background: color-mix(in oklab, var(--blue) 9%, var(--paper)); box-shadow: inset 3px 0 var(--blue); }
.system-chooser button { padding: 0; text-align: left; border: 0; background: none; font-size: 14px; font-weight: 500; }
.system-chooser .sys-meta { display: block; font-size: 12px; line-height: 1.4; }
.piece-result { font-weight: 600; }
.overall-result { color: var(--muted); }
.chooser-note { margin-top: 12px; }
#reference-video { position: absolute; inset: 0; }
.media-caption { font-size: 13px; top: 8px; left: 8px; padding: 5px 8px; }
.supporting-section { border-top: 0; padding: 0; }
.supporting-section > .disclosure { margin-top: 0; }
.supporting-section > .disclosure > summary { font-size: 14px; padding: 20px 0; }
.supporting-section:last-child { padding-bottom: 24px; }
footer { padding-top: 20px; padding-bottom: 20px; background: var(--paper); }
@media (max-width: 1000px) {
  .comparison-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .systems-panel { display: none; }
  .mobile-system { display: block; }
  .controls { grid-template-columns: minmax(0, 1fr) auto; }
  .select-field:first-child { grid-column: 1 / -1; }
}

.attempt-controls { display: flex; align-items: end; gap: 18px; margin-top: 12px; }
.attempt-controls .select-field { min-width: min(235px, 100%); }
.attempt-controls p { margin: 0 0 4px; }
.evidence:empty { display: none; }
#enter > p { max-width: 70ch; }
.kit-link { font-weight: 600; text-underline-offset: 4px; }
@media (max-width: 600px) { .attempt-controls { align-items: stretch; flex-direction: column; gap: 6px; } }

#submit-result { display: grid; gap: 12px; max-width: 550px; margin: 16px 0; }
#submit-result label { display: grid; gap: 4px; }
#submit-result input, #submit-result button { padding: 8px; }
#submit-result button { justify-self: start; }
#submit-status { overflow-wrap: anywhere; }
