/* ==========================================================================
   Orchestra — FULL SCORE skin
   The site is a conductor's full score of a piece called danmat.dev — for
   eleven instruments, one conductor, and the composer's own CMS. The most
   editorial, type-led skin: black ink on white, staff lines in grey, one
   signal green, and ONE hot magenta — the playhead, and nothing else.
   Two authored palettes: "engraved" (light, the root) and "light table" (dark).
   System fonts only; every mark on the staff is CSS-drawn from data classes.
   Motion: the playhead sweeps with scroll (scroll timeline, score.js fallback)
   and the baton flies the title page — both removed by reduced-motion.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens — light ("engraved") is the root palette
   -------------------------------------------------------------------------- */
:root {
  color-scheme: light dark;

  --display: "Helvetica Neue", "Segoe UI Variable Display", system-ui, Arial, sans-serif;
  --body: "Helvetica Neue", "Segoe UI Variable Text", system-ui, Arial, sans-serif;
  --serif: Charter, Georgia, "Iowan Old Style", ui-serif, serif;
  --mono: ui-monospace, "SF Mono", Menlo, "Cascadia Mono", Consolas, monospace;
  --body-size: 17px;
  --body-lh: 1.55;
  --measure: 62ch;
  --wrap: 1180px;

  --page: #FFFFFF;
  --ink: #0E0E10;
  --ink-2: #55555C;
  --staff: #C9C9CF;
  --staff-soft: #E4E4E9;
  --signal: #0F7A64;
  --playhead: #E8127A;

  /* base.css contract */
  --panel: var(--page);
  --text: var(--ink);
  --muted: var(--ink-2);
  --line: var(--staff);
  --link: var(--signal);
  --link-hover: var(--ink);
  --focus: var(--ink);
  --code-bg: rgba(14, 14, 16, .06);

  /* notation geometry */
  --sp: 10px;          /* staff line spacing */
  --margin: 5.5rem;    /* the left margin that holds the part abbreviation */
  --nhead: var(--ink); /* note-head ink (hover → signal) */

  /* Widgets (base.css) are engraved on the page: no surfaces, ink hairlines,
     the signal green as the only colour, square corners, no shadow. */
  --widget-mono: var(--mono);
  --widget-surface: var(--page);
  --widget-surface-2: var(--page);
  --widget-border: var(--ink);
  --widget-border-strong: var(--ink);
  --widget-radius: 2px;
  --widget-control-radius: 0px;
  --widget-hi: transparent;
  --widget-shadow: transparent;
  --widget-text: var(--ink);
  --widget-muted: var(--ink-2);
  --widget-accent: var(--signal);
  --widget-accent-fg: #0C0C0F;
  --widget-accent-glow: transparent;
  --widget-hot: var(--playhead);
  --widget-well: var(--staff-soft);
  --widget-well-fg: var(--signal);
  --widget-control: var(--page);
  --widget-marquee-bg: var(--ink);
  --widget-marquee-fg: var(--page);
}

/* Dark ("light table") — an authored palette, not an inversion. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #0C0C0F;
    --ink: #F2F2EE;
    --ink-2: #A2A2AC;
    --staff: #2A2A31;
    --staff-soft: #1B1B20;
    --signal: #33E6B8;
    --playhead: #FF4FA3;
    --code-bg: rgba(242, 242, 238, .08);
  }
}
:root[data-theme="dark"] {
  --page: #0C0C0F;
  --ink: #F2F2EE;
  --ink-2: #A2A2AC;
  --staff: #2A2A31;
  --staff-soft: #1B1B20;
  --signal: #33E6B8;
  --playhead: #FF4FA3;
  --code-bg: rgba(242, 242, 238, .08);
}

/* --------------------------------------------------------------------------
   2. Page + type
   -------------------------------------------------------------------------- */
body.skin-score {
  background: var(--page);
  color: var(--ink);
  font-family: var(--body);
}
.skip-link { background: var(--ink); color: var(--page); }
.skip-link:focus { outline-color: var(--ink); }
::selection { background: var(--ink); color: var(--page); }

