/* MySodeia: the opening scene (intro.js). A dark field at night, a seed, a sprout, then the mark.
   Always dark, in light mode too: it is a scene, not a page section. */

html:not(.js) .intro { display: none; }

.intro {
  --night: #0C1208;
  position: relative;
  z-index: 2;
  height: 260vh;
  background: var(--night);
  color: #EEF3E4;
}

/* Dawn: the night fades into the page as the scene scrolls away */
.intro::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 30vh;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(transparent, color-mix(in srgb, #F0B846 16%, transparent) 45%, var(--bg));
}

.intro-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}
.intro-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; }

/* Vignette, like a film frame */
.intro-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 42%, transparent 55%, rgba(0, 0, 0, .65) 100%);
}

.intro-lines {
  position: absolute;
  left: 0; right: 0;
  bottom: 12vh;
  height: 6em;
  z-index: 2;
  pointer-events: none;
  font-size: clamp(1.5rem, 3.2vw, 2.7rem);
}
.intro-line {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  margin: 0 auto;
  padding-inline: 24px;
  max-width: 22ch;
  box-sizing: content-box;
  text-align: center;
  text-wrap: balance;
  font: 700 1em/1.15 var(--display);
  letter-spacing: -0.015em;
  color: #EEF3E4;
  opacity: 0;
  will-change: opacity, transform, filter;
}
.intro-line .soft { color: #A1A893; font-weight: 500; font-style: italic; }

/* The mark: the sprout (drawn by the canvas) above the name */
.intro-mark {
  position: absolute;
  left: 0; right: 0;
  top: 41%;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 14px;
  padding-inline: 24px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
}
.intro-mark .word { font: 700 clamp(3rem, 9vw, 6.6rem)/1 var(--display); letter-spacing: -0.03em; color: #EEF3E4; }
.intro-mark .tag { font-size: clamp(1.05rem, 1.7vw, 1.3rem); color: #F0B846; font-weight: 600; }
.intro-mark .soon { font-size: clamp(.95rem, 1.3vw, 1.05rem); color: #A1A893; }
.intro-mark .badges { justify-content: center; margin-top: 6px; }
/* The store badges take clicks only once the mark is fully in view (intro.js adds .ready); before that the
   scene is see-through and they could be pressed without being seen. */
.intro-mark.ready .badges { pointer-events: auto; }

.intro-cue {
  position: absolute;
  left: 50%;
  bottom: 28px;
  z-index: 2;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 10px;
  font-size: 13px;
  color: #A1A893;
  pointer-events: none;
}
.intro-cue i { position: relative; display: block; width: 1px; height: 44px; background: rgba(238, 243, 228, .18); overflow: hidden; }
.intro-cue i::after {
  content: "";
  position: absolute;
  left: 0; top: -40%;
  width: 1px; height: 40%;
  background: #F0B846;
  animation: intro-cue 2.2s cubic-bezier(.65, 0, .35, 1) infinite;
}
@keyframes intro-cue { to { top: 100%; } }

/* Keyboard users can jump past the scene */
.intro-skip {
  position: absolute;
  top: 16px; left: 16px;
  z-index: 4;
  padding: 10px 16px;
  border-radius: 999px;
  background: #EEF3E4;
  color: #0C1208;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
}
.intro-skip:focus-visible { transform: none; outline: 2px solid #F0B846; outline-offset: 3px; }

/* While the scene plays, the hero's entrance waits for the hero to come on screen */
.intro.playing ~ main .hero .enter,
.intro.playing ~ main .hero h1 .line > span { animation-play-state: paused; }

@media (max-width: 720px) {
  .intro { height: 230vh; }
  .intro-lines { bottom: 15vh; }
  .intro-mark { top: 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .intro { display: none; }
}
