@font-face {
  font-family: "Inter";
  src: url("assets/fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Inter Tight";
  src: url("assets/fonts/inter-tight-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #d6e0eb;
  --ink: #002a5f; /* the logo's navy */
  --muted: #435a7e;
  --hair: rgb(0 42 95 / 0.26);
  --pad: clamp(16px, 2.4vw, 32px);
  --row: 34px;
  --nav: calc(60px + var(--pad) * 1.5);
  --side: 380px;
  --gutter: calc(var(--pad) * 1.5);
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0f1a2d;
  --ink: #d6e0eb;
  --muted: #8e9bb2;
  --hair: rgb(214 224 235 / 0.24);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); scroll-padding-top: calc(var(--nav) + 12px); }
body {
  margin: 0;
  font: 400 15px/1.45 "Inter", system-ui, sans-serif;
  font-feature-settings: "tnum" 1, "cv11" 1;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s, color .3s;
  background: var(--bg);
}
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Top bar ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  height: var(--nav);
  padding: 0 var(--pad);
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, background-color 0.3s;
}
.scrolled .top { border-bottom-color: var(--hair); }
.logo { display: block; width: 60px; }
.logo svg { display: block; width: 100%; height: auto; }
.logo .box { fill: #002a5f; }
.logo .letters { fill: #fff; }
[data-theme="dark"] .logo svg { outline: 1px solid var(--ink); outline-offset: -1px; }
[data-theme="dark"] .logo .box { fill: var(--bg); }
[data-theme="dark"] .logo .letters { fill: var(--ink); }
.top-meta { margin: 0; justify-self: end; font-size: 15px; }
.theme { width: 32px; height: 32px; display: grid; place-items: center; }
.theme svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
[data-theme="dark"] .theme svg circle { fill: currentColor; }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--side);
  gap: var(--gutter);
  align-items: start;
  padding: clamp(24px, 3.5vw, 56px) var(--pad) clamp(40px, 5vw, 72px);
}
h1 .line { display: block; }
h1 .line > span { display: block; }
h1 {
  /* Trim the line box to the capital letters, so the top of "M" is the top of the block
     and lines up with the intro's rule. */
  text-box: trim-both cap alphabetic;
  margin: 0;
  font: 300 clamp(52px, 9.2vw, 152px)/0.94 "Inter Tight", sans-serif;
  letter-spacing: -0.045em;
}
.deck {
  margin: 0;
  border-top: 2px solid var(--ink);
  padding-top: 10px;
  font-size: 15px;
  line-height: 1.45;
}