.opus {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(56px, 15.5vw, 160px);
  line-height: .92;
  letter-spacing: -.04em;
  overflow-wrap: anywhere;
}
.opus--page { font-size: clamp(40px, 8vw, 96px); line-height: .95; }
.opus--part { font-size: clamp(40px, 9vw, 120px); text-wrap: balance; }

/* Expression markings — the ONLY italic serif on the page. */
.expr {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.08rem;
  line-height: 1.4;
  color: var(--ink);
}
.dyn, .staff__dyn {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 700;
  line-height: 1;
}

/* Part abbreviations and catalogue lines. */
.mono-label {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 11px;
  line-height: 1.6;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--ink-2);
}
.caps {
  font-family: var(--display);
  font-weight: 500;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .28em;
  color: var(--ink);
}

a { color: var(--link); }
a:hover { color: var(--link-hover); }
.prose a { text-decoration-thickness: 1px; }
.prose h2, .prose h3 { font-family: var(--display); font-weight: 800; letter-spacing: -.02em; }
.prose h2 { font-size: 1.6rem; }
.prose h3 { font-size: 1.25rem; }
.prose blockquote { border-left-color: var(--ink); }
.prose--reading { font-size: 1.12rem; line-height: 1.65; }

.btn {
  display: inline-block;
  font-family: var(--mono);
  font-weight: 600;
  font-size: .74rem;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: .12em;
  padding: .85em 1.15em;
  border: 1px solid var(--ink);
  border-radius: 2px;
  color: var(--ink);
  background: var(--page);
  text-decoration: none;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn:hover { background: var(--ink); color: var(--page); }
.btn--ink { background: var(--ink); color: var(--page); }
.btn--ink:hover { background: var(--signal); border-color: var(--signal); color: #0C0C0F; }
.backlink { text-decoration: none; color: var(--ink); }
.backlink:hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
   3. Running head
   -------------------------------------------------------------------------- */
.head { border-bottom: 1px solid var(--ink); }
.head__row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .6rem 2rem;
  padding-block: 1.1rem;
}
.head__mark { text-decoration: none; color: var(--ink); }
.head__mark:hover .caps { color: var(--signal); }
.movements {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.4rem;
  margin-left: auto;
}
.movement {
  font-family: var(--display);
  font-weight: 500;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.movement__no { font-family: var(--mono); color: var(--ink-2); margin-right: .3em; }
.movement:hover { text-decoration: underline; text-underline-offset: .4em; }
.movement[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: .4em;
}
.movement[aria-current="page"] .movement__no { color: var(--ink); }

.tune {
  display: inline-flex;
  align-items: center;
  gap: .55em;
  font-family: var(--mono);
  font-weight: 600;
  font-size: .68rem;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: .14em;
  padding: .6em .8em;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--page);
  color: var(--ink);
}
.tune__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  border: 1px solid var(--ink);
  background: transparent;
  transition: background-color .15s;
}
.tune[aria-pressed="true"] { background: var(--ink); color: var(--page); }
.tune[aria-pressed="true"] .tune__dot { background: var(--signal); border-color: var(--signal); }
.tune:hover .tune__dot { background: var(--signal); border-color: var(--signal); }

/* --------------------------------------------------------------------------
   4. Title page
   -------------------------------------------------------------------------- */
.title-page {
  position: relative;
  overflow: clip;
  padding-block: clamp(40px, 7vw, 110px) clamp(40px, 6vw, 80px);
  --margin: 0px;
}
.title-page__stage {
  position: absolute;
  left: 0; right: 0;
  top: 34%;
  bottom: 0;
  pointer-events: none;
}
/* Five staff lines in perspective + bar lines converging on the horizon. */
.staff-plane {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(var(--staff), var(--staff)) 0 0    / 100% 1px no-repeat,
    linear-gradient(var(--staff), var(--staff)) 0 9%   / 100% 1px no-repeat,
    linear-gradient(var(--staff), var(--staff)) 0 22%  / 100% 1px no-repeat,
    linear-gradient(var(--staff), var(--staff)) 0 41%  / 100% 1px no-repeat,
    linear-gradient(var(--staff), var(--staff)) 0 68%  / 100% 1px no-repeat,
    repeating-conic-gradient(from 0deg at 50% 0, var(--staff) 0 .3deg, transparent .3deg 5deg);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.9), #000 20%, #000 70%, transparent);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.9), #000 20%, #000 70%, transparent);
}
.baton {
  position: absolute;
  left: 0; right: 0;
  top: -32px;
  width: 100%;
  height: 64px;
}
.title-page__copy {
  position: relative;
  display: grid;
  gap: 1.1rem;
  justify-items: start;
}
.composer { margin-bottom: -.2rem; }
.subtitle { font-size: clamp(1.2rem, 2.4vw, 1.7rem); line-height: 1.3; margin-top: .6rem; }
.subtitle__line { display: block; }
.program-note {
  max-width: var(--measure);
  font-size: 1.08rem;
  margin-top: .4rem;
}

