:root {
  --cobalt: #2340c8;
  --cobalt-deep: #1a32a6;
  --ink: #0b1030;
  --card: #f3f5fd;
  --white: #ffffff;
  --on-cobalt-2: #cdd6ff;   /* secondary text on cobalt, tinted from the hue */
  --on-card-2: #33407a;     /* secondary text on white card */
  --rule-cobalt: rgba(255, 255, 255, 0.28);
  --rule-card: rgba(35, 64, 200, 0.22);
  --peak: #ff4b3e;          /* the only red: meter segments past 0 VU */
  --cond: "Archivo", "Arial Narrow", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --spine: 64px;
  --gutter: clamp(16px, 4vw, 56px);
  --radius: 14px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--white) var(--cobalt-deep); }

body {
  margin: 0;
  background: var(--cobalt);
  color: var(--white);
  font-family: var(--cond);
  font-variation-settings: "wdth" 100;
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--white); color: var(--cobalt); }
.liner ::selection { background: var(--cobalt); color: var(--white); }

a { color: inherit; text-underline-offset: 0.18em; }

:focus-visible { outline: 2px solid var(--white); outline-offset: 3px; border-radius: 4px; }
.liner :focus-visible { outline-color: var(--cobalt); }

h1, h2, h3 { margin: 0; font-weight: 800; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }

/* ---------- Spine ---------- */
.spine {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--spine);
  background: var(--ink);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-variation-settings: "wdth" 62;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8125rem;
  white-space: nowrap;
  overflow: hidden;
  z-index: 2;
}
.spine .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--white); flex: none; }

main { margin-left: var(--spine); }

/* ---------- Cover ---------- */
.cover {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 8fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: center;
  min-height: min(100svh, 980px);
  padding: clamp(40px, 7vh, 88px) var(--gutter);
  max-width: 1480px;
}

h1 {
  font-variation-settings: "wdth" 62;
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(3.75rem, 8.4vw, 6rem);
  line-height: 0.86;
  letter-spacing: -0.01em;
}
h1 span { display: block; }

.edition {
  margin-top: 22px;
  font-variation-settings: "wdth" 75;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.875rem;
  padding: 8px 0;
  border-top: 2px solid var(--white);
  border-bottom: 1px solid var(--rule-cobalt);
}

.lede {
  margin-top: 22px;
  max-width: 38ch;
  font-size: clamp(1.0625rem, 1.3vw, 1.25rem);
  line-height: 1.5;
  color: var(--white);
}

.window { margin: 0; }
.window-frame {
  position: relative;
  border-radius: var(--radius);
  padding: 10px;
  background: var(--ink);
  outline: 2px solid var(--white);
  outline-offset: 6px;
}
.window video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  background: #000;
}
.window figcaption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  margin-top: 22px;
  padding-top: 10px;
  border-top: 1px solid var(--rule-cobalt);
  font-size: 0.9375rem;
}
.fc-title {
  font-variation-settings: "wdth" 70;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.fc-meta { color: var(--on-cobalt-2); font-variant-numeric: tabular-nums; }

/* ---------- Section heads ---------- */
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 8fr);
  gap: clamp(20px, 4vw, 64px);
  align-items: end;
  margin-bottom: clamp(24px, 4vw, 40px);
}
.section-head h2, .liner h2 {
  font-variation-settings: "wdth" 62;
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(2.75rem, 6vw, 4.5rem);
  line-height: 0.9;
}
.section-head p { max-width: 60ch; color: var(--on-cobalt-2); }

/* ---------- Side A ---------- */
.side-a, .lyric {
  padding: clamp(64px, 10vw, 128px) var(--gutter) clamp(48px, 7vw, 96px);
  max-width: 1480px;
}

.tracks { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--white); }

.track {
  display: grid;
  grid-template-columns: 2.25rem 56px minmax(0, 1fr) 168px 6.5rem;
  grid-template-areas:
    "num play body meter time"
    "num play seek seek  seek"
    ".   .    script script script";
  column-gap: 18px;
  row-gap: 10px;
  align-items: center;
  padding: 22px 0 18px;
  border-bottom: 1px solid var(--rule-cobalt);
  scroll-margin-top: 24px;
}
.track:target { background-color: var(--cobalt-deep); }

