/* The opening logo is unchanged; separate layers keep its entrance, gentle
   float and scroll-driven exit from competing for the same properties. */
.opening-screen {
  overflow-anchor: none;
  background: #000;
}

.intro-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(510px, 75vw);
  transform: translate(-50%, calc(-50% + var(--opening-lift, 0px)));
  opacity: var(--opening-opacity, 1);
}

.opening-screen .intro-logo img {
  width: 100%;
  height: auto;
  max-height: max(40px, calc(100dvh - 150px));
  object-fit: contain;
  filter: none;
  animation: intro-fade-in 1.1s ease-out both, intro-logo-float 4s ease-in-out infinite;
}

.intro-scroll-cue {
  position: absolute;
  right: 0;
  bottom: max(24px, calc(env(safe-area-inset-bottom, 0px) + 16px));
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: max-content;
  max-width: 100%;
  margin: 0 auto;
  color: #fff;
  font: 700 10px/1.4 var(--sans, Arial, sans-serif);
  letter-spacing: 0.16em;
  text-align: center;
  opacity: var(--opening-opacity, 1);
  animation: intro-cue-bob 2.6s ease-in-out infinite;
}

.intro-scroll-cue > span {
  animation: intro-fade-in 1.1s .15s ease-out both;
}

.intro-scroll-arrow {
  font: 400 24px/1 var(--sans, Arial, sans-serif);
  letter-spacing: 0;
}

@keyframes intro-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes intro-logo-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes intro-cue-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

.opening-screen.intro-dismissed {
  display: none;
}

/* The sticky bar overlaps, rather than precedes, the hero. This puts the
   photograph directly against the opening without leaving an 80px blank band. */
.site-header {
  margin-bottom: calc(-1 * var(--header));
  transition: opacity .65s ease, box-shadow .3s ease;
}

.hero-shade, .hero-content, .hero-scroll {
  transition: opacity .65s ease;
}

.floating-call {
  transition: opacity .65s ease, background-color .2s ease, color .2s ease,
    border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

/* Retain a black canvas until the opening is fully removed, including the
   brief period after the header starts fading in. */
.opening-in-progress,
.opening-in-progress body { background: #000; }

/* Applied only after the JavaScript scroll handlers are ready. Visibility
   keeps hidden controls out of the tab order until the picture is in view. */
.opening-staging :is(.site-header, .hero-shade, .hero-content, .hero-scroll, .floating-call) {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
.opening-staging main > :not(.hero),
.opening-staging .footer {
  visibility: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .opening-screen .intro-logo img,
  .intro-scroll-cue,
  .intro-scroll-cue > span { animation: none; }
}
