/*
 * hero.css — Nottworks Child Theme (Revision 02)
 *
 * Hero Section:
 * - Full first-screen viewport height (100svh / 100vh)
 * - Seamless background video/poster with zero gap at bottom
 * - Floating header overlays the hero with zero white band
 * - Content vertically balanced and fully visible within first screen
 * - Proportional typography and spacing across desktop, laptop, tablet, mobile
 */

.nw-hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-deep-charcoal);
  color: #ffffff;
  overflow: hidden;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Desktop first-viewport composition: hero balances with reference logo strip */
@media (min-width: 1025px) {
  .nw-hero {
    min-height: calc(100vh - var(--nw-logos-height-desktop, 92px));
    height: calc(100vh - var(--nw-logos-height-desktop, 92px));
    min-height: calc(100svh - var(--nw-logos-height-desktop, 92px));
    height: calc(100svh - var(--nw-logos-height-desktop, 92px));
  }
}

/* Ensure no bottom gap leaks a light color on sub-pixel rendering */
.nw-hero::after {
  content: '';
  display: block;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-deep-charcoal);
  z-index: 3;
}

/* =============================================================================
   BACKGROUND MEDIA (Dark Cinematic Atmospheric Video Background)
   ============================================================================= */

.nw-hero__media {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 1;
  background-color: var(--color-deep-charcoal, #0B0D10);
  pointer-events: none;
}

/* Base double-buffered video layer */
.nw-hero__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  z-index: 0;
  filter: brightness(0.92) contrast(1.02) saturate(0.85);
  pointer-events: none;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity;
}

/* Active resting video: 100% solid, fully visible at z-index 1, completely covering background */
.nw-hero__video.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 1;
}

/* Incoming video: sits ON TOP of active video at z-index 2, starts at opacity 0 */
.nw-hero__video.is-incoming {
  opacity: 0;
  visibility: visible;
  z-index: 2;
}

/* Incoming video fading in: smoothly ramps from 0 to 1 over active video */
.nw-hero__video.is-incoming.is-fading-in {
  opacity: 1;
}

/* Outgoing video during transition: remains fully visible at z-index 1 while incoming fades in over it */
.nw-hero__video.is-outgoing {
  opacity: 1;
  visibility: visible;
  z-index: 1;
}

/* Static poster fallback: matches the enhanced atmospheric treatment */
.nw-hero__poster {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 1;
  filter: brightness(0.92) contrast(1.02) saturate(0.85);
}

/*
 * Layered Atmospheric Overlay:
 * Positioned at z-index 3 (strictly on top of both active and incoming video layers)
 * 1. Top & bottom linear gradient: Anchors header clearance and seamless fold blend.
 * 2. Focused radial text shield: Soft, balanced core that keeps footage clearly visible
 *    while ensuring heading and CTA buttons remain dominant and 100% readable.
 */
.nw-hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    /* Layer 1: Vertical atmospheric vignette (header protection + smooth bottom fold) */
    linear-gradient(
      180deg,
      rgba(11, 13, 16, 0.65) 0%,
      rgba(11, 13, 16, 0.15) 24%,
      rgba(11, 13, 16, 0.25) 65%,
      rgba(11, 13, 16, 0.85) 100%
    ),
    /* Layer 2: Focused soft radial text shield behind typography */
    radial-gradient(
      ellipse 75% 55% at 50% 48%,
      rgba(17, 24, 39, 0.45) 0%,
      rgba(17, 24, 39, 0.28) 45%,
      rgba(11, 13, 16, 0.00) 80%
    );
}

/* =============================================================================
   CONTENT — Centered headline, subtitle, CTAs
   ============================================================================= */

.nw-hero__content {
  position: relative;
  z-index: 4;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  /* Balanced vertical padding accounting for header offset */
  padding-top: calc(var(--header-height, 64px) + clamp(1rem, 2.5vh, 2.25rem));
  padding-bottom: clamp(1.25rem, 2.5vh, 2.25rem);
  width: 100%;
  box-sizing: border-box;
}

/* Headline — Pure solid white (#FFFFFF), bold (800), zero gradients/shadows/strokes */
.nw-hero__title {
  font-family: var(--font-heading);
  font-size: clamp(2.1rem, 3.8vw, 3.35rem);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #ffffff;
  text-shadow: none;
  -webkit-text-stroke: 0;
  opacity: 1;
  margin: 0 0 clamp(0.75rem, 1.8vh, 1.15rem) 0;
  max-width: 860px;
}

