/* Scroll-driven prism introduction. Load after trust-site.css. */

.hero.hero-prism-shell,
.hero.hero-prism-scroll {
  --hero-copy-opacity: 1;
  --hero-copy-shift: 0px;
  --prism-atmosphere-opacity: 0;
  --prism-exit-opacity: 1;
  --prism-scene-opacity: 1;
  --prism-orb-opacity: 1;
  --prism-orb-core: rgba(215, 173, 88, 0.32);
  --prism-orb-accent: rgba(31, 111, 168, 0.24);
  --prism-orb-shadow: rgba(9, 34, 56, 0.16);
  position: relative;
  display: block;
  padding: 0;
  isolation: isolate;
}

.hero.hero-prism-shell {
  min-height: calc(100svh - 92px);
}

.hero.hero-prism-scroll {
  min-height: 430svh;
}

/* Keep the normal light hero visible while the module and WebGL scene load.
   This prevents the old CSS prism and a half-rendered scroll state flashing
   during refresh, especially when the browser restores the scroll position. */
.hero.hero-prism-shell:not(.hero-scene-ready) {
  --hero-copy-opacity: 1 !important;
  --hero-copy-shift: 0px !important;
  --prism-atmosphere-opacity: 0 !important;
  --prism-scene-opacity: 0 !important;
}

.hero.hero-prism-shell:not(.hero-scene-ready) .hero-prism-phrases {
  visibility: hidden;
}

.hero.hero-prism-shell::before,
.hero.hero-prism-scroll::before {
  display: none;
}

.hero.hero-prism-shell::after,
.hero.hero-prism-scroll::after {
  display: none;
}

.hero-prism-stage {
  position: sticky;
  top: 92px;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(300px, 0.82fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  width: 100vw;
  height: calc(100svh - 92px);
  margin-left: calc(50% - 50vw);
  padding-inline: max(1rem, calc((100vw - 1180px) / 2));
  box-sizing: border-box;
  overflow: hidden;
  opacity: var(--prism-exit-opacity, 1);
}

.hero-prism-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: var(--prism-atmosphere-opacity, 0);
  background:
    radial-gradient(circle at 50% 46%, rgba(27, 111, 153, 0.58), transparent 32%),
    radial-gradient(circle at 72% 36%, rgba(24, 165, 200, 0.2), transparent 38%),
    linear-gradient(145deg, #06111d 0%, #0a2a40 54%, #061521 100%);
  transition: opacity 0.18s ease;
}

.hero-prism-stage::after {
  content: "";
  position: absolute;
  top: 9%;
  right: 7%;
  z-index: 0;
  width: clamp(110px, 13vw, 210px);
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
  opacity: var(--prism-orb-opacity, 1);
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.78), transparent 10%),
    radial-gradient(circle at 42% 42%, var(--prism-orb-core), transparent 60%),
    radial-gradient(circle at 62% 72%, var(--prism-orb-accent), transparent 65%);
  box-shadow: 0 30px 60px var(--prism-orb-shadow);
  filter: blur(1px);
  animation: orbFloatSmall 9s ease-in-out infinite alternate;
  will-change: opacity, transform;
}

.hero-prism-scroll .hero-copy {
  position: relative;
  z-index: 3;
  grid-column: 1;
  max-width: 35rem;
  opacity: var(--hero-copy-opacity, 1);
  transform: translate3d(0, var(--hero-copy-shift), 0);
  will-change: opacity, transform;
}

.hero-three-background {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100vw;
  height: 100%;
  margin: 0;
  overflow: hidden;
  pointer-events: none;
  contain: layout paint style;
  opacity: var(--prism-scene-opacity, 0);
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent 0%,
    transparent 25%,
    rgba(0, 0, 0, 0.35) 38%,
    #000 55%,
    #000 95%,
    transparent 100%
  );
  mask-image: linear-gradient(
    90deg,
    transparent 0%,
    transparent 25%,
    rgba(0, 0, 0, 0.35) 38%,
    #000 55%,
    #000 95%,
    transparent 100%
  );
}

.hero-three-background.is-transitioning {
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 0, 0, 0.78) 10%,
    #000 30%,
    #000 92%,
    transparent 100%
  );
  mask-image: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 0, 0, 0.78) 10%,
    #000 30%,
    #000 92%,
    transparent 100%
  );
}

.hero-three-background.is-transition-complete {
  visibility: hidden;
}

