/* ============================================================
   Interactive hero — animated scene + hotspots + chapter player
   Overrides the static .hero background defined in styles.css
   ============================================================ */

.hero.hero-interactive {
  background:
    radial-gradient(ellipse 60% 50% at 85% 25%, rgba(42, 157, 143, 0.22) 0%, rgba(0, 0, 0, 0) 60%),    radial-gradient(ellipse 50% 40% at 15% 90%, rgba(127, 193, 116, 0.08) 0%, rgba(0, 0, 0, 0) 65%),
    #000000;
  isolation: isolate;
  min-height: 78vh;
  overflow: hidden;
}

.hero.hero-interactive::before {
  display: none;
}

/* ---- Scene layer ----------------------------------------- */
.hero-scene {
  inset: 0;
  position: absolute;
  z-index: 0;
  pointer-events: none;
  transform-style: preserve-3d;
  transition: transform 600ms cubic-bezier(.2,.7,.2,1);
  will-change: transform;
}

.hero-scene > * {
  position: absolute;
  inset: 0;
}

.hero-hotspots { pointer-events: none; }

/* Animated grid */
.hero-grid {
  background-image:
    linear-gradient(rgba(166, 230, 218, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(166, 230, 218, 0.06) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 70% 50%, #000 0%, #000 45%, transparent 85%);
  animation: hero-grid-drift 28s linear infinite;
  opacity: 0.85;
}

@keyframes hero-grid-drift {
  to { background-position: 56px 56px, 56px 56px; }
}

/* Ambient glows */
.hero-glow {
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  pointer-events: none;
}
.hero-glow--a {
  background: radial-gradient(circle, #2A9D8F 0%, transparent 60%);
  height: 520px;
  left: auto; right: 8%;
  top: 12%;
  width: 520px;
  animation: hero-float 14s ease-in-out infinite;
}
.hero-glow--b {
  background: radial-gradient(circle, #7FC174 0%, transparent 60%);
  height: 360px;
  left: auto; right: 32%;
  top: 48%;
  width: 360px;
  animation: hero-float 18s ease-in-out -6s infinite;
  opacity: 0.35;
}

@keyframes hero-float {
  0%, 100% { transform: translate3d(0,0,0); }
  50% { transform: translate3d(-30px, 20px, 0); }
}

/* ---- SVG scene ------------------------------------------- */
.hero-svg {
  height: 100%;
  width: 100%;
}

.hero-orbit {
  transform-origin: center;
  transform-box: fill-box;
}
.hero-orbit--1 { animation: hero-spin 36s linear infinite; }
.hero-orbit--2 { animation: hero-spin 60s linear infinite reverse; }
.hero-orbit--3 { animation: hero-spin 90s linear infinite; }

@keyframes hero-spin {
  to { transform: rotate(360deg); }
}

.hero-core-pulse {
  transform-origin: center;
  transform-box: fill-box;
  animation: hero-pulse 4s ease-in-out infinite;
}
.hero-core-glyph { /* static — no animation */ }
@keyframes hero-pulse {
  0%, 100% { transform: scale(1); opacity: 0.95; }
  50%      { transform: scale(1.12); opacity: 0.6; }
}

.hero-link {
  opacity: 0.55;
  stroke-dasharray: 4 6;
  animation: hero-dash 5s linear infinite;
  transition: opacity 320ms ease, stroke-width 320ms ease;
}
@keyframes hero-dash {
  to { stroke-dashoffset: -120; }
}

.hero-link.is-active {
  opacity: 1;
  stroke-width: 2.2;
}

.hero-packet {
  offset-rotate: 0deg;
  animation: hero-packet-flow 4.2s cubic-bezier(.4,.05,.6,.95) infinite;
  filter: drop-shadow(0 0 6px #A6E6DA);
}
@keyframes hero-packet-flow {
  0%   { offset-distance: 0%;   opacity: 0; }
  10%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; }
}

/* Paused state */
.hero.is-paused .hero-grid,
.hero.is-paused .hero-glow,
.hero.is-paused .hero-orbit,
.hero.is-paused .hero-core-pulse,
.hero.is-paused .hero-link,
.hero.is-paused .hero-packet {
  animation-play-state: paused;
}

/* ---- Hotspots -------------------------------------------- */
.hero-hotspot {
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0;
  pointer-events: auto;
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.hero-hotspot-dot {
  background: #A6E6DA;
  border-radius: 50%;
  box-shadow:
    0 0 0 4px rgba(166, 230, 218, 0.18),
    0 0 24px rgba(166, 230, 218, 0.7);
  display: block;
  height: 12px;
  position: relative;
  transition: transform 320ms cubic-bezier(.2,.7,.2,1), box-shadow 320ms ease;
  width: 12px;
  z-index: 2;
}

.hero-hotspot-ring {
  border: 1px solid rgba(166, 230, 218, 0.6);
  border-radius: 50%;
  height: 12px;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  animation: hero-ring 2.6s ease-out infinite;
  z-index: 1;
}
@keyframes hero-ring {
  0%   { opacity: 0.9; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0;   transform: translate(-50%, -50%) scale(5.5); }
}

.hero-hotspot:nth-child(2) .hero-hotspot-ring { animation-delay: 0.6s; }
.hero-hotspot:nth-child(3) .hero-hotspot-ring { animation-delay: 1.2s; }
.hero-hotspot:nth-child(4) .hero-hotspot-ring { animation-delay: 1.8s; }

.hero-hotspot-label {
  background: rgba(6, 21, 19, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(166, 230, 218, 0.18);
  border-radius: 12px;
  color: #ffffff;
  display: grid;
  font-family: inherit;
  gap: 2px;
  left: 22px;
  min-width: 168px;
  opacity: 0;
  padding: 10px 14px;
  pointer-events: none;
  position: absolute;
  text-align: left;
  top: -8px;
  transform: translateY(4px);
  transition: opacity 240ms ease, transform 240ms ease;
  white-space: nowrap;
}
.hero-hotspot-label strong {
  color: #A6E6DA;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.hero-hotspot-label em {
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-style: normal;
  font-weight: 500;
}

.hero-hotspot:hover .hero-hotspot-dot,
.hero-hotspot.is-active .hero-hotspot-dot {
  background: #ffffff;
  transform: scale(1.4);
  box-shadow:
    0 0 0 6px rgba(166, 230, 218, 0.28),
    0 0 40px rgba(166, 230, 218, 0.9);
}
.hero-hotspot:hover .hero-hotspot-label,
.hero-hotspot.is-active .hero-hotspot-label,
.hero-hotspot:focus-visible .hero-hotspot-label {
  opacity: 1;
  transform: translateY(0);
}
.hero-hotspot:focus-visible {
  outline: none;
}
.hero-hotspot:focus-visible .hero-hotspot-dot {
  outline: 2px solid #ffffff;
  outline-offset: 6px;
}

/* ---- Headline crossfade --------------------------------- */
.hero h1[data-hero-headline] {
  position: relative;
}
.hero h1[data-hero-headline] > span[data-chapter] {
  display: inline-block;
  opacity: 0;
  position: absolute;
  left: 0;
  top: 0;
  transform: translateY(8px);
  transition: opacity 420ms ease, transform 420ms cubic-bezier(.2,.7,.2,1);
}
.hero h1[data-hero-headline] > span[data-chapter].is-active {
  opacity: 1;
  position: relative;
  transform: translateY(0);
}

.hero p[data-hero-sub] {
  position: relative;
  min-height: 3.2em;
}
.hero p[data-hero-sub] > span[data-chapter] {
  display: block;
  opacity: 0;
  position: absolute;
  left: 0;
  top: 0;
  transform: translateY(6px);
  transition: opacity 380ms ease, transform 380ms cubic-bezier(.2,.7,.2,1);
}
.hero p[data-hero-sub] > span[data-chapter].is-active {
  opacity: 1;
  position: relative;
  transform: translateY(0);
}

/* ---- Player controls ------------------------------------ */
.hero-player {
  align-items: center;
  display: flex;
  gap: 18px;
  margin-top: 34px;
}

.hero-player-toggle {
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(166, 230, 218, 0.3);
  border-radius: 50%;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  height: 40px;
  justify-content: center;
  transition: background 240ms ease, border-color 240ms ease, transform 200ms ease;
  width: 40px;
}
.hero-player-toggle:hover {
  background: rgba(166, 230, 218, 0.15);
  border-color: rgba(166, 230, 218, 0.6);
}
.hero-player-toggle:active { transform: scale(0.95); }
.hero-player-toggle svg { height: 14px; width: 14px; }
.hero-player-toggle .hero-icon-play  { display: none; }
.hero.is-paused .hero-player-toggle .hero-icon-pause { display: none; }
.hero.is-paused .hero-player-toggle .hero-icon-play  { display: block; }

.hero-chapters {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.hero-chapter {
  align-items: center;
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  display: flex;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  gap: 8px;
  letter-spacing: 0.12em;
  padding: 6px 10px;
  text-transform: uppercase;
  transition: color 240ms ease;
}
.hero-chapter:hover { color: #ffffff; }
.hero-chapter.is-active { color: #ffffff; }
.hero-chapter-bar {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 2px;
  display: block;
  height: 2px;
  overflow: hidden;
  position: relative;
  width: 28px;
}
.hero-chapter-bar::after {
  background: linear-gradient(90deg, #A6E6DA, #7FC174);
  content: "";
  display: block;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 280ms ease;
  width: 100%;
}
.hero-chapter.is-active .hero-chapter-bar::after {
  animation: hero-chapter-fill 6s linear forwards;
}
.hero.is-paused .hero-chapter.is-active .hero-chapter-bar::after {
  animation-play-state: paused;
}
@keyframes hero-chapter-fill {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* ---- Layout tweaks -------------------------------------- */
.hero.hero-interactive .hero-content {
  margin-left: 0;
  margin-right: auto;
  max-width: clamp(560px, 38vw, 760px);
  padding-right: 12px;
}
.hero.hero-interactive .eyebrow {
  font-size: 15px;
  letter-spacing: 0.16em;
  white-space: nowrap;
}
.hero.hero-interactive h1 {
  font-size: clamp(40px, 6.2vw, 72px);
  letter-spacing: -0.025em;
  line-height: 1.04;
  max-width: 620px;
}
.hero.hero-interactive .hero-content > p:not([data-hero-sub]) {
  max-width: 560px;
}
.hero.hero-interactive p[data-hero-sub] {
  font-size: 20px;
  line-height: 1.45;
  max-width: 560px;
}

/* ---- Responsive ----------------------------------------- */
@media (max-width: 900px) {
  .hero.hero-interactive {
    min-height: auto;
    padding-bottom: 60px;
  }
  .hero-hotspots,
  .hero-glow--b {
    display: none;
  }
  .hero-svg { opacity: 0.45; }
  .hero p[data-hero-sub] { min-height: 5em; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-grid,
  .hero-glow,
  .hero-orbit,
  .hero-core,
  .hero-core-pulse,
  .hero-link,
  .hero-packet,
  .hero-hotspot-ring,
  .hero-chapter.is-active .hero-chapter-bar::after {
    animation: none !important;
  }
  .hero h1[data-hero-headline] > span[data-chapter],
  .hero p[data-hero-sub] > span[data-chapter] {
    transition: none;
  }
}


/* ============================================================
   Full-bleed photo hero — swap the animated scene for an image
   ============================================================ */
.hero.hero-interactive.hero-bg-image {
  background: #050b0d;
  position: relative;
  overflow: hidden;
}
.hero.hero-bg-image::before { display: none; }

/* Hide the animated dots / SVG when image hero is active */
.hero.hero-bg-image .hero-grid,
.hero.hero-bg-image .hero-glow,
.hero.hero-bg-image .hero-svg,
.hero.hero-bg-image .hero-hotspots {
  display: none !important;
}

/* The photograph itself, anchored right so the globe sits on the right.
   Full bleed — image flows under the headline area so the globe bleeds into the text.
   Scaled to 85% to keep the globe from overwhelming the composition. */
.hero.hero-bg-image .hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('assets/hero-bg.png');
  background-repeat: no-repeat;
  background-position: right center;
  background-size: cover;
  transform: scale(0.75);
  transform-origin: 100% 50%;
  opacity: 0.56;
  z-index: 0;
}

/* Video layer that replaces the static image. Sits on top of the background-image
   fallback so when the MP4 loads it covers the still. */
.hero.hero-bg-image .hero-bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
  display: block;
  pointer-events: none;
}

/* Soft horizontal fade — dark on the left, fully clear over the globe on the right. */
.hero.hero-bg-image .hero-bg-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg,
      rgba(5, 11, 13, 0.92) 0%,
      rgba(5, 11, 13, 0.78) 28%,
      rgba(5, 11, 13, 0.45) 50%,
      rgba(5, 11, 13, 0.12) 72%,
      rgba(5, 11, 13, 0)   100%),
    linear-gradient(180deg,
      rgba(5, 11, 13, 0.25) 0%,
      rgba(5, 11, 13, 0)   30%,
      rgba(5, 11, 13, 0)   70%,
      rgba(5, 11, 13, 0.55) 100%);
  z-index: 1;
  pointer-events: none;
}

/* Keep hero content above the image + veil */
.hero.hero-bg-image .hero-content {
  position: relative;
  z-index: 2;
}

/* Narrower viewports: keep the globe peeking from the right but still readable */
@media (max-width: 1100px) {
  .hero.hero-bg-image .hero-bg {
    background-position: 78% center;
  }
  .hero.hero-bg-image .hero-bg-veil {
    background:
      linear-gradient(90deg,
        rgba(5, 11, 13, 0.94) 0%,
        rgba(5, 11, 13, 0.82) 45%,
        rgba(5, 11, 13, 0.4)  85%,
        rgba(5, 11, 13, 0.25) 100%),
      linear-gradient(180deg,
        rgba(5, 11, 13, 0.2) 0%,
        rgba(5, 11, 13, 0)   30%,
        rgba(5, 11, 13, 0)   70%,
        rgba(5, 11, 13, 0.55) 100%);
  }
}

@media (max-width: 720px) {
  .hero.hero-bg-image .hero-bg {
    background-position: 68% center;
    background-size: cover;
  }
  .hero.hero-bg-image .hero-bg-veil {
    background:
      linear-gradient(180deg,
        rgba(5, 11, 13, 0.55) 0%,
        rgba(5, 11, 13, 0.72) 100%),
      linear-gradient(90deg,
        rgba(5, 11, 13, 0.4) 0%,
        rgba(5, 11, 13, 0.3) 100%);
  }
}


/* Vertically center the hero content so it reads in line with the globe */
.hero.hero-interactive {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 120px;
  padding-bottom: 120px;
}