.nw-hero__title-accent {
  color: #ffffff;
  font-weight: inherit;
  background: none;
  -webkit-text-fill-color: #ffffff;
  background-clip: border-box;
  -webkit-background-clip: border-box;
  text-shadow: none;
  -webkit-text-stroke: 0;
  opacity: 1;
}

/* Supporting paragraph — tightened line-height and balanced measure */
.nw-hero__subtitle {
  font-family: var(--font-body);
  font-size: clamp(0.9375rem, 1.15vw, 1.03125rem);
  line-height: 1.45;
  color: #cbd5e1;
  text-shadow: 0 1px 16px rgba(11, 13, 16, 0.80);
  max-width: 720px;
  margin: 0 auto clamp(1.25rem, 2.2vh, 1.85rem) auto;
  text-align: center;
  text-wrap: balance;
}

.nw-hero__br-desktop {
  display: inline;
}

/* CTAs row */
.nw-hero__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* Primary button on dark: white fill, ink-navy text */
.nw-hero__btn-main {
  background-color: #ffffff;
  color: var(--color-ink-navy);
  border-color: #ffffff;
}

.nw-hero__btn-main:hover,
.nw-hero__btn-main:focus-visible {
  background-color: var(--color-warm-white);
  border-color: var(--color-warm-white);
  color: var(--color-ink-navy);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(255, 255, 255, 0.15);
}

.nw-hero__btn-main:active {
  transform: translateY(0);
  box-shadow: none;
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */

/* Short viewports (e.g. laptops 1366x768 with browser toolbars, height <= 720px) */
@media (min-width: 769px) and (max-height: 720px) {
  .nw-hero__content {
    padding-top: calc(var(--header-height, 64px) + 12px);
    padding-bottom: 14px;
  }

  .nw-hero__title {
    font-size: clamp(1.85rem, 3.8vw, 2.75rem);
    margin-bottom: 8px;
  }

  .nw-hero__subtitle {
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 14px;
    max-width: 580px;
  }
}

/* Very short viewports (height <= 600px) */
@media (min-width: 769px) and (max-height: 600px) {
  .nw-hero {
    height: auto;
    min-height: 100svh;
  }

  .nw-hero__content {
    padding-top: calc(var(--header-height, 64px) + 8px);
    padding-bottom: 12px;
  }

  .nw-hero__title {
    font-size: clamp(1.6rem, 3.2vw, 2.25rem);
    margin-bottom: 6px;
  }

  .nw-hero__subtitle {
    font-size: 0.8125rem;
    line-height: 1.45;
    margin-bottom: 12px;
  }
}

/* Tablet (max-width: 1024px) */
@media (max-width: 1024px) {
  .nw-hero__title {
    font-size: clamp(2rem, 5vw, 3rem);
    max-width: 720px;
  }

  .nw-hero__subtitle {
    max-width: 560px;
  }
}

/* Mobile (max-width: 768px) */
@media (min-width: 769px) {
  .nw-hero__strip-mobile {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .nw-hero {
    min-height: 100svh !important;
    height: 100svh !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    align-items: center !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 !important;
    position: relative !important;
  }

  .nw-hero__content {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    margin: 0 !important;
    /* Balanced clearance: header top gap (14px) + header (58px) + matching bottom gap (14px) = 86px */
    padding-top: var(--nw-mobile-header-clearance, 86px) !important;
    padding-bottom: clamp(8px, 1.5vh, 14px) !important;
    padding-left: var(--section-padding-x, 18px) !important;
    padding-right: var(--section-padding-x, 18px) !important;
    box-sizing: border-box !important;
  }

  .nw-hero__title {
    font-size: clamp(2.75rem, 11vw, 3.85rem);
    font-weight: 850;
    font-variation-settings: 'wght' 850;
    line-height: 1.06;
    letter-spacing: -0.04em;
    max-width: min(94vw, 420px);
    margin-top: 0;
    margin-bottom: clamp(8px, 1.6vh, 12px);
  }

  .nw-hero__subtitle {
    font-size: clamp(0.78125rem, 2.9vw, 0.875rem);
    line-height: 1.46;
    margin-bottom: clamp(14px, 2vh, 18px);
    max-width: 320px;
    padding: 0;
  }

  .nw-hero__br-desktop {
    display: none !important;
  }

  .nw-hero__actions {
    flex-direction: column;
    width: 100%;
    max-width: 280px;
    gap: 8px;
    margin-bottom: clamp(6px, 1.2vh, 12px) !important;
  }

  .nw-hero__actions .nw-btn {
    width: 100%;
    justify-content: center;
    min-height: 44px;
    font-size: 0.84375rem;
  }

  /* Concept B: Floating Translucent Dark Navy Glass Capsule at the bottom */
  .nw-hero__strip-mobile {
    flex-shrink: 0 !important;
    width: calc(100% - 32px) !important;
    max-width: 440px !important;
    height: 60px !important;
    min-height: 60px !important;
    margin: 0 16px max(14px, env(safe-area-inset-bottom, 14px)) 16px !important;
    background: rgba(17, 24, 39, 0.62) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.14) !important;
    padding: 0 20px !important;
    position: relative !important;
    z-index: 5 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    pointer-events: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .nw-hero__strip-track-wrapper {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    overflow: hidden !important;
    position: relative !important;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%) !important;
    mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%) !important;
  }

  .nw-hero__strip-track {
    display: flex !important;
    align-items: center !important;
    width: max-content !important;
    animation: nw-hero-strip-marquee 25s linear infinite !important;
    will-change: transform;
  }

  .nw-hero__strip-group {
    display: flex !important;
    align-items: center !important;
    gap: 36px !important;
    padding-right: 36px !important;
  }

  .nw-hero__strip-item {
    flex-shrink: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 42px !important;
  }

  .nw-hero__strip-img {
    height: 37.5px !important;
    max-height: 38px !important;
    width: auto !important;
    max-width: 178px !important;
    object-fit: contain !important;
    display: block !important;
    user-select: none !important;
    -webkit-user-drag: none !important;
  }

  /* Per-logo optical vertical centering to account for asset whitespace */
  .nw-hero__strip-img[src*="ref-1.png"] {
    transform: translateY(2.2px) !important;
  }
  .nw-hero__strip-img[src*="ref-7.png"] {
    transform: translateY(2px) !important;
  }
  .nw-hero__strip-img[src*="ref-5.png"] {
    transform: translateY(1.5px) !important;
  }
  .nw-hero__strip-img[src*="ref-4.png"] {
    transform: translateY(0.8px) !important;
  }
  .nw-hero__strip-img[src*="ref-9.png"] {
    transform: translateY(-0.8px) !important;
  }

  /* Monochrome / Light Logo Treatments */
  .nw-hero__strip-img--mono {
    filter: brightness(0) invert(1);
    opacity: 0.92;
  }

  .nw-hero__strip-img--color {
    opacity: 1;
    filter: contrast(1.08) brightness(1.05);
  }
}

