/* Editorial grotesk substitute for Molde (the supplied Molde file was a
   watermarked demo). Space Grotesk — SIL OFL, full clean punctuation. */
@font-face {
  font-family: "Editorial";
  src: url("/static/fonts/space-grotesk-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
  font-family: "Editorial";
  src: url("/static/fonts/space-grotesk-latin-ext.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #ffffff;
  --ink: #14110f;
  --muted: #8c857e;
  --faint: #b7b0a8;
  --line: #ece8e3;
  --card: #f6f4f1;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Editorial", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100%;
}

body { overflow-x: hidden; }

/* ---------------------------------------------------------------- covers */
.covers { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.cover {
  position: absolute;
  width: var(--w, 130px);
  aspect-ratio: 1;
  object-fit: cover;
  box-shadow: 0 18px 50px rgba(20,17,15,.10);
  opacity: 0; /* revealed by the staggered pop-in */
  animation:
    popIn .5s cubic-bezier(.2,.8,.3,1.25) both var(--d, 0s),
    drift var(--dur, 22s) ease-in-out infinite alternate calc(var(--d, 0s) + .5s);
}
@keyframes popIn {
  0%   { opacity: 0; transform: scale(.35); }
  100% { opacity: .9; transform: scale(1); }
}
@keyframes drift {
  from { transform: translate(0,0); }
  to   { transform: translate(var(--dx,10px), var(--dy,-12px)); }
}

/* --------------------------------------------------------------- landing */
.landing {
  position: relative; z-index: 2;
  min-height: 100vh;   /* fallback for browsers without dvh */
  min-height: 100dvh;  /* real visible height — avoids the mobile Safari
                           toolbar jump that pushes centered content low */
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  /* asymmetric padding nudges the centered content up a bit */
  padding: 20px 24px 60px;
  text-align: center;
}
.mast {
  max-width: 800px; margin-bottom: 44px;
  display: flex; flex-direction: column; align-items: center;
}
.brand { height: 88px; width: auto; margin-bottom: 26px; }
.title {
  font-size: clamp(30px, 4.2vw, 50px);
  font-weight: 500; line-height: 1.1; letter-spacing: -.015em;
}

/* ------------------------------------------------------------ search bar */
.searchwrap { position: relative; z-index: 3; width: min(620px, 92vw); }
.searchbar {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 18px 26px;
  box-shadow: 0 10px 40px rgba(20,17,15,.06);
}
.mag { width: 22px; height: 22px; color: var(--ink); flex: none; }
#q, #q2 {
  flex: 1; border: none; outline: none; background: transparent;
  font-family: inherit; font-size: 20px; color: var(--ink);
}
#q::placeholder, #q2::placeholder { color: var(--faint); }

/* compact search in the results top bar */
.searchbar-sm { padding: 11px 18px; box-shadow: 0 6px 20px rgba(20,17,15,.05); }
.searchbar-sm .mag { width: 18px; height: 18px; }
.searchbar-sm #q2 { font-size: 16px; }
.searchwrap-top { width: min(400px, 58vw); margin-left: auto; }

.suggest {
  position: absolute; top: calc(100% + 12px); left: 0; right: 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(20,17,15,.10);
  overflow: hidden;
  display: none;
}
.suggest.open { display: block; }
.sug-group-label {
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--faint); padding: 16px 24px 8px;
}
.sug {
  display: flex; align-items: baseline; gap: 10px;
  padding: 12px 24px; cursor: pointer; text-align: left;
}
.sug:hover, .sug.active { background: var(--card); }
.sug-main { font-size: 17px; }
.sug-sub { font-size: 13px; color: var(--muted); }
.sug-rating { margin-left: auto; font-size: 13px; color: var(--faint); }
.sug-empty { padding: 22px 24px; color: var(--muted); font-size: 15px; }

/* --------------------------------------------------------------- results */
.results {
  position: relative; z-index: 5;
  background: var(--bg);
  min-height: 100vh;
  max-width: 1120px; margin: 0 auto;
  padding: 0 32px 120px;
}
.results-top {
  position: sticky; top: 0; z-index: 6;
  display: flex; align-items: center; gap: 20px;
  padding: 26px 0 22px;
  margin-bottom: 26px;
  background: var(--bg);
}
.back {
  font-family: inherit; font-size: 15px; color: var(--muted);
  background: none; border: none; cursor: pointer; padding: 6px 0; flex: none;
}
.back:hover { color: var(--ink); }

.results-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 64px;
  align-items: start;
}
@media (max-width: 820px) {
  .results-grid { grid-template-columns: 1fr; gap: 36px; }
}

