/* C-60 - a weekend tape. Dark hi-fi cassette deck aesthetic. */

@font-face {
  font-family: "Oswald";
  src: url("assets/oswald.ttf") format("truetype");
  font-weight: 200 700;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/ibm-plex-mono.ttf") format("truetype");
  font-weight: 100 700;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("assets/dm-sans.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ink: #0e1014;
  --ink-2: #12141a;
  --shell: #181b23;
  --shell-2: #20242f;
  --shell-3: #272c39;
  --line: #2a2f3a;
  --line-2: #393f4d;
  --paper: #ece5d4;
  --paper-2: #e0d8c4;
  --paper-ink: #161821;
  --paper-dim: #5b5a55;
  --rec: #ff5436;
  --rec-deep: #d6381a;
  --rec-deep-hover: #bf3119;
  --rec-dim: #c4381f;
  --text: #e7e3d8;
  --text-dim: #9aa0ad;
  --text-mute: #878d9a;

  --ff-display: "Oswald", "Arial Narrow", sans-serif;
  --ff-mono: "IBM Plex Mono", ui-monospace, monospace;
  --ff-body: "DM Sans", system-ui, sans-serif;

  --r-card: 14px;
  --r-pill: 999px;
  --r-input: 8px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background:
    radial-gradient(120% 80% at 50% -10%, #1a1d27 0%, transparent 60%),
    var(--ink);
  color: var(--text);
  font-family: var(--ff-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

/* faint deck texture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.012) 0 1px, transparent 1px 3px);
  pointer-events: none;
  z-index: 0;
}

img { max-width: 100%; display: block; }

a { color: var(--rec); }
a:hover { text-decoration: underline; }

.skip {
  position: absolute; left: -999px; top: 8px;
  background: var(--rec); color: #fff; padding: 8px 12px;
  border-radius: var(--r-input); font-family: var(--ff-mono); font-size: 13px;
  z-index: 100;
}
.skip:focus { left: 12px; }
.vh { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

:focus-visible {
  outline: 2px solid var(--rec);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- DECK / TOP BAR ---------- */
.deck {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-mark {
  font-family: var(--ff-display); font-weight: 700; font-size: 26px;
  letter-spacing: 0.02em; color: var(--text);
  font-stretch: condensed;
}
.brand-sub {
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--text-dim);
}
.deck-nav {
  display: flex; align-items: center; gap: 22px;
  font-family: var(--ff-mono); font-size: 12px; letter-spacing: 0.04em;
}
.deck-dates { color: var(--text-dim); }
.deck-mix { color: var(--rec); }

main { position: relative; max-width: 1280px; margin: 0 auto; padding: 0 28px 64px; }

/* ---------- HERO ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 40px;
  align-items: center;
  padding: 56px 0 48px;
}
.hero-copy { max-width: 540px; }
.eyebrow {
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--text-dim);
  margin: 0 0 18px;
}
.hero-title {
  font-family: var(--ff-display); font-weight: 700;
  font-size: clamp(46px, 7vw, 86px);
  line-height: 0.98; letter-spacing: -0.01em;
  margin: 0 0 22px; color: var(--text);
  font-stretch: condensed;
}
.hero-title .ital {
  font-style: italic; font-weight: 600; color: var(--rec);
  display: inline-block; padding-bottom: 4px;
  line-height: 1.05;
}
.hero-sub {
  font-size: 18px; line-height: 1.5; color: var(--text-dim);
  max-width: 46ch; margin: 0 0 28px;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }

/* hero tape */
.hero-tape { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.tape { width: min(440px, 100%); height: auto; filter: drop-shadow(0 30px 50px rgba(0,0,0,0.45)); }
.now-playing {
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.28em;
  text-transform: uppercase; color: var(--text-mute); margin: 0;
}
body.is-playing .now-playing { color: var(--rec); }

/* cassette SVG parts */
.tape .shell { fill: var(--shell); stroke: var(--line-2); stroke-width: 1.5; }
.tape .shell-edge { fill: none; stroke: rgba(255,255,255,0.04); stroke-width: 1; }
.tape .reel-well { fill: #0a0b0f; stroke: var(--line); stroke-width: 1; }
.tape .reel-ring { fill: none; stroke: var(--shell-3); stroke-width: 2; }
.tape .hub { fill: var(--shell-3); }
.tape .spoke { fill: var(--text-dim); }
.tape .tape-strip { fill: #2b2317; stroke: #3a3022; stroke-width: 1; }
.tape .label { fill: var(--paper); stroke: var(--paper-2); stroke-width: 1; }
.tape .label-rule { stroke: var(--paper-dim); stroke-width: 1; opacity: 0.5; }
.tape .label-title { font-family: var(--ff-display); font-weight: 700; font-size: 18px; fill: var(--paper-ink); letter-spacing: 0.02em; }
.tape .label-side { font-family: var(--ff-mono); font-size: 9px; fill: var(--paper-ink); letter-spacing: 0.2em; }
.tape .label-foot { font-family: var(--ff-mono); font-size: 10px; fill: var(--paper-ink); letter-spacing: 0.14em; }
.tape .label-foot.dim { fill: var(--paper-dim); }
.tape .teeth rect { fill: var(--shell-2); }

/* reel spin while playing */
.reel-spokes { transform-box: fill-box; transform-origin: center; }
body.is-playing .reel-spokes {
  animation: reel 4s linear infinite;
}
body.is-playing .reel-spokes.dir-rev { animation-direction: reverse; }

@keyframes reel { to { transform: rotate(360deg); } }

/* ---------- BUTTONS ---------- */
.btn {
  font-family: var(--ff-mono); font-size: 13px; letter-spacing: 0.04em;
  border: 1px solid transparent; border-radius: var(--r-input);
  padding: 12px 18px; cursor: pointer; color: var(--text);
  background: var(--shell-2); transition: transform .12s ease, background .15s ease, border-color .15s ease, color .15s ease;
  line-height: 1;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-primary { background: var(--rec-deep); color: #fff; border-color: var(--rec-deep); }
.btn-primary:hover { background: var(--rec-deep-hover); border-color: var(--rec-deep-hover); }
.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { border-color: var(--text-dim); background: rgba(255,255,255,0.03); }
.btn-toggle[aria-pressed="true"] { background: var(--rec-deep); color: #fff; border-color: var(--rec-deep); }
.btn-toggle[aria-pressed="true"]:hover { background: var(--rec-deep-hover); }
.btn-save { background: transparent; border-color: var(--rec); color: var(--rec); }
.btn-save[aria-pressed="true"] { background: var(--rec-deep); color: #fff; }
.btn-save[aria-pressed="true"]:hover { background: var(--rec-deep-hover); border-color: var(--rec-deep-hover); }

/* ---------- CONSOLE ---------- */
.console {
  position: sticky; top: 0; z-index: 5;
  background: rgba(14,16,20,0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 0 -28px 28px;
  padding: 16px 28px;
}
.console-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.2fr;
  gap: 20px;
  align-items: end;
}
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field-label {
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--text-dim);
}
.field-control { display: flex; flex-direction: column; gap: 4px; }
.field-help {
  font-family: var(--ff-mono); font-size: 10px; color: var(--text-mute);
  letter-spacing: 0.02em;
}
#search, #filter {
  width: 100%;
  font-family: var(--ff-mono); font-size: 14px;
  color: var(--text); background: var(--ink-2);
  border: 1px solid var(--line-2); border-radius: var(--r-input);
  padding: 11px 12px;
}
#search::placeholder { color: var(--text-mute); }
#search:focus, #filter:focus { border-color: var(--rec); outline: none; box-shadow: 0 0 0 2px rgba(255,84,54,0.25); }
#filter { appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%), linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
  background-position: calc(100% - 18px) 52%, calc(100% - 12px) 52%;
  background-size: 6px 6px; background-repeat: no-repeat; padding-right: 34px;
}

.mix-field .mix-control { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.mix-count { font-family: var(--ff-mono); font-size: 12px; color: var(--text-dim); letter-spacing: 0.04em; white-space: nowrap; }
.mix-count b { color: var(--rec); font-weight: 600; }

/* VU meter */
.meter {
  display: flex; gap: 3px; align-items: flex-end; height: 26px; min-width: 130px;
}
.meter .seg {
  flex: 1; min-width: 6px; height: 100%;
  background: var(--shell-3); border-radius: 2px;
  transition: background .18s ease, box-shadow .18s ease;
}
.meter .seg.on { background: var(--rec); box-shadow: 0 0 6px rgba(255,84,54,0.5); }
.meter .seg.peak { background: #ffb15a; box-shadow: 0 0 8px rgba(255,177,90,0.6); }

/* ---------- SIDES / TRACKLIST ---------- */
.sides {
  display: grid; grid-template-columns: 1fr 1fr; gap: 28px;
}
.side { min-width: 0; }
.side-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; padding: 0 4px 14px;
  border-bottom: 1px solid var(--line); margin-bottom: 6px;
}
.side-label {
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--text-mute);
}
.side-title {
  font-family: var(--ff-display); font-weight: 700; font-size: 28px;
  letter-spacing: 0.01em; color: var(--text); font-stretch: condensed;
  margin: 0;
}
.side-title .side-day { color: var(--rec); }
.side-date {
  font-family: var(--ff-mono); font-size: 12px; color: var(--text-dim);
  letter-spacing: 0.08em;
}

.tracklist { list-style: none; margin: 0; padding: 0; }

/* track row = button */
.track {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  padding: 16px 8px;
  cursor: pointer;
  font-family: var(--ff-body);
  transition: background .14s ease;
}
.track:hover { background: rgba(255,255,255,0.025); }
.track:focus-visible { outline: 2px solid var(--rec); outline-offset: -2px; }
.track:active { transform: scale(0.995); }
.track:last-child { border-bottom: 0; }

.track-num {
  font-family: var(--ff-mono); font-size: 13px; color: var(--text-mute);
  letter-spacing: 0.04em; text-align: right;
}
.track-main { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.track-title {
  font-family: var(--ff-display); font-weight: 600; font-size: 19px;
  line-height: 1.15; letter-spacing: 0.005em; color: var(--text);
  font-stretch: condensed;
  display: flex; align-items: center; gap: 10px;
}
.track-title .saved-mark {
  width: 8px; height: 8px; border-radius: 50%; background: var(--rec);
  box-shadow: 0 0 6px rgba(255,84,54,0.6); flex: 0 0 auto;
}
.track-meta {
  font-family: var(--ff-mono); font-size: 11px; color: var(--text-dim);
  letter-spacing: 0.03em; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center;
}
.tag {
  display: inline-block; font-family: var(--ff-mono); font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--rec);
  border: 1px solid var(--rec-dim); border-radius: var(--r-pill);
  padding: 2px 8px; line-height: 1.4;
}
.track-meta .sep { color: var(--line-2); }
.track-side {
  font-family: var(--ff-mono); font-size: 11px; color: var(--text-mute);
  letter-spacing: 0.1em; white-space: nowrap;
}

.side-empty {
  font-family: var(--ff-mono); font-size: 12px; color: var(--text-mute);
  padding: 24px 8px; letter-spacing: 0.04em;
}

/* ---------- EMPTY STATE ---------- */
.empty {
  margin-top: 40px; padding: 48px 24px; text-align: center;
  border: 1px dashed var(--line-2); border-radius: var(--r-card);
}
.empty-title {
  font-family: var(--ff-display); font-weight: 700; font-size: 28px;
  color: var(--text); margin: 0 0 8px; font-stretch: condensed;
}
.empty-body { color: var(--text-dim); margin: 0 0 22px; }

/* ---------- FOOTER ---------- */
.foot {
  border-top: 1px solid var(--line);
  margin-top: 64px; padding: 28px 28px 40px;
  position: relative; z-index: 1;
}
.foot-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: baseline; justify-content: space-between;
}
.foot-brand {
  font-family: var(--ff-display); font-weight: 700; font-size: 18px;
  letter-spacing: 0.02em; color: var(--text); font-stretch: condensed;
}
.foot-note {
  font-family: var(--ff-mono); font-size: 11px; color: var(--text-mute);
  letter-spacing: 0.02em; max-width: 60ch;
}

/* ---------- LINER NOTES DIALOG ---------- */
.liner {
  border: 0; background: transparent; padding: 0; margin: 0;
  max-width: 100%; max-height: 100%; width: 100%; height: 100%;
  color: var(--text);
}
.liner::backdrop { background: rgba(6,7,10,0.72); backdrop-filter: blur(4px); }
.liner[open] { animation: slideIn .26s cubic-bezier(0.16,1,0.3,1); }
.liner-inner {
  margin: 0 0 0 auto;
  width: min(560px, 100%); height: 100%;
  background:
    radial-gradient(140% 60% at 0% 0%, #1f2330 0%, var(--shell) 55%, var(--ink-2) 100%);
  border-left: 1px solid var(--line-2);
  padding: 28px 30px 40px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px;
  position: relative;
}
.liner-close {
  position: absolute; top: 18px; right: 22px;
  background: var(--shell-2); border: 1px solid var(--line-2);
  color: var(--text); font-family: var(--ff-mono); font-size: 12px;
  letter-spacing: 0.08em; padding: 8px 12px; border-radius: var(--r-input);
  cursor: pointer;
}
.liner-close:hover { border-color: var(--rec); color: var(--rec); }
.liner-meta {
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--rec); padding-top: 4px;
}
.liner-title {
  font-family: var(--ff-display); font-weight: 700; font-size: 34px;
  line-height: 1.05; letter-spacing: 0.005em; color: var(--text);
  margin: 0; font-stretch: condensed;
}

.liner-facts {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  margin: 6px 0 0; padding: 0;
  border: 1px solid var(--line); border-radius: var(--r-card);
  overflow: hidden;
}
.liner-facts .fact {
  padding: 12px 14px; border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 4px;
}
.liner-facts .fact:nth-child(odd) { border-right: 1px solid var(--line); }
.liner-facts .fact:nth-last-child(-n+2) { border-bottom: 0; }
.liner-facts .fact:nth-last-child(-n+2):nth-child(odd):last-child { border-right: 0; }
.fact dt {
  font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--text-mute);
}
.fact dd {
  font-family: var(--ff-mono); font-size: 14px; color: var(--text);
  margin: 0; letter-spacing: 0.01em;
}
.fact .free { color: var(--rec); font-weight: 600; }

.liner-body {
  font-size: 16px; line-height: 1.6; color: var(--text);
  white-space: pre-line; max-width: 56ch;
  border-top: 1px solid var(--line); padding-top: 16px;
}
.liner-actions {
  display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px;
  border-top: 1px solid var(--line); padding-top: 18px;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 24px; padding: 36px 0 32px; }
  .hero-tape { order: -1; }
  .tape { width: min(360px, 86%); }
  .console-row { grid-template-columns: 1fr 1fr; }
  .mix-field { grid-column: 1 / -1; }
  .sides { grid-template-columns: 1fr; gap: 8px; }
}

@media (max-width: 560px) {
  .deck { padding: 14px 18px; flex-wrap: wrap; }
  .deck-nav { gap: 14px; }
  main { padding: 0 18px 48px; }
  .console { margin: 0 -18px 22px; padding: 14px 18px; }
  .console-row { grid-template-columns: 1fr; gap: 14px; }
  .hero-title { font-size: clamp(40px, 11vw, 64px); }
  .hero-sub { font-size: 16px; }
  .track { grid-template-columns: 26px 1fr; gap: 10px; padding: 14px 6px; }
  .track-side { display: none; }
  .track-title { font-size: 17px; }
  .liner-inner { padding: 24px 20px 32px; }
  .liner-title { font-size: 26px; }
  .liner-facts { grid-template-columns: 1fr; }
  .liner-facts .fact { border-right: 0 !important; }
  .liner-facts .fact:not(:last-child) { border-bottom: 1px solid var(--line); }
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  body.is-playing .reel-spokes { animation: none; }
  .liner[open] { animation: none; }
  .btn, .track, .meter .seg { transition: none; }
}
