:root {
  --bg: #111111;
  --panel: #1b1b1c;
  --line: #2c2c2e;
  --text: #f2efe9;
  --muted: #a39e94;
  --accent: #f3c13a;   /* vinyl-label yellow */
  --accent-ink: #1a1400;
  --error: #ff7a6b;
  --radius: 14px;
}
* { box-sizing: border-box; }
/* .drop/.query set display:flex/grid, which would otherwise override the
   hidden attribute: the empty results header showed on a fresh page. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
main, footer { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
header { padding: 40px 0 20px; }
h1 { margin: 0 0 8px; font-size: clamp(28px, 6vw, 44px); letter-spacing: -0.02em; line-height: 1.1; }
.sub { margin: 0; color: var(--muted); max-width: 46ch; }

.drop {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  margin: 12px 0 28px; padding: 44px 16px;
  border: 2px dashed var(--line); border-radius: var(--radius);
  background: var(--panel); cursor: pointer; text-align: center;
  transition: border-color .15s, transform .15s;
}
.drop:hover, .drop:focus-visible, .drop.over { border-color: var(--accent); outline: none; }
.drop:active { transform: scale(.99); }
.drop-icon { font-size: 44px; color: var(--accent); line-height: 1; }
.drop-main { font-weight: 650; font-size: 18px; }
.drop-hint { color: var(--muted); font-size: 14px; }
.drop-tip { color: var(--accent); font-size: 13px; margin-top: 6px; }

.examples { margin: -12px 0 28px; }
.examples-label { color: var(--muted); font-size: 14px; margin: 0 0 8px; }
.example-row { display: flex; gap: 12px; }
.example {
  flex: 1; max-width: 160px; padding: 0; overflow: hidden; cursor: pointer;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
  color: var(--text); font: inherit; text-align: left;
}
.example img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.example span { display: block; padding: 6px 10px; font-size: 13px; }
.example:hover, .example:focus-visible { border-color: var(--accent); outline: none; }

.query {
  display: grid; grid-template-columns: minmax(0, 320px) 1fr; gap: 20px; align-items: start;
  margin: 12px 0 24px; padding: 12px; background: var(--panel); border-radius: var(--radius);
}
/* the image box must match the photo's aspect so the % crop boxes line up */
.stage { position: relative; line-height: 0; border-radius: 10px; overflow: hidden; }
.stage img { width: 100%; height: auto; display: block; }
.scan {
  position: absolute; box-sizing: border-box; pointer-events: none;
  border: 2px solid var(--accent); border-radius: 4px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .38);
  transition: left .14s ease, top .14s ease, width .14s ease, height .14s ease;
}
.scan.found {
  border-width: 3px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .55);
  transition: left .45s cubic-bezier(.2, .8, .2, 1), top .45s cubic-bezier(.2, .8, .2, 1),
              width .45s cubic-bezier(.2, .8, .2, 1), height .45s cubic-bezier(.2, .8, .2, 1);
}
.phase { margin: 0 0 10px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.status { margin: 0 0 8px; color: var(--muted); }
.status.busy::before {
  content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 8px;
  border: 2px solid var(--accent); border-right-color: transparent; border-radius: 50%;
  vertical-align: -1px; animation: spin .8s linear infinite;
}
.status.error { color: var(--error); }
@keyframes spin { to { transform: rotate(360deg); } }

button.ghost {
  font: inherit; color: var(--text); background: transparent; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px;
}
button.ghost:hover { border-color: var(--accent); }

.results { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; padding-bottom: 32px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; animation: rise .25s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.card.fresh .match { color: var(--accent); }
.card.top { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.art { display: block; aspect-ratio: 1; background: #000; }
.art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.info { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.match { font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.card.top .match { color: var(--accent); }
.artist { margin: 0; font-size: 17px; line-height: 1.25; }
.title { margin: 0; }
.meta { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.links { margin-top: auto; padding-top: 10px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn { background: var(--accent); color: var(--accent-ink); font-weight: 650; text-decoration: none; padding: 7px 12px; border-radius: 999px; font-size: 14px; }
.btn:hover { filter: brightness(1.08); }
.text { color: var(--muted); font-size: 13px; }
.text:hover { color: var(--text); }

footer { color: var(--muted); font-size: 13px; padding-top: 8px; padding-bottom: 40px; border-top: 1px solid var(--line); }
footer p { margin: 8px 0; }

@media (prefers-reduced-motion: reduce) {
  .scan, .scan.found { transition: none; }
  .card, .status.busy::before { animation: none; }
}

@media (max-width: 640px) {
  .query { grid-template-columns: 1fr; }
  .stage { max-width: 420px; }
}

@media (max-width: 480px) {
  header { padding-top: 28px; }
  .results { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .info { padding: 10px; }
  .artist { font-size: 15px; }
  .links .text { display: none; }
}