.t-num {
  grid-area: num;
  align-self: start;
  padding-top: 10px;
  font-variation-settings: "wdth" 62;
  font-weight: 900;
  font-size: 1.75rem;
  line-height: 1;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.t-num:hover { text-decoration: underline; text-decoration-thickness: 2px; }

.t-play {
  grid-area: play;
  align-self: start;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid var(--white);
  background: transparent;
  color: var(--white);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color 160ms cubic-bezier(.2,.8,.2,1), color 160ms cubic-bezier(.2,.8,.2,1);
}
.t-play svg { width: 22px; height: 22px; fill: currentColor; }
.t-play .i-pause { display: none; }
.t-play:hover { background: var(--white); color: var(--cobalt); }
.t-play[aria-pressed="true"] { background: var(--white); color: var(--cobalt); }
.t-play[aria-pressed="true"] .i-play { display: none; }
.t-play[aria-pressed="true"] .i-pause { display: block; }
.t-play[data-loading="true"] { opacity: 0.6; cursor: progress; }

.t-body { grid-area: body; min-width: 0; }
.t-title {
  font-variation-settings: "wdth" 70;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: clamp(1.25rem, 2vw, 1.625rem);
  line-height: 1.1;
}
.t-note { margin-top: 6px; color: var(--on-cobalt-2); max-width: 62ch; }

/* level ladder */
.t-meter {
  grid-area: meter;
  display: grid;
  grid-template-columns: repeat(14, 1fr);
  gap: 3px;
  height: 22px;
}
.t-meter i {
  display: block;
  border-radius: 2px;
  background: var(--white);
  opacity: 0.16;
}
.t-meter i.hot { background: var(--peak); }
.t-meter i.on { opacity: 1; }

.t-time {
  grid-area: time;
  text-align: right;
  font-variation-settings: "wdth" 75;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--on-cobalt-2);
}
.t-cur { color: var(--white); }

/* seek bar */
.t-seek {
  grid-area: seek;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 20px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  --p: 0%;
}
.t-seek::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--white) var(--p), var(--rule-cobalt) var(--p));
}
.t-seek::-moz-range-track { height: 3px; border-radius: 2px; background: var(--rule-cobalt); }
.t-seek::-moz-range-progress { height: 3px; border-radius: 2px; background: var(--white); }
.t-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px; margin-top: -5.5px;
  border-radius: 50%;
  background: var(--white);
  border: 0;
}
.t-seek::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--white); border: 0; }
.t-seek:focus-visible { outline-offset: 2px; }

.track audio { display: none; }
.no-js .track audio { display: block; grid-column: 3 / -1; width: 100%; }
.no-js .t-play, .no-js .t-seek, .no-js .t-meter { display: none; }

.t-script { grid-area: script; margin-top: 4px; }
.t-script summary {
  cursor: pointer;
  width: fit-content;
  font-variation-settings: "wdth" 75;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8125rem;
  color: var(--on-cobalt-2);
  list-style: none;
  padding: 4px 0;
}
.t-script summary::-webkit-details-marker { display: none; }
.t-script summary::after { content: " +"; }
.t-script[open] summary::after { content: " −"; }
.t-script summary:hover { color: var(--white); }
.t-script p { margin-top: 10px; max-width: 70ch; }
.t-script b {
  font-variation-settings: "wdth" 70;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.8125rem;
  margin-right: 8px;
}

/* ---------- Liner notes (inner flap, white card) ---------- */
.liner {
  background: var(--card);
  color: var(--ink);
}
.liner-inner {
  padding: clamp(64px, 10vw, 128px) var(--gutter);
  max-width: 1480px;
}
.liner h2 { color: var(--cobalt); max-width: 14ch; }
.liner-lede { margin-top: 22px; max-width: 60ch; color: var(--on-card-2); font-size: 1.125rem; }

