/* 248 Anthems — TPC Sawgrass · "The Survey Sheet"
 * Brand System v2: bone page, graphite ink, Barlow Condensed display,
 * Inter text, IBM Plex Mono data. Lime = signal — and here it earns a second
 * job: it is the colour of a ball in the water. Orange appears exactly once,
 * on the 2007 band. Two course-derived support tints — bulkhead timber and
 * lagoon — are used as thin band tints and drawing ink only. */

/* ---------- fonts ---------- */
@font-face {
  font-family: 'Barlow Condensed';
  src: url('../fonts/barlow-condensed-latin-500-normal.woff2') format('woff2');
  font-weight: 500; font-display: swap;
}
@font-face {
  font-family: 'Barlow Condensed';
  src: url('../fonts/barlow-condensed-latin-600-normal.woff2') format('woff2');
  font-weight: 600; font-display: swap;
}
@font-face {
  font-family: 'Barlow Condensed';
  src: url('../fonts/barlow-condensed-latin-700-normal.woff2') format('woff2');
  font-weight: 700; font-display: swap;
}
@font-face {
  font-family: 'Inter Var';
  src: url('../fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 100 900; font-display: swap;
}
@font-face {
  font-family: 'Plex Mono';
  src: url('../fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: 'Plex Mono';
  src: url('../fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2');
  font-weight: 500; font-display: swap;
}

/* ---------- tokens ---------- */
:root {
  --bone: #F4F3EF;          /* a cooler bone — Florida lagoon light */
  --bone-hi: #FAF9F6;
  --graphite: #1E1E1E;
  --charcoal: #0D0D0D;
  --ash: #D8D6D0;
  --ink: #1F201E;
  --ink-dim: #565A55;
  --lime: #CCFF00;
  --lime-ink: #5A7100;      /* lime darkened for text on bone (AA) */
  --orange: #FF6A00;
  --orange-deep: #A33E00;

  /* course-derived support tints — thin bands and drawing ink only */
  --timber: #6B4A32;
  --timber-deep: #4A3021;
  --lagoon: #2C4A45;
  --lagoon-deep: #1E3531;

  --font-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --font-text: 'Inter Var', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'Plex Mono', ui-monospace, 'SF Mono', monospace;

  --maxw: 1440px;
  --gutter: clamp(1rem, 5vw, 4.5rem);
  --hairline: color-mix(in srgb, var(--graphite) 14%, transparent);

  --beat: 0.5357s;          /* 60 / 112 */
  --bar8: 4.2857s;          /* 8 beats */
}

/* ---------- base ---------- */
* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-text);
  font-variation-settings: 'wght' 420;
  background: var(--bone);
  color: var(--ink);
  font-size: clamp(0.98rem, 0.93rem + 0.25vw, 1.08rem);
  line-height: 1.58;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
.mono { font-family: var(--font-mono); font-weight: 500; letter-spacing: .1em; }
::selection { background: var(--lime); color: var(--graphite); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--graphite); outline-offset: 3px; }
.anthems :focus-visible { outline-color: var(--lime); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1; text-transform: uppercase; letter-spacing: .005em; }
em { font-style: normal; border-bottom: 2px solid var(--lime); }
.container { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--lime); color: var(--graphite);
  padding: .8rem 1.2rem; font-family: var(--font-mono); text-decoration: none;
}
.skip:focus { left: 0; }

/* ---------- masthead ---------- */
.masthead {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 1.2rem;
  padding: .75rem var(--gutter);
  background: color-mix(in srgb, var(--bone) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
  transition: border-color .6s ease;
}
body.is-playing .masthead { border-bottom-color: color-mix(in srgb, var(--lagoon) 55%, transparent); }
.masthead-mark { display: inline-flex; align-items: baseline; gap: .45rem; text-decoration: none; font-family: var(--font-display); }
.mark-num { background: var(--graphite); color: var(--bone); font-weight: 700; font-size: 1.05rem; padding: .1em .3em .12em; letter-spacing: .02em; }
.mark-word { font-weight: 600; letter-spacing: .3em; font-size: .82rem; }
.masthead-nav { display: flex; gap: clamp(.9rem, 2.4vw, 2rem); }
.masthead-nav a {
  text-decoration: none; font-size: .84rem; font-variation-settings: 'wght' 560;
  color: var(--ink-dim); padding-bottom: .15em;
  border-bottom: 2px solid transparent;
  transition: color .18s ease, border-color .18s ease;
}
.masthead-nav a:hover { color: var(--ink); border-color: var(--lime); }
.masthead-meta { font-size: .62rem; color: var(--ink-dim); display: inline-flex; align-items: center; gap: .55em; }
.key-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ash); transition: background .6s ease; }
body.is-playing .key-dot { background: var(--lime); box-shadow: 0 0 0 1px var(--graphite); animation: dot-beat calc(var(--beat) * 2) ease-in-out infinite; }
@keyframes dot-beat { 0%, 100% { transform: scale(1); } 28% { transform: scale(1.45); } }
@media (max-width: 900px) { .masthead-meta { display: none; } }