/* anchor (left) — stays pinned while the recs column scrolls */
.anchor { position: sticky; top: 96px; align-self: start; }
.anchor-cover {
  width: 100%; aspect-ratio: 1; border-radius: 10px;
  background: var(--card); object-fit: cover; margin-bottom: 22px;
  box-shadow: 0 20px 50px rgba(20,17,15,.12);
}
.anchor-name { font-size: 32px; font-weight: 500; line-height: 1.08; letter-spacing: -.01em; }
.anchor-sub { margin-top: 8px; font-size: 16px; color: var(--muted); }
.anchor-blurb {
  margin-top: 20px; font-size: 15px; line-height: 1.6; color: var(--ink);
  padding-left: 14px; border-left: 2px solid var(--line);
}
.anchor-blurb-by { display: block; margin-top: 8px; font-size: 13px; color: var(--muted); }

/* recs (right) */
.recs-head { font-size: 14px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.rec {
  display: flex; gap: 18px; align-items: flex-start;
  padding: 22px 0; border-top: 1px solid var(--line);
}
.rec:first-of-type { border-top: none; }
.rec-cover {
  width: 66px; height: 66px; flex: none; border-radius: 6px;
  background: var(--card); object-fit: cover;
}
.rec-body { flex: 1; min-width: 0; }
.rec-track {
  font-size: 18px; font-weight: 500; letter-spacing: -.005em;
  cursor: pointer; display: inline-flex; align-items: baseline; gap: 10px;
}
.rec-track:hover { text-decoration: underline; text-underline-offset: 3px; }
.rec-more {
  font-size: 12px; font-weight: 400; color: var(--faint);
  opacity: 0; transition: opacity .15s; white-space: nowrap;
}
.rec-track:hover .rec-more, .rec-track:focus-visible .rec-more { opacity: 1; }

/* similar artists — clickable image squares */
.artist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(94px, 1fr));
  gap: 18px 14px;
  margin: 16px 0 42px;
}
.asq {
  display: flex; flex-direction: column; align-items: flex-start; gap: 7px;
  background: none; border: none; padding: 0; cursor: pointer;
  font-family: inherit; text-align: left;
}
.asq-img {
  display: block; width: 100%; aspect-ratio: 1; overflow: hidden;
  background: var(--card); box-shadow: 0 8px 22px rgba(20,17,15,.09);
}
.asq-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.asq:hover .asq-img img { transform: scale(1.06); }
.asq-name { font-size: 14px; font-weight: 500; line-height: 1.15; }
.asq-rel { font-size: 11px; color: var(--muted); text-transform: capitalize; }
.rec-artist { font-size: 15px; color: var(--muted); margin-top: 2px; }
.rec-artist-link { cursor: pointer; display: inline-block; }
.rec-artist-link:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.rec-quote {
  font-size: 15px; line-height: 1.55; color: var(--ink);
  margin-top: 12px; padding-left: 14px; border-left: 2px solid var(--line);
}
.rec-why { font-size: 13px; color: var(--faint); margin-top: 10px; }
.rec-idx { font-size: 14px; color: var(--faint); width: 26px; flex: none; padding-top: 4px; }

