/* ─── PUB ’94 ─────────────────────────────────────────────────────────────── */

:root {
  --bg: #060608;
  --ink: #eae6df;
  --dim: #8d8a85;
  --amber: #e8b34b;
  --red: #ff3b2f;
  --smoke: #93a7bd;
  --hairline: rgba(234, 230, 223, 0.14);
  --mono: "Space Mono", ui-monospace, monospace;
  --display: "Bebas Neue", "Arial Narrow", sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  overflow: hidden;
}

/* the room */
#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* vignette + projector-light falloff */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background:
    radial-gradient(120% 90% at 50% 42%, transparent 55%, rgba(0, 0, 0, 0.62) 100%),
    linear-gradient(to top, rgba(0, 0, 0, 0.35), transparent 22%);
}

/* film grain */
body::after {
  content: "";
  position: fixed;
  inset: -100px;
  pointer-events: none;
  z-index: 3;
  opacity: 0.09;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.9s steps(8) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-38px, 22px); }
  50% { transform: translate(24px, -30px); }
  75% { transform: translate(-14px, -18px); }
  100% { transform: translate(0, 0); }
}

/* ── loader / the door ─────────────────────────────────────────────────────── */
#loader {
  position: fixed;
  inset: 0;
  z-index: 40;
  perspective: 1500px;
  /* one source of truth for the door height — the doorway sizes off it and the
     lamp glow hangs above it, so the two can't drift apart */
  --door-h: min(86vh, 186vw);
}

/* the jukebox belongs to the inside — no UI shows through the doorway while
   the door is still there (the loader is removed once it has swung open) */
.hud,
#now-playing,
#credits {
  transition: opacity 0.9s ease 0.25s;
}
body:has(#loader) .hud,
body:has(#loader) #now-playing,
body:has(#loader) #credits {
  opacity: 0;
  pointer-events: none;
}

/* a whisper of grain over wall + door, and a warm lamp glow above the doorway */
#loader::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
}
#loader::after {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(50% - var(--door-h) / 2); /* the door's top edge */
  transform: translate(-50%, -100%); /* glow hangs just above it */
  width: 64vmin;
  height: 22vmin;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 196, 96, 0.16), transparent);
}

/* the doorway: the element's own box is the hole in the wall — its spread
   shadow IS the wall. Room shows through the moment the door moves. */
#doorway {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  height: var(--door-h);
  aspect-ratio: 10 / 21;
  box-shadow: 0 0 0 200vmax #130b08;
  border: clamp(8px, 1.4vmin, 14px) solid #2a1a12; /* wooden jamb, all four sides:
     centred in the wall it reads as a frame, not a doorway resting on a floor */
  transition: opacity 0.7s ease 1.2s;
}
/* you walk through: the doorway rushes past the camera as the door swings,
   so the room arrives by approach rather than by cutting to it */
#loader.opening #doorway {
  opacity: 0;
  transform: translate(-50%, -50%) scale(3.2);
  transition:
    transform 1.7s cubic-bezier(0.45, 0, 0.75, 1) 0.3s,
    opacity 0.85s ease 1.15s;
}

/* the padded leather door — swings on its left hinge when you enter.
   container-type lets everything inside scale with the door (cqw units). */
#door {
  position: absolute;
  inset: 0;
  container-type: size;
  background:
    linear-gradient(rgba(0, 0, 0, 0.38), rgba(0, 0, 0, 0.1) 35%, rgba(0, 0, 0, 0.52)),
    url("../assets/door-leather.png") #3a201a;
  background-size: auto, 62cqw;
  transform-origin: left center;
  transition: transform 1.6s cubic-bezier(0.65, 0, 0.35, 1);
  box-shadow: inset 0 0 8cqw rgba(0, 0, 0, 0.35);
  backface-visibility: hidden;
}
#loader.opening #door {
  transform: rotateY(-103deg);
}

