:root {
  --bg: #0a0a0b;
  --bg-soft: #111113;
  --ink: #ededed;
  --ink-dim: #b8b8b8;
  --muted: #6a6a70;
  --rule: rgba(255,255,255,0.07);
  --accent: #ededed;
  --serif: 'Instrument Serif', 'Times New Roman', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --t: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

@media (hover: hover) and (pointer: fine) {
  html, body { cursor: none; }
}

a { color: inherit; text-decoration: none; }

/* ----------- Custom cursor ----------- */
.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 6px;
  height: 6px;
  background: var(--ink);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width .35s var(--t), height .35s var(--t),
              background .25s, opacity .25s;
  will-change: transform, left, top;
}
.cursor.lg {
  width: 56px;
  height: 56px;
  background: rgba(237,237,237,0.08);
  border: 1px solid rgba(237,237,237,0.3);
  mix-blend-mode: normal;
}
.cursor.hidden { opacity: 0; }
@media (hover: none) { .cursor, .cursor-glow { display: none; } }

.cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle at center,
    rgba(255,235,210,0.07) 0%,
    rgba(255,235,210,0.03) 30%,
    transparent 65%);
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, -50%);
  filter: blur(40px);
  will-change: transform, left, top;
}

/* ----------- Background design (dot grid + drifting glows) ----------- */
.aurora {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

/* Dot grid — fades softly at edges */
.aurora::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.16) 1px, transparent 1.6px);
  background-size: 38px 38px;
  background-position: 0 0;
  mask-image: radial-gradient(ellipse 85% 75% at 50% 45%, black 10%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 85% 75% at 50% 45%, black 10%, transparent 100%);
}

/* Soft center wash so the grid feels lit */
.aurora::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 40%,
    rgba(255,255,255,0.04) 0%,
    transparent 60%);
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(85px);
  will-change: transform;
}
.blob-1 {
  width: 65vw; height: 65vw;
  max-width: 880px; max-height: 880px;
  background: radial-gradient(circle, rgba(255,255,255,0.09), transparent 62%);
  top: -20vh; left: -15vw;
  animation: drift1 36s ease-in-out infinite;
}
.blob-2 {
  width: 70vw; height: 70vw;
  max-width: 900px; max-height: 900px;
  background: radial-gradient(circle, rgba(255,255,255,0.07), transparent 62%);
  top: 25vh; right: -25vw;
  animation: drift2 44s ease-in-out infinite;
}
.blob-3 {
  width: 55vw; height: 55vw;
  max-width: 750px; max-height: 750px;
  background: radial-gradient(circle, rgba(255,255,255,0.06), transparent 62%);
  bottom: -15vh; left: 15vw;
  animation: drift3 50s ease-in-out infinite;
}
.blob-4 {
  width: 50vw; height: 50vw;
  max-width: 700px; max-height: 700px;
  background: radial-gradient(circle, rgba(255,255,255,0.05), transparent 62%);
  bottom: 15vh; right: 25vw;
  animation: drift4 40s ease-in-out infinite;
}

@keyframes drift1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25%      { transform: translate(20vw, 18vh) scale(1.08); }
  50%      { transform: translate(35vw, 50vh) scale(0.95); }
  75%      { transform: translate(10vw, 35vh) scale(1.1); }
}
@keyframes drift2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25%      { transform: translate(-15vw, 12vh) scale(0.95); }
  50%      { transform: translate(-30vw, -10vh) scale(1.12); }
  75%      { transform: translate(-12vw, -25vh) scale(1); }
}
@keyframes drift3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25%      { transform: translate(25vw, -20vh) scale(1.1); }
  50%      { transform: translate(45vw, -38vh) scale(0.92); }
  75%      { transform: translate(20vw, -18vh) scale(1.05); }
}
@keyframes drift4 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25%      { transform: translate(-30vw, -15vh) scale(0.95); }
  50%      { transform: translate(-15vw, -42vh) scale(1.1); }
  75%      { transform: translate(-40vw, -25vh) scale(1.02); }
}

