/* =========================================
   hero.css — Hero Component Base
   OWNS:    Structural layout (position, flex, overflow, isolation), media/shade/glow layers,
            copy typography, panel base dimensions, responsive breakpoints, status dot.
            Defines --hero-inline-gutter and --hero-frame-max.
   MAY OVERRIDE: Nothing — hero.css is a base component file.
   MUST NOT DEFINE: Homepage-specific visual values (owned by home.css),
                    cinematic FX layers (owned by hero-enhanced.css),
                    dock/control styles (owned by hero-controls.css).
   =========================================
   --header-height is the single source of truth in css/core/tokens.css
   --hero-dock-height is owned by hero-controls.css — responsive values live there */
:root {
  --hero-inline-gutter: clamp(1.5rem, 6vw, 6.5rem);
  --hero-frame-max: 1280px;
}

.hero-home.section {
  min-height: 100vh;
  min-height: 100svh;
  padding-block: 0 !important;
}

.hero-home {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  isolation: isolate;
  background: #020617;
}

.hero-home__media,
.hero-home__shade,
.hero-home__glow {
  position: absolute;
  inset: 0;
}

.hero-home__media {
  height: 100%;
  min-height: 100%;
  will-change: transform;
  transform-style: preserve-3d;
}

/* home.css is the visual authority for image presentation on the homepage.
   object-position, transform, and filter below are fallback values only —
   home.css overrides all three with different live values (later load order). */
.hero-home__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 48%;
  transform: scale(1.025);
  filter: brightness(0.98) contrast(1.08) saturate(1.04);
}

/* home.css owns the homepage shade gradient (lighter, 94deg, later load wins).
   This declaration is fallback for any non-home context using .hero-home. */
.hero-home__shade {
  background:
    linear-gradient(100deg, rgba(2, 6, 23, 0.96) 0%, rgba(2, 6, 23, 0.74) 34%, rgba(2, 6, 23, 0.28) 58%, rgba(2, 6, 23, 0.7) 100%),
    radial-gradient(circle at 18% 39%, rgba(10, 20, 50, 0.14) 0%, rgba(5, 10, 28, 0.24) 42%, rgba(2, 6, 23, 0.64) 100%),
    linear-gradient(180deg, rgba(2, 6, 23, 0.06) 0%, transparent 26%, rgba(2, 6, 23, 0.42) 100%);
}

/* home.css owns the homepage glow (3-radial version, later load wins).
   Structural properties (mix-blend-mode, pointer-events) are shared. */
.hero-home__glow {
  background:
    radial-gradient(circle at 19% 31%, rgba(var(--scene-accent-rgb, 34, 211, 238), 0.08), transparent 30%),
    radial-gradient(circle at 79% 69%, rgba(99, 102, 241, 0.06), transparent 36%);
  mix-blend-mode: screen;
  pointer-events: none;
}

.hero-home__grid {
  position: relative;
  z-index: 2;
  display: grid;
  align-items: center;
  width: 100%;
  max-width: var(--hero-frame-max);
  margin-left: auto;
  margin-right: auto;
  gap: clamp(2.5rem, 5vw, 6rem);
  padding: calc(var(--header-height) + clamp(2.5rem, 5vh, 4.5rem)) clamp(1.75rem, 6vw, 2.25rem) calc(var(--hero-dock-height) + 1.5rem);
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 400px);
}

.hero-home__copy {
  max-width: 48rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: clamp(24rem, 40vh, 32rem); /* Reserve space for layout stability */
}

.hero-home__copy .eyebrow {
  display: block;
  margin: 0 0 1.25rem;
  color: rgba(125, 211, 252, 0.92);
  letter-spacing: 0.35em;
  font-size: clamp(0.75rem, 0.8vw, 0.85rem);
  font-weight: 700;
  text-transform: uppercase;
  /* Locked for stability during entrance */
  opacity: 1;
  transform: none;
  animation: none;
}

.hero-home__copy h1 {
  max-width: 14ch; /* Stable multi-line layout, prevents cropping */
  margin: 0;
  font-size: clamp(2.15rem, 7vw, 4.45rem);
  font-weight: 850;
  line-height: 1.02;
  letter-spacing: -0.06em;
  text-wrap: balance;
  text-shadow: 0 2px 10px rgba(2, 6, 23, 0.55), 0 10px 32px rgba(2, 6, 23, 0.36);
  display: block;
  min-height: 1.1em;
}