.instrumentation {
  margin-top: 1.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--ink);
  width: 100%;
  max-width: 820px;
  display: grid;
  gap: 1rem;
}
.instrumentation__cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: .2rem 3rem;
}
.instrumentation__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: .2rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -.01em;
}
.instrumentation__list li { display: flex; gap: .8em; align-items: baseline; }
.instrumentation__list li::first-letter { text-transform: uppercase; }
.instrumentation__no {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--ink-2);
  flex: none;
  min-width: 2ch;
}
.instrumentation__coda { color: var(--ink); font-size: .98rem; }
.instrumentation__coda .mono-label { margin-right: .5em; }
.instrumentation__engraved { color: var(--ink-2); margin-top: .2rem; }

.title-page__links {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
  margin-top: 1rem;
}
.imprint {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem 1.2rem;
}
.imprint__mark {
  font-family: var(--display);
  font-weight: 700;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .3em;
  padding: .55em .9em .5em 1.2em;
  border: 1.5px solid var(--ink);
  color: var(--ink);
}
.imprint__note {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--ink-2);
}
.imprint__catalogue { text-transform: uppercase; letter-spacing: .12em; }

/* --------------------------------------------------------------------------
   5. Score head (collection pages)
   -------------------------------------------------------------------------- */
.score-head {
  display: grid;
  gap: .8rem;
  justify-items: start;
  padding-block: clamp(28px, 5vw, 64px) 1.5rem;
}
.score-head__lead { max-width: var(--measure); color: var(--ink); }

/* --------------------------------------------------------------------------
   6. The system — staves, bar lines, notation
   -------------------------------------------------------------------------- */
.sheet { position: relative; }
.system {
  position: relative;
  container-type: inline-size;
  overflow-x: clip;
  --travel: calc(100cqw - var(--margin));
  padding-bottom: 3rem;
  margin-bottom: 2rem;
}
/* Shared bar lines: four bars, drawn ONCE through the whole system, plus the
   system line at the left. Text in the system knocks them out with the page. */
.system::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: var(--margin);
  right: 0;
  pointer-events: none;
  background:
    linear-gradient(var(--staff), var(--staff)) 25%  0 / 1px 100% no-repeat,
    linear-gradient(var(--staff), var(--staff)) 50%  0 / 1px 100% no-repeat,
    linear-gradient(var(--staff), var(--staff)) 75%  0 / 1px 100% no-repeat,
    linear-gradient(var(--staff), var(--staff)) 100% 0 / 1px 100% no-repeat;
  box-shadow: inset 1.5px 0 0 var(--ink);
}
.system--single { padding-bottom: 0; margin-bottom: 0; }

.section { position: relative; padding-top: 1.6rem; }
.section + .section { margin-top: 1.4rem; }
.section__name {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin-bottom: 1.4rem;
  padding: 0 .35em 0 0;
  background: var(--page);
  color: var(--ink);
  font-weight: 600;
}
.section__n { color: var(--ink-2); margin-left: .5em; }
.section--tutti .section__name { font-weight: 700; letter-spacing: .2em; }

.staves {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 2.4rem;
}

