/**
 * HealthN.E.S.S. — Cinematic hero foundation
 * Replaceable media stage for future Higgsfield / photography assets.
 * No advanced scroll choreography — atmosphere only.
 */

.hero {
  --hero-text-max: 38rem;
  --hero-overlay-strength: 0.58;
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  background: var(--color-deep-black);
  color: var(--color-on-background);
}

/* --------------------------------------------------------------------------
 * Media stage
 * ------------------------------------------------------------------------ */
/* Specificity must beat `.chapter > * { position: relative }` from foundation/experience,
   or absolute children collapse the stage to height 0 and the loop never paints. */
.hero > .hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 72% 42%, rgba(242, 202, 80, 0.07), transparent 58%),
    radial-gradient(ellipse 50% 40% at 18% 70%, rgba(211, 197, 173, 0.04), transparent 55%),
    linear-gradient(165deg, #0a0b0a 0%, var(--color-charcoal-black) 48%, #0c0f0e 100%);
}

.hero-media__stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero-media__stage img,
.hero-media__stage video,
.hero-media__stage picture {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hero-media__stage img,
.hero-media__stage video {
  object-fit: cover;
  object-position: var(--hero-object-position, center center);
  /* Shared grade so poster ↔ video do not jump; approved loop is already dark-left. */
  filter: saturate(0.94) contrast(1.02) brightness(0.96);
}

.hero-media__stage video {
  /* Optional, extremely slow background breath — pure CSS, no ScrollTrigger. */
  transform-origin: 42% 50%;
  animation: hero-video-drift 46s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes hero-video-drift {
  from { transform: scale(1.02); }
  to   { transform: scale(1.07); }
}

.hero-media__stage[data-has-media="false"] {
  /* Atmosphere canvas carries the visual when assets are pending */
  opacity: 0;
}

.hero-media__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(
      105deg,
      rgba(0, 0, 0, calc(var(--hero-overlay-strength) + 0.12)) 0%,
      rgba(0, 0, 0, calc(var(--hero-overlay-strength) * 0.55)) 42%,
      rgba(12, 15, 14, 0.35) 100%
    ),
    linear-gradient(to top, rgba(18, 20, 19, 0.92) 0%, transparent 42%);
}

.hero-media__overlay[hidden] {
  display: none !important;
}

/* Atmospheric depth — intentional without final media */
.hero-media__atmosphere {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  contain: paint;
}

.hero-media__light {
  position: absolute;
  width: min(70vw, 52rem);
  height: min(70vw, 52rem);
  top: 8%;
  right: -8%;
  border-radius: 50%;
  background:
    radial-gradient(
      circle at 40% 45%,
      rgba(242, 202, 80, 0.11) 0%,
      rgba(211, 197, 173, 0.04) 35%,
      transparent 68%
    );
  filter: blur(2px);
  opacity: 0.75;
  animation: hero-ambient-drift 34s ease-in-out infinite alternate;
}

.hero-media__light--secondary {
  width: min(45vw, 28rem);
  height: min(45vw, 28rem);
  top: auto;
  bottom: 5%;
  right: auto;
  left: -6%;
  background:
    radial-gradient(
      circle,
      rgba(211, 197, 173, 0.08) 0%,
      transparent 70%
    );
  animation-duration: 36s;
  animation-direction: alternate-reverse;
  opacity: 0.7;
}

.hero-media__beam {
  position: absolute;
  top: -10%;
  right: 18%;
  width: 1px;
  height: 75%;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(242, 202, 80, 0.22),
    transparent
  );
  opacity: 0.45;
  transform: rotate(18deg);
  transform-origin: top center;
}

.hero-media__vignette {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 12rem 4rem rgba(0, 0, 0, 0.55);
  background: radial-gradient(
    ellipse 75% 65% at 50% 40%,
    transparent 30%,
    rgba(0, 0, 0, 0.45) 100%
  );
}

.hero-media__depth {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.35) 0%, transparent 28%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.25) 0%, transparent 22%);
}

.hero-media__foreground {
  position: absolute;
  inset: 0;
  z-index: 3;
  background:
    linear-gradient(
      to top,
      rgba(18, 20, 19, 0.55) 0%,
      transparent 28%
    );
  opacity: 0.9;
}

.hero-media__foreground[hidden],
.hero-media__atmosphere[hidden] {
  display: none !important;
}

.hero-media__placeholder {
  position: absolute;
  z-index: 4;
  right: clamp(1.25rem, 4vw, 3rem);
  bottom: clamp(5rem, 12vh, 7rem);
  max-width: 14rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(153, 144, 124, 0.28);
  background: rgba(12, 15, 14, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.hero-media__placeholder[hidden] {
  display: none !important;
}

.hero-media__placeholder-label {
  display: block;
  font-family: var(--font-label);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 0.35rem;
}

.hero-media__placeholder-note {
  display: block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--color-on-surface-variant);
}

@media (max-width: 767px) {
  .hero-media__placeholder {
    display: none;
  }
}

@keyframes hero-ambient-drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.75;
  }
  to {
    transform: translate3d(-3%, 4%, 0) scale(1.06);
    opacity: 0.95;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-media__light,
  .hero-media__light--secondary,
  .hero-media__stage video {
    animation: none;
  }
  .hero-media__stage video {
    transform: none;
  }
}

/* --------------------------------------------------------------------------
 * Content
 * ------------------------------------------------------------------------ */
