:root {
  --ink: #4a1410;
  --ink-dim: rgba(74, 20, 16, 0.68);
  --paper: #efdcb8;
  --chip: rgba(244, 228, 198, 0.82);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; background: #e9d2ac; color: var(--ink); }
body { font: 15px/1.4 Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
.scroll { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
:focus-visible { outline: 2px solid #b33a1c; outline-offset: 3px; }

/* ---------- top ---------- */
.top { position: fixed; top: 0; left: 0; right: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: max(16px, env(safe-area-inset-top)) clamp(16px, 4vw, 56px) 0; pointer-events: none; }
.top > * { pointer-events: auto; }
.logo { color: var(--ink); text-decoration: none; display: flex; flex-direction: column; line-height: 1; padding: 6px 12px 8px; border-radius: 12px;
  background: radial-gradient(closest-side, rgba(244, 228, 198, 0.75), rgba(244, 228, 198, 0)); }
.logo span { font-size: 11px; letter-spacing: 0.08em; opacity: 0.8; margin-left: 2px; }
.logo b { font: 400 clamp(28px, 2.8vw, 38px)/1.1 "Great Vibes", cursive; }
.libbtn { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid rgba(74, 20, 16, 0.25);
  background: var(--chip); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); cursor: pointer; font-size: 14px; letter-spacing: 0.04em;
  transition: opacity 0.6s, transform 0.3s; }
.libbtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.libbtn:hover { transform: translateY(-1px); }
.in-library .libbtn { opacity: 0; pointer-events: none; }

/* ---------- library: his covers laid on the paper like postcards ---------- */
.library { position: fixed; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 96px clamp(16px, 4vw, 56px) 40px; visibility: hidden; }
.in-library .library { visibility: visible; }
.lib-title { font: 600 clamp(34px, 4vw, 56px)/1 "Cormorant Garamond", serif; letter-spacing: 0.01em; }
.lib-sub { font: italic 500 clamp(16px, 1.4vw, 20px)/1.3 "Cormorant Garamond", serif; color: var(--ink-dim); margin: 8px 0 clamp(20px, 4vh, 44px); text-align: center; }
.cards { list-style: none; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(14px, 2vw, 30px) clamp(14px, 1.8vw, 28px);
  width: min(1180px, 100%); }
.cards li:nth-child(7) { grid-column-start: 1; }
.cards li { display: flex; justify-content: center; }
.cards li:nth-child(n + 7) { transform: translateX(50%); }
.card { display: block; width: 100%; max-width: 170px; border: 0; background: none; cursor: pointer; padding: 0; text-align: center;
  transform: rotate(var(--r, 0deg)); transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1); }
.card .pc { display: block; padding: 7px 7px 8px; border-radius: 3px; position: relative; transition: box-shadow 0.45s;
  background: radial-gradient(120% 90% at 30% 20%, #f6ead0, #ead7b2 70%, #dcc296); /* aged card */
  box-shadow: inset 0 0 18px rgba(120, 70, 30, 0.22), 0 1px 1px rgba(60, 20, 10, 0.18), 0 10px 22px rgba(60, 20, 10, 0.22); }
.card img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
/* the old print; on hover its true colours come back */
.card .now { position: absolute; left: 7px; top: 7px; width: calc(100% - 14px); opacity: 0; transition: opacity 0.6s ease;
  -webkit-mask: radial-gradient(closest-side, #000 86%, transparent 100%) center / 112% 112% no-repeat; mask: radial-gradient(closest-side, #000 86%, transparent 100%) center / 112% 112% no-repeat; }
.card:hover .now, .card:focus-visible .now, .card.is-on .now { opacity: 1; }
.card .t { display: block; margin-top: 9px; font: 600 15px/1.15 "Cormorant Garamond", serif; }
.card .tag { display: block; margin-top: 2px; font: italic 500 13px/1 "Cormorant Garamond", serif; color: var(--ink-dim); letter-spacing: 0.02em; }
.card:hover, .card:focus-visible { transform: rotate(0deg) translateY(-8px) scale(1.04); }
.card:hover .pc { box-shadow: inset 0 0 18px rgba(120, 70, 30, 0.22), 0 1px 1px rgba(60, 20, 10, 0.18), 0 22px 36px rgba(60, 20, 10, 0.3); }
.card.is-on .pc { box-shadow: 0 0 0 2px #b33a1c, 0 14px 28px rgba(60, 20, 10, 0.3); }

.soon { position: fixed; left: 50%; top: 46%; transform: translate(-50%, -50%); z-index: 3; text-align: center; max-width: 80vw;
  font: italic 500 clamp(20px, 2vw, 28px)/1.3 "Cormorant Garamond", serif; color: var(--ink-dim); opacity: 0; transition: opacity 1.2s; pointer-events: none; }
.soon.on { opacity: 1; }

/* ---------- the small player ---------- */
.dock { position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 5;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "mini words ctrl" "bar bar bar"; align-items: center; column-gap: 14px;
  width: min(560px, calc(100vw - 32px)); padding: 10px 14px 8px; border-radius: 18px; background: var(--chip);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 10px 30px rgba(60, 20, 10, 0.18); transition: opacity 0.6s, transform 0.6s; }
.dock.hidden { opacity: 0; transform: translate(-50%, 20px); pointer-events: none; }
.mini { grid-area: mini; width: 50px; height: 50px; border-radius: 50%; background: url(img/vinyl.webp) center / contain no-repeat; position: relative; will-change: transform; }
.mini-label { position: absolute; left: 33%; top: 33%; width: 34%; height: 34%; border-radius: 50%; background: center / 150% no-repeat; }
.mini-label::after { content: ""; position: absolute; left: 44%; top: 44%; width: 12%; height: 12%; border-radius: 50%; background: #1a1410; }
.words { grid-area: words; min-width: 0; }
.title { font: 600 22px/1.05 "Cormorant Garamond", serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub { font-size: 12px; color: var(--ink-dim); letter-spacing: 0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.ctrl { grid-area: ctrl; display: flex; align-items: center; gap: 2px; }
.ctrl button { width: 44px; height: 44px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; border-radius: 50%; }
.ctrl svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ctrl .play { background: var(--ink); color: #fbf3e3; }
.ctrl .play svg { fill: currentColor; }
.ctrl .play .i-pause { display: none; stroke-width: 3.2; fill: none; }
.ctrl .play.is-on .i-pause { display: block; }
.ctrl .play.is-on .i-play { display: none; }
.bar { grid-area: bar; display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--ink-dim); font-variant-numeric: tabular-nums; margin-top: 4px; }
.track { position: relative; flex: 1; height: 18px; }
.track::before, .fill { content: ""; position: absolute; left: 0; top: 8px; height: 2px; border-radius: 2px; }
.track::before { right: 0; background: rgba(74, 20, 16, 0.18); }
.fill { width: 0; background: var(--ink); }
.seek { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; margin: 0; z-index: 1; }

/* ---------- phone ---------- */
@media (max-width: 760px) {
  .library { justify-content: flex-start; overflow-y: auto; padding-top: 104px; padding-bottom: 32px; }
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 14px; }
  .cards li:nth-child(7) { grid-column-start: auto; }
  .cards li:nth-child(n + 7) { transform: none; }
  .card .t { font-size: 13px; }
  .card .tag { font-size: 12px; }
  .libbtn span { display: none; }
  .libbtn { width: 44px; padding: 0; justify-content: center; }
  .dock { column-gap: 10px; padding: 8px 10px 6px; }
  .mini { width: 42px; height: 42px; }
  .title { font-size: 19px; }
  .ctrl button { width: 40px; height: 40px; }
}
@media (prefers-reduced-motion: reduce) { .card, .dock, .libbtn { transition: none; } }