.results.fade { animation: fade .45s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* rec cover + play affordance */
.rec-art { position: relative; width: 66px; height: 66px; flex: none; }
.rec.playable .rec-art { cursor: pointer; }
.rec-play {
  position: absolute; inset: 0; display: none;
  align-items: center; justify-content: center;
  background: rgba(20,17,15,.42); color: #fff; border-radius: 6px;
  font-size: 20px; padding-left: 3px;
}
.rec.playable .rec-art:hover .rec-play { display: flex; }

.rec-yt {
  display: inline-block; margin-top: 10px;
  font-size: 13px; color: var(--muted); text-decoration: none;
  border-bottom: 1px solid var(--line); padding-bottom: 1px;
}
.rec-yt:hover { color: #c4302b; border-color: #c4302b; } /* youtube red on hover */

/* ------------------------------------------------------------ 30s player */
.player {
  position: fixed; z-index: 20; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 22px;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 30px rgba(20,17,15,.06);
}
.np-cover { width: 46px; height: 46px; border-radius: 5px; object-fit: cover; background: var(--card); flex: none; }
.np-meta { min-width: 130px; max-width: 220px; }
.np-track { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-artist { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-btn {
  width: 40px; height: 40px; flex: none; border-radius: 50%;
  border: 1.5px solid var(--ink); background: var(--ink); color: #fff;
  font-size: 14px; cursor: pointer; line-height: 1;
}
.np-btn:hover { opacity: .85; }
.np-bar { flex: 1; height: 4px; border-radius: 2px; background: var(--line); cursor: pointer; overflow: hidden; }
.np-fill { height: 100%; width: 0; background: var(--ink); }
.np-time { font-size: 13px; color: var(--muted); width: 34px; text-align: right; flex: none; font-variant-numeric: tabular-nums; }
.np-yt {
  font-size: 13px; color: var(--muted); text-decoration: none; flex: none;
  border-bottom: 1px solid var(--line); padding-bottom: 1px;
}
.np-yt:hover { color: #c4302b; border-color: #c4302b; }

.results { padding-bottom: 120px; } /* room for the fixed player */

/* ============================================================= responsive */
/* The floating covers are a desktop-only flourish — they need wide margins to
   sit clear of the hero text, so tablet and phone both go without them. */
@media (max-width: 1000px) {
  .covers { display: none; }
}

/* Tablet / large phone */
@media (max-width: 820px) {
  .results { padding: 0 18px 130px; }
  .results-top { gap: 12px; padding: 18px 0 16px; margin-bottom: 22px; }
  .searchwrap-top { width: auto; flex: 1; }
  .searchbar-sm { padding: 10px 15px; }
  .results-grid { grid-template-columns: 1fr; gap: 30px; }
  .anchor { position: static; margin-bottom: 8px; }   /* no sticky on mobile */
  .anchor-cover { max-width: 220px; margin-bottom: 18px; }
  .anchor-name { font-size: 27px; }
  .artist-grid {
    grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
    gap: 16px 12px; margin: 14px 0 34px;
  }
}

/* Phone */
@media (max-width: 560px) {
  /* tightened + heavily asymmetric so the whole hero sits well above center,
     with generous top/bottom bands left clear for the 5-cover mobile scatter */
  .landing { padding: 8px 20px 96px; }
  .mast { margin-bottom: 22px; }
  .brand { height: 56px; margin-bottom: 12px; }
  .title { font-size: 26px; line-height: 1.14; }
  .searchbar { padding: 14px 20px; }
  #q, #q2 { font-size: 17px; }
  .sug-main { font-size: 16px; }
  .anchor-cover { max-width: 190px; }
  .anchor-name { font-size: 24px; }
  .anchor-blurb { font-size: 14px; }
  .rec { gap: 12px; padding: 18px 0; }
  .rec-idx { display: none; }
  .rec-track { font-size: 16px; }
  .rec-quote, .rec-artist { font-size: 14px; }
  .player { gap: 12px; padding: 10px 14px; }
  .np-cover { width: 40px; height: 40px; }
}

@media (max-width: 640px) {
  .np-yt, .np-meta { display: none; }
}