.hero-three-background::after {
  z-index: 2;
  opacity: 0.56;
  -webkit-mask-image: radial-gradient(circle at 64% 48%, #000, transparent 70%);
  mask-image: radial-gradient(circle at 64% 48%, #000, transparent 70%);
}

.hero-three-background canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero-prism-fallback {
  opacity: 0;
  transform: translateX(clamp(170px, 25vw, 430px));
}

.hero-three-background.three-fallback-active canvas {
  display: none;
}

.hero-three-background.three-fallback-active .hero-prism-fallback {
  opacity: 1;
}

.hero-prism-phrases {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.hero-prism-phrases p {
  position: absolute;
  width: min(820px, calc(100% - 2rem));
  margin: 0;
  color: #f4fbff;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(2.25rem, 5.8vw, 5.8rem);
  font-weight: 600;
  line-height: 0.96;
  letter-spacing: -0.035em;
  text-align: center;
  text-wrap: balance;
  opacity: 0;
  transform: translate3d(0, 22px, 0) scale(0.985);
  text-shadow: 0 2px 28px rgba(0, 10, 20, 0.82);
  will-change: opacity, transform;
}

body > nav {
  z-index: 20;
}

body > main,
body > footer {
  position: relative;
  z-index: 1;
}

/* Let the first standard content edge enter as the sticky stage completes. */
.hero-prism-scroll + .trust-bar {
  position: relative;
  z-index: 5;
  margin-top: -18svh;
}

.hero.hero-prism-scroll.hero-prism-static {
  min-height: calc(100svh - 92px);
}

.hero-prism-static .hero-prism-stage {
  position: relative;
  top: 0;
}

.hero-prism-static .hero-prism-stage::before,
.hero-prism-static .hero-prism-phrases {
  display: none;
}

.hero-prism-static + .trust-bar {
  margin-top: 0;
}

.hero-prism-static .hero-three-background {
  opacity: 0.22 !important;
  transition: none;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 0%, rgba(0, 0, 0, 0.72) 58%, transparent 88%);
  mask-image: radial-gradient(circle at 50% 50%, #000 0%, rgba(0, 0, 0, 0.72) 58%, transparent 88%);
}

.hero-prism-static .hero-prism-fallback {
  transform: none;
}

@supports not (height: 100svh) {
  .hero.hero-prism-scroll {
    min-height: 430vh;
  }

  .hero-prism-stage {
    height: calc(100vh - 92px);
  }
}

@media (max-width: 1080px) and (min-width: 781px) {
  .hero-prism-scroll .hero-copy {
    max-width: min(37rem, 72vw);
  }
}

@media (max-width: 780px) {
  .hero.hero-prism-scroll {
    min-height: 280svh;
  }

  .hero-prism-stage {
    top: 82px;
    display: block;
    height: calc(100svh - 82px);
    padding-inline: 0;
  }

  .hero-prism-scroll .hero-copy {
    position: absolute;
    top: 50%;
    left: 1rem;
    z-index: 3;
    width: min(33rem, calc(100% - 2rem));
    max-width: calc(100% - 2rem);
    transform: translate3d(0, calc(-50% + var(--hero-copy-shift)), 0);
  }

  .hero-three-background {
    inset-inline: 0;
    -webkit-mask-image: radial-gradient(circle at 64% 48%, #000 0%, rgba(0, 0, 0, 0.76) 48%, transparent 88%);
    mask-image: radial-gradient(circle at 64% 48%, #000 0%, rgba(0, 0, 0, 0.76) 48%, transparent 88%);
  }

  .hero-prism-stage::after {
    top: 12%;
    right: -5%;
    width: clamp(105px, 38vw, 155px);
  }

  .hero-three-background.is-transitioning {
    -webkit-mask-image: radial-gradient(circle at 50% 48%, #000 0%, rgba(0, 0, 0, 0.88) 58%, transparent 96%);
    mask-image: radial-gradient(circle at 50% 48%, #000 0%, rgba(0, 0, 0, 0.88) 58%, transparent 96%);
  }

  .hero-prism-phrases p {
    width: min(92vw, 34rem);
    font-size: clamp(2.35rem, 12vw, 4.5rem);
  }

  .hero-prism-scroll + .trust-bar {
    margin-top: -12svh;
  }

  .hero.hero-prism-scroll.hero-prism-static {
    min-height: calc(100svh - 82px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero.hero-prism-scroll {
    min-height: calc(100svh - 92px);
  }

  .hero-prism-stage {
    position: relative;
    top: 0;
  }

  .hero-prism-stage::before,
  .hero-prism-phrases {
    display: none;
  }

  .hero-prism-stage::after {
    animation: none;
  }

  .hero-prism-scroll + .trust-bar {
    margin-top: 0;
  }

  .hero-three-background {
    opacity: 0.22 !important;
    transition: none;
    -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 0%, rgba(0, 0, 0, 0.72) 58%, transparent 88%);
    mask-image: radial-gradient(circle at 50% 50%, #000 0%, rgba(0, 0, 0, 0.72) 58%, transparent 88%);
  }

  .hero-prism-fallback {
    transform: none;
  }
}

@media (max-width: 780px) and (prefers-reduced-motion: reduce) {
  .hero.hero-prism-scroll {
    min-height: calc(100svh - 82px);
  }
}
