:root {
  --ink: #fff7ef;
  --ink-dim: rgba(255, 247, 239, 0.62);
  --glass: rgba(24, 12, 38, 0.35);
}

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

html, body { height: 100%; overflow: hidden; background: #1a0e2e; }

body {
  font-family: "Space Grotesk", system-ui, sans-serif;
  color: var(--ink);
}

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

.hud {
  position: fixed;
  left: 0; right: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 28px 36px;
  pointer-events: none;
  z-index: 5;
}
.hud-top { top: 0; align-items: flex-start; }
.hud-bottom { bottom: 0; }

.wordmark h1 {
  font-family: "Marcellus", serif;
  font-weight: 400;
  font-size: 28px;
  letter-spacing: 0.06em;
  text-shadow: 0 1px 24px rgba(255, 110, 80, 0.35);
}
.tagline {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.clock {
  font-variant-numeric: tabular-nums;
  font-weight: 300;
  font-size: 22px;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 18px rgba(255, 110, 80, 0.4);
}
.clock span { font-size: 12px; letter-spacing: 0.2em; color: var(--ink-dim); }

.now-playing {
  pointer-events: auto;
  text-decoration: none;
  color: var(--ink-dim);
  transition: border-color 0.3s, color 0.3s;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 0.12em;
  color: var(--ink-dim);
  background: var(--glass);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 247, 239, 0.12);
  border-radius: 999px;
  padding: 10px 18px;
  max-width: 46vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.now-playing:hover, .now-playing:focus-visible {
  color: var(--ink);
  border-color: rgba(255, 247, 239, 0.4);
}
.now-playing .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #ff8a5c;
  box-shadow: 0 0 12px #ff8a5c;
  animation: pulse 2.4s ease-in-out infinite;
  flex: none;
}
@keyframes pulse { 50% { opacity: 0.35; } }

#player-dock { pointer-events: auto; }
#player-dock iframe {
  display: block;
  width: 420px;
  height: 60px;
  border: 0;
  border-radius: 14px;
  opacity: 0.88;
}

.gate {
  position: fixed; inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  background: rgba(10, 7, 18, 0.4);
  backdrop-filter: blur(3px);
  transition: opacity 1.8s ease, visibility 1.8s;
}
.gate.open { opacity: 0; visibility: hidden; }

.gate-inner { text-align: center; max-width: 440px; padding: 0 24px; }
.gate-inner h1 {
  font-family: "Marcellus", serif;
  font-weight: 400;
  font-size: 52px;
  letter-spacing: 0.04em;
  margin-bottom: 14px;
  text-shadow: 0 2px 34px rgba(0, 0, 0, 0.5);
}
.gate-inner p {
  font-weight: 300;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-dim);
  margin-bottom: 34px;
}
#enter {
  font-family: "Space Grotesk", sans-serif;
  font-size: 13px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink);
  background: transparent;
  border: 1px solid rgba(255, 247, 239, 0.45);
  border-radius: 999px;
  padding: 16px 42px;
  cursor: pointer;
  transition: background 0.4s, box-shadow 0.4s;
}
#enter:hover, #enter:focus-visible {
  background: rgba(255, 247, 239, 0.12);
  box-shadow: 0 0 40px rgba(255, 138, 92, 0.45);
}
#enter:focus-visible, .now-playing:focus-visible {
  outline: 2px solid rgba(255, 247, 239, 0.7);
  outline-offset: 3px;
}
.fine {
  margin-top: 22px !important;
  margin-bottom: 0 !important;
  font-size: 10px !important;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.sound-pill {
  position: fixed;
  top: 26px; right: 36px;
  z-index: 6;
  font-family: "Space Grotesk", sans-serif;
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--glass);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 247, 239, 0.28);
  border-radius: 999px;
  padding: 11px 20px;
  cursor: pointer;
  transition: background 0.4s, opacity 0.8s;
}
.sound-pill:hover, .sound-pill:focus-visible {
  background: rgba(255, 247, 239, 0.14);
}
.sound-pill svg { display: none; width: 19px; height: 19px; }
.sound-pill[hidden] { display: none !important; }

@media (max-width: 720px) {
  .hud { padding: 18px 20px; }
  .sound-pill {
    top: 16px; right: 20px;
    width: 42px; height: 42px;
    padding: 0;
    display: grid;
    place-items: center;
    letter-spacing: 0;
  }
  .sound-pill svg { display: block; }
  .sound-pill .pill-label { display: none; }
  .wordmark h1 { font-size: 20px; }
  .clock { font-size: 16px; }
  .hud-bottom { flex-direction: column; align-items: stretch; gap: 10px; }
  .now-playing { max-width: none; justify-content: center; }
  #player-dock iframe { width: 100%; }
  .gate-inner h1 { font-size: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  .now-playing .dot { animation: none; }
  .gate { transition: opacity 0.4s ease, visibility 0.4s; }
}
