:root {
  --color-bg: #0c0c0c;
  --color-cream: #FFF6E5;
  --color-amber: #e8b86d;
  /* Drop a downloaded chalk font into fonts/ (see @font-face below); it takes priority */
  --font-chalk: 'Chalk', 'Caveat', cursive;
  --transition-ms: 1800ms;
  /* doorway position in the exterior photo; the zoom homes in on this point */
  --door-x: 60%;
  --door-y: 60%;
}

@font-face {
  font-family: 'Chalk';
  src: url('fonts/chalk.otf') format('opentype');
  font-display: swap;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: 'Oswald', sans-serif;
  background: #000;
  color: var(--color-cream);
  overflow: hidden;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ===== Scenes ===== */
/* opacity only: a transform here would break position: fixed on the interior background */
.scene {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  overflow-y: auto;
  transition: opacity 600ms ease, visibility 0s linear 600ms;
}
.scene--active {
  opacity: 1;
  visibility: visible;
  transition: opacity 600ms ease, visibility 0s linear 0s;
}
.scene--interior { justify-content: flex-start; }
.scene--interior.is-exiting { pointer-events: none; }

/* CSS cover = guaranteed full-bleed, no sizing math */
.scene-bg {
  position: fixed;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #000;
  filter: contrast(1.05);
  z-index: 0;
}
#interior-bg {
  background-image: linear-gradient(135deg, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.65)), url('pics/bar-interior.png');
}

/* WebGL depth version; replaces the CSS image once textures are loaded */
.interior-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: none;
  filter: contrast(1.05);
}
.scene--interior.gl-ready .interior-canvas { display: block; }
.scene--interior.gl-ready #interior-bg { visibility: hidden; }
.scene--interior.gl-ready { overflow: hidden; }

/* Exterior: oversized slightly so mouse parallax never reveals an edge */
.exterior-bg {
  background-image: url('pics/bar-exterior.png');
  transform-origin: var(--door-x) var(--door-y);
  transform: translate3d(var(--px, 0px), var(--py, 0px), 0) scale(1.08);
  will-change: transform;
}
.scene--exterior.is-entering .exterior-bg {
  transform: translate3d(0, 0, 0) scale(3.6);
  transition: transform var(--transition-ms) cubic-bezier(0.55, 0, 0.8, 0.4);
}
.scene--exterior.is-instant .exterior-bg,
.scene--exterior.is-instant .scene-content,
.scene--exterior.is-instant .scene-fade { transition: none; }

/* WebGL depth version; replaces the CSS image once textures are loaded */
.exterior-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: none;
  filter: contrast(1.05);
}
.scene--exterior.gl-ready .exterior-canvas { display: block; }
.scene--exterior.gl-ready .exterior-bg { visibility: hidden; }

.scene-vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.85) 100%);
  pointer-events: none;
}

/* darkens toward the end of the walk-in, like stepping into a dim room */
.scene-fade {
  position: fixed;
  inset: 0;
  z-index: 3;
  background: #000;
  opacity: 0;
  pointer-events: none;
}
.scene--exterior.is-entering .scene-fade {
  opacity: 0.85;
  transition: opacity var(--transition-ms) ease-in;
}

/* ===== Exterior content ===== */
.scene-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 20px;
  transition: opacity 500ms ease;
}
.scene--exterior.is-entering .scene-content { opacity: 0; }
.wordmark {
  font-size: 4rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-shadow: 2px 2px 12px rgba(0, 0, 0, 0.8);
}
.wordmark span { color: var(--color-amber); }
.tagline { margin-top: 0.5rem; font-size: 1.2rem; opacity: 0.85; }

.enter-btn {
  margin-top: 2.5rem;
  padding: 14px 40px;
  border: 2px solid var(--color-amber);
  background: rgba(0, 0, 0, 0.4);
  color: var(--color-amber);
  font-family: 'Oswald', sans-serif;
  font-size: 1.1rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease;
  animation: glow 2.4s ease-in-out infinite;
}
.enter-btn:hover, .enter-btn:focus, .enter-btn:focus-visible { background: var(--color-amber); color: #141414; }
.enter-btn:disabled { pointer-events: none; }

@keyframes glow {
  0%, 100% { box-shadow: 0 0 6px rgba(232, 184, 109, 0.3); }
  50% { box-shadow: 0 0 22px rgba(232, 184, 109, 0.7); }
}

.mute-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.5);
  color: var(--color-cream);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0.6rem 1.2rem;
  border-radius: 20px;
  cursor: pointer;
  font-family: 'Oswald', sans-serif;
}
.mute-btn:hover, .mute-btn:focus-visible { border-color: var(--color-amber); color: var(--color-amber); }
.mute-btn[aria-pressed="false"] { border-color: var(--color-amber); color: var(--color-amber); }