/* ----------- Status bar ----------- */
.status {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 22px 40px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-dim);
  z-index: 50;
  font-feature-settings: "ss01";
}
.status-l, .status-r {
  display: flex;
  gap: 14px;
  align-items: center;
}
.dot {
  width: 6px; height: 6px;
  background: #4ade80;
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(74, 222, 128, 0.6);
  animation: dotPulse 2s ease-in-out infinite;
}
@keyframes dotPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 12px rgba(74,222,128,0.6); }
  50% { opacity: 0.45; box-shadow: 0 0 4px rgba(74,222,128,0.3); }
}
.ticker {
  font-variant-numeric: tabular-nums;
  transition: opacity .4s var(--t);
  display: inline-block;
  min-width: 240px;
  text-align: right;
}
.status-time {
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.socials {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  margin: 0 4px;
  border-left: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
}
.socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-dim);
  transition: color .25s var(--t), transform .35s var(--t);
}
.socials a:hover {
  color: var(--ink);
  transform: translateY(-1.5px);
}
.socials svg { display: block; }
@media (max-width: 640px) {
  .socials { gap: 12px; padding: 0 10px; }
}

/* ----------- Section heads ----------- */
.lobby, .now {
  padding: 160px 40px 120px;
  max-width: 1440px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.lobby { padding-top: 110px; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.section-head {
  margin-bottom: 96px;
  max-width: 720px;
}
.section-head--top { margin-bottom: 64px; max-width: none; }

.lobby-eyebrow {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 28px;
  opacity: 0;
  animation: fadeUp .9s var(--t) 0.1s forwards;
}
.lobby-eyebrow .line {
  width: 40px;
  height: 1px;
  background: var(--muted);
  display: inline-block;
}

.section-head--top .section-title {
  opacity: 0;
  animation: fadeUp 1s var(--t) 0.25s forwards;
}
.section-head--top .section-blurb {
  opacity: 0;
  animation: fadeUp 1s var(--t) 0.5s forwards;
  max-width: none;
}
.section-head--top .section-blurb em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--ink);
}
.section-num {
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 32px;
}
.section-title {
  font-family: var(--serif);
  font-size: clamp(48px, 8vw, 96px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.025em;
  margin-bottom: 24px;
}
.serif-period {
  color: #9d2c3d;
}
.section-blurb {
  color: var(--ink-dim);
  font-size: 16px;
  max-width: 460px;
  font-weight: 300;
}

/* ----------- Rooms ----------- */
.rooms-wrap {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 80px;
  align-items: start;
}
.rooms-list {
  border-top: 1px solid var(--rule);
}

.room {
  display: grid;
  grid-template-columns: 56px 1fr auto 36px;
  gap: 28px;
  align-items: center;
  padding: 32px 0;
  border-bottom: 1px solid var(--rule);
  position: relative;
  transition: padding .55s var(--t), color .3s, opacity .3s;
  --room-accent: #ededed;
}
.room::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    rgba(255,255,255,0.025) 0%,
    transparent 50%);
  opacity: 0;
  transition: opacity .55s var(--t);
  pointer-events: none;
}
.room::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 0;
  height: 1px;
  background: var(--room-accent);
  transition: width .65s var(--t);
}
.room:hover::before { opacity: 1; }
.room:hover::after { width: 100%; }
.room:hover {
  padding-left: 24px;
  padding-right: 8px;
}
.room:hover .room-arrow { transform: translateX(10px); color: var(--room-accent); }
.room:hover .room-name { color: var(--room-accent); }

.room[data-status="soon"] {
  opacity: 0.55;
}
.room[data-status="soon"]:hover { opacity: 0.85; }