.chain {
  list-style: none;
  margin: clamp(40px, 6vw, 72px) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  counter-reset: stage;
  position: relative;
}
.chain li {
  position: relative;
  padding: 44px 22px 0 0;
}
/* the tape path: one cobalt line through five capstans */
.chain li::before {
  content: "";
  position: absolute;
  top: 13px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--cobalt);
}
.chain li::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 0;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: var(--card);
  border: 3px solid var(--cobalt);
}
.chain li:last-child::before { right: auto; width: 25px; }
.chain li:last-child::after { background: var(--cobalt); }
.chain h3 {
  color: var(--cobalt);
  font-variation-settings: "wdth" 62;
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(1.5rem, 2.4vw, 2.125rem);
  line-height: 0.95;
}
.chain p { margin-top: 12px; color: var(--on-card-2); font-size: 0.9875rem; line-height: 1.5; }

/* ---------- Lyric sheet ---------- */
.prompt {
  margin: 0;
  background: var(--ink);
  color: #dfe5ff;
  border-radius: var(--radius);
  padding: clamp(20px, 3vw, 36px);
  font-family: var(--mono);
  font-size: clamp(0.78rem, 1.05vw, 0.9rem);
  line-height: 1.65;
  overflow-x: auto;
  white-space: pre;
  tab-size: 2;
  scrollbar-color: var(--on-cobalt-2) var(--ink);
}
.prompt .c-k { color: var(--white); font-weight: 600; }
.prompt .c-d { color: #9fb0ff; }

/* ---------- Credits ---------- */
.credits {
  padding: clamp(56px, 8vw, 104px) var(--gutter) clamp(40px, 6vw, 72px);
  border-top: 2px solid var(--white);
  margin: 0 var(--gutter);
  padding-left: 0;
  padding-right: 0;
  max-width: 1368px;
}
.credit-line {
  font-variation-settings: "wdth" 62;
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(2rem, 4.6vw, 3.75rem);
  line-height: 0.95;
  max-width: 22ch;
  text-wrap: balance;
}
.fine {
  margin-top: 36px;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 16px 48px;
  font-size: 0.875rem;
  color: var(--on-cobalt-2);
}
.fine p { max-width: 72ch; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .chain { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 40px; }
  .chain li:nth-child(3)::before { right: auto; width: 25px; }
}

@media (max-width: 900px) {
  :root { --spine: 0px; }
  .spine {
    position: static;
    width: auto;
    height: 40px;
    writing-mode: horizontal-tb;
    transform: none;
    justify-content: flex-start;
    padding: 0 16px;
    gap: 12px;
    font-size: 0.75rem;
  }
  .spine > :nth-child(n+6) { display: none; }
  .prompt { white-space: pre-wrap; overflow-wrap: anywhere; }
  .cover { grid-template-columns: 1fr; min-height: 0; padding-top: 36px; gap: 36px; }
  h1 { font-size: clamp(3.5rem, 19vw, 6rem); }
  h1 span { display: inline; }
  .section-head { grid-template-columns: 1fr; gap: 14px; }
  .track {
    grid-template-columns: 1.75rem 48px minmax(0, 1fr);
    grid-template-areas:
      "num play body"
      ".   meter meter"
      ".   seek seek"
      ".   time time"
      ".   script script";
    column-gap: 14px;
    row-gap: 8px;
  }
  .t-play { width: 48px; height: 48px; }
  .t-meter { height: 14px; }
  .t-time { text-align: left; font-size: 0.875rem; }
  .chain { grid-template-columns: 1fr; row-gap: 0; }
  .chain li { padding: 0 0 32px 48px; }
  .chain li::before { top: 0; bottom: 0; left: 11px; right: auto; width: 3px; height: auto; }
  .chain li::after { top: 0; }
  .chain li:nth-child(3)::before { width: 3px; }
  .chain li:last-child::before { bottom: auto; height: 25px; width: 3px; }
  .fine { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  h1 { line-height: 0.9; }
  h1 span { display: block; }
  .window-frame { padding: 6px; outline-offset: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