/* ===== Interior nav ===== */
.bar-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 10;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(4px);
  border-bottom: 1px solid rgba(232, 184, 109, 0.2);
}
.bar-nav__container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.bar-nav__logo { font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--color-cream); }
.bar-nav__logo span { color: var(--color-amber); }
.bar-nav__menu { list-style: none; display: flex; gap: 2rem; }
.bar-nav__link { color: var(--color-cream); text-decoration: none; font-weight: 500; transition: color 0.3s ease; }
.bar-nav__link:hover, .bar-nav__link.active { color: var(--color-amber); }

@media (max-width: 520px) {
  .bar-nav__logo { display: none; }
  .bar-nav__container { justify-content: center; }
  .bar-nav__menu { gap: 1.2rem; }
}

@media (max-width: 699px), (max-aspect-ratio: 85/100) {
  .scene--exterior .exterior-bg { transform: none; }
}

/* ===== Interior stage ===== */
/* Panels are sized in design px and scaled/positioned onto the photo by interior-scene.js. */
.stage { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
.panel {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 400ms ease, visibility 0s linear 400ms;
}
.panel.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 500ms ease 150ms, visibility 0s linear 0s;
}
.panel__title { font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }

/* Chalkboard: text only, the board itself is in the photo */
.panel--gigs {
  padding: 12px 26px;
  font-family: var(--font-chalk);
  font-synthesis: none;
  color: rgba(239, 234, 219, 0.88);
  text-shadow: 0 0 3px rgba(255, 255, 255, 0.2);
}
.panel--gigs .panel__title {
  font-family: var(--font-chalk);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 56px;
  line-height: 1;
  text-align: center;
  padding-bottom: 4px;
  border-bottom: 3px solid rgba(239, 234, 219, 0.4);
  margin-bottom: 4px;
}
.gigs-list { list-style: none; }
.gig-item {
  display: grid;
  gap: 0;
  padding: 6px 0;
  border-bottom: 2px dashed rgba(239, 234, 219, 0.18);
  font-size: 29px;
  line-height: 1;
}
.gig-item__date { color: rgba(243, 217, 139, 0.9); font-weight: 400; }
.gig-item__city { opacity: 0.75; font-size: 24px; }