.staff {
  position: relative;
  display: grid;
  grid-template-columns: var(--margin) minmax(0, 1fr);
  grid-template-areas:
    ".    expr"
    "abbr staff"
    ".    name"
    ".    tag"
    ".    meta";
  column-gap: 0;
  row-gap: .3rem;
  align-items: start;
}
.staff--solo {
  grid-template-areas:
    "abbr staff";
  row-gap: 0;
}
.staff__abbr {
  grid-area: abbr;
  align-self: center;
  width: fit-content;
  padding: .2em .5em .2em 0;
  background: var(--page);
  color: var(--ink);
  font-weight: 600;
  position: relative;
}
.staff__expr,
.staff__name,
.staff__tag,
.staff__meta {
  position: relative;
  width: fit-content;
  max-width: 100%;
  background: var(--page);
  padding-inline: .3em;
  margin-left: -.3em;
}
.staff__expr { grid-area: expr; }
.staff__name {
  grid-area: name;
  margin-top: .7rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  line-height: 1.05;
  letter-spacing: -.025em;
}
.staff--tutti .staff__name { font-size: clamp(1.8rem, 4vw, 3rem); }
.staff__link { color: inherit; text-decoration: none; }
.staff__link::after { content: ""; position: absolute; inset: -.6rem 0; z-index: 1; }
.staff__link:hover { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: .12em; }
.staff:has(.staff__link:hover) { --nhead: var(--signal); }
.staff:has(.staff__link:hover) .staff__abbr { color: var(--signal); }
.staff:focus-within { outline: 3px solid var(--ink); outline-offset: 10px; border-radius: 2px; }
.staff__link:focus-visible { outline: none; }
.staff__tag { grid-area: tag; max-width: 62ch; color: var(--ink); }
.staff__meta { grid-area: meta; }
.status-live .staff__status,
.status-shipped .staff__status,
.status-live .part__status,
.status-shipped .part__status { color: var(--signal); }

/* The staff: 16 beats across, five hairlines, events placed by class. */
.staff__notation {
  grid-area: staff;
  position: relative;
  display: grid;
  grid-template-columns: repeat(16, minmax(0, 1fr));
  grid-template-rows: 100%;
  height: calc(var(--sp) * 4 + 1px);
  margin-block: calc(var(--sp) * 1.8) calc(var(--sp) * 1.6);
  background: repeating-linear-gradient(to bottom, var(--staff) 0 1px, transparent 1px var(--sp));
}
.staff__dyn {
  position: absolute;
  left: 2px;
  top: calc(100% + 5px);
  font-size: 1.05rem;
  padding: 0 3px;
  background: var(--page);
  color: var(--ink);
}

/* Events -------------------------------------------------------------- */
.ev { position: relative; grid-row: 1; height: 100%; min-width: 0; pointer-events: none; }
.b1  { grid-column-start: 1; }  .b2  { grid-column-start: 2; }  .b3  { grid-column-start: 3; }  .b4  { grid-column-start: 4; }
.b5  { grid-column-start: 5; }  .b6  { grid-column-start: 6; }  .b7  { grid-column-start: 7; }  .b8  { grid-column-start: 8; }
.b9  { grid-column-start: 9; }  .b10 { grid-column-start: 10; } .b11 { grid-column-start: 11; } .b12 { grid-column-start: 12; }
.b13 { grid-column-start: 13; } .b14 { grid-column-start: 14; } .b15 { grid-column-start: 15; } .b16 { grid-column-start: 16; }
.p0 { --p: 0; } .p1 { --p: 1; } .p2 { --p: 2; } .p3 { --p: 3; } .p4 { --p: 4; }
.p5 { --p: 5; } .p6 { --p: 6; } .p7 { --p: 7; } .p8 { --p: 8; }
.s2  { --s: 2;  grid-column-end: span 2; }  .s3  { --s: 3;  grid-column-end: span 3; }
.s4  { --s: 4;  grid-column-end: span 4; }  .s5  { --s: 5;  grid-column-end: span 5; }
.s6  { --s: 6;  grid-column-end: span 6; }  .s7  { --s: 7;  grid-column-end: span 7; }
.s8  { --s: 8;  grid-column-end: span 8; }  .s9  { --s: 9;  grid-column-end: span 9; }
.s10 { --s: 10; grid-column-end: span 10; } .s11 { --s: 11; grid-column-end: span 11; }
.s12 { --s: 12; grid-column-end: span 12; } .s13 { --s: 13; grid-column-end: span 13; }
.s14 { --s: 14; grid-column-end: span 14; } .s15 { --s: 15; grid-column-end: span 15; }
.s16 { --s: 16; grid-column-end: span 16; }