/* ---------- ratio stripe (24 + 8 = 32 units) ---------- */
.stripe { display: flex; gap: 3px; height: 24px; }
.stripe span { flex: 1; background: color-mix(in srgb, var(--graphite) 14%, transparent); transition: background .3s ease, opacity .3s ease; }
.stripe span.u-down { background: color-mix(in srgb, var(--lime) 38%, var(--bone)); }
.stripe span.lit { background: var(--graphite); }
.stripe span.u-down.lit { background: var(--lime); }
.stripe-dark span { background: color-mix(in srgb, var(--bone) 13%, transparent); }
.stripe-dark span.u-down { background: color-mix(in srgb, var(--lime) 22%, transparent); }
.stripe-dark span.lit { background: var(--bone); }
.stripe-dark span.u-down.lit { background: var(--lime); }
.stripe-caption { display: flex; justify-content: space-between; gap: 1rem; font-size: .6rem; color: var(--ink-dim); margin-top: .55rem; }

/* ---------- hero ---------- */
.hero { padding: clamp(6.5rem, 12vh, 9rem) var(--gutter) clamp(3rem, 6vh, 5rem); max-width: var(--maxw); margin: 0 auto; }
.crumb { font-size: .64rem; color: var(--ink-dim); margin-bottom: clamp(2rem, 5vh, 3.5rem); }
.crumb a { text-decoration: none; }
.crumb a:hover { color: var(--ink); border-bottom: 1px solid var(--lime); }
.crumb [aria-current] { color: var(--ink); }
.hero-kicker { font-size: .7rem; color: var(--ink-dim); display: flex; align-items: center; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.hero-kicker::before { content: ''; width: 44px; height: 2px; background: var(--graphite); flex: none; }
.hero h1 {
  font-weight: 700;
  font-size: clamp(4.2rem, 14vw, 11rem);
  line-height: .88; letter-spacing: .002em;
  color: var(--charcoal);
}
.hero-sub {
  margin-top: 1.8rem; max-width: 60ch;
  font-size: clamp(1.02rem, 1.4vw, 1.2rem); line-height: 1.6;
  color: #3A3C39;
}
.spec {
  margin-top: clamp(2.4rem, 5vh, 3.6rem);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--ash); border: 1px solid var(--ash);
}
.spec > div { background: var(--bone); padding: 1rem 1.1rem 1.15rem; }
.spec dt { font-size: .58rem; color: var(--ink-dim); }
.spec dd {
  margin: .55rem 0 0; font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.2rem, 2vw, 1.65rem); text-transform: uppercase;
  line-height: 1; color: var(--charcoal);
}
.spec > div:last-child dd { color: var(--lagoon-deep); }
.hero .stripe { margin-top: clamp(2.4rem, 5vh, 3.6rem); }

/* ---------- section scaffolding ---------- */
/* NOTE: scoped by class — a bare `section` rule would leak into the player's
   internal <section> panels and the guide's sections. */