/* ---------- Layout ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--side);
  gap: var(--gutter);
  padding: 0 var(--pad);
  align-items: start;
}

/* ---------- Schedule (timetable) ---------- */
.schedule-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding-bottom: 8px;
}
h2 { margin: 0; font: 400 15px/1.3 "Inter", sans-serif; }
.schedule-head h2 { text-transform: uppercase; letter-spacing: 0.06em; font-size: 12px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filters button {
  font-size: 13px;
  padding: 3px 10px;
  border: 1px solid var(--hair);
  border-radius: 999px;
}
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* Five columns shared by the column heads and every tape. */
.colheads, .tape {
  display: grid;
  grid-template-columns: 7.5rem 9.5rem 2.25rem minmax(0, 1fr) 4.5rem;
  column-gap: 14px;
}
.colheads {
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  padding: 6px 0;
  font-size: 12px;
  color: var(--muted);
}
.r { text-align: right; }

.year { position: relative; }
.year { padding-top: 18px; }
/* Year stays pinned under the nav while its tapes scroll by; the next year pushes it out. */
.year > h2 {
  position: sticky;
  top: var(--nav);
  z-index: 5;
  background: var(--bg);
  font: 300 clamp(40px, 5vw, 64px)/1 "Inter Tight", sans-serif;
  letter-spacing: -0.03em;
  padding: 10px 0 10px;
  border-bottom: 1px solid var(--ink);
}
.tape {
  border-bottom: 1px solid var(--ink);
  padding: 8px 0 10px;
}
.tape[hidden] { display: none; }
.month {
  grid-column: 1;
  font: 300 34px/1 "Inter Tight", sans-serif;
  letter-spacing: -0.02em;
  padding-top: 2px;
}
.store { grid-column: 2; padding-top: 4px; font-size: 15px; line-height: 1.3; }
.store small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.store .tag {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid var(--hair);
  padding: 1px 6px;
  border-radius: 999px;
  color: var(--muted);
}
.tracks { grid-column: 3 / 6; list-style: none; margin: 0; padding: 0; }
.tracks li + li .trk { border-top: 1px solid var(--hair); }
.trk {
  width: 100%;
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr) 4.5rem;
  column-gap: 14px;
  align-items: baseline;
  text-align: left;
  min-height: var(--row);
  padding: 7px 0;
}
.trk .n { color: var(--muted); }
.trk .open { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trk .len { text-align: right; color: var(--muted); }
.trk:hover .open { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.trk[aria-current="true"] {
  background: var(--ink);
  color: var(--bg);
  margin: -1px -8px;
  padding: 8px 8px;
  width: calc(100% + 16px);
  border-top-color: transparent !important;
}
.trk[aria-current="true"] .n,
.trk[aria-current="true"] .len { color: inherit; }
.trk .eq { display: none; }
.trk[aria-current="true"] .eq { display: inline-flex; gap: 2px; height: 10px; align-items: end; margin-right: 8px; }
.eq i { width: 2px; background: currentColor; height: 4px; }
.playing .trk[aria-current="true"] .eq i { animation: eq 0.9s ease-in-out infinite alternate; }
.eq i:nth-child(2) { animation-delay: -0.3s !important; }
.eq i:nth-child(3) { animation-delay: -0.6s !important; }
@keyframes eq { from { height: 2px; } to { height: 10px; } }
@media (prefers-reduced-motion: reduce) { .playing .trk[aria-current="true"] .eq i { animation: none; height: 8px; } }

/* ---------- Player ---------- */
.player {
  position: sticky;
  top: calc(var(--nav) + 12px);
  max-height: calc(100vh - var(--nav) - 12px - var(--pad));
  display: flex;
  flex-direction: column;
  border-top: 2px solid var(--ink);
  transition: border-color 0.2s;
}
/* Once pinned under the nav, the nav's divider does the job. */
.player.stuck { border-top-color: transparent; }
.np { padding: 8px 0 14px; }
.label {
  margin: 0;
  font: 400 12px/1.3 "Inter", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.np-title {
  margin: 14px 0 4px;
  font: 300 38px/1.02 "Inter Tight", sans-serif;
  letter-spacing: -0.025em;
}
.np-sub { margin: 0 0 18px; color: var(--muted); min-height: 2.9em; }
.time { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }

.seek {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  margin: 2px 0 12px;
  background: transparent;
  --p: 0%;
}
.seek::-webkit-slider-runnable-track {
  height: 2px;
  background: linear-gradient(var(--ink), var(--ink)) 0 / var(--p) 100% no-repeat, var(--hair);
}
.seek::-moz-range-track { height: 2px; background: var(--hair); }
.seek::-moz-range-progress { height: 2px; background: var(--ink); }
.seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--ink);
}
.seek::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--ink); }

.transport { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.transport button {
  height: 46px;
  border: 1px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.transport svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.transport .play svg { fill: currentColor; stroke: none; }
.transport .play { background: var(--ink); color: var(--bg); }
.transport .n { font-size: 10px; }
.transport .i-pause { display: none; }
.playing .transport .i-play { display: none; }
.playing .transport .i-pause { display: block; }
.transport button:disabled { opacity: 0.35; cursor: default; }
.dock-toggle { display: none; }

.sheet {
  overflow-y: auto;
  min-height: 0;
  padding-bottom: 24px;
  scrollbar-width: none;
  overscroll-behavior: contain;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 40px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 40px), transparent);
}
.sheet::-webkit-scrollbar { display: none; }
.rows { margin: 0 0 18px; }
.row {
  display: flex;
  justify-content: space-between;
  width: 100%;
  min-height: var(--row);
  align-items: center;
  border-bottom: 1px solid var(--ink);
  text-decoration: none;
  text-align: left;
  font-size: 15px;
}
.rows .row:first-child { border-top: 1px solid var(--ink); }
.row[hidden] { display: none; }