/* head (::before) + stem (::after) */
.note::before,
.note::after { content: ""; position: absolute; }
.note::before {
  left: calc(50% - 5.5px);
  bottom: calc(var(--p) * var(--sp) / 2 - 4px);
  width: 11px;
  height: 8px;
  border-radius: 50%;
  background: var(--nhead);
  transform: rotate(-20deg);
  transition: background-color .15s;
}
.note.h::before,
.note.w::before {
  background: transparent;
  border: 1.8px solid var(--nhead);
  box-sizing: border-box;
}
.note::after {
  width: 1.5px;
  height: calc(var(--sp) * 3.3);
  background: var(--nhead);
}
.note.up::after   { left: calc(50% + 4px);   bottom: calc(var(--p) * var(--sp) / 2); }
.note.down::after { left: calc(50% - 5.5px); top: calc(100% - var(--p) * var(--sp) / 2); }
.note.w::after,
.note.ns::after { display: none; }
/* staccato dot on the head side (opposite the stem) */
.note.stacc {
  background: radial-gradient(circle, var(--nhead) 1.4px, transparent 2px) no-repeat;
  background-size: 6px 6px;
  background-position: 50% calc(100% - var(--p) * var(--sp) / 2 + 9px);
}
.note.stacc.down { background-position: 50% calc(100% - var(--p) * var(--sp) / 2 - 9px); }

.beam::before {
  content: "";
  position: absolute;
  height: 3px;
  background: var(--nhead);
  left: calc(50% / var(--s) + 4px);
  right: calc(50% / var(--s) - 5.5px);
  bottom: calc(var(--p) * var(--sp) / 2 + var(--sp) * 3.3 - 3px);
}
.beam.down::before {
  left: calc(50% / var(--s) - 5.5px);
  right: calc(50% / var(--s) + 4px);
  bottom: auto;
  top: calc(100% - var(--p) * var(--sp) / 2 + var(--sp) * 3.3 - 3px);
}

.slur::before {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  height: calc(var(--sp) * 1.6);
  bottom: calc(var(--p) * var(--sp) / 2 + var(--sp) * 2.2);
  border-top: 1.5px solid var(--nhead);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.tie::before {
  content: "";
  position: absolute;
  left: calc(50% / var(--s) + 7px);
  right: calc(-50% / var(--s) + 7px);
  height: calc(var(--sp) * 1.2);
  top: calc(100% - var(--p) * var(--sp) / 2 + 5px);
  border-bottom: 1.5px solid var(--nhead);
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
}

.rest::before {
  content: "";
  position: absolute;
  left: calc(50% - 5px);
  bottom: calc(var(--sp) * 2);
  width: 10px;
  height: 4px;
  background: var(--nhead);
}

.mrest::before {
  content: "";
  position: absolute;
  left: 4%;
  right: 4%;
  top: calc(50% - 7px);
  height: 14px;
  border-left: 2px solid var(--nhead);
  border-right: 2px solid var(--nhead);
  background: linear-gradient(var(--nhead), var(--nhead)) center / 100% 5px no-repeat;
}
.mrest::after {
  content: attr(data-n);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 3px);
  transform: translateX(-50%);
  font: 700 13px/1 var(--mono);
  color: var(--nhead);
  background: var(--page);
  padding-inline: 4px;
}

.fermata::before,
.fermata::after { content: ""; position: absolute; }
.fermata::before {
  left: calc(50% - 8px);
  bottom: calc(var(--sp) * 5.4);
  width: 16px;
  height: 9px;
  border: 1.6px solid var(--nhead);
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
}
.fermata::after {
  left: calc(50% - 1.5px);
  bottom: calc(var(--sp) * 5.4 + 1px);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--nhead);
}

