:root {
  --ink: #0b0f15;
  --panel: #111720;
  --panel-soft: #161e29;
  --paper: #f4f1e8;
  --muted: #98a2ad;
  --acid: #d7ff3f;
  --coral: #ff665a;
  --sky: #68d8ff;
  --line: rgba(255, 255, 255, 0.13);
  --display: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  --body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--paper);
  background:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
    var(--ink);
  background-size: 42px 42px;
  font-family: var(--body);
  min-height: 100vh;
  overflow-x: hidden;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .28;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.14'/%3E%3C/svg%3E");
  z-index: 10;
}
a { color: inherit; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.ambient { position: fixed; border-radius: 50%; filter: blur(110px); opacity: .13; pointer-events: none; }
.ambient-one { width: 420px; height: 420px; background: var(--coral); top: -160px; right: -130px; }
.ambient-two { width: 360px; height: 360px; background: var(--sky); top: 54vh; left: -210px; }

.hero, main, footer { position: relative; z-index: 1; }
.hero { max-width: 1440px; margin: 0 auto; padding: 0 5vw 70px; }
.topbar { min-height: 88px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 850; letter-spacing: -.025em; }
.brand b { color: var(--acid); }
.brand-mark { width: 38px; aspect-ratio: 1; display: grid; place-items: center; border: 1px solid var(--acid); border-radius: 50%; color: var(--acid); transform: rotate(-10deg); }
.topbar-links { display: flex; align-items: center; gap: 22px; }
.mutopia-link, .queue-nav { color: var(--muted); font: 12px var(--mono); letter-spacing: .06em; text-transform: uppercase; text-underline-offset: 4px; }
.queue-nav { color: var(--paper); text-decoration: none; }
.queue-nav span { min-width: 24px; height: 24px; margin-left: 5px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 99px; background: var(--acid); color: var(--ink); font-weight: 900; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 420px); gap: clamp(40px, 8vw, 130px); align-items: end; padding-top: clamp(70px, 10vw, 130px); }
.eyebrow, .section-number, .pick-label { color: var(--acid); font: 700 12px var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.status-dot { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 16px var(--coral); animation: pulse 2s infinite; }
h1 { margin: 18px 0 20px; font: 900 clamp(76px, 12vw, 176px)/.78 var(--display); letter-spacing: -.055em; text-transform: uppercase; }
h1 span { color: transparent; -webkit-text-stroke: 2px var(--paper); }
.lede { margin: 0 0 34px; max-width: 620px; color: #d6d7d9; font-size: clamp(18px, 2vw, 27px); letter-spacing: -.03em; }
.trust-row { display: flex; flex-wrap: wrap; gap: 9px; }
.trust-row span { border: 1px solid var(--line); border-radius: 99px; padding: 9px 12px; color: var(--muted); font: 11px var(--mono); }

.random-button {
  position: relative;
  min-height: 390px;
  padding: 34px;
  border: 0;
  border-radius: 2px;
  color: var(--ink);
  background: var(--acid);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 18px 18px 0 rgba(255,102,90,.9);
  transition: transform .18s ease, box-shadow .18s ease;
}
.random-button::before { content: "♬"; position: absolute; right: -18px; top: -60px; font: 260px/.9 Georgia, serif; opacity: .09; transform: rotate(12deg); }
.random-button:hover { transform: translate(-5px, -5px); box-shadow: 24px 24px 0 var(--coral); }
.random-button:active { transform: translate(7px, 7px); box-shadow: 10px 10px 0 var(--coral); }
.random-kicker { display: block; font: 800 12px var(--mono); letter-spacing: .16em; }
.random-button strong { display: block; margin-top: 55px; font: 900 clamp(56px, 6vw, 84px)/.77 var(--display); letter-spacing: -.045em; }
.random-footer { position: absolute; left: 34px; right: 34px; bottom: 28px; display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 750; }
.random-footer span { margin-left: auto; font-size: 24px; }
kbd { border: 1px solid currentColor; border-radius: 3px; padding: 2px 6px; font: 11px var(--mono); box-shadow: 0 2px 0 currentColor; }
.random-button.rolling strong { font-size: clamp(35px, 4vw, 58px); overflow-wrap: anywhere; }
.shake { animation: shake .38s ease; }

main { max-width: 1440px; margin: 0 auto; padding: 0 5vw; }
.pick-panel { margin: 0 0 90px; padding: 22px 26px 28px; border: 1px solid var(--coral); background: rgba(255,102,90,.08); transform: translateY(12px); opacity: 0; }
.pick-panel.reveal { animation: reveal .35s ease forwards; }
.pick-label { color: var(--coral); margin-bottom: 22px; }
.pick-content { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 30px; }
.pick-content h2 { margin: 6px 0 8px; font: 800 clamp(30px, 5vw, 64px)/.95 var(--display); letter-spacing: -.025em; text-transform: uppercase; }
.pick-content p { margin: 0; color: var(--muted); }
.pick-meta { font: 700 12px var(--mono); color: var(--acid) !important; text-transform: uppercase; }
.pick-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.button { min-height: 48px; padding: 0 17px; display: inline-flex; gap: 10px; align-items: center; justify-content: center; border: 1px solid var(--line); color: var(--paper); background: transparent; cursor: pointer; font-size: 13px; font-weight: 800; text-decoration: none; text-transform: uppercase; }
.button.primary { background: var(--coral); border-color: var(--coral); color: var(--ink); }
.button.ghost:hover { border-color: var(--paper); }
.button:disabled, .queue-add:disabled { cursor: not-allowed; opacity: .55; }
.queue-button { border-color: var(--acid); color: var(--acid); }
.queue-button.queued { border-color: var(--line); color: var(--muted); }

.queue-board { margin: 0 0 100px; padding: clamp(26px, 5vw, 54px); border: 1px solid var(--line); background: linear-gradient(135deg, rgba(104,216,255,.08), rgba(215,255,63,.035)); }
.queue-heading { display: flex; justify-content: space-between; align-items: end; gap: 30px; }
.queue-heading h2 { margin: 10px 0 8px; font: 800 clamp(44px, 7vw, 88px)/.88 var(--display); letter-spacing: -.04em; text-transform: uppercase; }
.queue-intro { max-width: 700px; margin: 0; color: var(--muted); line-height: 1.6; }
.queue-count { display: flex; flex-direction: column; align-items: end; color: var(--muted); font: 11px var(--mono); text-transform: uppercase; letter-spacing: .1em; }
.queue-count strong { color: var(--acid); font: 700 56px var(--display); }
.queue-tools { margin: 34px 0 14px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.queue-tools label span { display: block; margin-bottom: 7px; color: var(--muted); font: 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.queue-tools input { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--line); outline: 0; color: var(--paper); background: rgba(11,15,21,.72); }
.queue-tools input:focus { border-color: var(--sky); }
.queue-message { min-height: 20px; margin: 0 0 12px; color: var(--sky); font: 11px var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.queue-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.queue-item { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 17px 0; border-bottom: 1px solid var(--line); }
.queue-position { color: var(--acid); font: 700 18px var(--mono); }
.queue-item strong { display: block; text-transform: uppercase; }
.queue-item div > span { display: block; margin-top: 5px; color: var(--muted); font: 11px var(--mono); }
.queue-links { display: flex; gap: 14px; }
.queue-links a { font: 800 10px var(--mono); text-transform: uppercase; text-underline-offset: 4px; }
.queue-empty { padding: 28px 0; color: var(--muted); font-style: italic; }

.catalog-shell { padding: 80px 0 120px; border-top: 1px solid var(--line); }
.catalog-heading { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 44px; }
.catalog-heading h2, .method-note h2 { margin: 10px 0 0; font: 800 clamp(44px, 7vw, 88px)/.88 var(--display); letter-spacing: -.04em; text-transform: uppercase; }
.catalog-status { display: flex; flex-direction: column; align-items: end; font: 11px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.catalog-status strong { font: 700 48px var(--display); color: var(--paper); letter-spacing: -.02em; }
.filter-panel { border: 1px solid var(--line); background: rgba(17,23,32,.9); }
.search-field { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 22px 24px; border-bottom: 1px solid var(--line); color: var(--muted); }
.search-field > span[aria-hidden] { color: var(--acid); font-size: 28px; line-height: 1; transform: rotate(-20deg); }
.search-field input { width: 100%; border: 0; outline: 0; color: var(--paper); background: transparent; font-size: clamp(17px, 2vw, 24px); }
.search-field input::placeholder { color: #68727d; }
.mode-row { display: flex; padding: 11px; gap: 8px; border-bottom: 1px solid var(--line); }
.mode-button { flex: 1; min-height: 52px; border: 1px solid transparent; color: var(--muted); background: transparent; cursor: pointer; font-weight: 800; text-transform: uppercase; font-size: 12px; letter-spacing: .06em; }
.mode-button:hover { color: var(--paper); background: rgba(255,255,255,.04); }
.mode-button.active { color: var(--ink); background: var(--acid); }
.select-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 1px; background: var(--line); }
.select-row label { min-width: 0; padding: 14px 18px; background: var(--panel); }
.select-row label span { display: block; color: var(--muted); margin-bottom: 6px; font: 10px var(--mono); text-transform: uppercase; letter-spacing: .12em; }
select { width: 100%; border: 0; outline: 0; background: transparent; color: var(--paper); font-weight: 700; cursor: pointer; }
select option { background: var(--panel); color: var(--paper); }
.clear-button { padding: 0 22px; border: 0; color: var(--paper); background: var(--panel); cursor: pointer; font-size: 12px; font-weight: 750; text-decoration: underline; text-underline-offset: 4px; }
.clear-button:hover { color: var(--acid); }
.results-bar { display: flex; justify-content: space-between; gap: 20px; color: var(--muted); margin: 30px 0 16px; font: 12px var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.results-bar p { margin: 0; }
.results-bar strong { color: var(--paper); }

.song-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.song-card { min-height: 340px; display: flex; flex-direction: column; padding: 22px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(17,23,32,.72); animation: cardIn .35s both; animation-delay: var(--delay); transition: background .2s ease, transform .2s ease; }
.song-card:hover { background: var(--panel-soft); transform: translateY(-3px); }
.song-card[data-category="piano"] { box-shadow: inset 0 3px var(--sky); }
.song-card[data-category="multi"] { box-shadow: inset 0 3px var(--coral); }
.song-card-top { display: flex; justify-content: space-between; align-items: start; gap: 15px; }
.song-number { color: #58616c; font: 11px var(--mono); }
.badges { display: flex; flex-wrap: wrap; justify-content: end; gap: 5px; }
.badge { padding: 5px 6px; border: 1px solid var(--line); color: var(--muted); font: 9px var(--mono); letter-spacing: .06em; }
.badge.pd { border-color: rgba(215,255,63,.42); color: var(--acid); }
.composer { color: var(--coral); margin: 36px 0 8px; font: 700 11px var(--mono); text-transform: uppercase; letter-spacing: .09em; }
.song-card h3 { margin: 0; font: 800 clamp(26px, 2.6vw, 42px)/.92 var(--display); text-transform: uppercase; letter-spacing: -.025em; }
.opus { color: var(--muted); margin: 10px 0 0; font: 11px var(--mono); }
.instrument { color: #d3d7dc; margin: 22px 0; font-size: 14px; line-height: 1.45; }
.song-footer { margin-top: auto; display: flex; justify-content: space-between; align-items: end; gap: 12px; padding-top: 18px; border-top: 1px solid var(--line); }
.song-footer .style { color: var(--muted); font: 10px var(--mono); text-transform: uppercase; }
.song-actions { display: flex; flex-wrap: wrap; justify-content: end; align-items: center; gap: 11px; }
.song-footer a { font-size: 11px; font-weight: 800; text-underline-offset: 4px; text-transform: uppercase; }
.song-footer a:hover { color: var(--acid); }
.queue-add { padding: 0; border: 0; color: var(--acid); background: transparent; cursor: pointer; font-size: 11px; font-weight: 900; text-transform: uppercase; }
.queue-add.queued { color: var(--muted); }
.empty-state { grid-column: 1 / -1; min-height: 260px; display: grid; place-content: center; gap: 8px; text-align: center; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.empty-state strong { font: 800 36px var(--display); text-transform: uppercase; }
.empty-state span { color: var(--muted); }
.load-more { width: 100%; min-height: 62px; border: 1px solid var(--line); border-top: 0; color: var(--paper); background: var(--panel); cursor: pointer; font-weight: 800; text-transform: uppercase; }
.load-more:hover { color: var(--ink); background: var(--acid); }

.method-note { display: grid; grid-template-columns: .55fr 1.25fr .8fr; gap: clamp(30px, 6vw, 90px); padding: 100px 0; border-top: 1px solid var(--line); }
.method-note h2 { font-size: clamp(40px, 5.5vw, 72px); }
.method-note div p, .fine-print { color: var(--muted); line-height: 1.7; }
.method-note div p { max-width: 720px; font-size: 17px; }
.method-note b { color: var(--paper); }
.fine-print { margin: 0; font: 12px/1.75 var(--mono); }
footer { max-width: 1440px; min-height: 100px; margin: 0 auto; padding: 0 5vw; display: flex; justify-content: space-between; align-items: center; gap: 20px; border-top: 1px solid var(--line); color: var(--muted); font: 10px var(--mono); text-transform: uppercase; letter-spacing: .08em; }
footer a { text-underline-offset: 4px; }

@keyframes pulse { 50% { opacity: .4; transform: scale(.8); } }
@keyframes reveal { to { opacity: 1; transform: translateY(0); } }
@keyframes cardIn { from { opacity: 0; transform: translateY(12px); } }
@keyframes shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }

@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .random-button { min-height: 280px; max-width: 620px; }
  .random-button strong { margin-top: 35px; }
  .song-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .method-note { grid-template-columns: 1fr 2fr; }
  .method-note .fine-print { grid-column: 2; }
}

@media (max-width: 660px) {
  .hero { padding-inline: 20px; }
  main { padding-inline: 20px; }
  .topbar { min-height: 72px; }
  .mutopia-link { font-size: 0; }
  .mutopia-link span { font-size: 20px; }
  .hero-grid { padding-top: 70px; }
  h1 { font-size: clamp(67px, 23vw, 104px); }
  .random-button { min-height: 300px; padding: 26px; box-shadow: 10px 10px 0 var(--coral); }
  .random-footer { left: 26px; right: 26px; }
  .pick-content { grid-template-columns: 1fr; }
  .queue-heading { align-items: start; }
  .queue-count { align-items: start; }
  .queue-tools { grid-template-columns: 1fr; }
  .queue-item { grid-template-columns: 38px minmax(0, 1fr); }
  .queue-links { grid-column: 2; }
  .catalog-heading { align-items: start; }
  .catalog-status { align-items: start; }
  .catalog-status strong { font-size: 34px; }
  .mode-row { overflow-x: auto; }
  .mode-button { min-width: 140px; }
  .select-row { grid-template-columns: 1fr; }
  .select-row label, .clear-button { min-height: 66px; }
  .song-grid { grid-template-columns: 1fr; }
  .results-bar { align-items: end; }
  .catalog-date { text-align: right; }
  .method-note { grid-template-columns: 1fr; }
  .method-note .fine-print { grid-column: auto; }
  footer { align-items: start; flex-direction: column; padding-block: 32px; }
}

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