.playlist h3 { padding-bottom: 6px; border-bottom: 1px solid var(--ink); }
#songs { list-style: none; margin: 0; padding: 0; counter-reset: s; }
#songs li {
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr);
  padding: 6px 0 7px;
  border-bottom: 1px solid var(--hair);
  counter-increment: s;
  line-height: 1.3;
}
#songs li::before { content: counter(s); color: var(--muted); font-size: 12px; padding-top: 2px; }
#songs .ti { display: block; }
#songs .ar { display: block; color: var(--muted); font-size: 13px; }
.fine { font-size: 12.5px; color: var(--muted); margin: 8px 0 18px; }
.keys { margin-top: 0; }

/* ---------- Footer ---------- */
.foot {
  margin: 80px var(--pad) 0;
  padding: 10px 0 40px;
  border-top: 1px solid var(--ink);
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--side);
  gap: var(--gutter);
  font-size: 13px;
  color: var(--muted);
}
.foot p { margin: 0 0 8px; max-width: 46em; }
.about { color: var(--ink); font-size: 14px; }
.about .label { margin: 0 0 8px; }
.about .fine-print { color: var(--muted); font-size: 13px; margin-top: 14px; }
.foot .credits { text-align: right; }
.coffee { white-space: nowrap; }
.coffee svg { fill: none; stroke: currentColor; stroke-width: 2; vertical-align: -2px; margin-right: 5px; }

/* ---------- Narrow screens ---------- */
@media (max-width: 1060px) {
  :root { --side: 320px; }
  .colheads, .tape { grid-template-columns: 5.5rem 8rem 2rem minmax(0, 1fr) 4rem; }
  .trk { grid-template-columns: 2rem minmax(0, 1fr) 4rem; }
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .layout { grid-template-columns: 1fr; }
  .colheads { display: none; }
  .tape { grid-template-columns: 4.5rem minmax(0, 1fr); row-gap: 6px; }
  .month { font-size: 28px; }
  .store { grid-column: 2; }
  .store small, .store .tag { display: inline-block; margin: 0 0 0 8px; }
  .tracks { grid-column: 1 / -1; }
  .trk { grid-template-columns: 1.5rem minmax(0, 1fr) 3.8rem; }
  .foot { grid-template-columns: 1fr; gap: 8px; margin-bottom: 120px; }
  .foot .credits { text-align: left; }

  /* Player docks to the bottom of the screen. */
  .player {
    position: fixed;
    left: 0; right: 0; bottom: 0; top: auto;
    max-height: 85vh;
    background: var(--bg);
    border-top: 2px solid var(--ink);
    padding: 8px var(--pad) calc(10px + env(safe-area-inset-bottom));
    z-index: 10;
    box-shadow: 0 -12px 30px rgb(0 0 0 / 0.12);
  }
  .np { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; padding: 0; }
  .np .label, .np-sub, .time { display: none; }
  .np-title { margin: 2px 0 0; font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .seek { grid-column: 1 / -1; margin: 4px 0 6px; }
  .transport { grid-column: 1 / -1; grid-row: 3; }
  .transport button { height: 40px; }
  .dock-toggle { display: block; grid-column: 2; grid-row: 1; font-size: 13px; border: 1px solid var(--ink); border-radius: 999px; padding: 3px 12px; align-self: center; }
  .sheet { display: none; }
  .player { display: flex; flex-direction: column; }
  .sheet { margin-top: 14px; }
  .player[data-open="true"] .sheet { display: block; }
}
@media (max-width: 520px) {
  .top-meta { font-size: 13px; white-space: nowrap; }
  .logo { width: 48px; }
  :root { --nav: calc(48px + var(--pad) * 1.5); }
}

/* ---------- Transitions ---------- */
/* Page load: header and hero rise in, h1 lines slide up out of a mask. */
html.boot .rise,
html.boot .tape,
html.boot .year > h2 { opacity: 0; transform: translateY(14px); }
html.boot h1 .line > span { opacity: 0; filter: blur(18px); transform: translateY(0.06em); }
html.boot .tape.in,
html.boot .year > h2.in,
html.boot.intro-done .rise,
html.boot.intro-done .tape,
html.boot.intro-done .year > h2 {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: var(--d, 0ms);
}
html.boot.ready h1 .line > span,
html.boot.intro-done h1 .line > span {
  opacity: 1;
  filter: none;
  transform: none;
  transition: opacity 1.1s ease, filter 1.2s cubic-bezier(0.2, 0.7, 0.1, 1), transform 1.2s cubic-bezier(0.2, 0.7, 0.1, 1);
  transition-delay: var(--d, 0ms);
}
html.boot.ready .rise { opacity: 1; transform: none; transition: opacity 0.7s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1); transition-delay: var(--d, 0ms); }