.anthems, .system, .uses, .seventeen, .related { padding-block: clamp(4rem, 9vh, 7.5rem); }
.sec-head { display: flex; align-items: center; gap: 1.1rem; margin-bottom: clamp(1.8rem, 4vh, 2.8rem); }
.sec-no { font-size: .78rem; color: var(--ink-dim); }
.sec-rule { flex: 1; height: 1px; background: var(--hairline); transition: background .6s ease; }
body.is-playing .sec-rule { background: color-mix(in srgb, var(--lagoon) 45%, transparent); }
.sec-kicker { font-size: .66rem; color: var(--ink-dim); }
.sec-intro h2 { font-size: clamp(2.5rem, 5.6vw, 4.4rem); color: var(--charcoal); max-width: 20ch; }
.sec-sub { margin-top: 1.1rem; max-width: 72ch; color: #3A3C39; }
.sub-title { font-size: clamp(1.7rem, 3.2vw, 2.5rem); display: flex; gap: .9rem; align-items: baseline; margin-bottom: 1.3rem; }
.sub-no { font-size: .64rem; color: var(--ink-dim); }

/* ---------- 01 · anthems (dark player panel) ---------- */
.anthems { background: var(--charcoal); color: var(--bone); }
.anthems .sec-no, .anthems .sec-kicker { color: color-mix(in srgb, var(--bone) 55%, transparent); }
.anthems .sec-rule { background: color-mix(in srgb, var(--bone) 16%, transparent); }
body.is-playing .anthems .sec-rule { background: color-mix(in srgb, var(--lime) 40%, transparent); }
.anthems .sec-intro h2 { color: var(--bone); }
.anthems .sec-sub { color: color-mix(in srgb, var(--bone) 74%, transparent); }
.player-shell {
  position: relative; margin-top: clamp(2rem, 5vh, 3rem);
  background: var(--graphite);
  border: 1px solid color-mix(in srgb, var(--bone) 13%, transparent);
  border-top: 3px solid color-mix(in srgb, var(--bone) 13%, transparent);
  padding: clamp(1.2rem, 3vw, 2.4rem);
  transition: border-top-color .6s ease;
}
body.is-playing .player-shell { border-top-color: var(--lime); }
#spectrum { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: .5; }
#player { position: relative; }
.anthems .ap {
  --ap-accent: var(--lime);
  --ap-accent-fg: var(--charcoal);
  --ap-font: var(--font-text);
  --ap-radius: 0; --ap-row-radius: 0;
}
.anthems .ap-title { font-family: var(--font-display); text-transform: uppercase; font-weight: 600; letter-spacing: .01em; font-size: clamp(1.5rem, 3vw, 2.2rem); }
.anthems .ap-kicker, .anthems .ap-panel-title, .anthems .ap-time, .anthems .ap-row-num,
.anthems .ap-badge, .anthems .ap-lib-course, .anthems .ap-sub, .anthems .ap-status { font-family: var(--font-mono); }
.anthems .ap-sub, .anthems .ap-status { font-size: .72rem; letter-spacing: .06em; }
.rs-progress-wrap { position: relative; margin-top: 1.5rem; }
.rs-progress-wrap .stripe { height: 18px; }
.rs-progress-wrap .stripe-caption { color: color-mix(in srgb, var(--bone) 56%, transparent); }
.stage-note { margin-top: 1.1rem; font-size: .6rem; color: color-mix(in srgb, var(--bone) 54%, transparent); text-align: center; }

/* ---------- 02 · system ---------- */
.system-grid { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(1.6rem, 4vw, 3.2rem); margin-top: clamp(1.8rem, 4vh, 2.6rem); align-items: start; }
.frames-ribbon { border: 1px solid var(--hairline); padding: 1.1rem; background: var(--bone-hi); }
.frames { display: flex; gap: 3px; height: 30px; }
.frames.down { margin-top: 3px; }
.frames span { flex: 1; background: var(--graphite); opacity: .09; transition: opacity .18s ease; }
.frames.down span { background: var(--lime); opacity: .22; }
.frames span.lit { opacity: .92; }
.frames.down span.lit { opacity: 1; }
.frames-caption { display: flex; justify-content: space-between; font-size: .58rem; color: var(--ink-dim); margin-top: .6rem; }
.pulse-block {
  margin-top: 1px; background: var(--graphite); color: var(--bone);
  padding: clamp(1.2rem, 2.5vw, 2rem);
  display: grid; justify-items: center; gap: .6rem;
}
.pulse-ring { width: min(210px, 58vw); height: auto; }
.pulse-ring .pr-outer { stroke: color-mix(in srgb, var(--bone) 30%, transparent); stroke-width: 1; }
.pulse-ring .pr-inner { stroke: var(--lime); stroke-width: 1.6; }
.pulse-ring .pr-num { font-family: var(--font-display); font-weight: 600; font-size: 34px; fill: var(--bone); }
.pulse-ring .pr-unit { font-family: var(--font-mono); font-size: 10px; letter-spacing: .35em; fill: color-mix(in srgb, var(--bone) 55%, transparent); }
#pulse-ticks line { stroke: color-mix(in srgb, var(--bone) 38%, transparent); stroke-width: 1; }
#pulse-ticks line.q { stroke: var(--lime); stroke-width: 1.6; }
.pulse-core { transform-origin: 100px 100px; }
body:not(.is-playing) .pulse-core { animation: breathe calc(var(--beat) * 2) ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 30% { transform: scale(1.05); } }
.pulse-caption { font-size: .56rem; color: color-mix(in srgb, var(--bone) 48%, transparent); text-align: center; }
.method-cards { display: grid; gap: 1px; background: var(--hairline); border: 1px solid var(--hairline); }
.method-card { background: var(--bone-hi); padding: clamp(1.3rem, 2.6vw, 2rem); }
.method-card h3 { font-size: 1.5rem; display: flex; gap: .8rem; align-items: baseline; margin-bottom: .7rem; }
.card-no { font-size: .62rem; color: var(--ink-dim); }
.method-card p { color: #3A3C39; font-size: .96rem; max-width: 62ch; }
.footnote { margin-top: 1rem; padding-top: .7rem; border-top: 1px dashed var(--hairline); font-size: .62rem !important; letter-spacing: .04em; line-height: 1.7; color: var(--ink-dim) !important; font-weight: 400; }

/* ---------- 03 · uses ---------- */
.uses { padding-top: 0; }
.uses-grid {
  list-style: none; padding: 0; margin: clamp(1.6rem, 4vh, 2.4rem) 0 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--hairline); border: 1px solid var(--hairline);
}
.use { background: var(--bone); padding: clamp(1.2rem, 2.4vw, 1.8rem); }
.use-no { display: block; font-size: .6rem; color: var(--ink-dim); margin-bottom: 1.6rem; }
.use h3 { font-size: 1.45rem; margin-bottom: .45rem; }
.use p { font-size: .92rem; color: #3A3C39; max-width: 42ch; }

/* ═══════════ 04 · the sheet ═══════════ */
.seventeen { border-top: 1px solid var(--hairline); background: linear-gradient(180deg, color-mix(in srgb, var(--lagoon) 4%, var(--bone)) 0%, var(--bone) 44%); }
.sheet-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 310px;
  gap: clamp(1.2rem, 2.4vw, 2rem);
  margin-top: clamp(2rem, 4vh, 3rem);
  align-items: start;
}

/* the drawing sheet */
.sheet {
  /* the sheet is a grid item whose child is a scroll container: it must be
     allowed to shrink below the drawing's min-width or the page overflows */
  min-width: 0;
  margin: 0; background: var(--bone-hi);
  border: 1px solid color-mix(in srgb, var(--lagoon) 26%, var(--ash));
  padding: 0;
}
.sheet-head {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-size: .58rem; color: var(--ink-dim);
  padding: .7rem clamp(.7rem, 1.6vw, 1.2rem);
  border-bottom: 1px solid color-mix(in srgb, var(--lagoon) 22%, var(--ash));
}
#plan { display: block; width: 100%; height: auto; }
.plan-hint, .plan-key { display: none; }
.sheet-foot {
  padding: clamp(.9rem, 2vw, 1.4rem) clamp(.7rem, 1.6vw, 1.2rem) clamp(1rem, 2vw, 1.3rem);
  border-top: 1px solid color-mix(in srgb, var(--lagoon) 22%, var(--ash));
  display: grid; gap: .7rem;
}
.sheet-caption { font-size: .84rem; line-height: 1.62; color: #3A3C39; max-width: 88ch; }
.sheet-caption strong { font-variation-settings: 'wght' 640; color: var(--charcoal); }
.sheet-tally {
  margin-top: .3rem; padding-top: .7rem; border-top: 1px dashed var(--hairline);
  font-size: .58rem; color: var(--ink-dim);
  display: flex; flex-wrap: wrap; gap: .5rem .7rem; align-items: baseline;
}
.sheet-tally #tally { color: var(--lime-ink); font-weight: 500; }
.sheet-tally-sep { opacity: .5; }

/* plan drawing grammar */
.pl-water { fill: color-mix(in srgb, var(--lagoon) 13%, var(--bone-hi)); stroke: color-mix(in srgb, var(--lagoon) 55%, transparent); stroke-width: 1.2; }
.pl-grid line { stroke: color-mix(in srgb, var(--lagoon) 16%, transparent); stroke-width: 1; }
.pl-grid line.g-major { stroke: color-mix(in srgb, var(--lagoon) 28%, transparent); }
.pl-balls circle { fill: var(--lime); stroke: var(--lagoon-deep); stroke-width: .5; }
.pl-balls-hi circle { stroke-width: .6; }
.pl-band { fill: color-mix(in srgb, var(--orange) 11%, transparent); stroke: var(--orange-deep); stroke-width: 1; stroke-dasharray: 4 4; }
.pl-island { fill: color-mix(in srgb, var(--timber) 17%, var(--bone-hi)); stroke: var(--timber-deep); stroke-width: 1.4; }
.pl-green { fill: var(--bone-hi); stroke: var(--graphite); stroke-width: 1.1; }
.pl-timber line { stroke: var(--timber-deep); stroke-width: 2; stroke-linecap: butt; }
.pl-walk { fill: color-mix(in srgb, var(--timber) 16%, var(--bone-hi)); stroke: var(--timber-deep); stroke-width: 1.1; }
.pl-bunker { fill: color-mix(in srgb, var(--graphite) 12%, var(--bone-hi)); stroke: var(--graphite); stroke-width: 1; }
.pl-pin { fill: var(--graphite); }
.pl-pin-stick { fill: none; stroke: var(--graphite); stroke-width: 1.4; stroke-linejoin: round; }
.pl-tee { fill: color-mix(in srgb, var(--timber) 18%, var(--bone-hi)); stroke: var(--timber-deep); stroke-width: 1.1; }
.pl-dim path { fill: none; stroke: var(--graphite); stroke-width: 1.1; }
.pl-dim-plate { fill: var(--bone-hi); stroke: none; }
.pl-dim-text { font-family: var(--font-mono); font-weight: 500; font-size: 15px; letter-spacing: .1em; fill: var(--charcoal); }
.pl-label { font-family: var(--font-mono); font-weight: 500; font-size: 12px; letter-spacing: .11em; fill: var(--ink-dim); }
.pl-label-sm { font-family: var(--font-mono); font-weight: 500; font-size: 11px; letter-spacing: .1em; fill: var(--ink-dim); }
.pl-label-dim { fill: color-mix(in srgb, var(--ink-dim) 78%, transparent); }
.pl-label-hi { fill: var(--orange-deep); }
.pl-figure { font-family: var(--font-display); font-weight: 700; font-size: 30px; letter-spacing: .01em; fill: var(--charcoal); }
.pl-rule { stroke: color-mix(in srgb, var(--graphite) 22%, transparent); stroke-width: 1; }
.pl-stub { stroke: color-mix(in srgb, var(--ink-dim) 55%, transparent); stroke-width: 1; }
.pl-stub-hi { stroke: var(--orange-deep); }
.pl-balloon { fill: var(--bone-hi); stroke: var(--graphite); stroke-width: 1.1; }
.pl-balloon-hi { stroke: var(--orange-deep); }
.pl-balloon-n { font-family: var(--font-mono); font-weight: 500; font-size: 11px; fill: var(--graphite); }
.pl-beat line { stroke: color-mix(in srgb, var(--lagoon) 45%, transparent); stroke-width: 1.4; }

/* the metronome sweep: idle it does not exist */
.pl-sweep { opacity: 0; }
.pl-needle { fill: var(--lime); }
body.is-playing .pl-sweep { opacity: 1; animation: sweep-x var(--bar8) linear infinite; }
@keyframes sweep-x { from { transform: translateX(48px); } to { transform: translateX(796px); } }

/* metric tiles */
.tiles { list-style: none; padding: 0; margin: 0; display: grid; gap: 1px; background: var(--hairline); border: 1px solid var(--hairline); }
.tile { background: var(--bone-hi); padding: clamp(1.1rem, 2.2vw, 1.5rem); position: relative; }
.tile-no { position: absolute; top: 1rem; right: 1.1rem; font-size: .56rem; color: var(--ink-dim); }
.tile-val {
  display: block; font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.8rem, 5vw, 3.9rem); line-height: .92; color: var(--charcoal);
  letter-spacing: -.005em;
}
.tile-unit { display: block; font-size: .56rem; color: var(--ink-dim); margin-top: .5rem; line-height: 1.5; }
.tile p { font-size: .82rem; line-height: 1.55; color: #3A3C39; margin-top: .8rem; }
.tile-lime { border-left: 3px solid var(--lime); }
.tile-lime .tile-val { color: var(--charcoal); }
.tile-hi { border-left: 3px solid var(--orange); }
.tile-hi .tile-val { color: var(--orange-deep); }
.tile-est { background: color-mix(in srgb, var(--ash) 34%, var(--bone-hi)); }
.tile-est .tile-val { color: var(--ink-dim); }
.est-flag {
  display: inline-block; font-size: .54rem; letter-spacing: .12em;
  background: var(--graphite); color: var(--bone);
  padding: .2em .5em .25em; margin-right: .45em; vertical-align: .08em;
}

/* 4.6 the closing three */
.closing, .record, .log { margin-top: clamp(3rem, 7vh, 5rem); }
.ledger { width: 100%; border-collapse: collapse; text-align: left; }
.ledger caption { text-align: left; font-size: .58rem; color: var(--ink-dim); padding-bottom: .7rem; letter-spacing: .12em; }
.ledger th, .ledger td { padding: .8rem 1rem .8rem 0; border-bottom: 1px solid var(--hairline); vertical-align: baseline; }
.ledger thead th { font-size: .58rem; color: var(--ink-dim); border-bottom: 1px solid var(--graphite); font-weight: 500; letter-spacing: .12em; }
.ledger tbody th {
  font-family: var(--font-display); font-weight: 700; font-size: 1.9rem;
  line-height: 1; color: var(--charcoal); width: 4.5rem;
}
.ledger tbody td:nth-child(2), .ledger tbody td:nth-child(3) { font-size: .8rem; color: var(--ink-dim); width: 5.5rem; }
.ledger tbody td:last-child { font-size: .95rem; color: #3A3C39; }
.ledger .row-hi th { color: var(--lagoon-deep); }
.ledger .row-hi td:nth-child(3) { color: var(--charcoal); }
.ledger .row-hi { background: color-mix(in srgb, var(--lime) 9%, transparent); }
.ledger-note { margin-top: .9rem; font-size: .56rem; color: var(--ink-dim); }

/* 4.7 the record */
.cr-grid { border-top: 1px solid var(--graphite); }
.cr-row { display: grid; grid-template-columns: minmax(190px, 260px) 1fr; gap: .3rem 2rem; padding: .85rem 0; border-bottom: 1px solid var(--hairline); }
.cr-row dt { font-size: .6rem; color: var(--ink-dim); padding-top: .3em; }
.cr-row dd { margin: 0; font-size: .96rem; color: #2B2D2A; }

/* 4.8 the log */
.log-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--graphite); }
.log-list li {
  display: grid; grid-template-columns: 6.5rem 1fr; gap: .4rem 2rem;
  padding: .95rem 0; border-bottom: 1px solid var(--hairline);
}
.log-year { font-size: .74rem; color: var(--lagoon-deep); padding-top: .2em; }
.log-list p { font-size: .96rem; color: #2B2D2A; max-width: 78ch; }
.log-list li:nth-child(5) .log-year { color: var(--orange-deep); }

/* ---------- 05 · related ---------- */
.related { border-top: 1px solid var(--hairline); }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--hairline); border: 1px solid var(--hairline); margin-top: clamp(1.6rem, 4vh, 2.4rem); }
.rel-card {
  position: relative; background: var(--bone); text-decoration: none;
  padding: clamp(1.4rem, 2.8vw, 2.2rem); min-height: 190px;
  display: flex; flex-direction: column; justify-content: flex-end; gap: .3rem;
  transition: background .25s ease;
}
.rel-card:hover { background: var(--bone-hi); }
.rel-no { position: absolute; top: 1.2rem; left: 1.4rem; font-size: .6rem; color: var(--ink-dim); }
.rel-card h3 { font-size: clamp(1.7rem, 2.8vw, 2.4rem); color: var(--charcoal); }
.rel-card p { font-size: .62rem; color: var(--ink-dim); }
.rel-arrow { position: absolute; top: 1.05rem; right: 1.4rem; font-size: 1.1rem; color: var(--ink-dim); transition: transform .25s ease, color .25s ease; }
.rel-card:hover .rel-arrow { transform: translateX(5px); color: var(--ink); }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--hairline); padding-block: clamp(2.4rem, 5vh, 3.6rem); }
.footer .stripe { margin-bottom: 2.2rem; height: 16px; }
.footer-cols { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; align-items: flex-end; }
.footer-line { margin-top: 1rem; font-variation-settings: 'wght' 560; }
.footer-sub { font-size: .6rem; color: var(--ink-dim); margin-top: .4rem; }
.footer-links { display: grid; gap: .8rem; font-size: .64rem; justify-items: end; }
.footer-links a { text-decoration: none; color: var(--ink-dim); border-bottom: 1px solid var(--hairline); padding-bottom: .15em; }
.footer-links a:hover { color: var(--ink); border-color: var(--lime); }
@media (max-width: 700px) { .footer-links { justify-items: start; } }

