/* ==========================================================================
   hero.css — hero / brief auto intro
   The hero is a short 3D intro driven by space-scene.js. During the
   'initial' state the page shows only the 3D scene (no text yet). When
   the intro auto-transitions to 'revealed', the title fades in and the
   page becomes scrollable — the hero text stays visible as the user
   scrolls and naturally moves out of view with the hero section.
   No click, no skip button.
   ========================================================================== */

#space-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: var(--z-canvas);
  display: block;
}

/* ----- Hero block ----- */
.hero {
  position: relative;
  width: 100vw;
  height: 100vh;
  z-index: var(--z-hero);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-inline: var(--space-5);
  text-align: center;
  pointer-events: none;
}

.hero__inner {
  position: relative;
  max-width: 1200px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(var(--space-5), 4vh, var(--space-7));
}

.hero__subtitle {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--fs-subtitle);
  letter-spacing: 0.4em;
  color: var(--color-text-soft);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 600ms var(--ease-out),
              transform 600ms var(--ease-out);
  white-space: nowrap;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-display);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--color-text);
  text-shadow: 0 0 32px rgba(232, 180, 92, 0.18),
               0 0 64px rgba(184, 168, 224, 0.12);
  margin: 0;
  max-width: 16ch;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 700ms var(--ease-out),
              transform 700ms var(--ease-out);
}

/* ----- Intro: keep the title HIDDEN while the 3D animation plays ----- */
body.page--initial .hero__subtitle,
body.page--initial .hero__title {
  opacity: 0;
  transform: translateY(12px);
}

/* ----- After the intro: title fades in and stays ----- */
body.page--revealed .hero__subtitle,
body.page--revealed .hero__title {
  opacity: 1;
  transform: translateY(0);
}

body.page--revealed .hero__subtitle {
  opacity: 0.75;
  transition-delay: 0s;
}

body.page--revealed .hero__title {
  transition-delay: 150ms;
}

.hero__title-hl {
  display: inline;
  font-weight: 700;
}

.hero__title-hl--gold {
  color: var(--color-accent-1);
  text-shadow: 0 0 24px rgba(232, 180, 92, 0.35),
               0 0 48px rgba(232, 180, 92, 0.18);
}

.hero__title-hl--lilac {
  color: var(--color-accent-2);
  text-shadow: 0 0 24px rgba(184, 168, 224, 0.35),
               0 0 48px rgba(184, 168, 224, 0.18);
}

.hero__title-soft {
  color: var(--color-text-soft);
}

/* ----- Reduced motion: instant title, no fade choreography ----- */
@media (prefers-reduced-motion: reduce) {
  .hero__subtitle,
  .hero__title {
    transition: none;
  }
  body.page--revealed .hero__subtitle,
  body.page--revealed .hero__title {
    transition-delay: 0s;
  }
}

/* ----- Mobile adjustments ----- */
@media (max-width: 767px) {
  .hero__subtitle {
    font-size: 0.8rem;
    letter-spacing: 0.3em;
    white-space: normal;
    max-width: 80vw;
  }
  .hero__title {
    max-width: 90vw;
  }
}

/* ----- Scroll-down hint (bottom of hero) ----- */
.hero__scroll-hint {
  position: absolute;
  left: 50%;
  bottom: var(--space-7);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--color-text-soft);
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  pointer-events: auto;
  cursor: pointer;
  opacity: 0;
  transition: opacity 800ms var(--ease-out);
  z-index: 1;
}

body.page--initial .hero__scroll-hint {
  opacity: 0;
  pointer-events: none;
}

body.page--revealed .hero__scroll-hint {
  opacity: 0.72;
  transition-delay: 700ms;
}

body.page--revealed .hero__scroll-hint:hover,
.hero__scroll-hint:focus-visible {
  opacity: 1;
  outline: none;
}

/* Chevron — two borders rotated 45° */
.hero__scroll-hint-arrow {
  width: 18px;
  height: 18px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px);
  animation: hero-scroll-bounce 1.9s var(--ease-in-out) infinite;
}

@keyframes hero-scroll-bounce {
  0%   { transform: rotate(45deg) translate(-2px, -2px);  opacity: 0.35; }
  50%  { transform: rotate(45deg) translate(2px,  2px);   opacity: 1;    }
  100% { transform: rotate(45deg) translate(-2px, -2px);  opacity: 0.35; }
}

/* Hide once the user has scrolled past the hero */
body.is-scrolled .hero__scroll-hint {
  opacity: 0;
  pointer-events: none;
  transition: opacity 400ms var(--ease-out);
}

/* Respect reduced-motion: keep the hint, kill the bounce */
@media (prefers-reduced-motion: reduce) {
  .hero__scroll-hint-arrow {
    animation: none;
  }
}

@media (max-width: 767px) {
  .hero__scroll-hint {
    bottom: var(--space-5);
    font-size: 0.65rem;
    letter-spacing: 0.28em;
  }
  .hero__scroll-hint-arrow {
    width: 14px;
    height: 14px;
  }
}