/* Bar-line articulations (status) */
.bar::before,
.bar::after { content: ""; position: absolute; top: 0; bottom: 1px; }
.bar.final::before  { right: 4px;  width: 1px; background: var(--ink); }
.bar.final::after   { right: -1px; width: 3px; background: var(--ink); }
.bar.repeat::before { right: 4px;  width: 1px; background: var(--ink); }
.bar.repeat::after  { right: -1px; width: 3px; background: var(--ink); }
.bar.repeat {
  background:
    radial-gradient(circle, var(--ink) 1.6px, transparent 2.2px) right 8px top calc(50% - 5px) / 6px 6px no-repeat,
    radial-gradient(circle, var(--ink) 1.6px, transparent 2.2px) right 8px top calc(50% + 5px) / 6px 6px no-repeat;
}
.bar.dashed::before {
  right: -2px;
  width: 4px;
  background: var(--page);
  border-right: 1px dashed var(--ink);
}
.bar.dashed::after { display: none; }
.bar.dblstart::before { left: 4px; width: 1px; background: var(--ink); }
.bar.dblstart::after  { display: none; }

/* --------------------------------------------------------------------------
   7. The playhead — the ONE magenta thing
   -------------------------------------------------------------------------- */
.playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--margin);
  width: 1px;
  background: var(--playhead);
  z-index: 3;
  pointer-events: none;
  will-change: transform;
}
.playhead::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -5px;
  border: 5px solid transparent;
  border-top: 7px solid var(--playhead);
  border-bottom: 0;
}
@supports (animation-timeline: view()) {
  .sheet .playhead {
    animation: score-sweep linear both;
    animation-timeline: view();
    animation-range: cover 0% cover 100%;
  }
}
@keyframes score-sweep {
  from { transform: translateX(0); }
  to   { transform: translateX(var(--travel)); }
}
.title-page .playhead { left: 0; --travel: 100cqw; }
.title-page { container-type: inline-size; }

/* A project page's single staff is a header ornament, not a scroll-swept score:
   its playhead rests at the start (TUNE plays the notes once instead of relying
   on a scroll sweep, which lands mid-staff on a header element). */
.sheet--part .playhead { animation: none !important; transform: none !important; }

/* --------------------------------------------------------------------------
   8. A part (project page)
   -------------------------------------------------------------------------- */
.part { padding-block: clamp(28px, 5vw, 64px) 3rem; }
.part__head { display: grid; gap: .8rem; justify-items: start; }
.part__expr { font-size: 1.3rem; }
.sheet--part { width: 100%; margin-top: 1rem; }
.part__tagline { font-size: 1.2rem; max-width: var(--measure); margin-top: 1rem; }

.spec-strip {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem 2.6rem;
  margin-block: 2rem 2.4rem;
  padding-block: .9rem;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.spec-strip > div { display: grid; gap: .1rem; }
.spec-strip dd { margin: 0; font-weight: 600; font-size: .98rem; }
.spec-strip .dyn { font-size: 1.15rem; }
.spec-strip__sub { color: var(--ink-2); font-weight: 400; font-size: .9rem; }

.part__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
}
@media (min-width: 880px) {
  .part__grid { grid-template-columns: minmax(0, 1fr) 16rem; gap: 3.5rem; align-items: start; }
}
.part__body { display: grid; gap: 1.6rem; justify-items: start; }
.summary { font-size: 1.15rem; max-width: var(--measure); }
.part__section { display: grid; gap: .8rem; }
.diagram { display: grid; gap: .6rem; width: 100%; max-width: 820px; }
.diagram__svg { border: 1px solid var(--staff); padding: 1rem; background: var(--page); }
.diagram__svg svg { width: 100%; height: auto; }

.references { display: grid; gap: .8rem; padding-top: .4rem; }
.references__list { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; justify-items: start; }
.part__foot { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--staff); }

/* --------------------------------------------------------------------------
   9. Errata (oss / generic collection)
   -------------------------------------------------------------------------- */