/* ---------- reveals ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
.reveal.in { opacity: 1; transform: none; }
/* the sheet draws itself in: the drawing first, then the record on top of it */
#balls { opacity: 0; }
.sheet.in #balls { opacity: 1; transition: opacity 1.1s ease .35s; }
#band-2007, #balls-2007, #note-2007 { opacity: 0; }
.sheet.in #band-2007, .sheet.in #balls-2007, .sheet.in #note-2007 { opacity: 1; transition: opacity .8s ease 1.35s; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .sheet-grid { grid-template-columns: minmax(0, 1fr); }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .tile-est { grid-column: 1 / -1; }
}
@media (max-width: 1080px) {
  .system-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .uses-grid { grid-template-columns: 1fr 1fr; }
  .spec { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .related-grid { grid-template-columns: 1fr; }
  .rel-card { min-height: 0; padding-top: 2.6rem; }
  .cr-row { grid-template-columns: 1fr; gap: .2rem; }
  .log-list li { grid-template-columns: 1fr; gap: .15rem; }
  .tiles { grid-template-columns: 1fr; }
  .ledger tbody th { font-size: 1.5rem; width: 3.4rem; }
  .ledger th, .ledger td { padding-right: .6rem; }
  .ledger tbody td:nth-child(2), .ledger tbody td:nth-child(3) { width: 3.2rem; }
}
@media (max-width: 1080px) {
  /* the SVG key column is dropped (JS narrows the viewBox to 0 0 800 700) and
     the key is handed to HTML, so the drawing keeps its scale and its labels */
  #key-col { display: none; }
  #plan { min-width: 620px; }
  .plan-scroll { overflow-x: auto; overscroll-behavior-x: contain; }
  .plan-hint {
    font-size: .54rem; color: var(--ink-dim); text-align: center;
    padding: .5rem 0 .1rem;
  }
  .sheet.can-pan .plan-hint { display: block; }
  .plan-key {
    display: grid; grid-template-columns: 1fr 1fr; gap: .45rem 1rem;
    list-style: none; margin: 0; padding: .8rem clamp(.7rem, 1.6vw, 1.2rem) .2rem;
  }
  .plan-key li { display: flex; align-items: center; gap: .5rem; }
  .pk-n {
    flex: none; width: 1.35rem; height: 1.35rem; border-radius: 50%;
    border: 1px solid var(--graphite); display: grid; place-items: center;
    font-size: .58rem; color: var(--graphite);
  }
  .pk-label { font-size: .58rem; color: var(--ink-dim); }
  .plan-key .pk-hi .pk-n { border-color: var(--orange-deep); color: var(--orange-deep); }
  .plan-key .pk-hi .pk-label { color: var(--orange-deep); }
}
@media (max-width: 560px) {
  .plan-key { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .uses-grid { grid-template-columns: 1fr; }
  .masthead-nav a { font-size: .78rem; }
  .sec-intro h2 { max-width: 14ch; }
}
@media (max-width: 400px) {
  .mark-word { display: none; }
  .spec { grid-template-columns: 1fr; }
}

/* ---------- reduced motion: composed, instant, fully annotated ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  #balls, #balls-2007, #band-2007, #note-2007 { opacity: 1; transition: none; }
  body:not(.is-playing) .pulse-core { animation: none; }
  body.is-playing .key-dot { animation: none; }
  .pl-sweep, body.is-playing .pl-sweep { animation: none; opacity: 0; }
  .masthead, .sec-rule, .player-shell, .key-dot, .rel-card, .rel-arrow, .stripe span, .reveal { transition: none; }
}