/* brass studs around the door edge */
#door::before {
  content: "";
  position: absolute;
  inset: 3.2cqw;
  pointer-events: none;
  background:
    radial-gradient(circle 0.7cqw, #caa64b 98%, transparent) top left / 8cqw 2cqw repeat-x,
    radial-gradient(circle 0.7cqw, #caa64b 98%, transparent) bottom left / 8cqw 2cqw repeat-x,
    radial-gradient(circle 0.7cqw, #caa64b 98%, transparent) top left / 2cqw 8cqw repeat-y,
    radial-gradient(circle 0.7cqw, #caa64b 98%, transparent) top right / 2cqw 8cqw repeat-y;
  opacity: 0.85;
}

/* warm light leaking under the door — the room is awake in there */
#door::after {
  content: "";
  position: absolute;
  left: 3%;
  right: 3%;
  bottom: 0;
  height: 2cqw;
  pointer-events: none;
  background: linear-gradient(to top, rgba(255, 176, 82, 0.5), transparent);
  filter: blur(3px);
}

/* brass pull bar on the opening edge, on its standoffs */
.door-knob {
  position: absolute;
  right: 8%;
  top: 50%;
  transform: translateY(-50%);
  width: 2.2cqw;
  height: 24cqw;
  border-radius: 1.1cqw;
  background: linear-gradient(90deg, #6b4c1a, #f0d089 35%, #c8a24e 62%, #6b4c1a);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.75), 0 0 20px rgba(212, 175, 55, 0.22);
}
/* the two standoffs that mount it to the leather */
.door-knob::before,
.door-knob::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 3.4cqw;
  height: 1.6cqw;
  transform: translateX(-50%);
  border-radius: 0.8cqw;
  background: linear-gradient(180deg, #d9b365, #7d5c22);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
  z-index: -1;
}
.door-knob::before { top: 1.6cqw; }
.door-knob::after { bottom: 1.6cqw; }

.door-inner {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4cqw;
  text-align: center;
}
.door-inner .neon {
  font-size: 15cqw;
}

.neon {
  font-family: var(--display);
  font-size: clamp(64px, 14vw, 150px);
  letter-spacing: 0.06em;
  line-height: 0.9;
  color: #f5e9d0;
  text-shadow:
    0 0 8px rgba(232, 179, 75, 0.9),
    0 0 30px rgba(232, 179, 75, 0.55),
    0 0 80px rgba(255, 59, 47, 0.35);
  animation: neon-flicker 6s infinite;
}
@keyframes neon-flicker {
  0%, 100% { opacity: 1; }
  91% { opacity: 1; }
  92% { opacity: 0.55; }
  93% { opacity: 0.95; }
  95% { opacity: 0.7; }
  96% { opacity: 1; }
}

#loader-tag {
  font-size: 2.5cqw;
  letter-spacing: 0.45em;
  text-indent: 0.45em; /* recentres tracked text */
  text-transform: uppercase;
  color: rgba(240, 224, 198, 0.6);
  margin-top: -2cqw;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

#loader-lines,
#loader-status {
  font-size: 1.8cqw;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(240, 224, 198, 0.55);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  padding: 0 4cqw;
}
#loader-status {
  color: var(--amber);
}

/* the maker's plate — sits low on the door, well clear of the centred title
   stack, and reads as a small engraved line rather than another status */
#loader-credit {
  position: absolute;
  bottom: 10cqw; /* clear of the bottom stud row */
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 1.5cqw;
  letter-spacing: 0.24em;
  text-indent: 0.24em; /* recentres tracked text */
  text-transform: uppercase;
  color: rgba(240, 224, 198, 0.42);
  text-decoration: none;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
  transition: color 0.3s ease;
}
#loader-credit:hover,
#loader-credit:focus-visible {
  color: var(--amber);
}

/* the brass push plate */
#enter-btn {
  margin-top: 2cqw;
  font-family: var(--mono);
  font-size: 2.7cqw;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #2a1a06;
  background: linear-gradient(180deg, #e8c87a, #b98e3e 55%, #96702a);
  border: 1px solid #6b4e1c;
  border-radius: 3px;
  padding: 3.2cqw 7cqw;
  cursor: pointer;
  box-shadow:
    0 2px 0 #54380f,
    0 6px 18px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 240, 200, 0.7);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.2s ease;
}
#enter-btn:disabled {
  opacity: 0.45;
  cursor: wait;
  filter: grayscale(0.5);
}
#enter-btn:not(:disabled):hover {
  filter: brightness(1.1);
}
#enter-btn:not(:disabled):active {
  transform: translateY(2px);
  box-shadow:
    0 0 0 #54380f,
    0 2px 8px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 240, 200, 0.7);
}

/* ── HUD corners ───────────────────────────────────────────────────────────── */
.hud {
  position: fixed;
  z-index: 10;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
}

#hud-logo {
  top: 22px;
  left: 26px;
  font-family: var(--display);
  font-size: 26px;
  letter-spacing: 0.1em;
  color: #f5e9d0;
  text-shadow: 0 0 14px rgba(232, 179, 75, 0.55);
}

#hud-sub {
  top: 52px;
  left: 27px;
  color: var(--dim);
}

