/* The hero's app window. Spiral's own tokens (black ground, JetBrains Mono, amber), drawn as a
   product shot. Every state the tour passes through is a data attribute on .win; the scripts in
   mockup/ only flip attributes and render rows. The catalogue's own rules are in
   mockup/catalogue.css, the chapter tabs under the window in mockup/chapters.css. */

.shot {
  container-type: inline-size;
  --s0: oklch(0 0 0);
  --s1: oklch(0.145 0 0);
  --s2: oklch(0.185 0 0);
  --s3: oklch(0.235 0 0);
  --s-playing: color-mix(in oklch, var(--s1), var(--amber) 10%);
  --line: oklch(0.269 0 0);
  --line-strong: oklch(0.321 0 0);
  --ink: oklch(0.922 0 0);
  --ink-muted: oklch(0.72 0 0);
  /* Faint text also sits on --s3, the selected row; 0.64 keeps it above 4.5:1 there. */
  --ink-faint: oklch(0.64 0 0);
  --amber: oklch(0.81 0.16 80);
  --gem: oklch(0.84 0.13 155);
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --fast: 120ms;
  --base: 180ms;
  --out: cubic-bezier(.2, 0, 0, 1);
  --bar: 36px;
  --hdr: 52px;
  --search: 54px;
  --strip: 64px;
  --side: 240px;
  --aside: 300px;
  --row: 48px;
  --thumb: 36px;
  --ticks: 80;
  --fill: 0%;
  --i: 0;
  /* The window is drawn at one desktop size and scaled to fit, like a screenshot: it is a Mac
     app at every width. --view is how much of it shows; --crop-x where that starts. mockup/fit.js
     measures the scale into --zoom and the scaled height into --fit-height; the clip keeps the
     full-size window from widening the page before it does. */
  --design: 1280px;
  --view: var(--design);
  --crop-x: 0px;
  width: 100%;
  height: var(--fit-height, auto);
  overflow-x: clip;
  /* iOS would enlarge text in a block this wide, and the window would reflow. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.win {
  width: var(--design);
  transform-origin: 0 0;
  transform: scale(var(--zoom)) translateX(calc(var(--crop-x) * -1));
  position: relative;
  overflow: hidden;
  font: 400 12px/1.5 var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: var(--s0);
  border-radius: 10px;
}
.win *, .win *::before, .win *::after { box-sizing: border-box; }
/* Paused, the tour shows finished frames: entrances complete at once and nothing blinks. */
.shot-wrap[data-paused] .win *,
.shot-wrap[data-paused] .win *::before,
.shot-wrap[data-paused] .win *::after { animation: none !important; }
.win ul, .win ol { margin: 0; padding: 0; list-style: none; }
.win p, .win b { margin: 0; font-weight: 400; }
.win i { font-style: normal; }
.win svg { display: block; flex: none; }
.win .cover { width: 100%; height: 100%; border-radius: 2px; }
.win kbd {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 4px;
  font: inherit;
  font-size: 11px;
  color: var(--ink-muted);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  transition: background-color var(--fast) var(--out), color var(--fast) var(--out);
}
.win kbd[data-hot] { color: var(--s0); background: var(--amber); border-color: var(--amber); }
.tag { display: inline-flex; flex: none; align-items: center; height: 16px; padding: 0 4px; font-size: 11px; line-height: 1; white-space: nowrap; color: var(--ink-muted); border: 1px solid var(--line); }
.tag[data-gem] { color: var(--gem); border-color: var(--gem); }
.tag[data-owned] { color: var(--ink); background: var(--s3); border-color: var(--s3); }
.tag[data-fresh] { color: var(--amber); border-color: var(--amber); }
.heart { display: grid; color: var(--ink-faint); transition: color var(--fast) var(--out); }
.heart path { fill: none; transition: fill var(--fast) var(--out); }

/* macOS chrome: monochrome dots, so the amber inside stays the only colour. */
.win-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--bar);
  padding: 0 14px;
  color: var(--ink-faint);
  background: var(--s1);
  border-bottom: 1px solid var(--line);
}
.win-bar span { width: 12px; height: 12px; border-radius: 50%; background: var(--s3); }
.win-bar b { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }

.app {
  display: grid;
  grid-template-columns: var(--side) minmax(0, 1fr) var(--aside);
  grid-template-rows: var(--hdr) var(--search) minmax(0, 1fr) var(--strip);
  grid-template-areas: "hdr hdr hdr" "side search player" "side main player" "strip strip strip";
  height: 680px;
}

/* Header */
.hdr { grid-area: hdr; display: flex; align-items: center; gap: 24px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: .08em; }
.brand img { width: 20px; height: 20px; }
.nav { display: flex; gap: 4px; }
.pill, .settings { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 10px; color: var(--ink-muted); border: 1px solid transparent; border-radius: 2px; }
.pill[data-section="catalog"], .win[data-view="explore"] .pill[data-section="explore"] { color: var(--ink); background: var(--s3); border-color: var(--line); }
.win[data-view="collection"] .settings { color: var(--ink); background: var(--s3); border-color: var(--line); }
.win:is([data-view="explore"], [data-view="collection"]) .pill[data-section="catalog"] { color: var(--ink-muted); background: none; border-color: transparent; }
.pill kbd, .settings kbd { height: 16px; font-size: 10px; color: var(--ink-faint); }
.pill .count { color: var(--ink-faint); transition: color var(--base) var(--out); }
.win[data-saved] .pill .count { color: var(--amber); }
.settings { margin-left: auto; }

