.hero {
  --door-light:0;
  --copy-light:0;
  --lantern-light:0;
  --title-wave-front:160%;
  --title-wave-spread:44%;
}
.hero.has-door-video::before { content:none; }
.hero.has-door-video::after {
  background:linear-gradient(0deg,var(--bg) 0%,transparent 24%);
  pointer-events:none;
}
.hero-lighting { position:absolute; inset:0; overflow:hidden; z-index:-1; pointer-events:none; }
.hero-lighting-plane { position:absolute; width:100%; height:100%; }
.hero-lighting-plane > div { position:absolute; inset:0; }
/* Image-space masks stay aligned with the lamp, doorway and distant window. */
.hero-scene-shade {
  background:linear-gradient(90deg,
    rgb(0 0 0 / calc(.97 - .46 * var(--door-light))) 0%,
    rgb(0 0 0 / calc(.95 - .53 * var(--door-light))) 33%,
    rgb(0 0 0 / calc(.91 - .63 * var(--door-light))) 56%,
    rgb(0 0 0 / calc(.84 - .77 * var(--door-light))) 69%,
    rgb(0 0 0 / .62) 83%,rgb(0 0 0 / .88) 95%,rgb(0 0 0 / .85) 100%);
}
.hero-lantern-shade {
  opacity:calc(1 - var(--lantern-light));
  background:
    radial-gradient(ellipse 2.6% 10% at 61.05% 12.8%,rgb(0 0 0 / .88) 0%,rgb(0 0 0 / .88) 54%,rgb(0 0 0 / .72) 74%,transparent 100%),
    radial-gradient(ellipse 10% 23% at 59.5% 13%,rgb(0 0 0 / .78) 0%,rgb(0 0 0 / .65) 30%,rgb(0 0 0 / .34) 58%,transparent 100%);
}
.hero-door-spill {
  opacity:var(--door-light);
  background:radial-gradient(ellipse 43% 64% at 65.5% 87%,rgb(229 164 99 / .085),rgb(229 164 99 / .025) 50%,transparent 100%);
  mix-blend-mode:screen;
  transform-origin:65.5% 87%;
  transform:scaleX(calc(.18 + .82 * var(--door-light)));
}
.hero.has-door-video .hero-copy { mask-image:none; }
.hero.has-door-video .hero-copy h1 {
  opacity:1;
  /* Gaussian-like falloff: blur the light boundary, never the letterforms. */
  --title-wave-mask:linear-gradient(90deg,
    rgb(0 0 0 / .018) calc(var(--title-wave-front) - var(--title-wave-spread)),
    rgb(0 0 0 / .022) calc(var(--title-wave-front) - var(--title-wave-spread) * .85),
    rgb(0 0 0 / .038) calc(var(--title-wave-front) - var(--title-wave-spread) * .70),
    rgb(0 0 0 / .078) calc(var(--title-wave-front) - var(--title-wave-spread) * .55),
    rgb(0 0 0 / .160) calc(var(--title-wave-front) - var(--title-wave-spread) * .40),
    rgb(0 0 0 / .288) calc(var(--title-wave-front) - var(--title-wave-spread) * .25),
    rgb(0 0 0 / .509) var(--title-wave-front),
    rgb(0 0 0 / .730) calc(var(--title-wave-front) + var(--title-wave-spread) * .25),
    rgb(0 0 0 / .858) calc(var(--title-wave-front) + var(--title-wave-spread) * .40),
    rgb(0 0 0 / .940) calc(var(--title-wave-front) + var(--title-wave-spread) * .55),
    rgb(0 0 0 / .980) calc(var(--title-wave-front) + var(--title-wave-spread) * .70),
    rgb(0 0 0 / .996) calc(var(--title-wave-front) + var(--title-wave-spread) * .85),
    #000 calc(var(--title-wave-front) + var(--title-wave-spread)));
  -webkit-mask-image:var(--title-wave-mask);
  mask-image:var(--title-wave-mask);
}
.hero.has-door-video .hero-copy h1 span {
  text-shadow:1px 0 0 rgb(255 194 126 / calc(.38 * var(--lantern-light))),3px 0 7px rgb(246 166 85 / calc(.19 * var(--lantern-light)));
}
.hero.has-door-video .hero-copy > :not(h1),
.hero.has-door-video .header {
  opacity:var(--copy-light);
  mask-image:linear-gradient(270deg,#000,rgb(0 0 0 / calc(.25 + .75 * var(--copy-light))));
}
.hero.has-door-video .hero-copy > :focus-within,
.hero.has-door-video .header:focus-within { opacity:1; mask-image:none; }
@media (max-width:700px) {
  .hero.has-door-video :is(.hero-picture img,.hero-animation) { object-position:63% center; }
}