/* the hour and the headcount, on little brass-rail pills */
#chips {
  top: 78px;
  left: 26px;
  display: flex;
  gap: 8px;
  letter-spacing: 0.16em;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: rgba(8, 8, 10, 0.42);
  backdrop-filter: blur(4px);
  font-size: 9.5px;
  color: var(--dim);
  white-space: nowrap;
}
.chip b {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.1em;
}
.chip-unit {
  opacity: 0.75;
}
.chip .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex: none;
}
.chip .dot.amber {
  background: var(--amber);
  box-shadow: 0 0 8px rgba(232, 179, 75, 0.8);
}
/* the crowd dot breathes, so the count reads as live rather than as a number
   that was true whenever the page happened to load */
.chip .dot.green {
  background: #7fd18a;
  box-shadow: 0 0 8px rgba(127, 209, 138, 0.75);
  animation: crowd-pulse 2.6s ease-in-out infinite;
}
@keyframes crowd-pulse {
  50% {
    opacity: 0.35;
  }
}
@media (prefers-reduced-motion: reduce) {
  .chip .dot.green {
    animation: none;
  }
}
/* [hidden] needs the assist — .chip sets display:inline-flex */
#chip-crowd[hidden] {
  display: none;
}
#hud-actions {
  top: 22px;
  right: 26px;
  display: flex;
  gap: 10px;
}
#hud-actions button {
  background: transparent;
  border: 1px solid var(--hairline);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 9px 16px;
  cursor: pointer;
  transition: all 0.2s;
}
#hud-actions button:hover,
#setlist-btn.open {
  border-color: var(--amber);
  color: var(--amber);
}
#scene-btn:disabled {
  opacity: 0.45;
  cursor: wait;
}

/* the room dims while the next one is fetched, then comes back up */
#scene {
  transition: opacity 0.45s ease;
}
body.scene-swapping #scene {
  opacity: 0.08;
}

/* ── now playing bar ───────────────────────────────────────────────────────── */
#now-playing {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  background: linear-gradient(to top, rgba(4, 4, 6, 0.88), rgba(4, 4, 6, 0.55) 70%, transparent);
  backdrop-filter: blur(6px);
  padding: 26px 26px 14px;
}

#np-progress {
  height: 14px;
  display: flex;
  align-items: center;
  cursor: pointer;
}
#np-progress::before {
  content: "";
  position: absolute;
  left: 26px;
  right: 26px;
  height: 2px;
  background: rgba(234, 230, 223, 0.18);
}
#np-progress-fill {
  height: 2px;
  width: 0%;
  background: var(--amber);
  box-shadow: 0 0 10px rgba(232, 179, 75, 0.7);
  transition: width 0.4s linear;
  position: relative;
  z-index: 1;
}

#np-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 6px;
}

.transport {
  display: flex;
  align-items: center;
  gap: 6px;
}
.transport button {
  background: transparent;
  border: none;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 14px;
  padding: 8px;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.15s, color 0.15s;
}
.transport button:hover {
  opacity: 1;
  color: var(--amber);
}
#btn-play {
  font-size: 16px;
}

#np-info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 12px;
  white-space: nowrap;
  overflow: hidden;
}
#np-title {
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
}
#np-artist {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
}

/* little equaliser */
#np-eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}
#np-eq span {
  width: 3px;
  background: var(--amber);
  height: 3px;
}
#np-eq.on span {
  animation: eq 0.9s ease-in-out infinite;
}
#np-eq.on span:nth-child(2) { animation-delay: 0.25s; }
#np-eq.on span:nth-child(3) { animation-delay: 0.5s; }
#np-eq.on span:nth-child(4) { animation-delay: 0.12s; }
@keyframes eq {
  0%, 100% { height: 3px; }
  50% { height: 12px; }
}

#np-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
#np-time {
  font-size: 11px;
  color: var(--dim);
  letter-spacing: 0.08em;
}
#source-tag {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
}
#source-tag b {
  color: var(--red);
  font-weight: 400;
}

/* room ambience toggle — lit while the crowd is murmuring */
#amb-btn {
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: 2px;
  padding: 4px 8px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, text-shadow 0.2s;
}
#amb-btn[aria-pressed="true"] {
  color: var(--amber);
  border-color: rgba(232, 179, 75, 0.45);
  text-shadow: 0 0 10px rgba(232, 179, 75, 0.5);
}
#amb-btn:hover {
  color: var(--ink);
}

#volume {
  width: 84px;
  accent-color: var(--amber);
  cursor: pointer;
}

/* ── setlist drawer ────────────────────────────────────────────────────────── */
#drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(390px, 92vw);
  z-index: 30;
  background: rgba(7, 7, 10, 0.92);
  backdrop-filter: blur(14px);
  border-left: 1px solid var(--hairline);
  transform: translateX(102%);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
}
#drawer.open {
  transform: translateX(0);
}

#drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px 14px;
  border-bottom: 1px solid var(--hairline);
}
/* which set the band is playing tonight */
#set-tabs {
  display: flex;
  gap: 8px;
  padding: 14px 24px 12px;
  border-bottom: 1px solid var(--hairline);
}
#set-tabs button {
  flex: 1;
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: 2px;
  padding: 7px 4px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
#set-tabs button:hover {
  color: var(--ink);
  border-color: rgba(234, 230, 223, 0.3);
}
#set-tabs button[aria-selected="true"] {
  color: var(--amber);
  border-color: rgba(232, 179, 75, 0.5);
  background: rgba(232, 179, 75, 0.07);
}

#drawer-head h2 {
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: 0.12em;
  color: var(--amber);
  font-weight: 400;
}
#drawer-close {
  background: none;
  border: none;
  color: var(--dim);
  font-size: 18px;
  cursor: pointer;
  padding: 6px;
}
#drawer-close:hover {
  color: var(--ink);
}

#track-rows {
  list-style: none;
  overflow-y: auto;
  flex: 1;
  padding: 8px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--hairline) transparent;
}

.row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 24px;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: background 0.15s;
}
.row:hover {
  background: rgba(234, 230, 223, 0.05);
}
.row .no {
  font-size: 10px;
  color: var(--dim);
  min-width: 20px;
}
.row .meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.row .meta b {
  font-weight: 400;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row .meta i {
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}
.row .yr {
  font-size: 10px;
  color: var(--dim);
}
.row.active {
  border-left-color: var(--amber);
  background: rgba(232, 179, 75, 0.07);
}
.row.active .meta b {
  color: var(--amber);
}
.row.active .no::before {
  content: "▸ ";
}
.row.dead {
  opacity: 0.35;
}
.row.dead .meta b {
  text-decoration: line-through;
}

/* spotify block */
#spotify-section {
  border-top: 1px solid var(--hairline);
  padding: 16px 24px 20px;
}
#spotify-section h3 {
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #1db954;
  margin-bottom: 10px;
  font-weight: 400;
}
#sp-btn {
  width: 100%;
  background: transparent;
  border: 1px solid var(--hairline);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 10px;
  cursor: pointer;
  transition: all 0.2s;
}
#sp-btn:hover {
  border-color: #1db954;
  color: #1db954;
}
#import-form {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}
#import-url {
  flex: 1;
  min-width: 0;
  background: rgba(234, 230, 223, 0.06);
  border: 1px solid var(--hairline);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  padding: 9px 10px;
}
#import-url:focus {
  outline: none;
  border-color: #1db954;
}
#import-form button {
  background: transparent;
  border: 1px solid var(--hairline);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  padding: 9px 12px;
  cursor: pointer;
}
#import-form button:hover {
  border-color: #1db954;
  color: #1db954;
}
#import-status {
  margin-top: 10px;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--dim);
  min-height: 14px;
}

/* sound credit, tucked above the now-playing bar */
#credits {
  position: fixed;
  left: 26px;
  bottom: 96px;
  z-index: 9;
  display: grid; /* byline over asset credits, not run together on one line */
  gap: 5px;
  justify-items: start;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(234, 230, 223, 0.28);
  pointer-events: none;
}
#credits a {
  color: rgba(234, 230, 223, 0.38);
  text-decoration: none;
  pointer-events: auto;
}
#credits a:hover,
#credits a:focus-visible {
  color: var(--amber);
}
/* the byline reads a step above the asset credits under it */
#credits .built-by {
  color: rgba(234, 230, 223, 0.5);
  letter-spacing: 0.18em;
}

/* hidden youtube iframe */
#yt-player {
  position: fixed;
  width: 1px;
  height: 1px;
  left: -10px;
  top: -10px;
  opacity: 0.01;
  pointer-events: none;
}

/* ── small screens ─────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  #hud-sub,
  #source-tag,
  #volume {
    display: none;
  }
  #chips {
    top: 56px; /* #hud-sub is gone, so the pills move up under the sign */
    left: 22px;
  }
  #hud-actions .wide {
    display: none; /* just "scene" where the corner is tight */
  }
  #hud-actions button {
    padding: 8px 11px;
    font-size: 10px;
  }
  #np-row {
    gap: 10px;
  }
  #now-playing {
    padding: 20px 16px 12px;
  }
  #np-progress::before {
    left: 16px;
    right: 16px;
  }
}

/* no-JS fallback (a class, not a style attribute, so the CSP needs no
   'unsafe-inline' for styles — see the headers block in netlify.toml) */
.noscript-note {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
}
