:root {
  color-scheme: light dark;
  --paper: #fbf7fa;
  --panel: #f3eaf1;
  --ink: #24121f;
  --muted: #6e5c6a;
  --line: #e4d6e1;
  --tile: #e9dce6;
  --accent: #6e2763;
  --wash: #efdfec;
  --on-accent: #fff;
  --record: #150e13;
  --island: #fff;
  --control: #46203f;
  --on-control: #f6e9f3;
  --press-out: cubic-bezier(.3, 1.25, .5, 1);
  --app-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #160f15;
    --panel: #201620;
    --ink: #f5edf3;
    --muted: #b2a3af;
    --line: #34262f;
    --tile: #2c2029;
    --accent: #e3a6d8;
    --wash: #3b2036;
    --on-accent: #24121f;
    --record: #33262f;
    --island: #2b1f29;
    --control: #efc5e6;
    --on-control: #37162f;
  }
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.45 var(--app-font); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, ol, figure { margin: 0; }
button { border: 0; cursor: pointer; color: inherit; font: inherit; touch-action: manipulation; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.mast { border-bottom: 1px solid var(--line); }
.mast-inner, main { width: min(calc(100% - clamp(32px, 8vw, 148px)), 1400px); margin: auto; }
.mast-inner { height: 62px; display: flex; align-items: center; }
.credits { width: min(calc(100% - clamp(32px, 8vw, 148px)), 1400px); margin: auto; padding: 20px 0 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; line-height: 1.55; }
.credits p { max-width: 80ch; margin: 0; }
.credits a { color: inherit; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 700; letter-spacing: -.055em; color: inherit; text-decoration: none; }
.brand::before, .launch-mark::before { content: ""; width: 28px; height: 28px; background: var(--accent); mask: url(assets/speaker.svg) center / contain no-repeat; }
.article-opening { padding: clamp(34px, 6vw, 90px) 0 clamp(28px, 4vw, 60px); }
.article-opening h1 { font-size: clamp(44px, 5.9vw, 89px); line-height: .99; letter-spacing: -.055em; }
.article-opening p, .study-intro p { max-width: 64ch; color: var(--muted); font-size: clamp(16px, 1.35vw, 20px); line-height: 1.55; text-wrap: pretty; }
.article-opening p { margin-top: 18px; }
.pair-study { border-top: 1px solid var(--line); padding: clamp(28px, 4vw, 60px) 0; scroll-margin-top: 16px; }
.study-intro { margin-bottom: 22px; }
.study-intro h2 { font-size: clamp(32px, 4vw, 58px); line-height: 1.07; font-weight: 650; letter-spacing: -.04em; margin-bottom: 12px; }

.pair-driver { display: grid; grid-template-columns: 10rem 1fr; align-items: start; gap: 8px 20px; margin-bottom: 20px; padding: 14px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--wash); }
.driver-copy { grid-column: 2; grid-row: 1; }
.driver-copy strong { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.driver-note { margin-top: 2px; font-size: 15px; }
.run-state { color: var(--muted); text-transform: none; letter-spacing: normal; }
.drive { grid-column: 1; grid-row: 1; display: flex; align-items: center; justify-content: center; gap: 8px; width: 10rem; height: 48px; padding: 4px 10px; color: var(--on-control); background: var(--control); }
.drive, .warm-visit { border-radius: 999px; font-size: 14px; font-weight: 600; }
.drive img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.retry-mark { font-size: 1.3em; line-height: 1; }
.warm-visit { min-height: 44px; padding: 8px 14px; color: var(--accent); background: var(--panel); }
.warm-visit:disabled { color: var(--muted); }
.drive, .warm-visit, .mini-shelf button:enabled { transition: scale 280ms var(--press-out), background-color 150ms, color 150ms; }
@media (hover: hover) and (pointer: fine) {
  .drive:hover { background: color-mix(in srgb, var(--control) 80%, var(--accent)); }
  .warm-visit:enabled:hover { background: var(--wash); }
  .mini-shelf button:enabled:hover .jacket img { filter: brightness(1.1); }
}
.drive:active { background: var(--accent); color: var(--on-accent); }
button:enabled:active { scale: .935; transition-duration: 85ms; transition-timing-function: ease-out; }
.cache-detail { font-size: 14px; max-width: 80ch; color: var(--muted); margin: 12px 0; }

.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(10px, 2vw, 30px); }
.policy { min-width: 0; display: grid; grid-template-rows: subgrid; grid-row: span 3; }
.policy-name { display: flex; align-items: center; gap: 11px; margin-bottom: 10px; font-size: clamp(16px, 1.65vw, 26px); letter-spacing: -.045em; }
.policy-name::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.policy:last-child .policy-name::before { background: var(--accent); }
.player { display: flex; flex-direction: column; min-height: clamp(180px, 22vw, 300px); padding: clamp(12px, 1.6vw, 23px); border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.policy:first-child .player { background: var(--island); }
.player-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.player-head h4 { font-size: 17px; letter-spacing: -.035em; }
.route { padding: 4px 12px; border: 1px solid var(--line); border-radius: 30px; color: var(--muted); font: 600 10px/1.4 var(--app-font); font-variant-numeric: tabular-nums; white-space: nowrap; }
.screen { display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr); }
.player [data-view] { grid-area: 1/1; align-self: start; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 180ms ease-out, visibility 0s linear 180ms; }
.player .on-screen { opacity: 1; visibility: visible; pointer-events: auto; transition-delay: 0s; }
.mini-shelf { display: flex; gap: 14%; padding-top: 16px; }
.mini-shelf button { align-self: start; width: 40%; padding: 0; background: transparent; text-align: left; }
.mini-shelf img, .album img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.jacket { display: block; position: relative; isolation: isolate; aspect-ratio: 1; }
.jacket img { position: relative; z-index: 1; box-shadow: 0 1px 4px color-mix(in srgb,var(--ink) 18%,transparent); }
.artist-name { display: block; font-size: 13px; margin-top: 6px; }
.disc-carriage { position: absolute; inset: 3%; border-radius: 50%; visibility: hidden; transition: transform 280ms cubic-bezier(.22,.8,.3,1), visibility 0s linear 280ms; }
.vinyl { display: block; height: 100%; border: 1px solid var(--line); border-radius: 50%; background: conic-gradient(from 20deg,transparent 8%,#fff4 12%,transparent 18% 55%,#fff3 62%,transparent 70%), radial-gradient(circle,var(--paper) 0 4%,var(--accent) 4.5% 17%,var(--record) 17.5%); animation: vinyl-turn 1.35s linear infinite paused; }
.pending .disc-carriage { transform: translateX(33%); visibility: visible; transition-delay: 0s; }
.on-screen .pending .vinyl { animation-play-state: running; }
@keyframes vinyl-turn { to { transform: rotate(1turn); } }
.switch-hint { display: none; }
.mini-shelf button:enabled .switch-hint, .selection-state { background: var(--accent); color: var(--on-accent); border-radius: 4px; }
.mini-shelf button:enabled .switch-hint { display: inline-block; margin-top: 5px; padding: 3px 7px; font-size: 12px; font-weight: 650; }
.mini-shelf button:enabled .jacket { outline: 2px solid var(--accent); outline-offset: 2px; }
.empty-album { display: grid; grid-template-columns: 35% 1fr; gap: 10%; align-items: center; margin-top: 19px; }
.empty-cover, .bones i { display: block; background: var(--tile); }
.empty-cover { aspect-ratio: 1; }
.bones i { width: 85%; height: 8px; margin: 12px 0; }
.bones i:nth-child(2) { width: 60%; }
.player .launch-mark, .player .closed-player { display: grid; place-items: center; align-self: stretch; min-height: 140px; color: var(--muted); }
.launch-mark::before { width: 48px; height: 48px; }
.covers-loading .jacket { background: var(--tile); }
.covers-loading .jacket img, .covers-loading .disc-carriage { opacity: 0; }
.missing-art .album img { visibility: hidden; }
.album { display: grid; grid-template-columns: 35% 1fr; gap: clamp(15px,2vw,30px); align-items: center; margin-top: 18px; }
.album h2 { font-size: clamp(19px,2.4vw,33px); line-height: 1.04; font-weight: 650; letter-spacing: -.04em; }
.album .artist { color: var(--muted); font-size: 12px; margin: 7px 0 8px; }
.album ol { list-style: none; padding: 0; }
.album li { padding: 3px 0; border-top: 1px solid var(--line); font-size: 12px; }
.track-no { margin-right: 9px; font-size: 11px; font-weight: 600; }
.long-shelf { gap: 7%; overflow-x: auto; max-width: 100%; min-width: 0; padding-bottom: 7px; scrollbar-color: var(--muted) var(--panel); scrollbar-width: thin; }
.long-shelf button, .tail { flex: 0 0 43%; }
.tail figcaption { font-size: 13px; }
.offset { display: block; color: var(--muted); margin-bottom: 12px; font-size: 11px; }

/* The hand crosses the space between the sleeves before the selection changes. */
.tap-gesture { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transform: translateX(-135%); transition: transform 750ms cubic-bezier(.4,0,.2,1), opacity 140ms; }
.tap-gesture svg { position: absolute; left: 42%; top: 46%; width: clamp(24px,3.3vw,48px); fill: var(--on-control); stroke: var(--control); stroke-width: 1.3; filter: drop-shadow(0 1px 2px var(--muted)); }
.aiming .tap-gesture { opacity: 1; transform: translateX(0); }
.switched .tap-gesture { opacity: 0; transition: opacity 250ms 420ms; }
.switched [data-choice="1"] .jacket { animation: switch-press 350ms ease-out; }
@keyframes switch-press { 35% { transform: scale(.93); } }
.selection-state { display: block; visibility: hidden; width: fit-content; max-width: 100%; margin-top: 6px; padding: 1px clamp(2px,.5vw,7px); font-size: clamp(9px,1vw,13px); font-weight: 700; }
.switched .selection-state { visibility: visible; }
.switched [data-choice="0"] .selection-state { background: var(--tile); color: var(--muted); }
.switched [data-choice="0"] .jacket { opacity: .53; transition: opacity 250ms; }

.study-checklist {
  list-style: none;
  margin: 12px 0;
  padding: 0;
  color: var(--muted);
  font-size: clamp(13px, 1.1vw, 16px);
}
.study-checklist li {
  display: grid;
  grid-template-columns: 1rem minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 5px 0;
}
.step-mark {
  display: grid;
  place-items: center;
  width: 1rem;
  height: 1rem;
  margin-top: .18em;
  border: 1px solid var(--muted);
  border-radius: 4px;
}
.study-checklist .done { color: var(--ink); }
.done .step-mark { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.done .step-mark::after { content: "✓"; font: 700 .75rem/1 var(--app-font); }
.step-state { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

@media (max-width: 730px) {
  .pair-driver { grid-template-columns: 1fr; padding: 12px; }
  .driver-copy { grid-column: 1; grid-row: 2; }
  .album { display: block; min-height: 175px; }
  .album img { width: 60px; float: left; margin: 0 9px 5px 0; }
  .album ol { clear: both; }
}
@media (max-width: 500px) {
  .mast-inner { height: 48px; }
  .player { min-height: 190px; }
  .player-head { align-items: start; flex-direction: column; gap: 4px; }
  .route { font-size: 9px; padding: 2px 5px; }
  .artist-name { font-size: 11px; }
  .policy-name::before { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  button:enabled:active { scale: 1; }
}
