/* ==========================================================================
   Panelicious — Hero
   Dark→light fade, panel wall, and the morphing lead panel.
   ========================================================================== */

.hero {
  position: relative;
  background: var(--darkgrey);
  color: var(--ink-invert);
  padding-top: calc(var(--header-h) + clamp(2.5rem, 6vw, 5rem));
  padding-bottom: clamp(5rem, 12vw, 9rem);
  overflow: hidden;
  isolation: isolate;
}

/* Ambient glow — red/purple, top corner. Subtle, no clutter. */
.hero__glow {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 55% at 78% -5%, rgba(224,7,0,0.30), transparent 60%),
    radial-gradient(50% 50% at 8% 8%, rgba(74,47,70,0.55), transparent 60%);
}

/* The dark→light fade into the page below (the pitch.com effect). */
.hero__fade {
  position: absolute; left: 0; right: 0; bottom: 0; height: 42%;
  z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, rgba(36, 39, 44, 1) 32%, rgba(61, 64, 68, 1) 46%, rgba(84, 86, 89, 1) 56%, rgba(114, 115, 117, 1) 66%, rgba(149, 149, 150, 1) 76%, rgba(202, 201, 200, 1) 86%, rgba(250, 247, 245, 1) 96%);
}

.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; gap: 2.5rem; }
}
/* On small screens the mini wall gets too cramped — show just the
   morphing lead panel, which stays legible and still carries the motion. */
@media (max-width: 560px) {
  .hero__stage { grid-template-columns: 1fr; }
  .hero-panel:not(.hero-panel--lead) { display: none; }
}

.hero__copy { max-width: 34ch; }
.hero__copy h1 { margin-bottom: 0.6em; }
.hero__copy .lead { color: var(--ink-invert); margin-bottom: 1.75rem; }
.hero__copy .actions { margin-bottom: 1.5rem; }
.hero .eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--red);
  animation: syncPulse 2.6s var(--ease) infinite;
}
.hero__note {
  font-family: var(--font-mono);
  font-size: 0.8rem; letter-spacing: 0.04em;
  color: var(--ink-invert-dim); margin: 0;
}

/* --- Panel wall --- */
.hero__stage {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.hero-panel { min-width: 0; }
.hero-panel--lead { grid-column: 1 / -1; }
.hero-panel--lead .screen { aspect-ratio: 16 / 9; }
.hero-panel:not(.hero-panel--lead) .screen { aspect-ratio: 1 / 1; }
/* Small square minis: keep them legible, no overlap with the corner label */
.hero-panel:not(.hero-panel--lead) .screen__title { font-size: 1rem; line-height: 1.12; }
.hero-panel:not(.hero-panel--lead) .screen__meta { display: none; }
.hero-panel:not(.hero-panel--lead) .screen__body { padding: 0.85rem 0.85rem 1.7rem; gap: 0.2rem; }
.hero-panel:not(.hero-panel--lead) .screen--dash .screen__body { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 10px 10px 20px; }
.hero-panel:not(.hero-panel--lead) .dash-tile { padding: 6px 8px; }
.hero-panel:not(.hero-panel--lead) .dash-tile b { font-size: 0.8rem; }
.hero-panel .screen {
  box-shadow: 0 18px 50px rgba(0,0,0,0.35);
  border-color: rgba(250,247,245,0.16);
}

/* Entrance — staggered rise (neutralised under reduced-motion by base.css) */
.hero-panel { animation: heroRise 0.7s var(--ease) both; }
.hero-panel:nth-child(1) { animation-delay: 0.05s; }
.hero-panel:nth-child(2) { animation-delay: 0.16s; }
.hero-panel:nth-child(3) { animation-delay: 0.24s; }
.hero-panel:nth-child(4) { animation-delay: 0.32s; }
@keyframes heroRise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

/* --- Morph crossfade on the lead panel --- */
.hero-panel--lead .screen {
  transition: opacity 0.5s var(--ease);
}
.hero-panel--lead.is-swapping .screen { opacity: 0; }

/* A brief "syncing" flash on the lead label when it morphs */
.hero-panel--lead.is-swapping .screen__label { color: var(--red); }

/* --- Solo hero (About / Pricing): centred copy, no stage --- */
.hero--solo { padding-bottom: clamp(3rem, 7vw, 5.5rem); }
.hero--solo .hero__inner { grid-template-columns: 1fr; }
.hero--solo .hero__copy {
  max-width: 54ch; margin-inline: auto; text-align: center;
}
.hero--solo .hero__copy .lead { margin-inline: auto; }
.hero--solo .actions { justify-content: center; }

/* --- Inner (sector) hero: slightly shorter --- */
.hero--inner { padding-bottom: clamp(4rem, 9vw, 7rem); }
.hero--inner .hero__copy { max-width: 38ch; }

/* ==========================================================================
   Feature hero (index) — full-bleed cinematic photo, crossfading, dark→light
   ========================================================================== */
.hero--feature {
  min-height: min(90vh, 880px);
  display: flex;
  align-items: center;
  padding-bottom: clamp(4rem, 10vw, 7rem);
}
.hero--feature .hero__inner {
  grid-template-columns: 1fr;
  position: relative;
  z-index: 2;
  width: 100%;
}
.hero--feature .hero__copy {
  max-width: 40ch;
  text-shadow: 0 0 15px rgba(36, 39, 44, 1);
}
.hero--feature .hero__copy .lead {
  color: var(--ink-invert);
  text-shadow: 0 0 6px rgba(36, 39, 44, 1);
}
.hero--feature .hero__note span {
    color: var(--ink-invert);
    border-bottom: 1px solid var(--red);
    padding-bottom: .25em;
}

.hero__bg { position: absolute; inset: 0; z-index: 0; }
.hero__slide {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.4s ease;
  will-change: opacity;
}
.hero__slide.is-active { opacity: 1; }

.hero__scrim {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(20,22,26,0.92) 0%, rgba(20,22,26,0.64) 38%, rgba(20,22,26,0.20) 70%, rgba(20,22,26,0.04) 100%),
    linear-gradient(180deg, rgba(20,22,26,0.55) 0%, rgba(20,22,26,0) 22%);
}
/* Bottom fade to the light page sits above the photo on the feature hero */
.hero--feature .hero__fade {
  z-index: 1;
  height: 26%;
  background: linear-gradient(to bottom, rgba(250,247,245,0) 0%, var(--offwhite) 96%);
}

@media (max-width: 760px) {
  .hero--feature { min-height: 82vh; }
  .hero__scrim {
    background: linear-gradient(180deg, rgba(20,22,26,0.78) 0%, rgba(20,22,26,0.45) 45%, rgba(20,22,26,0.30) 100%);
  }
}