@keyframes nw-hero-strip-marquee {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-50%, 0, 0);
  }
}

@media (max-width: 360px) {
  .nw-hero__title {
    font-size: clamp(2.45rem, 10.8vw, 2.9rem);
    font-weight: 850;
    font-variation-settings: 'wght' 850;
    line-height: 1.06;
    letter-spacing: -0.038em;
    max-width: 330px;
  }

  .nw-hero__subtitle {
    font-size: 0.75rem;
    line-height: 1.42;
    max-width: 270px;
    margin-bottom: 12px;
  }

  .nw-hero__actions {
    max-width: 260px;
    gap: 6px;
  }

  .nw-hero__actions .nw-btn {
    min-height: 40px;
    font-size: 0.8125rem;
    padding: 0 12px;
  }

  .nw-hero__strip-mobile {
    width: calc(100% - 24px) !important;
    height: 52px !important;
    min-height: 52px !important;
    margin: 0 12px max(10px, env(safe-area-inset-bottom, 10px)) 12px !important;
    border-radius: 16px !important;
    padding: 0 16px !important;
  }

  .nw-hero__strip-group {
    gap: 30px !important;
    padding-right: 30px !important;
  }

  .nw-hero__strip-item {
    height: 36px !important;
  }

  .nw-hero__strip-img {
    height: 32px !important;
    max-height: 32.5px !important;
    max-width: 150px !important;
  }

  .nw-hero__strip-img[src*="ref-1.png"] {
    transform: translateY(1.8px) !important;
  }
  .nw-hero__strip-img[src*="ref-7.png"] {
    transform: translateY(1.6px) !important;
  }
  .nw-hero__strip-img[src*="ref-5.png"] {
    transform: translateY(1.2px) !important;
  }
  .nw-hero__strip-img[src*="ref-4.png"] {
    transform: translateY(0.6px) !important;
  }
  .nw-hero__strip-img[src*="ref-9.png"] {
    transform: translateY(-0.6px) !important;
  }
}

/* Reduced motion: hide video, show poster & stop marquee */
@media (prefers-reduced-motion: reduce) {
  .nw-hero__video {
    display: none;
  }

  .nw-hero__poster {
    display: block;
  }

  .nw-hero__strip-track {
    animation: none;
  }
}
