/* ==========================================================================
   Hero — the 3D world
   ========================================================================== */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(180deg, #cfeafa 0%, #eaf6fb 52%, var(--cream) 100%);
}

.hero__canvas-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

#hero-canvas {
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.2s var(--ease-out);
  outline: none;
}

.hero.is-webgl-ready #hero-canvas {
  opacity: 1;
}

/* A designed fallback for devices without WebGL */
.hero__fallback {
  position: absolute;
  inset: 0;
  display: none;
  background:
    radial-gradient(80% 60% at 72% 18%, rgba(255, 255, 255, 0.65), transparent 60%),
    linear-gradient(180deg, #c9e8f8 0%, #eaf6fb 55%, var(--cream) 100%);
}

.hero__fallback svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.no-webgl .hero__fallback {
  display: block;
}

.no-webgl #hero-canvas {
  display: none;
}

/* Legibility scrims */
.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(
      92deg,
      rgba(255, 245, 232, 0.97) 0%,
      rgba(255, 245, 232, 0.9) 22%,
      rgba(255, 245, 232, 0.52) 40%,
      rgba(255, 245, 232, 0.06) 62%,
      transparent 78%
    ),
    linear-gradient(0deg, var(--cream) 0%, rgba(255, 245, 232, 0.55) 12%, transparent 30%);
}

.hero__content {
  position: relative;
  z-index: 3;
  width: min(calc(100% - (var(--gutter) * 2)), var(--container));
  margin-inline: auto;
  padding-top: clamp(7rem, 16vh, 11rem);
  padding-bottom: clamp(7.5rem, 16vh, 11rem);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  pointer-events: none;
}

.hero__content > * {
  pointer-events: auto;
}

.hero__eyebrow {
  margin-bottom: 1.35rem;
  color: var(--ink-soft);
  padding: 0.55rem 0.95rem 0.55rem 0.55rem;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 12px 26px -22px rgba(52, 59, 69, 0.4);
  backdrop-filter: blur(10px);
}

.hero__eyebrow::before {
  margin-left: 0.2rem;
}

.hero__title {
  max-width: 17ch;
  font-size: var(--fs-display);
  font-weight: 600;
  line-height: 0.965;
  letter-spacing: -0.045em;
  color: var(--ink);
}

.hero__title .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.06em;
  margin-bottom: -0.02em;
}

.hero__title .line > span {
  display: block;
}

.hero__title em {
  position: relative;
  font-style: normal;
  color: var(--peach-deep);
  white-space: nowrap;
}

.hero__title em::after {
  content: '';
  position: absolute;
  left: 2%;
  right: 2%;
  bottom: 0.02em;
  height: 0.09em;
  border-radius: 999px;
  background: rgba(247, 216, 120, 0.75);
  z-index: -1;
  transform: rotate(-1.4deg);
}

.hero__title .hero__adventure {
  position: relative;
  display: inline-block;
}

.hero__title .hero__adventure svg {
  position: absolute;
  left: -3%;
  right: -3%;
  bottom: -0.2em;
  width: 106%;
  height: 0.26em;
  overflow: visible;
}

.hero__title .hero__adventure path {
  fill: none;
  stroke: var(--peach-deep);
  stroke-width: 6;
  stroke-linecap: round;
  opacity: 0.8;
}

.hero__lede {
  max-width: 44ch;
  margin-top: 1.4rem;
  font-size: clamp(1rem, 0.4vw + 0.92rem, 1.16rem);
  line-height: 1.65;
  color: var(--ink-soft);
  font-weight: 500;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
  margin-top: 1.85rem;
}

.hero__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1.9rem;
}

.hero__pills .pill {
  background: rgba(255, 255, 255, 0.6);
}

.hero__pills .pill svg {
  color: var(--peach-deep);
}

.hero__pills .pill:nth-child(2) svg {
  color: var(--mint-deep);
}

.hero__pills .pill:nth-child(3) svg {
  color: var(--sky-deep);
}

/* Bottom hero rail */
.hero__rail {
  position: absolute;
  z-index: 4;
  left: 0;
  right: 0;
  bottom: 0;
  padding-bottom: 1.5rem;
  pointer-events: none;
}

.hero__rail-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  width: min(calc(100% - (var(--gutter) * 2)), var(--container));
  margin-inline: auto;
}

