/* ---------- ART PASS: the header is the Reliquary Bus board (tools/art/extract-board.mjs) ----------
   One dark circuit board: reactor socket, the wordmark plate, the skyline inlay with its relay, and the search rail.
   board-brand.webp is the left block, board-tile.webp (mirrored, seamless) carries the rail to any width. Our own
   wordmark, DEMO badge, search, nav and avatar sit on the art's plates. All geometry is in board pixels (--k each):
   the board is 286 tall; the rail band runs 140-196; the wordmark plate 148-602 x 131-196; the search slot starts at 690.
   Scrolling, the skyline band slides away and the rail stays (sticky with a negative top). */
:root { --H: clamp(128px, 11vw, 172px); --k: calc(var(--H) / 286); --hdr: calc(var(--k) * 158); }
.hdr { height: var(--H) !important; min-height: 0 !important; top: calc(var(--k) * -128) !important; gap: 10px !important; align-items: center !important; flex-wrap: nowrap !important;
  padding: calc(var(--k) * 140) 16px calc(var(--k) * 90) 0 !important; border: 0 !important;
  background: url("/web/art/board-brand.webp") 0 0 / auto var(--H) no-repeat, url("/web/art/board-tile.webp") calc(var(--k) * 720) 0 / auto var(--H) repeat-x, #121513 !important;
  box-shadow: 0 2px 0 #050605, 0 4px 0 #ff5b1c2e, 0 8px 22px #0007 !important; }
.hdr::before, .hdr::after, .hdr > .hdr-noise { display: none !important; }
.hdr .logo { flex: none !important; position: relative; display: block !important; width: calc(var(--k) * 690); height: calc(var(--k) * 56); padding: 0 !important; margin: 0 !important; background: none !important; border: 0 !important; box-shadow: none !important; }
.hdr .logo .logo-mark { display: none !important; } /* the board's reactor core is the mark */
.hdr .logo-wordmark { position: absolute; left: calc(var(--k) * 166); top: calc(50% - var(--k) * 4); transform: translateY(-50%); height: calc(var(--k) * 44) !important; width: auto !important; max-width: none !important; filter: drop-shadow(0 2px 0 #050605); }
.hdr #demo-badge { position: absolute; left: calc(var(--k) * 520); top: calc(50% - var(--k) * 4); transform: translateY(-50%); padding: calc(var(--k) * 6) calc(var(--k) * 9) !important;
  border: 2px solid #c8521c !important; border-radius: 2px; background: #2a160e !important; color: #ff7a35 !important; font: 700 calc(var(--k) * 19) / 1 var(--head) !important; letter-spacing: .08em !important; box-shadow: inset 0 0 0 1px #00000088; }
/* the reactor core breathes; the skyline relay pings (board coordinates, relative to the logo, whose top is the rail) */
.hdr .logo::before, .hdr .logo::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.hdr .logo::before { left: calc(var(--k) * 48); top: calc(var(--k) * -25); width: calc(var(--k) * 60); height: calc(var(--k) * 60);
  background: radial-gradient(circle, #ffe2c4 0 10%, #ff7a2e 24%, #ff5b1c55 48%, transparent 70%); mix-blend-mode: screen; animation: core-breathe 3.2s ease-in-out infinite; }
.hdr .logo::after { left: calc(var(--k) * 540); top: calc(var(--k) * -135); width: calc(var(--k) * 36); height: calc(var(--k) * 36); border: 2px solid #ff7a2e; opacity: 0; animation: relay-ping 3.6s cubic-bezier(.2, .7, .3, 1) infinite; }
@keyframes core-breathe { 0%, 100% { opacity: .45; transform: scale(.9); } 50% { opacity: 1; transform: scale(1.12); } }
@keyframes relay-ping { 0% { transform: scale(.25); opacity: .9; } 70% { opacity: 0; } 100% { transform: scale(1.7); opacity: 0; } }
body.motion-quiet .hdr .logo::before, body.motion-quiet .hdr .logo::after { animation: none; }
/* the search is the slot itself: no box of its own */
.hdr .search { flex: 1 1 240px !important; min-width: 140px !important; max-width: 560px !important; height: calc(var(--k) * 50) !important; margin: 0 !important; padding: 0 12px 0 10px !important;
  background: transparent !important; border: 0 !important; box-shadow: none !important; clip-path: none !important; }
.hdr .search input { color: #efe6cf !important; background: transparent !important; font-size: 13px !important; }
.hdr .search input::placeholder { color: #9b9a88 !important; }
.hdr .search > .ic { color: #ff6a26 !important; width: 17px !important; height: 17px !important; }
.hdr .search kbd { background: #1c201b !important; color: #b8b29f !important; border-color: #3d4239 !important; }
.hdr .nav { background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; margin-left: auto; }
.hdr .me { flex: none; width: calc(var(--k) * 54) !important; height: calc(var(--k) * 54) !important; min-width: 30px; min-height: 30px; border: 2px solid #c9bfa3 !important; box-shadow: 0 0 0 2px #050605, 0 0 0 4px #ff5b1c55; }

/* tablets: one rail, search right after the plate; below 1000px the nav shows icons only (titles explain them) */
@media (min-width: 761px) and (max-width: 1080px) { .hdr .search { order: 0 !important; flex: 1 1 150px !important; max-width: none !important; } }
@media (min-width: 761px) and (max-width: 1000px) {
  .hdr .nav > button[data-nav], .hdr .nav-drop > button { font-size: 0 !important; letter-spacing: 0 !important; padding: 0 9px !important; gap: 0 !important; }
  .hdr .nav > button[data-nav] .ic, .hdr .nav-drop > button .ic { width: 16px !important; height: 16px !important; margin: 0 !important; }
  .hdr .nav > button[data-nav] > span:not(.nav-badge) { display: none !important; }
  .hdr .nav-drop > button .chev { display: none !important; }
  .hdr .search kbd { display: none !important; }
}

/* ---------- PHONE ---------- */
@media (max-width: 760px) {
  /* the board, smaller: row one (brand, search button, you) sits on the rail; the game buttons sit in the skyline band */
  :root { --H: 112px; --hdr: auto; }
  .hdr { position: relative !important; top: auto !important; height: auto !important; min-height: var(--H) !important; padding: calc(var(--k) * 140 - 10px) 8px 0 0 !important;
    grid-template-columns: calc(var(--k) * 690) minmax(0, 1fr) 32px 32px !important; grid-template-areas: "brand . search-toggle avatar" "search search search search" !important; gap: 0 6px !important; align-content: start !important; }
  .hdr .logo { grid-area: brand; width: auto; height: calc(var(--k) * 56 + 20px); }
  .hdr .logo-wordmark { height: calc(var(--k) * 44) !important; }
  .hdr #demo-badge { padding: 2px 3px !important; font-size: 8px !important; border-width: 1px !important; }
  .hdr .me { width: 30px !important; height: 30px !important; }
  .hdr.search-open { padding-bottom: 8px !important; }
  .hdr.search-open .search { background: #0b1110 !important; border: 1px solid #3d4239 !important; margin-top: calc(var(--k) * 90 - 14px) !important; }
  .game-dock { position: absolute !important; top: 10px !important; right: 8px !important; bottom: auto !important; z-index: 40 !important; gap: 6px !important; }
  .game-dock .dark-ball, .game-dock #arcade-chip { width: 30px !important; height: 30px !important; }
  /* LOG IN stays visible on phone too (owner, 20 Oct) */

  /* track rows: smaller titles that fit, and every row keeps its waveform (a slim strip under the artist).
     Selectors match bugfix.css's phone row rules (which hid the waveform) so these win. */
  .rows:not(.grid) .row:not(.compact) > .r-body .r-title, .rows:not(.grid) .row:not(.compact) > .r-body .r-title a { font-size: 12.5px !important; line-height: 1.3 !important; letter-spacing: 0 !important; }
  .rows:not(.grid) .row:not(.compact) > .r-body .r-artist { font-size: 11.5px !important; }
  .rows:not(.grid) .row:not(.compact) > .r-body .r-wave { display: block !important; position: relative; height: 22px !important; margin-top: 4px; min-width: 0; }
  .rows:not(.grid) .row:not(.compact) > .r-body .r-wave canvas { display: block; width: 100% !important; height: 22px !important; }
  .rows:not(.grid) .row:not(.compact) > .r-body .r-wave .r-time { display: none !important; }
  .rows:not(.grid) .row:not(.compact).current > .r-body .r-wave .r-time { display: inline-block !important; font-size: 9px; }
}
@media (max-width: 359px) { :root { --H: 96px; } }