/* Filtering: tapes that come back fade in. */
.tape.show { animation: show 0.45s ease both; animation-delay: var(--d, 0ms); }
@keyframes show { from { opacity: 0; transform: translateY(8px); } }

/* Changing tracks: the player text swaps in. */
.swap { animation: swap 0.4s ease both; }
@keyframes swap { from { opacity: 0; transform: translateY(6px); } }

/* Buffering: the play button pulses and the seek bar shimmers. */
.buffering .transport .play { animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { to { opacity: 0.55; } }
.buffering .seek::-webkit-slider-runnable-track {
  background: linear-gradient(90deg, transparent, var(--ink), transparent) 0 0 / 30% 100% no-repeat, var(--hair);
  animation: shimmer 1.1s linear infinite;
}
@keyframes shimmer { from { background-position: -40% 0, 0 0; } to { background-position: 140% 0, 0 0; } }
.buffering .trk[aria-current="true"] .eq i { animation: eq 0.35s ease-in-out infinite alternate !important; opacity: 0.6; }

@media (prefers-reduced-motion: reduce) {
  .tape.show, .swap, .buffering .transport .play, .buffering .seek::-webkit-slider-runnable-track { animation: none; }
}

/* Browsers without text-box trimming (Firefox): pull the headline up by the
   space above its capitals so it still lines up with the intro's rule. */
@supports not (text-box: trim-both cap alphabetic) {
  h1 { margin-top: -0.11em; }
}

/* ---------- Disc ---------- */
.np-head {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin: 14px 0 18px;
}
.np-head .np-title { margin: 0 0 4px; font-size: 30px; }
.np-head .np-sub { margin: 0; min-height: 0; }
.disc {
  --sheen: #c4d1e0;
  --sheen2: #eef2f6;
  width: 120px;
  aspect-ratio: 1;
  border-radius: 50%;
  /* a faint rainbow-free shimmer in the page's blues */
  background: conic-gradient(from 20deg, var(--sheen2), var(--sheen), var(--sheen2), var(--sheen), var(--sheen2), var(--sheen), var(--sheen2));
  animation: spin 2.4s linear infinite;
  animation-play-state: paused;
}
[data-theme="dark"] .disc { --sheen: #1c2c47; --sheen2: #33496d; }
.playing .disc { animation-play-state: running; }
.buffering .disc { animation-duration: 6s; animation-play-state: running; }
.disc svg { display: block; width: 100%; height: 100%; }
.disc-edge { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.disc-groove { fill: none; stroke: var(--ink); stroke-width: 0.75; opacity: 0.25; }
.disc-hub { fill: var(--bg); stroke: var(--ink); stroke-width: 1.5; }
.disc-hole { fill: var(--bg); stroke: var(--ink); stroke-width: 1.5; }
.disc-text { font: 600 17px "Inter", sans-serif; letter-spacing: 0.06em; fill: var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .disc { animation: none; } }
@media (max-width: 860px) {
  .np-head { display: block; margin: 0; }
  .np-head .np-title { font-size: 22px; }
  .disc { display: none; }
}