.hero-home__title {
  display: grid;
  gap: 0.03em;
}

.hero-home__title-accent {
  background: linear-gradient(90deg, rgba(111, 126, 245, 0.94) 0%, rgba(46, 179, 241, 0.96) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: brightness(1.04) saturate(1);
}

.hero-home__lede {
  max-width: 34rem;
  margin-top: clamp(1.5rem, 2.8vw, 2.25rem);
  font-size: clamp(1rem, 1.15vw, 1.2rem);
  line-height: 1.65;
  color: rgba(232, 238, 255, 0.82);
  text-shadow: 0 2px 8px rgba(2, 6, 23, 0.48), 0 6px 20px rgba(2, 6, 23, 0.28);
}

.hero-home__subtag {
  max-width: 32rem;
  margin-top: 0.85rem;
  margin-bottom: 0;
  font-size: clamp(0.85rem, 0.95vw, 0.95rem);
  line-height: 1.55;
  color: rgba(224, 232, 255, 0.52);
  text-shadow: 0 2px 8px rgba(2, 6, 23, 0.38);
}

.hero-home__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: clamp(1.5rem, 3vw, 2rem); /* Consistent spacing for CTA buttons */
}

.hero-home__actions .button {
  min-height: 52px;
  padding-inline: clamp(1.5rem, 2.5vw, 2.4rem);
}

.hero-home__panel {
  position: relative;
  width: 100%;
  max-width: 23.5rem;
  padding: 1.5rem;
  margin-bottom: 0;
  margin-left: 0;
  justify-self: end;
}

.hero-home__panel--enhanced {
  background:
    linear-gradient(180deg, rgba(10, 17, 38, 0.76), rgba(6, 12, 30, 0.72)),
    linear-gradient(90deg, rgba(99, 102, 241, 0.022), rgba(34, 211, 238, 0.016));
  border: 1px solid rgba(120, 146, 255, 0.085);
  box-shadow:
    0 12px 28px rgba(3, 8, 24, 0.26),
    inset 0 1px 0 rgba(255,255,255,0.03),
    inset 0 0 0 1px rgba(255,255,255,0.008);
  backdrop-filter: blur(var(--blur-panel)) saturate(var(--sat-header));
  -webkit-backdrop-filter: blur(var(--blur-panel)) saturate(var(--sat-header));
}

/* Cinematic Continuity: Bottom fade dissolves the hero into the next section without a hard edge */
.hero-home::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 22vh;
  background: linear-gradient(to bottom, transparent, #020617);
  z-index: 3;
}

.hero-home__panel--enhanced .system-list__row strong {
  display: inline-flex;
  align-items: center;
}

.hero-home__panel--enhanced .system-list__row {
  border-color: rgba(255,255,255,0.05);
}

.status-dot {
  display: inline-block;
  width: 3px;
  height: 3px;
  margin-left: 7px;
  border-radius: 50%;
  background: rgba(34, 211, 238, 0.88);
  box-shadow: 0 0 3px rgba(34, 211, 238, 0.22);
  animation: hero-status-pulse 3.2s infinite ease-in-out;
  flex: 0 0 auto;
  font-style: normal;
}

@keyframes hero-status-pulse {
  0%, 100% {
    opacity: 0.42;
    transform: scale(1);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.06);
  }
}

@media (max-width: 1160px) {
  .hero-home__grid {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
    gap: clamp(2rem, 4vw, 3rem);
    padding-right: clamp(2rem, 6vw, 3rem);
    padding-left: clamp(2rem, 6vw, 3rem);
  }

  .hero-home__panel {
    max-width: 320px;
  }
}

