/* ==========================================================================
   Section 2 — Hero
   As on the original site (project/index.html #hero): centred copy over a
   particle network canvas (js/sections/hero.js), a soft radial glow behind
   the headline, and a fade into the next section. Theme-aware.
   Prefixed .hero- and scoped to .hero. Entrance motion is CSS-only, so
   nothing is hidden if JS fails.
   Other backgrounds tried (all in backups/): hero.v2-particle-drift,
   hero.v3-dot-grid, hero.v4-graph, hero.v5-flow, hero.v6-paper-dots
   ========================================================================== */

.hero {
  --hero-glow: rgba(37,99,235,0.07);
  --hero-veil: rgba(255,255,255,0.88);
  --hero-fade: var(--surface);

  position: relative;
  /* Always the full first fold of the device */
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--surface);
}

:root[data-theme="dark"] .hero {
  --hero-glow: rgba(55,138,221,0.14);
  --hero-veil: rgba(6,21,48,0.86);
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* Centred radial glow behind the headline */
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  z-index: 0;
  width: 900px; height: 640px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse 65% 55% at 50% 38%, var(--hero-glow) 0%, transparent 70%);
  pointer-events: none;
}
/* Fade into the next section */
.hero::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 1;
  height: 120px;
  background: linear-gradient(to bottom, transparent, var(--hero-fade));
  pointer-events: none;
}

/* ─── Content ─────────────────────────────────────────────────────────── */
.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: calc(var(--container) + var(--page-px) * 2);
  margin: 0 auto;
  padding: calc(var(--nav-height) + 60px) var(--page-px) 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-headline {
  margin-bottom: 32px;
  /* sized so each sentence fits on one line from tablet up */
  font-size: clamp(34px, 4.6vw, 68px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}
.hero-headline-line { display: block; white-space: nowrap; }
.hero-headline em { font-style: normal; color: var(--accent); }

.hero-sub {
  max-width: 600px;
  margin-bottom: 48px;
  font-size: clamp(15px, 1.8vw, 18px);
  font-weight: 300;
  line-height: 1.75;
  color: var(--text-secondary);
  text-wrap: pretty;
}
.hero-sub strong { font-weight: 500; color: var(--text-primary); }

.hero-ctas {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 52px;
}

/* Trust line — sits where the original stats row was */
.hero-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
}
.hero-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
  flex-shrink: 0;
  color: var(--good);
}
.hero-bars i { display: block; width: 3px; border-radius: 1px; background: currentColor; }
.hero-bars i:nth-child(1) { height: 4px; }
.hero-bars i:nth-child(2) { height: 6.5px; }
.hero-bars i:nth-child(3) { height: 9px; }
.hero-bars i:nth-child(4) { height: 12px; }

/* ─── Entrance (the original's .anim-el timing, staggered) ────────────── */
.hero-headline, .hero-sub, .hero-ctas, .hero-trust {
  animation: hero-in 0.65s var(--ease-out) both;
}
.hero-headline { animation-delay: 0.15s; }
.hero-sub      { animation-delay: 0.36s; }
.hero-ctas     { animation-delay: 0.46s; }
.hero-trust    { animation-delay: 0.62s; }

@keyframes hero-in {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Responsive ──────────────────────────────────────────────────────── */
/* Phones: let each sentence wrap, balanced */
@media (max-width: 760px) {
  .hero-headline { font-size: clamp(34px, 8.6vw, 48px); }
  .hero-headline-line { white-space: normal; text-wrap: balance; }
  .hero-headline-line + .hero-headline-line { margin-top: 0.12em; }
}
@media (max-width: 600px) {
  /* Text sits over the network on phones: veil it for legibility */
  .hero::before {
    inset: 0;
    width: auto; height: auto;
    transform: none;
    background: linear-gradient(to bottom, var(--hero-veil) 0%, color-mix(in srgb, var(--hero-veil) 80%, transparent) 60%, var(--hero-veil) 100%);
    z-index: 1;
  }
  .hero-content { padding-top: calc(var(--nav-height) + 40px); padding-bottom: 80px; }
  .hero-sub { margin-bottom: 28px; }
  .hero-ctas {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 10px;
    margin-bottom: 32px;
  }
  .hero-ctas .btn { width: 100%; padding: 15px 24px; font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-headline, .hero-sub, .hero-ctas, .hero-trust { animation: none; }
}