.hero__scroll {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  pointer-events: auto;
}

.hero__scroll-track {
  position: relative;
  display: block;
  width: 1px;
  height: 46px;
  background: rgba(52, 59, 69, 0.18);
  overflow: hidden;
}

.hero__scroll-track::after {
  content: '';
  position: absolute;
  left: -1px;
  top: 0;
  width: 3px;
  height: 14px;
  border-radius: 999px;
  background: var(--peach-deep);
  animation: scroll-cue 2.3s var(--ease-in-out) infinite;
}

@keyframes scroll-cue {
  0% { transform: translateY(-16px); opacity: 0; }
  35% { opacity: 1; }
  100% { transform: translateY(48px); opacity: 0; }
}

.hero__rail-meta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}

.hero__rail-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.hero__rail-meta span + span::before {
  content: '';
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--ink-faint);
}

/* Rotating seal */
.hero__seal {
  position: absolute;
  z-index: 3;
  right: max(2.5%, calc((100vw - var(--container)) / 2 - 70px));
  bottom: 16%;
  width: 118px;
  height: 118px;
  opacity: 0.7;
  pointer-events: none;
}

.hero__seal svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  animation: spin-slow 34s linear infinite;
}

.hero__seal text {
  font-family: var(--font-body);
  font-size: 8.1px;
  font-weight: 800;
  letter-spacing: 0.24em;
  fill: var(--ink);
  text-transform: uppercase;
}

.hero__seal .seal-star {
  fill: var(--peach-deep);
}

/* Scroll-driven exit parallax is handled by GSAP, but the CSS gives a base */
.hero__canvas-wrap,
.hero__scrim,
.hero__content,
.hero__seal {
  will-change: transform;
}

@media (max-width: 900px) {
  .hero__seal {
    display: none;
  }

  .hero__content {
    padding-bottom: clamp(6.5rem, 15vh, 9rem);
  }

  .hero__title {
    max-width: 15ch;
  }
}

@media (max-width: 680px) {
  .hero {
    min-height: 100svh;
    justify-content: flex-end;
  }

  .hero__scrim {
    background:
      linear-gradient(
        180deg,
        rgba(255, 245, 232, 0.1) 0%,
        rgba(255, 245, 232, 0.18) 34%,
        rgba(255, 245, 232, 0.82) 58%,
        var(--cream) 92%
      );
  }

  .hero__content {
    padding-top: 22svh;
    padding-bottom: 6rem;
  }

  .hero__eyebrow {
    font-size: 0.58rem;
    letter-spacing: 0.15em;
    margin-bottom: 1rem;
  }

  .hero__title {
    max-width: 100%;
    font-size: clamp(2.55rem, 12.4vw, 3.15rem);
    line-height: 1;
  }

  .hero__lede {
    margin-top: 1rem;
    font-size: 0.96rem;
    max-width: 36ch;
  }

  .hero__actions {
    margin-top: 1.4rem;
    width: 100%;
  }

  .hero__actions .btn {
    flex: 1 1 auto;
    font-size: 0.9rem;
    min-height: 3.2rem;
    padding-left: 1.1rem;
  }

  .hero__actions .btn--ghost {
    padding-left: 1.1rem;
    padding-right: 1.1rem;
  }

  .hero__actions .btn__arrow {
    width: 2.25rem;
    height: 2.25rem;
  }

  .hero__pills {
    margin-top: 1.2rem;
    gap: 0.35rem;
  }

  .hero__pills .pill {
    font-size: 0.7rem;
    padding: 0.42rem 0.68rem;
  }

  .hero__pills .pill:nth-child(3) {
    display: none;
  }

  .hero__rail {
    padding-bottom: 1.1rem;
  }

  .hero__scroll {
    font-size: 0.58rem;
  }

  .hero__scroll-track {
    height: 32px;
  }

  .hero__rail-meta {
    display: none;
  }
}

@media (max-height: 700px) and (min-width: 681px) {
  .hero__content {
    padding-top: 6.5rem;
    padding-bottom: 5.5rem;
  }

  .hero__title {
    font-size: clamp(2.7rem, 5vw, 4.4rem);
  }

  .hero__pills {
    margin-top: 1.2rem;
  }
}
