/* ==========================================================================
   Home hero — "Signals over the Waitematā"
   A live agent network drawn into the dusk sky above the Auckland skyline.
   The Sky Tower tip is the hub that broadcasts messages (js/hero-network.js).
   Scoped to .hero--home so inner-page heroes are untouched.
   ========================================================================== */

.hero--home {
  --hero-night:  #061A2E;
  --hero-signal: #8FDCE6;
  --font-display: 'Archivo', var(--font-heading);

  min-height: max(600px, calc(100svh - 160px));
  align-items: stretch;
  justify-content: flex-start;
  text-align: left;
  background: var(--hero-night);
  isolation: isolate;
}

/* Photo + canvas share one stage so the slow push-in keeps them aligned */
.hero-stage {
  position: absolute;
  inset: 0;
  z-index: 0;
  transform-origin: 68% 60%;
  animation: heroPush 28s ease-out forwards;
}

.hero-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 68% 60%;
  filter: saturate(0.85) brightness(0.9);
}

.hero-network {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  mix-blend-mode: screen;
}

@keyframes heroPush {
  from { transform: scale(1.08); }
  to   { transform: scale(1); }
}

/* Night falls from the left so the type always sits on deep water */
.hero-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg,
      rgba(6, 26, 46, 0.94) 0%,
      rgba(6, 26, 46, 0.82) 32%,
      rgba(6, 26, 46, 0.30) 62%,
      rgba(6, 26, 46, 0.05) 100%),
    linear-gradient(180deg,
      rgba(6, 26, 46, 0.55) 0%,
      rgba(6, 26, 46, 0) 30%,
      rgba(6, 26, 46, 0) 70%,
      rgba(6, 26, 46, 0.65) 100%);
}

.hero--home .hero-content {
  z-index: 2;
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-12) var(--space-8) var(--space-20);
  display: flex;
  flex-direction: column;
  justify-content: center;
  pointer-events: none; /* let the pointer reach the network canvas */
}

.hero--home .hero-content a,
.hero--home .hero-content .countdown {
  pointer-events: auto;
}

.hero-kicker {
  max-width: 44rem;
  margin-bottom: var(--space-6);
  padding-left: var(--space-4);
  border-left: 3px solid var(--color-accent-gold);
  font-family: var(--font-heading);
  font-size: var(--fs-md);
  font-weight: var(--fw-medium);
  line-height: var(--lh-snug);
  color: rgba(255, 255, 255, 0.86);
}

.hero--home .hero-title {
  margin-bottom: var(--space-8);
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 4.4vw, 4.25rem);
  font-weight: 750;
  font-stretch: 108%;
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--color-white);
  text-wrap: balance;
}

/* Each line slides up out of its own mask: the page's one orchestrated entrance */
.hero-line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.06em;
}

.hero-line > span {
  display: inline-block;
  transform: translateY(105%);
  animation: heroLine 0.9s cubic-bezier(0.2, 0.7, 0.1, 1) forwards;
}

.hero-line:nth-child(2) > span { animation-delay: 0.1s; }
.hero-line:nth-child(3) > span { animation-delay: 0.2s; }

@keyframes heroLine {
  to { transform: translateY(0); }
}

.hero-rise {
  opacity: 0;
  animation: heroRise 0.8s ease forwards;
}
.hero-kicker.hero-rise { animation-delay: 0s; }
.hero-facts.hero-rise  { animation-delay: 0.45s; }
.hero-ctas.hero-rise   { animation-delay: 0.6s; }

@keyframes heroRise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Key facts ── */
.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5) var(--space-10);
  margin: 0 0 var(--space-8);
  padding-top: var(--space-5);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  max-width: 46rem;
}

.hero-fact dt {
  margin-bottom: var(--space-1);
  font-size: var(--fs-sm);
  color: var(--hero-signal);
}

.hero-fact dd {
  margin: 0;
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  color: var(--color-white);
}

/* Countdown restyled as one compact line (markup comes from js/countdown.js) */
.hero--home .countdown {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  margin: 0;
  justify-content: flex-start;
}

.hero--home .countdown-item {
  display: flex;
  align-items: baseline;
  flex: none;
  gap: 0.2em;
  min-width: 0;
  text-align: left;
}

.hero--home .countdown-value {
  display: inline;
  padding: 0;
  background: none;
  border: 0;
  backdrop-filter: none;
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
}

.hero--home .countdown-label {
  display: inline;
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: var(--fw-regular);
  text-transform: lowercase;
  letter-spacing: 0;
  opacity: 0.7;
}

.hero--home .hero-ctas {
  justify-content: flex-start;
}

.hero--home .btn:focus-visible {
  outline: 3px solid var(--hero-signal);
  outline-offset: 3px;
}

/* ── Responsive ── */
/* Wide screens: widen the stage past the right edge so the Sky Tower
   sits clear of the headline */
@media (min-width: 1024px) {
  .hero-stage {
    right: -24%;
  }
  .hero-photo {
    object-position: 68% 40%;
  }
}

@media (max-width: 768px) {
  .hero--home {
    min-height: calc(100svh - 70px);
  }
  .hero-photo {
    object-position: 66% 50%;
  }
  .hero-shade {
    background: linear-gradient(180deg,
      rgba(6, 26, 46, 0.55) 0%,
      rgba(6, 26, 46, 0.75) 45%,
      rgba(6, 26, 46, 0.92) 100%);
  }
  .hero--home .hero-content {
    justify-content: flex-end;
    padding: var(--space-16) var(--space-5) var(--space-20);
  }
  .hero-kicker {
    font-size: var(--fs-base);
  }
  .hero--home .hero-title {
    font-size: clamp(2.1rem, 9vw, 3rem);
    margin-bottom: var(--space-8);
  }
  .hero-facts {
    gap: var(--space-4) var(--space-8);
    margin-bottom: var(--space-8);
  }
  .hero-fact dd,
  .hero--home .countdown-value {
    font-size: var(--fs-md);
  }
}

@media (max-width: 480px) {
  .hero--home .countdown {
    gap: var(--space-3);
  }
  .hero--home .hero-ctas {
    flex-direction: column;
    align-items: stretch;
  }
  .hero--home .hero-ctas .btn {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-stage,
  .hero-line > span,
  .hero-rise {
    animation: none;
    transform: none;
    opacity: 1;
  }
}
