:root {
  --bg: #07111f;
  --panel: rgba(255, 255, 255, 0.12);
  --border: rgba(255, 255, 255, 0.2);
  --text: #f4f7ff;
  --muted: #c7d3f2;
  --accent: #ffcf6b;
  --accent-2: #ff8a3d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(126, 220, 255, 0.2), transparent 28%),
    radial-gradient(circle at bottom right, rgba(157, 124, 255, 0.22), transparent 30%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.app {
  width: min(1200px, 100%);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-radius: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}

.intro {
  position: fixed;
  inset: 0;
  overflow: hidden;
  min-height: 100vh;
  width: 100vw;
  display: grid;
  place-items: center;
  text-align: center;
  z-index: 100;
}

.intro-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: url("../images/bg2.png") center / cover no-repeat;
  filter: blur(0px);
  scale: 1;
  animation: bg-blur-in 1.2s ease-in 1.3s forwards;
}

@keyframes bg-blur-in {
  to {
    filter: blur(4px);
    scale: 1.1;
  }
}

.intro-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(
    circle at center,
    rgba(7, 5, 2, 0.05) 0%,
    rgba(7, 5, 2, 0.2) 65%,
    rgba(7, 5, 2, 0.6) 100%
  );
}

.intro-blackout {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease;
}

.intro-blackout.active {
  opacity: 1;
}

.intro-sign {
  position: absolute;
  top: -75%;
  left: 50%;
  translate: -50% 0;
  transform-origin: top center;
  rotate: 0deg;
  width: min(1000px, 82vw);
  z-index: 2;
  animation: sign-swing-in 1.6s cubic-bezier(0.22, 0.61, 0.36, 1) 1.5s both;
}

.intro-sign.sign-exit {
  animation: sign-exit 1.1s ease both;
}

@keyframes sign-swing-in {
  0% {
    top: -152%;
    opacity: 0;
  }
  8% {
    opacity: 1;
  }
  100% {
    top: -75%;
    opacity: 1;
  }
}

@keyframes sign-exit {
  0% {
    top: -75%;
    animation-timing-function: ease-out;
  }
  20% {
    top: -68%;
    animation-timing-function: ease-in;
  }
  100% {
    top: -260%;
  }
}

.sign-main {
  position: relative;
  z-index: 2;
  pointer-events: none;
}

.sign-main-img {
  display: block;
  width: 100%;
  height: auto;
}

.sign-main-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3em;
  padding: 70% 16% 6%;
}

.sign-button-plate {
  position: relative;
  width: min(340px, 34vw);
  aspect-ratio: 780 / 572;
  margin: -21% auto 0;
  z-index: 1;
  transition: transform 0.25s ease, filter 0.25s ease;
}

.sign-button-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain; 
}

.sign-button-text {
  position: absolute;
  top: -43%;
  left: 50%;
  translate: -50% -50%;
  width: 70%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  cursor: pointer;
}

.sign-eyebrow,
.sign-title,
.sign-dates,
.sign-button-text {
  position: relative;
  margin: 0;
  font-family: "IM Fell DW Pica SC", serif;
  color: transparent;
  background: url("../images/PaintedWood005_2K-JPG_Color.jpg") center / 260% no-repeat;
  background-blend-mode: multiply;
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: -1px -1px 0 rgba(0, 0, 0, 0.35), 1px 1px 0 rgba(255, 214, 160, 0.12);
}

.sign-eyebrow::before,
.sign-title::before,
.sign-dates::before,
.sign-button-text::before {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  color: rgba(58, 36, 18, 0.5);
  filter: blur(3px);
  z-index: -1;
  scale: 1.03;
}

.sign-eyebrow {
  font-size: clamp(0.7rem, 1.8vw, 1.5rem);
  letter-spacing: 0.06em;
  background-position: 20% 10%;
}

.sign-title {
  font-size: clamp(2.2rem, 6.5vw, 6rem);
  letter-spacing: 0.05em;
  background-position: 55% 70%;
}

.sign-dates {
  font-size: clamp(0.75rem, 2vw, 1.5rem);
  letter-spacing: 0.04em;
  background-position: 80% 30%;
}

.sign-button-text {
  font-size: clamp(1.1rem, 2.6vw, 1.5rem);
  letter-spacing: 0.05em;
  background-position: 40% 50%;
  transition: filter 0.25s ease, scale 0.25s ease, text-shadow 0.25s ease;
}

.sign-button-plate:hover,
.sign-button-plate:has(.sign-button-text:focus-visible) {
  transform: translateY(-4px) scale(1.035);
  filter: drop-shadow(0 7px 10px rgba(255, 190, 92, 0.28));
}

.sign-button-text:hover,
.sign-button-text:focus-visible {
  filter: brightness(1.3);
  scale: 1.06;
  text-shadow: 0 0 8px rgba(255, 224, 156, 0.65);
}