@media (max-width: 1100px) {
  .hero-home {
    min-height: 100svh;
    height: auto;
  }
  
  .hero-home__grid {
    grid-template-columns: 1fr;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    min-height: 100svh; /* Ensure grid fills viewport height */
    align-content: center; /* Vertically center content */
    padding-top: calc(var(--header-height) + clamp(2.75rem, 7vh, 4rem));
    padding-right: clamp(1.75rem, 6vw, 2.25rem); /* Consistent horizontal padding */
    padding-bottom: calc(var(--hero-dock-height) + 3rem);
    padding-left: clamp(1.75rem, 6vw, 2.25rem); /* Consistent horizontal padding */
    gap: 2rem; /* Reduced gap for better vertical balance */
    justify-items: start; /* Keep text aligned left */
  }

  .hero-home__copy {
    width: 100%;
    max-width: min(100%, 38rem);
    min-height: 0;
    margin-left: 0; /* Ensure no left margin pushes content */
    margin-top: 0; /* Remove excessive top margin */
    margin-bottom: 0; /* Remove excessive bottom margin */
    transform: none;
    justify-content: center; /* Vertically center copy content */
  }

  .hero-home__copy h1 {
    max-width: 14ch; /* Adjusted for better wrapping and to prevent cropping */
  }

  .hero-home__lede,
  .hero-home__subtag {
    max-width: min(100%, 34rem);
  }

  .hero-home__panel,
  .hero-home__panel--desktop {
    display: none !important; /* Ensure panel is completely removed from layout */
    position: absolute; /* Prevent ghost spacing */
    pointer-events: none; /* Prevent interaction */
  }
}

.hero-home__glow::after {
  content: "";
  position: absolute;
  inset: -20%;
  background: radial-gradient(circle, rgba(34,211,238,0.05), transparent 65%);
  animation: hero-ambient-drift 18s ease-in-out infinite;
  pointer-events: none;
}

.hero-home::before {
  content: "";
  position: absolute;
  inset: -20%;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.03), transparent);
  transform: translateX(-20%);
  animation: hero-slow-sweep 52s linear infinite;
}

@keyframes hero-ambient-drift {
  0% { transform: translateX(-2%) translateY(0%) scale(1); }
  50% { transform: translateX(2%) translateY(1%) scale(1.05); }
  100% { transform: translateX(-2%) translateY(0%) scale(1); }
}

@keyframes hero-slow-sweep {
  from { transform: translateX(-20%); }
  to { transform: translateX(20%); }
}

.hero-home__bottom-reserve {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--hero-dock-height) + 2rem);
  pointer-events: none;
}

@media (max-width: 640px) {
  .hero-home__grid {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    min-height: 100svh; /* Ensure grid fills viewport height */
    align-content: center; /* Vertically center content */
    padding-top: calc(var(--header-height) + clamp(2.6rem, 7.5vh, 4.5rem));
    padding-right: clamp(1.75rem, 6vw, 2.25rem); /* Consistent horizontal padding */
    padding-bottom: calc(var(--hero-dock-height) + 1.75rem);
    padding-left: clamp(1.75rem, 6vw, 2.25rem); /* Consistent horizontal padding */
    gap: 2rem; /* Reduced gap for better vertical balance */
  }

  .hero-home__copy {
    width: 100%;
    max-width: 100%;
    transform: none;
    margin-left: 0; /* Ensure no left margin pushes content */
    margin-top: 0; /* Remove excessive top margin */
    margin-bottom: 0; /* Remove excessive bottom margin */
    padding-top: 0; /* Remove excessive top padding */
    justify-content: center; /* Vertically center copy content */
  }

  .hero-home__title {
    max-width: 14ch; /* Adjusted for better wrapping and to prevent cropping */
  }

  .hero-home__copy h1 {
    font-size: clamp(2rem, 8.6vw, 2.75rem);
    max-width: 14ch; /* Adjusted for better wrapping and to prevent cropping */
    margin-top: 0; /* Remove excessive top margin */
  }

  .hero-home__lede,
  .hero-home__subtag {
    max-width: min(100%, 30rem);
    padding-right: 0;
  }

  .hero-home__panel,
  .hero-home__panel--desktop {
    display: none !important; /* Ensure panel is completely removed from layout */
    position: absolute; /* Prevent ghost spacing */
    pointer-events: none; /* Prevent interaction */
  }
}

/* Final hero viewport authority */
@media (min-width: 980px) {
  .hero-home.section,
  .hero-home {
    min-height: 100vh;
    min-height: 100svh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-home__glow::after,
  .hero-home::before,
  .status-dot {
    animation: none;
  }
}

.hero-home + section .glass-panel,
.hero-home + .section .glass-panel {
  box-shadow:
    0 18px 44px rgba(3, 8, 24, 0.32),
    0 0 0 1px rgba(255, 255, 255, 0.028),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
@keyframes hero-eyebrow-fade {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}