/* Back bar: dark glass menu board */
.panel--about {
  height: auto !important; /* grow with the text; the pinned height would clip the social icons */
  padding: 24px 34px;
  text-align: center;
  background: rgba(12, 10, 8, 0.70);
  border: 1px solid rgba(232, 184, 109, 0.5);
  border-radius: 6px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9), 0 0 10px rgba(0, 0, 0, 0.7);
}
.panel--about .panel__title { font-size: 38px; color: var(--color-amber); margin-bottom: 12px; }
.about-text { font-size: 22px; font-weight: 300; line-height: 1.45; margin-bottom: 12px; }
.contact-info { font-size: 20px; }
.contact-info a { color: var(--color-amber); text-decoration: none; }
.social-links { display: flex; justify-content: center; gap: 1.8rem; margin-top: 10px; }
.social-link { color: var(--color-cream); opacity: 0.4; }
.social-link svg { display: block; width: 24px; height: 24px; fill: currentColor; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.social-link svg path { fill: none; }
.social-link svg rect { fill: none; }
.social-link__dot { fill: currentColor; stroke: none; }
.social-link svg .social-link__youtube { fill: currentColor; stroke: none; }
.social-link--disabled { cursor: default; }

/* Band corner: no background, so the bar stays visible behind the tracks */
.panel--playlist {
  padding: 22px 26px 14px;
  font-family: var(--font-chalk);
  font-synthesis: none;
  color: rgba(239, 234, 219, 0.88);
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.85), 0 0 12px rgba(0, 0, 0, 0.6);
}
.panel--playlist .panel__title {
  font-family: var(--font-chalk);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 44px;
  line-height: 1.15;
  text-align: center;
  text-wrap: balance;
}
.panel__subtitle {
  font-size: 28px;
  line-height: 1;
  text-align: center;
  color: rgba(243, 217, 139, 0.9);
  margin: 8px 0 10px;
}
.playlist-list { list-style: none; }
.playlist-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(239, 234, 219, 0.22);
  font-size: 30px;
  line-height: 1.1;
  cursor: pointer;
}
.playlist-item__play {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid rgba(243, 217, 139, 0.75);
  background: transparent;
  color: rgba(243, 217, 139, 0.85);
  font-size: 14px;
  cursor: pointer;
  text-shadow: none;
  transition: background 0.2s ease, color 0.2s ease;
}
.playlist-item:hover .playlist-item__play,
.playlist-item.is-playing .playlist-item__play { background: #f3d98b; color: #141414; }
.playlist-item__title { flex: 1; font-weight: 400; }
.playlist-item.is-playing .playlist-item__title { color: rgba(243, 217, 139, 0.9); }
.playlist-item__duration { opacity: 0.65; font-size: 26px; }

/* TV room: the frame and controls sit directly over the television artwork. */
.panel--tv { overflow: visible; }
.tv-frame {
  position: absolute;
  left: 10%;
  top: 14%;
  width: 64%;
  height: 71%;
  overflow: hidden;
  background: #050505;
  border-radius: 7% / 10%;
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.75);
}
.tv-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
/* Seek bar, shown under the current track */
.playlist-item__progress {
  display: none;
  flex-basis: 100%;
  align-items: center;
  gap: 10px;
  padding-left: 50px;
  font-size: 22px;
  line-height: 1;
}
.playlist-item.is-current .playlist-item__progress { display: flex; }
.playlist-item__time { min-width: 2.4em; opacity: 0.85; }
.playlist-item__seek {
  flex: 1;
  min-width: 0;
  height: 18px;
  margin: 0;
  accent-color: #f3d98b;
  background: transparent;
  cursor: pointer;
}