.errata {
  list-style: none;
  padding: 0;
  margin: 0 0 3rem;
  border-top: 1px solid var(--ink);
}
.errata__item {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr) auto;
  gap: .4rem 1.2rem;
  align-items: start;
  padding-block: 1.3rem;
  border-bottom: 1px solid var(--staff);
}
.errata__no { padding-top: .35rem; color: var(--ink); }
.errata__main { display: grid; gap: .3rem; }
.errata__title {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.35rem;
  line-height: 1.15;
  letter-spacing: -.02em;
}
.errata__title a { color: inherit; text-decoration: none; }
.errata__title a:hover { text-decoration: underline; text-decoration-thickness: 3px; }
.errata__blurb { max-width: 62ch; color: var(--ink); }
.errata__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .3rem 1.1rem;
  padding-top: .35rem;
  text-align: right;
  color: var(--ink);
}
.errata__status--merged { color: var(--signal); font-weight: 700; }
.errata__status--open, .errata__status--planned, .errata__status--proposed { color: var(--ink-2); }
.errata__ext { font-family: var(--display); font-size: 1rem; letter-spacing: 0; text-decoration: none; }
@media (max-width: 640px) {
  .errata__item { grid-template-columns: 2.2rem minmax(0, 1fr); }
  .errata__meta { grid-column: 2; justify-content: flex-start; text-align: left; padding-top: 0; }
}

.pager {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-block: 1rem 3rem;
}

/* --------------------------------------------------------------------------
   10. Program note (generic entry)
   -------------------------------------------------------------------------- */
/* (`.note` is a notation event — the reading page is `.program`.) */
.program { padding-block: clamp(28px, 5vw, 64px) 3rem; display: grid; gap: 2rem; }
.program__head { display: grid; gap: .8rem; }
.program__lead { font-size: 1.25rem; max-width: var(--measure); }
.edition-notes {
  display: grid;
  gap: .8rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--ink);
}
.edition-notes__list { display: grid; gap: .5rem; }
.edition-notes__list > div { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: 1rem; align-items: baseline; }
.edition-notes__list dd { margin: 0; overflow-wrap: anywhere; }

/* --------------------------------------------------------------------------
   11. Tacet (404)
   -------------------------------------------------------------------------- */
.tacet { padding-block: clamp(40px, 8vw, 110px) 4rem; display: grid; gap: 1rem; justify-items: start; }
.tacet__expr { font-size: 1.3rem; }
.tacet .system { width: 100%; max-width: 720px; margin-block: 1.5rem; }
.tacet__copy { max-width: var(--measure); }

/* --------------------------------------------------------------------------
   12. Publisher's plate (footer)
   -------------------------------------------------------------------------- */
.plate { margin-top: 3rem; padding-bottom: 2rem; }
.plate__rule { border-top: 1px solid var(--ink); }
.plate__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem;
  padding-block: 1.6rem;
}
.plate__imprint { display: grid; gap: .6rem; justify-items: start; }
.plate__edition { font-size: .95rem; max-width: 34ch; }
.plate__nav { display: grid; gap: .4rem; justify-items: start; }
.plate__nav a,
.editions a {
  font-family: var(--display);
  font-weight: 500;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--ink);
  text-decoration: none;
}
.plate__nav a:hover,
.editions a:hover { text-decoration: underline; text-underline-offset: .4em; }
.editions { display: grid; gap: .6rem; }
.editions ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.editions a[aria-current="true"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .4em; }
.editions a[aria-current="true"]::after { content: " ·"; color: var(--signal); }
.plate__line {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .4rem 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--staff);
}
@media (max-width: 760px) {
  .plate__grid { grid-template-columns: minmax(0, 1fr); gap: 1.6rem; }
}