/* Sidebar: the spirals, then the collection's most-owned labels and artists */
.side { grid-area: side; overflow: hidden; padding: 16px 12px; border-right: 1px solid var(--line); }
.side-h { margin-bottom: 8px; padding: 0 8px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.spirals + .side-h { margin-top: 16px; }
.side-meta { margin: -4px 0 8px; padding: 0 8px; font-size: 11px; color: var(--ink-faint); }
.side li { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 8px; border-radius: 2px; transition: background-color var(--fast) var(--out); }
.side li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side li time, .side .stops { color: var(--ink-faint); white-space: nowrap; }
.side li[data-on] { background: var(--s3); box-shadow: inset 2px 0 0 var(--amber); }
.spirals li[data-on] .stops { color: var(--amber); }
.rank-h { margin: 4px 0; padding: 0 8px; font-size: 11px; color: var(--ink-faint); }
.rank li { height: 26px; animation: slide var(--base) var(--out) both; }
.win[data-unranked] :is(.rank-h, .rank) { display: none; }
.rank li i { color: var(--ink-muted); }
.rank li[data-on] i { color: var(--amber); }

/* Search row: in the tour it only waits for ⌘K */
.search { grid-area: search; padding: 6px 20px; border-bottom: 1px solid var(--line); }
.search-box { display: flex; align-items: center; gap: 10px; height: 42px; max-width: 460px; padding: 0 12px; background: var(--s1); border: 1px solid var(--line); border-radius: 2px; }
.search-box svg { color: var(--ink-faint); }
.search-box kbd { margin-left: auto; }
.q { color: var(--ink-faint); }

/* The main area: the catalogue or Explore, and the toast that confirms an action */
.main { grid-area: main; position: relative; min-width: 0; overflow: hidden; padding: 16px 20px 0; }
.toast {
  position: absolute;
  right: 20px;
  bottom: 60px;
  z-index: 2;
  max-width: calc(100% - 40px);
  padding: 8px 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--s2);
  border: 1px solid var(--line-strong);
  box-shadow: inset 2px 0 0 var(--amber), 0 12px 32px -12px rgb(0 0 0 / .8);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity var(--base) var(--out), transform var(--base) var(--out);
}
.win[data-toast] .toast { opacity: 1; transform: none; }

/* Player panel: the playing record's sleeve, the source each track streams from, the queue */
.player { grid-area: player; display: flex; flex-direction: column; gap: 12px; min-height: 0; padding: 16px; overflow: hidden; border-left: 1px solid var(--line); }
.np-h, .queue-h { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.np-cover { aspect-ratio: 1; width: 100%; max-height: 220px; max-width: 220px; align-self: center; background: var(--s2); }
.np-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.np-title { font-size: 14px; }
.np-meta { color: var(--ink-muted); }
.np-src { color: var(--ink-faint); }
.win[data-fallback] .np-src, .win[data-fallback] .now .src { color: var(--amber); }
.np-idle { color: var(--ink-faint); }
.np-cover, .np-info, .queue-h, .queue { display: none; }
.win[data-playing] :is(.np-cover, .np-info) { display: flex; }
.win[data-playing] .np-idle { display: none; }
.queue-h:has(i:not(:empty)) { display: flex; gap: 8px; margin-top: 4px; }
.queue-h i { color: var(--amber); }
.queue:not(:empty) { display: block; }
.queue li { display: flex; align-items: center; gap: 10px; height: 40px; animation: rise var(--base) var(--out) both; }
.queue li .cover { width: 32px; height: 32px; flex: none; }
.queue li div { min-width: 0; }
.queue li b, .queue li span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue li span { font-size: 11px; color: var(--ink-muted); }

/* Player strip */
.strip { grid-area: strip; display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; column-gap: 20px; padding: 0 20px 0 10px; border-top: 1px solid var(--line); }
.transport { display: grid; place-items: center; width: 44px; height: 44px; color: var(--s0); background: var(--amber); border-radius: 2px; }
.transport .pause, .win[data-playing] .transport .play { display: none; }
.win[data-playing] .transport .pause { display: block; }
.readout { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.now { display: flex; gap: 16px; min-width: 0; letter-spacing: .08em; text-transform: uppercase; }
.now b { display: none; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now span { color: var(--ink-muted); white-space: nowrap; }
.now .idle { flex: 1; color: var(--ink-faint); }
.now .live { display: none; }
.win[data-playing] .now .idle { display: none; }
.win[data-playing] .now .live { display: inline; }
.win[data-playing] .now b { display: block; }
.ticks {
  height: 10px;
  background: linear-gradient(to right, var(--amber) var(--fill), var(--s3) var(--fill));
  mask-image: repeating-linear-gradient(to right, #000 0, #000 calc(100% / var(--ticks) - 2px), transparent calc(100% / var(--ticks) - 2px), transparent calc(100% / var(--ticks)));
}
.hints { display: flex; gap: 12px; color: var(--ink-faint); white-space: nowrap; }
.hints span { display: inline-flex; align-items: center; gap: 4px; }

@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes slide { from { opacity: 0; transform: translateX(-6px); } }
@keyframes grow { from { transform: scaleX(0); } }

@media (prefers-reduced-motion: reduce) {
  .win *, .win *::before, .win *::after { animation: none !important; transition: none !important; }
}