@supports not (background-clip: text) {
  .sign-eyebrow,
  .sign-title,
  .sign-dates,
  .sign-button-text {
    background: none;
    color: #3a2412;
  }

  .sign-eyebrow::before,
  .sign-title::before,
  .sign-dates::before,
  .sign-button-text::before {
    content: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .intro-bg {
    animation: none;
    filter: blur(8px);
    scale: 1.04;
  }

  .intro-sign {
    animation: none;
    top: -75%;
    rotate: 0deg;
    opacity: 1;
  }

  .stage-frame-beam {
    animation: none;
  }
}

.experience {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  padding: 0;
  display: none;
  z-index: 50;
}

.experience.active {
  display: block;
}

.video-shell {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}

.stage-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.buffer-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
  border: 4px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  z-index: 20;
  transition: opacity 0.2s ease;
  animation: buffer-spin 0.9s linear infinite;
}

.buffer-spinner.is-visible {
  opacity: 1;
}

@keyframes buffer-spin {
  to {
    transform: rotate(360deg);
  }
}

.still-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  pointer-events: none;
  transition: opacity 500ms ease;
}

.still-canvas.is-visible {
  opacity: 1;
}

.still-canvas {
  object-fit: contain;
}

.scene-overlay {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 500ms ease;
  z-index: 10;
}

.scene-overlay.is-active {
  opacity: 1;
  pointer-events: auto;
}

.scene-object {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
  z-index: 1;
  /* tight white rim hugs the alpha edge to smooth over jagged cutout pixels */
  filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.95)) drop-shadow(0 0 2px rgba(255, 255, 255, 0.85)) drop-shadow(0 0 6px rgba(255, 255, 255, 0.6));
  transition: filter 0.3s ease;
}

.scene-beam {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  mix-blend-mode: screen;
  opacity: 0.55;
  background: linear-gradient(
    to top,
    transparent 0%,
    rgba(255, 138, 61, 0.3) 38%,
    rgba(255, 234, 190, 0.6) 50%,
    rgba(255, 138, 61, 0.3) 62%,
    transparent 100%
  );
  background-size: 100% 260%;
  background-position: 0% 130%;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  filter: drop-shadow(0 0 10px var(--accent)) drop-shadow(0 0 20px var(--accent-2));
  transition: filter 0.3s ease;
  animation: beam-wave 15s linear infinite;
}

.scene-hotspot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: default;
  z-index: 3;
}

.scene-hotspot.is-hovering {
  cursor: pointer;
}

.scene-overlay.is-hovering .scene-object,
.scene-hotspot:focus-visible ~ .scene-object {
  filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.95)) drop-shadow(0 0 2px rgba(255, 255, 255, 0.85)) drop-shadow(0 0 6px rgba(255, 255, 255, 0.6)) drop-shadow(0 0 26px rgba(255, 255, 255, 0.9)) brightness(1.15);
}

.scene-overlay.is-hovering .scene-beam,
.scene-hotspot:focus-visible ~ .scene-beam {
  filter: drop-shadow(0 0 22px rgba(255, 255, 255, 0.98)) drop-shadow(0 0 40px rgba(255, 255, 255, 0.75));
}

@keyframes beam-wave {
  0% {
    background-position: 0% 130%;
  }
  100% {
    background-position: 0% -130%;
  }
}

.modal {
  position: absolute;
  left: 55%;
  top: 50%;
  width: min(440px, 34%);
  padding: 32px 36px;
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 0 40px rgba(255, 255, 255, 0.05);
  overflow: hidden;
  z-index: 20;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-50%) translateX(-16px);
  transition: opacity 0.45s ease, transform 0.45s ease, visibility 0s linear 0.45s;
}

.modal::before {
  /* diagonal glass sheen, purely decorative */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.35) 0%, transparent 40%);
  pointer-events: none;
}

.modal.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
  transition: opacity 0.45s ease, transform 0.45s ease, visibility 0s linear 0s;
}

.modal--right {
  left: 55%;
  right: auto;
}

.modal--left {
  left: auto;
  right: 55%;
  transform: translateY(-50%) translateX(16px);
}

.modal--left.active {
  transform: translateY(-50%) translateX(0);
}

.modal h3 {
  position: relative;
  margin: 0 0 12px;
  font-size: 1.4rem;
  color: #fff;
}

.modal p {
  position: relative;
  margin: 0;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.7;
  font-size: 1.05rem;
}

.modal button {
  position: relative;
  margin-top: 16px;
  border: none;
  background: transparent;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-size: 1rem;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: rgba(255, 255, 255, 0.5);
  transition: text-decoration-color 0.2s ease;
}

.modal button:hover {
  text-decoration-color: #fff;
}

.hidden {
  display: none !important;
}

.rotate-prompt {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background: #07111f;
  color: var(--text);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  font-family: "IM Fell DW Pica SC", serif;
  font-size: 1.3rem;
  text-align: center;
  padding: 2rem;
}

.rotate-prompt p {
  margin: 0;
}

@media (orientation: portrait) and (max-width: 900px) {
  .rotate-prompt {
    display: flex;
  }
}

@media (max-width: 700px) {
  .intro-content {
    padding: 32px 18px;
  }

  .modal {
    left: auto;
    right: 16px;
    top: auto;
    bottom: 16px;
    width: min(320px, calc(100% - 32px));
    transform: translateY(12px);
  }

  .modal.active {
    transform: translateY(0);
  }
}
