/*
 * The woods intro (js/intro.js): the walk through the night woods that part onto the photo at the top of the website
 * (index.html, which holds its photo back while it plays: css/style.css), or of the save-the-date. Uses the page's
 * --cream, --sans and --gold-soft.
 */
.intro { display: none; }
.intro-on:where(:not(.intro-envelope):not(.intro-flight)) .intro { /* (unless the envelope plays instead: js/intros.js; :where, so .is-ready below still wins) */
  display: block; position: fixed; inset: 0; z-index: 80; overflow: hidden;
  /* while the 3D woods load: the deep forest fog they start in (js/intro-scene.js), so the trees simply emerge */
  background:
    radial-gradient(ellipse 40% 30% at 50% 58%, rgba(90, 125, 135, .14), rgba(90, 125, 135, 0)),
    linear-gradient(180deg, #03070a 0%, #182a2e 55%, #0a1411 63%, #030605 100%);
  color: var(--cream); touch-action: none;
  transition: opacity .8s ease;
}
.intro-on:not(.intro-parted), .intro-on:not(.intro-parted) body { overflow: hidden; } /* (until the woods part) */
.intro.is-ready { background: transparent; }
.intro.is-done { opacity: 0; pointer-events: none; }
/* (as the woods part, the photo behind takes the pointer: js/intro.js; "Skip intro" still works) */
.intro.is-parting { pointer-events: none; }
.intro.is-parting .intro__skip { pointer-events: auto; }
.intro__layers canvas { position: absolute; inset: 0; width: 100%; height: 100%; will-change: transform, opacity; }

.intro__skip {
  position: absolute; right: clamp(1rem, 3vw, 2rem); bottom: calc(env(safe-area-inset-bottom, 0px) + 1.2rem);
  background: none; border: 0; color: rgba(246, 241, 231, .65); cursor: pointer;
  font-family: var(--sans); font-size: .7rem; letter-spacing: .24em; text-transform: uppercase; padding: .6rem;
}
.intro__skip:hover { color: var(--cream); }
.intro.is-diving .intro__skip { opacity: 0; }

/* (the ring pulsing beside "Tap to walk into the woods", as in the hint on the website's photo) */
.hero__hint-ring { width: 14px; height: 14px; border-radius: 50%; border: 1px solid currentColor; position: relative; }
.hero__hint-ring::after {
  content: ""; position: absolute; inset: -1px; border-radius: 50%; border: 1px solid currentColor;
  animation: ring 2.4s ease-out infinite;
}
@keyframes ring { from { transform: scale(1); opacity: .9; } to { transform: scale(3.2); opacity: 0; } }

/* "Tap anywhere to hear the woods" (until the browser lets the crickets play) */
.intro__sound-hint {
  position: absolute; left: calc(clamp(.8rem, 2vw, 1.4rem) + 54px); bottom: calc(env(safe-area-inset-bottom, 0px) + clamp(.8rem, 2vw, 1.4rem) + 10px);
  margin: 0; font: .7rem var(--sans); letter-spacing: .2em; text-transform: uppercase; color: rgba(246, 241, 231, .7);
  opacity: 0; transition: opacity .8s; pointer-events: none;
}
.intro__sound-hint.is-visible { opacity: 1; animation: flicker 2.4s ease-in-out infinite; }
.intro__sound-hint.is-gone { opacity: 0 !important; animation: none; }
/* "Tap to walk into the woods": the intro waits for it (js/intro.js), and that tap starts the sound too */
/* (the names and the hint well in from the top and the bottom, clear of a phone's browser bars, which can lie over the
   intro: measured from what's seen with them showing, svh) */
.intro__start { /* (like the hint on the photo at the top: .hero__hint) */
  position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + clamp(3.5rem, 20vh, 11rem));
  bottom: calc(env(safe-area-inset-bottom, 0px) + clamp(3.5rem, 20svh, 11rem)); transform: translateX(-50%); margin: 0; z-index: 3;
  display: flex; align-items: center; gap: .7rem; white-space: nowrap; pointer-events: none;
  font-family: var(--sans); font-size: .7rem; letter-spacing: .3em; text-transform: uppercase; color: rgba(246, 241, 231, .85);
  text-shadow: 0 1px 12px rgba(0, 0, 0, .6); opacity: 0; transition: opacity .8s;
}
.intro.is-waiting-tap .intro__start { opacity: 1; }
/* the names, the date and the place over the woods while it waits, as on the photo at the top */
.intro__welcome {
  position: absolute; inset-inline: 0; z-index: 3; text-align: center; padding-inline: 1rem; pointer-events: none;
  top: calc(env(safe-area-inset-top, 0px) + clamp(4rem, 17vh, 10rem)); top: calc(env(safe-area-inset-top, 0px) + clamp(4rem, 17svh, 10rem));
  color: var(--cream);
  text-shadow: 0 1px 2px rgba(10, 20, 15, .35), 0 2px 24px rgba(10, 20, 15, .55); opacity: 0; transition: opacity 1.2s ease;
}
.intro.is-waiting-tap .intro__welcome { opacity: 1; }
@media (max-height: 500px) { /* (a phone on its side: little room, and its browser bars smaller) */
  .intro__welcome { top: calc(env(safe-area-inset-top, 0px) + 2.5rem); }
  .intro__start { bottom: calc(env(safe-area-inset-bottom, 0px) + 1.6rem); }
}
.intro__welcome .eyebrow { color: var(--gold-soft); }
/* (no "Skip intro" button: scrolling or Escape still skips it) */
.intro__skip { display: none !important; }
.intro.is-waiting-tap { cursor: pointer; }
.intro.is-waiting-tap .intro__sound-hint { display: none; } /* (the same tap) */