.room-num {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 400;
}
.room-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.room-name {
  font-family: var(--serif);
  font-size: clamp(32px, 4.4vw, 52px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
  transition: color .4s var(--t);
}
.room-desc {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.005em;
  font-weight: 300;
}
.room-meta {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 5px 10px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-weight: 400;
}
.room-meta.meta-live {
  color: #4ade80;
  border-color: rgba(74,222,128,0.3);
}
.room-arrow {
  font-size: 22px;
  color: var(--muted);
  transition: transform .55s var(--t), color .4s;
  font-family: var(--sans);
  font-weight: 300;
}

/* ----------- Preview pane ----------- */
.preview {
  position: sticky;
  top: 100px;
  height: 600px;
}
.preview-card {
  position: relative;
  height: 100%;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0));
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
  transition: border-color .5s var(--t), background .5s var(--t);
}
.preview-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 20%,
    var(--room-accent-fade, rgba(255,255,255,0.04)),
    transparent 60%);
  opacity: 0.7;
  transition: opacity .6s var(--t);
  pointer-events: none;
}
.preview.has-room .preview-card {
  border-color: var(--room-accent-line, var(--rule));
}
.preview-eyebrow {
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--room-accent, var(--muted));
  position: relative;
  z-index: 1;
  transition: color .4s var(--t);
}
.preview-title {
  font-family: var(--serif);
  font-size: 56px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
  position: relative;
  z-index: 1;
}
.preview-stat {
  font-size: 13px;
  color: var(--ink-dim);
  position: relative;
  z-index: 1;
  font-weight: 300;
  max-width: 280px;
}
.preview-art {
  flex: 1;
  margin-top: 12px;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  overflow: hidden;
  min-height: 0;
}
.preview-art > * {
  width: 100%;
  height: 100%;
}
.preview-art svg {
  display: block;
}

/* Genre chart (HTML, fills available vertical space) */
.genre-chart {
  display: grid;
  grid-auto-rows: 1fr;
  gap: 6px;
  align-content: stretch;
}
.genre-row {
  display: grid;
  grid-template-columns: 110px 1fr 32px;
  gap: 10px;
  align-items: center;
  min-height: 0;
}
.genre-name {
  font-size: 11px;
  color: rgba(237,237,237,0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 400;
  letter-spacing: 0.005em;
}
.genre-track {
  background: rgba(255,255,255,0.06);
  height: 4px;
  border-radius: 1px;
  overflow: hidden;
  position: relative;
}
.genre-fill {
  height: 100%;
  background: var(--room-accent, #fa243c);
  width: 0;
  border-radius: 1px;
  animation: fillBar 0.95s var(--t) var(--d, 0s) forwards;
}
@keyframes fillBar {
  to { width: var(--w); }
}
.genre-val {
  font-size: 10.5px;
  color: rgba(255,255,255,0.5);
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-weight: 400;
}
.preview-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  position: relative;
  z-index: 1;
}
.preview-arrow {
  color: var(--room-accent, var(--muted));
  transition: color .4s var(--t), transform .4s var(--t);
  font-size: 14px;
}
.preview.has-room .preview-arrow { transform: translate(2px, -2px); }

/* fade transition during room change */
.preview .fadable {
  transition: opacity .25s var(--t-fast), transform .35s var(--t-fast);
}
.preview.changing .fadable {
  opacity: 0;
  transform: translateY(4px);
}

/* ----------- Now ----------- */
.now-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--rule);
}
.now-cell {
  padding: 36px 0;
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 24px;
  align-items: baseline;
  transition: background .4s var(--t);
}
.now-cell:nth-child(odd) { padding-right: 40px; }
.now-cell:nth-child(even) {
  padding-left: 40px;
  border-left: 1px solid var(--rule);
}
.now-cell:hover { background: rgba(255,255,255,0.012); }
.now-label {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
}
.now-value {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.now-value em {
  font-family: var(--sans);
  font-style: normal;
  font-weight: 300;
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 0;
  display: block;
  margin-top: 4px;
}

/* ----------- Footer ----------- */
.foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 32px 40px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  border-top: 1px solid var(--rule);
  position: relative;
  z-index: 1;
}

/* ----------- Scroll reveal ----------- */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1s var(--t), transform 1s var(--t);
}
.reveal-on-scroll.in {
  opacity: 1;
  transform: none;
}

