@font-face {
  font-family: "Space Grotesk";
  src: url("assets/space-grotesk.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/ibm-plex-mono.ttf") format("truetype");
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #171714;
  --paper: #f3f0e8;
  --cream: #fffdf5;
  --acid: #d8ff43;
  --orange: #ff5c35;
  --blue: #7aa7ff;
  --lilac: #c5a8ff;
  --pink: #ff9ac6;
  --rule: 2px solid var(--ink);
  --shadow: 6px 6px 0 var(--ink);
  --font-display: "Space Grotesk", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "Courier New", monospace;
  --fast: 150ms;
  --medium: 280ms;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 118px; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.5;
}

button, input, select { font: inherit; }
button, select { cursor: pointer; }

button, input, select, a {
  touch-action: manipulation;
}

:focus-visible {
  outline: 3px solid #1557ff;
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 10px 16px;
  color: white;
  background: var(--ink);
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.masthead {
  min-height: 72px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 12px clamp(20px, 4vw, 64px);
  border-bottom: var(--rule);
  background: var(--acid);
}

.brand, .jump-link {
  min-height: 44px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.brand, .jump-link { display: flex; align-items: center; }
.brand { gap: 10px; font-size: 19px; letter-spacing: -.04em; }
.brand-mark { width: 38px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2; }
.brand-mark circle { fill: currentColor; stroke: none; }
.edition { margin: 0; font: 13px var(--font-mono); letter-spacing: .06em; }
.jump-link { justify-self: end; border-bottom: 2px solid; }

button:active, a:active { opacity: .72; }

.hero {
  min-height: 440px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(400px, .9fr);
  gap: clamp(32px, 7vw, 112px);
  align-items: center;
  overflow: hidden;
  padding: 54px clamp(20px, 6vw, 88px) 64px;
  background: var(--orange);
  border-bottom: var(--rule);
}

.eyebrow {
  display: inline-block;
  margin: 0 0 13px;
  padding: 4px 8px;
  border: var(--rule);
  background: var(--cream);
  font: 700 12px var(--font-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  box-shadow: 3px 3px 0 var(--ink);
}
.eyebrow.dark { color: var(--cream); background: var(--ink); box-shadow: none; }

h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(54px, 7.2vw, 116px);
  line-height: .78;
  letter-spacing: -.085em;
  text-transform: uppercase;
}

.scribble {
  position: relative;
  display: inline-block;
  color: var(--cream);
  -webkit-text-stroke: 2px var(--ink);
  transform: rotate(-2deg);
}
.scribble::after {
  content: "";
  position: absolute;
  right: -3%; bottom: -12px; left: -1%;
  height: 9px;
  border: solid var(--ink);
  border-width: 4px 0 0;
  transform: rotate(1deg);
}

.intro { max-width: 610px; margin: 32px 0 0; font-size: 19px; font-weight: 600; line-height: 1.45; }

.cassette {
  width: min(100%, 520px);
  justify-self: center;
  padding: 20px 24px 24px;
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: var(--blue);
  box-shadow: 13px 13px 0 var(--ink);
  transform: rotate(4deg);
}

.cassette-topline, .cassette-footer, .cassette-label {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font: 700 11px var(--font-mono);
  letter-spacing: .08em;
}
.cassette-label {
  align-items: center;
  margin: 17px 0;
  padding: 12px;
  border: var(--rule);
  background: var(--cream);
}
.cassette-label strong { font-size: 15px; }
.tape-window {
  height: 112px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  border: var(--rule);
  border-radius: 55px;
  background: var(--ink);
}
.reel { width: 70px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: var(--cream); }
.reel i { width: 24px; aspect-ratio: 1; border: 7px dotted var(--ink); border-radius: 50%; }
.tape-line { width: 48px; height: 7px; background: var(--orange); }
.cassette-footer { align-items: center; }
.dolby { display: grid; place-items: center; width: 36px; height: 24px; border: var(--rule); border-radius: 50%; }

.browse { padding: 64px clamp(20px, 5vw, 72px) 100px; }
.browse-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 24px; }
.browse-heading h2 { margin: 0; font-size: clamp(40px, 6vw, 78px); line-height: .95; letter-spacing: -.065em; text-transform: uppercase; }
.results-status { margin: 0 0 6px; font: 13px var(--font-mono); text-align: right; }

.tuner {
  position: sticky;
  z-index: 5;
  top: 12px;
  display: grid;
  grid-template-columns: minmax(230px, 1.5fr) minmax(200px, .85fr) 190px;
  gap: 12px;
  padding: 14px;
  border: var(--rule);
  background: var(--ink);
  box-shadow: 6px 6px 0 rgba(23, 23, 20, .25);
}

.field label {
  display: block;
  margin: 0 0 6px;
  color: var(--cream);
  font: 11px var(--font-mono);
  letter-spacing: .05em;
  text-transform: uppercase;
}
.input-wrap, .select-wrap { position: relative; }
.input-wrap svg, .select-wrap svg {
  position: absolute;
  top: 50%;
  width: 20px; height: 20px;
  transform: translateY(-50%);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  pointer-events: none;
}
.input-wrap svg { left: 14px; }
.select-wrap svg { right: 14px; }
.field input, .field select {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 0;
  color: var(--ink);
  background: var(--cream);
  font-weight: 650;
}
.field input { padding: 0 14px 0 44px; }
.field select { appearance: none; padding: 0 42px 0 14px; }

.mix-toggle {
  align-self: end;
  min-height: 50px;
  display: grid;
  grid-template-columns: 34px 1fr 26px;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 0;
  color: var(--ink);
  background: var(--acid);
  text-align: left;
  transition: background var(--fast), color var(--fast);
}
.mix-toggle[aria-pressed="true"] { color: white; background: #1557ff; }
.mix-icon svg { width: 24px; fill: none; stroke: currentColor; stroke-width: 2; }
.mix-toggle small, .mix-toggle strong { display: block; line-height: 1.1; }
.mix-toggle small { font: 10px var(--font-mono); text-transform: uppercase; }
.mix-toggle strong { font-size: 16px; }
.mix-count { display: grid; place-items: center; min-width: 26px; height: 26px; border: 1.5px solid; border-radius: 50%; font: 12px var(--font-mono); }

.deck { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 32px; }
.side { min-width: 0; border: var(--rule); background: var(--cream); box-shadow: var(--shadow); }
.side-header { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 14px 18px; border-bottom: var(--rule); background: var(--lilac); }
.side-b .side-header { background: var(--pink); }
.side-header h3 { margin: 0; font-size: 27px; letter-spacing: -.05em; text-transform: uppercase; }
.side-header p { margin: 0; font: 11px var(--font-mono); text-align: right; }
.track-list { list-style: none; margin: 0; padding: 0; }
.track { position: relative; border-bottom: var(--rule); }
.track:last-child { border-bottom: 0; }
.track-button {
  width: 100%;
  min-height: 118px;
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) 92px 38px;
  align-items: center;
  gap: 14px;
  padding: 15px 17px;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  transition: background var(--fast), color var(--fast);
}
.track-button:hover { background: var(--acid); }
.track-button:active { background: var(--blue); }
.track-number { font: 700 15px var(--font-mono); }
.track-main { min-width: 0; }
.track-main h4 { margin: 3px 0 7px; font-size: clamp(17px, 1.45vw, 22px); line-height: 1.08; letter-spacing: -.035em; }
.track-category { margin: 0; font: 10px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.track-place { margin: 0; color: #4e4e46; font-size: 13px; }
.track-time { font: 12px var(--font-mono); text-align: right; }
.track-arrow { width: 34px; height: 34px; padding: 6px; border: 1.5px solid; border-radius: 50%; fill: none; stroke: currentColor; stroke-width: 1.8; }
.saved-notch { position: absolute; top: 0; right: 0; width: 12px; height: 12px; background: #1557ff; clip-path: polygon(0 0,100% 0,100% 100%); }

.empty-state { max-width: 680px; margin: 60px auto 0; padding: 40px; border: var(--rule); background: var(--cream); box-shadow: var(--shadow); text-align: center; }
.empty-state[hidden] { display: none; }
.empty-state svg { width: 82px; fill: none; stroke: var(--ink); stroke-width: 2; }
.empty-state h3 { margin: 12px 0 0; font-size: 40px; letter-spacing: -.05em; text-transform: uppercase; }
.empty-state p { max-width: 480px; margin: 8px auto 22px; }
.empty-state button { min-height: 48px; padding: 10px 18px; border: var(--rule); background: var(--acid); font-weight: 750; box-shadow: 4px 4px 0 var(--ink); }

footer { display: flex; justify-content: space-between; gap: 20px; padding: 24px clamp(20px, 5vw, 72px); border-top: var(--rule); background: var(--acid); font: 12px var(--font-mono); }
footer p { margin: 0; }

.detail-dialog {
  width: min(760px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}
.detail-dialog::backdrop { background: rgba(23, 23, 20, .77); backdrop-filter: blur(4px); }
.detail-card { max-height: calc(100vh - 40px); border: 3px solid var(--ink); background: var(--cream); box-shadow: 10px 10px 0 var(--acid); overflow: auto; }
.detail-header { position: sticky; z-index: 2; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 12px 10px 20px; border-bottom: var(--rule); background: var(--blue); }
.detail-kicker { margin: 0; font: 12px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.close-button { min-height: 46px; display: flex; align-items: center; gap: 9px; padding: 8px 11px 8px 15px; border: var(--rule); background: var(--cream); font-weight: 750; }
.close-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; }
.detail-body { padding: clamp(24px, 5vw, 52px); }
.detail-lead { position: relative; padding-right: 50px; }
.detail-number { position: absolute; top: 0; right: 0; margin: 0; font: 700 15px var(--font-mono); }
.detail-category { display: inline-block; margin: 0 0 14px; padding: 3px 7px; border: 1.5px solid; font: 11px var(--font-mono); text-transform: uppercase; }
.detail-lead h2 { max-width: 610px; margin: 0; font-size: clamp(38px, 6vw, 70px); line-height: .96; letter-spacing: -.065em; }
.detail-facts { display: grid; grid-template-columns: 1fr 1fr; margin: 34px 0; border: var(--rule); }
.detail-facts div { min-width: 0; padding: 13px 15px; border-right: var(--rule); border-bottom: var(--rule); }
.detail-facts div:nth-child(2n) { border-right: 0; }
.detail-facts div:nth-last-child(-n+2) { border-bottom: 0; }
.detail-facts dt { margin-bottom: 3px; font: 10px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.detail-facts dd { margin: 0; font-weight: 700; }
.detail-copy { max-width: 620px; font-size: 18px; }
.detail-copy p { margin: 0 0 16px; }
.detail-copy .detail-access { margin: 24px 0 0; padding: 16px 18px; border-left: 7px solid var(--orange); background: #ece7dc; font-size: 15px; }
.detail-access::before { content: "GOOD TO KNOW"; display: block; margin-bottom: 5px; font: 700 10px var(--font-mono); letter-spacing: .08em; }
.save-button { width: 100%; min-height: 58px; display: flex; justify-content: center; align-items: center; gap: 11px; margin-top: 30px; padding: 12px 18px; border: var(--rule); color: var(--ink); background: var(--acid); font-weight: 800; box-shadow: 5px 5px 0 var(--ink); transition: background var(--fast), color var(--fast); }
.save-button[aria-pressed="true"] { color: white; background: #1557ff; }
.save-button svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 2; }
.save-button[aria-pressed="true"] svg { fill: currentColor; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-copy { text-align: center; }
  .intro { margin-inline: auto; }
  .cassette { width: min(82%, 520px); }
  .tuner { grid-template-columns: 1fr 1fr; }
  .mix-toggle { grid-column: 1 / -1; }
  .deck { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  html { scroll-padding-top: 12px; }
  .masthead { min-height: 60px; grid-template-columns: 1fr auto; padding: 9px 16px; }
  .edition { display: none; }
  .jump-link { font-size: 13px; }
  .brand { font-size: 17px; }
  .brand-mark { width: 33px; }
  .hero { min-height: auto; padding: 45px 16px 54px; gap: 45px; }
  h1 { font-size: clamp(48px, 16.5vw, 68px); line-height: .82; }
  .scribble { -webkit-text-stroke-width: 1px; }
  .intro { margin-top: 28px; font-size: 17px; }
  .cassette { width: calc(100% - 20px); padding: 15px 16px 18px; border-radius: 14px; box-shadow: 8px 8px 0 var(--ink); transform: rotate(2deg); }
  .cassette-label { margin: 12px 0; padding: 9px; }
  .cassette-label span { display: none; }
  .cassette-label strong { width: 100%; text-align: center; }
  .tape-window { height: 84px; margin-bottom: 14px; }
  .reel { width: 52px; }
  .reel i { width: 19px; border-width: 6px; }
  .browse { padding: 48px 14px 72px; }
  .browse-heading { display: block; }
  .browse-heading h2 { font-size: 48px; }
  .results-status { margin-top: 12px; text-align: left; }
  .tuner { position: static; grid-template-columns: 1fr; gap: 10px; padding: 11px; box-shadow: 4px 4px 0 rgba(23, 23, 20, .25); }
  .mix-toggle { grid-column: auto; }
  .deck { gap: 22px; margin-top: 28px; }
  .side { box-shadow: 4px 4px 0 var(--ink); }
  .side-header { padding: 11px 13px; }
  .side-header h3 { font-size: 23px; }
  .track-button { min-height: 126px; grid-template-columns: 44px minmax(0, 1fr) 32px; gap: 10px; padding: 14px 11px; }
  .track-main h4 { font-size: 18px; }
  .track-time { grid-column: 2; text-align: left; margin-top: -5px; }
  .track-arrow { grid-column: 3; grid-row: 1 / span 2; }
  .empty-state { padding: 30px 20px; }
  footer { display: block; padding: 20px 16px; }
  footer p + p { margin-top: 8px; }
  .detail-dialog { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); }
  .detail-card { max-height: calc(100dvh - 20px); box-shadow: 5px 5px 0 var(--acid); }
  .detail-header { padding-left: 13px; }
  .detail-body { padding: 25px 18px 28px; }
  .detail-lead { padding-right: 0; }
  .detail-number { position: static; margin-bottom: 8px; }
  .detail-lead h2 { font-size: 40px; }
  .detail-facts { grid-template-columns: 1fr; margin: 26px 0; }
  .detail-facts div { border-right: 0; border-bottom: var(--rule) !important; }
  .detail-facts div:last-child { border-bottom: 0 !important; }
  .detail-copy { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media (forced-colors: active) {
  .saved-notch { border: 6px solid Highlight; }
}
