/* The festival entrance. The waitlist and ticket pages keep their own scene. */
html:has(.cross-door) {
  height: auto;
  min-height: 100%;
  overflow: auto;
  background: #090406;
}

html[data-festival-view] .cross-door {
  height: auto;
  min-height: 100svh;
  overflow: visible;
  touch-action: auto;
  background:
    radial-gradient(ellipse at 50% 19%, #431019 0%, #210b10 28%, transparent 64%),
    #090406;
  color: #fff3e4;
}

.cross-layout {
  position: relative;
  z-index: 7;
  display: grid;
  grid-template-rows: minmax(16rem, 51svh) auto;
  justify-items: center;
  min-height: 100svh;
  padding: 0 1rem max(2rem, env(safe-area-inset-bottom));
  isolation: isolate;
}

.cross-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  pointer-events: none;
}

/* A long vertical post and high crossbar occupy most of the room. */
.led-cross {
  --beam-width: 6.8%;
  --arm-height: 4.65%;
  --arm-center: 30%;
  --light: #fff7e9;
  --hot: #ff784d;
  --red: #f62636;
  position: relative;
  width: min(79vw, 31svh, 22rem);
  aspect-ratio: 0.65;
  margin-top: .75rem;
  filter: drop-shadow(0 0 2rem #ff273c8c);
}

.led-cross-upright,
.led-cross-arms {
  position: absolute;
  display: block;
  border-radius: 2px;
  background-color: var(--light);
  box-shadow:
    inset 0 0 0 1px #fff,
    0 0 .35rem #fff8ec,
    0 0 .85rem var(--hot),
    0 0 1.8rem var(--red);
}

.led-cross-arms {
  top: var(--arm-center);
  left: 0;
  width: 100%;
  height: var(--arm-height);
  transform: translateY(-50%);
  background-image: repeating-linear-gradient(90deg, transparent 0 5px, #ffb28d 5px 6px);
}

.led-cross-upright {
  inset: 0 auto 0 50%;
  width: var(--beam-width);
  transform: translateX(-50%);
  background-image: repeating-linear-gradient(0deg, transparent 0 5px, #ffb28d 5px 6px);
}

/* A soft pool grades the light into the black floor below the post. */
.cross-stage::after {
  content: '';
  position: absolute;
  z-index: -1;
  inset: auto 14% -6% 14%;
  height: 34%;
  background: radial-gradient(ellipse at 50% 36%, #9d212d6b, transparent 64%);
  transform: scaleY(.55);
}

[data-festival-view="door"] .cross-door #gate {
  position: relative;
  inset: auto;
  transform: none;
  width: min(54rem, 100%);
  max-height: none;
  padding: 0 0 1rem;
  gap: .75rem;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

[data-festival-view="door"] .cross-door .gate h1 {
  color: #fff3e4;
  font-size: clamp(2.5rem, 7vw, 4.75rem);
  letter-spacing: -.055em;
  line-height: .95;
  text-shadow: 0 0 1.5rem #ff512f4d;
}

.cross-door .festival-date {
  color: #f6bfaa;
  letter-spacing: .08em;
}

.cross-door .gate-kicker,
.cross-door .gate-welcome {
  color: #ffb7a5;
}

[data-festival-view="door"] .cross-door .gate-note {
  color: #e4bfb6;
}

[data-festival-view="door"] .cross-door .gate-btn,
[data-festival-view="door"] .cross-door .gate-btn:hover {
  color: #210b10;
  background: #fff3e4;
  border: 1px solid #fff8ef;
  box-shadow: 0 0 1.4rem #ff613d5c;
  text-decoration: none;
  letter-spacing: .16em;
}

[data-festival-view="door"] .cross-door .gate-btn:hover {
  background: #ffd2bc;
}

[data-festival-view="door"] .cross-door .gate-btn::before {
  background: radial-gradient(closest-side, #ff50263a, transparent 72%);
}

.cross-door .gate-more a {
  color: #ffb7a5;
  border-color: #d66d60;
}

[data-festival-view="door"] .cross-door .gate-more a:hover {
  color: #fff3e4;
}

.cross-door.entering .gate {
  animation: cross-enter-copy .32s ease both;
}

.cross-door.entering .led-cross {
  animation: cross-enter-light .55s ease both;
}

.cross-door.entering .flash {
  background: radial-gradient(ellipse at 50% 30%, #fff7e9, #ffb89a 55%, #be2431);
  animation: cross-enter-flash .55s ease-in both;
}

@keyframes cross-enter-copy {
  to { opacity: 0; }
}

@keyframes cross-enter-light {
  to { transform: scale(1.2); opacity: .65; }
}

@keyframes cross-enter-flash {
  from { opacity: 0; }
  to { opacity: .85; }
}

@media (max-width: 38rem) {
  .cross-layout {
    grid-template-rows: minmax(14rem, 49svh) auto;
  }

  .led-cross {
    width: clamp(8rem, 30svh, 14rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cross-door.entering :is(.gate, .led-cross, .flash) {
    animation: none;
  }
}

/* ── the LED cross, drawn live ─────────────────────────────────────────
   led-cross.js paints the real cross — nested LED loops, its colour show,
   candles, incense — into a canvas over the whole stage. The CSS cross
   above stays as the fallback when scripts don't run. */
.has-led-cross .cross-layout {
  grid-template-rows: minmax(22rem, 80svh) auto;
}
.has-led-cross .cross-stage {
  min-height: 20rem;
}
.has-led-cross .led-cross,
.has-led-cross .cross-stage::after {
  display: none;
}
.cross-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.cross-door.entering .cross-canvas {
  animation: cross-enter-light .55s ease both;
}

/* carved capitals, like the lettering over a church door */
[data-festival-view="door"] .cross-door .gate h1,
.cross-door .festival-date,
.cross-door .gate-kicker,
[data-festival-view="door"] .cross-door .gate-btn,
.cross-door .gate-more a {
  font-family: "Cinzel", Georgia, "Times New Roman", serif;
}
[data-festival-view="door"] .cross-door .gate h1 {
  letter-spacing: .04em;
  font-weight: 600;
}
[data-festival-view="door"] .cross-door .gate-btn {
  font-weight: 700;
}

@media (max-width: 38rem) {
  .has-led-cross .cross-layout {
    grid-template-rows: minmax(20rem, 72svh) auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cross-door.entering .cross-canvas { animation: none; }
}

/* ── for now the page is the cross and its name ───────────────────────
   Everything else on the door — the date, the button, the notes, the
   waiting list — stays in the markup, hidden. */
.cross-door .festival-date,
.cross-door .gate-kicker,
.cross-door .gate-btn,
.cross-door .gate-welcome,
.cross-door .gate-note,
.cross-door .gate-more {
  display: none !important;
}

/* ── the way in ────────────────────────────────────────────────────────
   While the cross is built, its canvas takes the whole screen and the
   page holds still under it; the title comes up as the camera pulls back,
   and the canvas drops back into its stage at the last frame. */
html.hf-intro,
html.hf-intro body {
  overflow: hidden;
}
html.hf-intro .cross-canvas {
  pointer-events: auto;              /* the stage turns them off; the tap to start needs them */
  cursor: pointer;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
}
.cross-door #gate {
  transition: opacity 1.4s ease, transform 1.6s cubic-bezier(.2,.7,.2,1);
}
html.hf-intro:not(.hf-title) .cross-door #gate {
  opacity: 0;
  transform: translateY(18px);
  transition: none;
}
.hf-intro-skip {
  position: fixed;
  z-index: 1001;
  right: max(1.1rem, env(safe-area-inset-right));
  bottom: max(1.1rem, env(safe-area-inset-bottom));
  font: 500 .7rem/1 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #8dffae;
  background: rgba(0, 10, 4, .6);
  border: 1px solid rgba(80, 255, 130, .35);
  border-radius: 999px;
  padding: .75em 1.2em .7em 1.4em;
  cursor: pointer;
  transition: opacity .5s;
}
.hf-intro-skip:hover,
.hf-intro-skip:focus-visible {
  color: #d8ffe4;
  border-color: #6dff9a;
  outline: none;
}
html:not(.hf-intro) .hf-intro-skip {
  opacity: 0;
  pointer-events: none;
}

/* the language pill sits out the way in */
html.hf-intro .wmm-lang {
  visibility: hidden;
}

/* the music switch: bottom left, out of the language pill's way */
.hf-sound {
  position: fixed;
  z-index: 60;
  left: max(1rem, env(safe-area-inset-left));
  bottom: max(1rem, env(safe-area-inset-bottom));
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  font: 600 1.05rem/1 Georgia, serif;
  color: #fff3e4;
  background: rgba(30, 8, 12, .6);
  border: 1px solid rgba(255, 120, 100, .5);
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: opacity .3s, border-color .3s;
}
.hf-sound.off {
  opacity: .55;
  background: linear-gradient(135deg, transparent 47%, rgba(255,150,130,.8) 48% 52%, transparent 53%), rgba(30, 8, 12, .6);
}
.hf-sound:hover,
.hf-sound:focus-visible {
  opacity: 1;
  border-color: #ff8a73;
  outline: none;
}
html.hf-intro .hf-sound {
  visibility: hidden;
}

/* the water under the cross: its own canvas, under the cross's, faded
   in once the way in has landed */
.cross-water {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  transition: opacity 1.8s ease .2s;
}
html.hf-intro .cross-water {
  opacity: 0;
  transition: none;
}