/* Stagger for room rows */
.rooms-list.in .room {
  animation: roomIn .9s var(--t) both;
}
.rooms-list.in .room:nth-child(1) { animation-delay: 0.05s; }
.rooms-list.in .room:nth-child(2) { animation-delay: 0.12s; }
.rooms-list.in .room:nth-child(3) { animation-delay: 0.19s; }
.rooms-list.in .room:nth-child(4) { animation-delay: 0.26s; }
.rooms-list.in .room:nth-child(5) { animation-delay: 0.33s; }
@keyframes roomIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: none; }
}
.rooms-list .room { opacity: 0; }
.rooms-list.in .room { opacity: 1; }
.rooms-list .room[data-status="soon"] { opacity: 0; }
.rooms-list.in .room[data-status="soon"] { opacity: 0.55; }

/* ----------- Responsive ----------- */
@media (max-width: 980px) {
  .rooms-wrap { grid-template-columns: 1fr; gap: 40px; }
  .preview { position: relative; top: 0; height: 460px; order: -1; }
  .room-name { font-size: 32px; }
  .now-grid { grid-template-columns: 1fr; }
  .now-cell:nth-child(even) {
    padding-left: 0;
    border-left: none;
  }
  .now-cell:nth-child(odd) { padding-right: 0; }
}
@media (max-width: 640px) {
  .status { padding: 18px 20px; }
  .hero, .lobby, .now { padding-left: 20px; padding-right: 20px; }
  .foot { padding: 24px 20px; }
  .ticker { display: none; }
  .room { grid-template-columns: 40px 1fr 32px; gap: 16px; padding: 24px 0; }
  .room .room-meta { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html, body { cursor: auto; }
  .cursor, .cursor-glow, .grain { display: none; }
}

/* ----------- Auth gate ----------- */
body.locked { overflow: hidden; cursor: auto; }
body.locked .hero,
body.locked .lobby,
body.locked .now,
body.locked .foot,
body.locked .status { visibility: hidden; }
body.locked .cursor { display: none; }

#auth-gate {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 11, 0.55);
  backdrop-filter: blur(40px) saturate(140%);
  -webkit-backdrop-filter: blur(40px) saturate(140%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity .45s var(--t);
  animation: gateIn .6s var(--t);
}
#auth-gate.hidden {
  opacity: 0;
  pointer-events: none;
}
@keyframes gateIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.auth-card {
  width: min(380px, 92vw);
  display: grid;
  gap: 16px;
  padding: 40px 36px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  box-shadow:
    0 20px 60px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.05);
  animation: cardIn .9s var(--t);
}

/* Loader (shown during cached-password check, hides the form to avoid flash) */
.auth-loader {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.loader-spinner {
  width: 26px;
  height: 26px;
  border: 1.5px solid rgba(255,255,255,0.08);
  border-top-color: rgba(255,255,255,0.55);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

html.checking #auth-form { display: none; }
html.checking .auth-loader { display: flex; }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.auth-eyebrow {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--muted);
  text-align: center;
  font-weight: 400;
}

.auth-title {
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 400;
  margin: 0 0 12px;
  text-align: center;
  letter-spacing: -0.02em;
  line-height: 1;
}

#auth-input {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 300;
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  background: rgba(255,255,255,0.02);
  color: var(--ink);
  outline: none;
  cursor: text;
  transition: border-color .25s var(--t), background .25s var(--t);
  letter-spacing: 0.05em;
}
#auth-input:focus {
  border-color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.04);
}

.auth-submit {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 14px;
  border: none;
  border-radius: 6px;
  background: var(--ink);
  color: var(--bg);
  cursor: pointer;
  transition: background .2s, transform .2s var(--t);
}
.auth-submit:hover {
  background: #fff;
  transform: translateY(-1px);
}

.auth-error {
  font-size: 13px;
  font-style: italic;
  font-family: var(--serif);
  color: #9d2c3d;
  text-align: center;
  min-height: 18px;
}

@keyframes auth-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.auth-card.shake { animation: auth-shake .38s ease-out; }