/* --------------------------------------------------------------------------
   13. Pocket score (≤ 480px, incl. 375px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  :root { --margin: 0px; --sp: 8px; }
  .head__row { gap: .6rem 1rem; align-items: center; }
  .movements { order: 2; flex-basis: 100%; margin-left: 0; gap: .4rem 1rem; }
  .movement { font-size: .74rem; }
  .tune { order: 1; margin-left: auto; }

  /* Pocket score: no system line at the page edge, and text no longer masks it. */
  .system::before { box-shadow: none; }
  .section__name,
  .staff__abbr,
  .staff__expr,
  .staff__name,
  .staff__tag,
  .staff__meta { margin-left: 0; padding-left: 0; }

  .opus { font-size: clamp(52px, 15.5vw, 160px); }
  .subtitle { font-size: 1.15rem; }
  .instrumentation__cols { grid-template-columns: minmax(0, 1fr); }
  .title-page__stage { top: 30%; }

  .staff {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "abbr"
      "expr"
      "staff"
      "name"
      "tag"
      "meta";
    row-gap: .2rem;
  }
  .staff--solo { grid-template-areas: "abbr" "staff"; }
  .staff__abbr { align-self: start; padding: 0 .4em 0 0; }
  .staff__notation { margin-block: calc(var(--sp) * 1.9) calc(var(--sp) * 1.8); }
  .staff__name { font-size: 1.45rem; }
  .staff--tutti .staff__name { font-size: 1.8rem; }
  .staves { gap: 2rem; }
  .note::before { width: 9px; height: 7px; left: calc(50% - 4.5px); bottom: calc(var(--p) * var(--sp) / 2 - 3.5px); }
  .note.up::after { left: calc(50% + 3px); }
  .note.down::after { left: calc(50% - 4.5px); }
  .spec-strip { gap: .6rem 1.6rem; }
  .edition-notes__list > div { grid-template-columns: minmax(0, 1fr); gap: .2rem; }
}

/* --------------------------------------------------------------------------
   13b. Widgets on the score — set between two engraved hairlines like the
   spec strip (no box, no fill), fields as ruled underlines, the command as a
   signal-green rule, the cabinet a hairline box with a display-caps marquee,
   and "Insert coin" as an italic expression marking. Structure in base.css.
   -------------------------------------------------------------------------- */
.skin-score .widget {
  max-width: 820px;
  padding-inline: 0;
  padding-block: 1.4rem 1.6rem;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  box-shadow: none;
}
.skin-score .pk__input, .skin-score .pk__select {
  padding-inline: 0 2.1em;
  background-color: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink);
}
.skin-score .pk__input { padding-right: 0; }
.skin-score .pk__input:focus, .skin-score .pk__select:focus { border-bottom-color: var(--signal); }
.skin-score .pk__label { color: var(--ink-2); font-weight: 500; }
.skin-score .pk__cmd { border: 0; border-left: 3px solid var(--signal); }
.skin-score .rx__cab { background: var(--page); box-shadow: none; }
.skin-score .rx__marquee {
  font-family: var(--display);
  font-weight: 900;
  font-size: 1.1rem;
  letter-spacing: .28em;
  box-shadow: none;
  border-radius: 0;
}
.skin-score .rx__bezel { border-radius: 0; }
.skin-score .rx__panel { background: var(--staff-soft); border-radius: 0; }
.skin-score .rx__coin {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 700;
  font-size: .95rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--signal);
}

/* --------------------------------------------------------------------------
   14. Reduced motion — fully readable; the playhead rests at the start
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .sheet .playhead { animation: none !important; transform: none !important; }
  .btn, .tune__dot, .note::before { transition: none; }
}

/* --------------------------------------------------------------------------
   By the numbers — the home stat strip (_stats.php / base.css .stats) engraved
   as a ruled table under the program note: an ink rule on top like the
   instrumentation block, figures at display weight, mono-label captions, and
   a staff hairline under every cell. Restrained: no fills, no colour.
   -------------------------------------------------------------------------- */
.by-numbers {
  margin-top: 1.4rem;
  width: 100%;
  max-width: 820px;
  display: grid;
  gap: .6rem;
}
.by-numbers .stats {
  gap: 0 2rem;
  border-top: 1px solid var(--ink);
}
.by-numbers .stat {
  gap: .35rem;
  padding: .85rem 0 .75rem;
  border-bottom: 1px solid var(--staff);
}
.by-numbers .stat__num {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(1.9rem, 4.2vw, 2.9rem);
  letter-spacing: -.035em;
  color: var(--ink);
}
.by-numbers .stat__label {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-2);
}