.hero__inner {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: var(--width-container-max);
  margin-inline: auto;
  padding:
    clamp(5.5rem, 12vh, 7.5rem)
    var(--space-gutter)
    clamp(4rem, 10vh, 6rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
}

.hero__copy {
  max-width: var(--hero-text-max);
  text-align: left;
}

.hero__eyebrow {
  display: block;
  margin-bottom: 1.25rem;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.65rem, 1.4rem + 4.2vw, 4.5rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--color-on-background);
  margin: 0 0 clamp(1.25rem, 2.5vw, 1.75rem);
  max-width: 12.5ch;
  text-wrap: balance;
}

.hero__title-accent {
  color: var(--color-primary);
  font-style: italic;
  font-weight: 500;
}

.hero__lede {
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.92rem + 0.35vw, 1.125rem);
  line-height: 1.7;
  color: var(--color-on-surface-variant);
  margin: 0 0 clamp(1.75rem, 3vw, 2.25rem);
  max-width: 34rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1rem;
  margin-bottom: 1rem;
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 48px;
  padding: 0.9rem 1.75rem;
  font-family: var(--font-label);
  font-size: 0.6875rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 700;
  text-decoration: none;
  border-radius: var(--radius-default);
  transition:
    background-color var(--duration-base) var(--ease-standard),
    color var(--duration-base) var(--ease-standard),
    border-color var(--duration-base) var(--ease-standard);
}

.hero__cta--primary {
  background: var(--color-primary);
  color: var(--color-on-primary);
  border: 1px solid var(--color-primary);
}

.hero__cta--primary:hover,
.hero__cta--primary:focus-visible {
  background: var(--color-primary-container);
  border-color: var(--color-primary-container);
  outline: none;
}

.hero__cta--secondary {
  background: transparent;
  color: var(--color-on-background);
  border: 1px solid rgba(153, 144, 124, 0.45);
}

.hero__cta--secondary:hover,
.hero__cta--secondary:focus-visible {
  color: var(--color-primary);
  border-color: rgba(242, 202, 80, 0.55);
  outline: none;
}

.hero__steer {
  margin: 0.85rem 0 0;
  max-width: 36rem;
  font-family: var(--font-body);
  font-size: 0.92rem;
  line-height: 1.5;
  color: rgba(211, 197, 173, 0.82);
}

.hero__steer-link {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  color: var(--color-primary, #f2ca50);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}

.hero__steer-link:hover,
.hero__steer-link:focus-visible {
  color: #fff6d8;
  outline: none;
}

.hero__text-link {
  display: inline-block;
  margin-top: 0.35rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--color-on-surface-variant);
  text-decoration: none;
  border-bottom: 1px solid rgba(153, 144, 124, 0.4);
  padding-bottom: 0.15rem;
  transition:
    color var(--duration-base) var(--ease-standard),
    border-color var(--duration-base) var(--ease-standard);
}

.hero__text-link:hover,
.hero__text-link:focus-visible {
  color: var(--color-primary);
  border-color: var(--color-primary);
  outline: none;
}

/* Soft entrance handled by cinematic.js / cinematic.css chapter reveals */

/* --------------------------------------------------------------------------
 * Mobile composition
 * ------------------------------------------------------------------------ */
@media (max-width: 767px) {
  .hero {
    --hero-overlay-strength: 0.78;
    min-height: 100svh;
  }

  .hero > .hero-media {
    /* Vertical bias: quieter lower half for copy readability */
    background:
      radial-gradient(ellipse 90% 50% at 50% 18%, rgba(242, 202, 80, 0.09), transparent 55%),
      linear-gradient(180deg, #080908 0%, var(--color-charcoal-black) 55%, #0c0f0e 100%);
  }

  .hero-media__light {
    top: -5%;
    right: 50%;
    transform: translateX(50%);
    width: 90vw;
    height: 55vw;
  }

  .hero-media__beam {
    right: 50%;
    opacity: 0.28;
  }

  .hero-media__overlay {
    background:
      linear-gradient(
        to top,
        rgba(18, 20, 19, 0.97) 0%,
        rgba(18, 20, 19, 0.82) 38%,
        rgba(0, 0, 0, 0.35) 72%,
        rgba(0, 0, 0, 0.5) 100%
      );
  }

  .hero-media__stage img,
  .hero-media__stage video {
    /* Slightly quieter on phones so poster gold stays restrained under the overlay */
    filter: saturate(0.9) contrast(1.01) brightness(0.92);
  }

  .hero__inner {
    padding-top: 5.75rem;
    padding-bottom: 5.5rem;
    justify-content: flex-end;
    box-sizing: border-box;
  }

  .hero__copy {
    max-width: none;
  }

  .hero__title {
    max-width: none;
    font-size: clamp(2.35rem, 9.5vw, 3rem);
    line-height: 1.1;
  }

  .hero__lede {
    max-width: 28rem;
    font-size: 1rem;
    line-height: 1.65;
  }

  .hero__actions {
    flex-direction: column;
    width: 100%;
  }

  .hero__cta {
    width: 100%;
    box-sizing: border-box;
  }

}

@media (min-width: 768px) and (max-width: 1023px) {
  .hero__title {
    max-width: 14ch;
  }

  .hero-media__light {
    right: -4%;
  }
}

@media (min-width: 1024px) {
  .hero__inner {
    padding-block: clamp(6.5rem, 14vh, 8.5rem) clamp(5rem, 12vh, 7rem);
  }

  .hero__copy {
    /* Editorial left bias — large negative space to the right */
    margin-right: auto;
  }
}