/* Narrow screens: panels dock to the bottom instead of sitting on the photo */
.stage--docked .panel {
  position: fixed;
  left: 12px;
  right: 12px;
  top: auto;
  bottom: 72px;
  max-height: 46vh;
  overflow-y: auto;
  transform: none;
}
.stage--docked .panel--gigs { background: #1b1b1a; border: 6px solid #5a4630; border-radius: 6px; }
.stage--docked ~ .bar-footer { display: none; }

/* No WebGL: stack the panels over the plain photo */
.scene--interior.no-gl .stage {
  position: relative;
  z-index: 2;
  pointer-events: auto;
  width: 100%;
  padding: 90px 16px 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}
.scene--interior.no-gl .panel {
  position: relative;
  width: min(560px, 100%);
  height: auto;
  transform: none;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.scene--interior.no-gl .panel--gigs { background: #1b1b1a; border: 6px solid #5a4630; border-radius: 6px; }
.scene--interior.no-gl .stage-arrow { display: none; }

@media (max-width: 699px), (max-aspect-ratio: 85/100) {
  .stage--docked .panel {
    bottom: 68px;
    max-height: 66vh;
    max-height: min(66vh, calc(100dvh - 128px));
    --u: clamp(14px, min(5.4vw, 2.96vh), 26px);
    padding: calc(var(--u) * 0.8) calc(var(--u) * 1.07);
    background: rgba(12, 10, 8, 0.92);
    border: 1px solid rgba(232, 184, 109, 0.5);
    border-radius: 6px;
  }
  .stage--docked .panel--gigs {
    position: absolute;
    left: 0;
    right: auto;
    top: 0;
    bottom: auto;
    max-height: none;
    padding: 12px 26px;
    background: transparent;
    border: 0;
    border-radius: 0;
  }
  .stage--docked .panel--gigs .panel__title { font-size: 56px; }
  .stage--docked .gig-item { font-size: 29px; padding: 6px 0; }
  .stage--docked .gig-item__city { font-size: 24px; }
  .stage--docked .panel--about {
    --u: clamp(11px, min(5.4vw, 2.5vh), 26px);
    background: rgba(12, 10, 8, 0.70);
    top: calc(18% + 27px); /* just below the arrows (18% center, 38px tall) */
    bottom: auto;
    max-height: calc(82% - 95px);
  }
  .stage--docked .panel--about .panel__title { font-size: calc(var(--u) * 1.6); margin-bottom: calc(var(--u) * 0.4); }
  .stage--docked .about-text { font-size: var(--u); line-height: 1.3; margin-bottom: calc(var(--u) * 0.4); }
  .stage--docked .contact-info { font-size: calc(var(--u) * 0.87); }
  .stage--docked .social-links { gap: calc(var(--u) * 1.07); margin-top: calc(var(--u) * 0.4); }
  .stage--docked .social-link svg { width: calc(var(--u) * 1.2); height: calc(var(--u) * 1.2); }
  .stage--docked .panel--playlist {
    bottom: max(68px, min(33vh, calc(82dvh - var(--u) * 18.2 - 25px)));
    padding: calc(var(--u) * 0.53) calc(var(--u) * 0.8);
    background: transparent;
    border: 0;
    border-radius: 0;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95), 0 0 10px rgba(0, 0, 0, 0.9), 0 0 22px rgba(0, 0, 0, 0.7);
  }
  .stage--docked .panel--playlist .panel__title { font-size: calc(var(--u) * 2.53); }
  .stage--docked .panel__subtitle { font-size: calc(var(--u) * 1.47); margin: calc(var(--u) * 0.27) 0 calc(var(--u) * 0.53); }
  .stage--docked .playlist-item { gap: calc(var(--u) * 0.67); padding: calc(var(--u) * 0.33) 0; font-size: calc(var(--u) * 1.6); }
  .stage--docked .playlist-item__play { width: calc(var(--u) * 2.27); height: calc(var(--u) * 2.27); }
  .stage--docked .playlist-item__duration { font-size: calc(var(--u) * 1.27); opacity: 0.95; }
  .stage--docked .playlist-item__progress { gap: calc(var(--u) * 0.53); padding-left: calc(var(--u) * 2.93); font-size: calc(var(--u) * 1.13); }
  .stage--docked ~ .stage-arrow { top: 20%; }
  .stage--docked .panel--tv {
    position: absolute;
    left: 0;
    right: auto;
    top: 0;
    bottom: auto;
    max-height: none;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    overflow: visible;
  }
}

.stage-arrow {
  position: fixed;
  top: 50%;
  z-index: 10;
  width: 48px;
  height: 48px;
  margin-top: -24px;
  border-radius: 50%;
  border: 1px solid var(--color-amber);
  background: rgba(0, 0, 0, 0.55);
  color: var(--color-amber);
  font-size: 2rem;
  line-height: 1;
  padding-bottom: 4px;
  cursor: pointer;
  transition: opacity 0.3s ease, background 0.3s ease, color 0.3s ease;
}
.stage-arrow--prev { left: 16px; }
.stage-arrow--next { right: 16px; }
.stage-arrow:hover:not(:disabled), .stage-arrow:focus-visible { background: var(--color-amber); color: #141414; }
.stage-arrow:disabled { opacity: 0.2; cursor: default; }
.stage--docked ~ .stage-arrow { top: 30%; }

.exit-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.5);
  color: var(--color-cream);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0.6rem 1.2rem;
  border-radius: 20px;
  cursor: pointer;
  font-family: 'Oswald', sans-serif;
}
.exit-btn:hover { border-color: var(--color-amber); color: var(--color-amber); }

.bar-footer {
  position: fixed;
  bottom: 8px;
  left: 0;
  right: 0;
  z-index: 4;
  text-align: center;
  opacity: 0.6;
  font-size: 1rem;
  pointer-events: none;
}

@media (max-width: 768px) {
  .stage--docked ~ .stage-arrow { top: 18%; width: 38px; height: 38px; margin-top: -19px; }
  .wordmark { font-size: 2.6rem; }
  .tagline { font-size: 1rem; }
}
@media (max-width: 480px) {
  .wordmark { font-size: 2rem; }
  .enter-btn { padding: 12px 28px; font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .scene--exterior.is-entering .exterior-bg { transform: scale(1.08); }
  .enter-btn { animation: none; }
}
