/* ==========================================================================
   AD PHASE — Hero 3D curved carousel
   Replaces the rocket + floating cards. Uses the theme tokens only
   (themes.css), so dark/light modes and brand colours follow automatically.
   ========================================================================== */

/* ---- hero becomes a column: copy on top, carousel underneath ----------- */
.hero{
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: var(--sp-4);
  min-height: 0;                         /* no forced 100vh → no empty bands above/below the content */
  justify-content: flex-start;
  padding-top: calc(var(--header-h) + var(--sp-4));
  padding-bottom: var(--sp-3);
}
.hero-title{ font-size: clamp(2.1rem, 1.35rem + 2.9vw, 3.4rem); line-height: 1.2; max-width: none; margin-bottom: var(--sp-3); }   /* two lines on desktop */
.hero-lead{ font-size: var(--fs-body); max-width: 62ch; margin-bottom: var(--sp-4); }
.hero-scroll-cue{ display:none; }

/* ---- stage ------------------------------------------------------------- */
.hero-carousel{
  --cw: 200px;                 /* card width  */
  --ch: 240px;                 /* card height */
  position: relative;
  z-index: 8;
  width: 100%;
  height: calc(var(--ch) + 110px);   /* extra room so the edge mask never clips tilted cards */
  margin-block: -22px;
  perspective: 1700px;
  perspective-origin: 50% 38%;
  cursor: grab;
  touch-action: pan-y;
  user-select: none; -webkit-user-select: none;
  outline: none;
  /* soft fade at both screen edges */
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 9%, #000 91%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 9%, #000 91%, transparent 100%);
}
.hero-carousel.is-dragging{ cursor: grabbing; }
.hero-carousel:focus-visible{ box-shadow: 0 0 0 2px var(--brand-line) inset; border-radius: var(--r-md); }

.hcar-track{
  position:absolute; left:50%; top:50%;      /* physical left: direction-independent */
  width:0; height:0;
  transform-style: preserve-3d;
}

/* ---- card base --------------------------------------------------------- */
.hcar-card{
  position:absolute;
  left: calc(var(--cw) / -2);
  top:  calc(var(--ch) / -2);
  width: var(--cw); height: var(--ch);
  padding: 1rem;
  display:flex; flex-direction:column; justify-content:space-between; gap:.6rem;
  overflow:hidden;
  border-radius: var(--r-md);
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-3), inset 0 1px 0 var(--glass-bg-2);
  color: var(--ink);
  font-size: var(--fs-micro);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  will-change: transform, opacity;
}
.hcar-card img{ -webkit-user-drag:none; user-select:none; pointer-events:none; }
.hcar-card .hc-label{ display:block; color:var(--ink-soft); font-weight:700; font-size: 0.85rem; }
.hcar-card .hc-sub{ display:block; color:var(--ink-faint); font-size: 0.78rem; font-weight:500; margin-top:.15rem; }
.hcar-card .hc-top{ display:flex; align-items:center; justify-content:space-between; gap:.6rem; }
.hcar-card .hc-pill{ font-family:var(--font-display); font-weight:700; font-size: 0.78rem; padding:.15em .55em; border-radius:var(--r-pill); direction:ltr; }
.hcar-card .hc-pill.up{ color:var(--brand-strong); background:var(--brand-wash); }
.hcar-card .hc-big{ font-family:var(--font-display); font-weight:800; font-size: 1.75rem; line-height:1; letter-spacing:-.03em; color:var(--ink); direction:ltr; display:flex; align-items:baseline; gap:.3em; }
.hcar-card .hc-big small{ font-size: 0.78rem; font-weight:600; letter-spacing:0; color:var(--ink-faint); }

/* data-viz pieces, scaled up for the larger card */
.hcar-card .hc-spark{ width:100%; height:92px; }
.hcar-card .hc-bars{ height:92px; gap:7px; margin-top:0; }
.hcar-card .hc-bars i{ flex:1; width:auto; }
.hcar-card .hc-meter{ width:100%; height:9px; margin-top:0; }
.hcar-card .hc-ring{ width:84px; margin-inline:auto; }
.hcar-card .hc-ring b{ font-size: 1.25rem; }
.hcar-card .hc-dot{ display:inline-block; vertical-align:middle; }

/* ---- variants ---------------------------------------------------------- */
/* photo (real image, caption chip) */
.hcar-photo{ padding:0; justify-content:flex-end; }
.hcar-photo > img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.hcar-photo::after{ content:""; position:absolute; inset:0; background:linear-gradient(to top, rgba(13,23,18,.55), transparent 55%); }
.hcar-chip{
  position:relative; z-index:1; margin:.6rem;
  display:flex; align-items:center; justify-content:space-between; gap:.6rem;
  padding:.6rem .75rem; border-radius:var(--r-sm);
  background: var(--bg-elevated); border:1px solid var(--glass-border);
}
.hcar-chip b{ font-family:var(--font-display); font-weight:800; color:var(--brand-strong); direction:ltr; }

/* 3D service illustration (transparent webp) */
.hcar-art{
  padding:.9rem;
  background:
    radial-gradient(80% 60% at 50% 38%, var(--brand-wash), transparent 70%),
    var(--bg-elevated);
}
.hcar-art > img{ width:100%; height:0; flex:1; object-fit:contain; filter: drop-shadow(0 14px 22px rgba(0,0,0,.28)); }
.hcar-art .hc-label{ text-align:center; color:var(--ink); }

/* deep-green statement card (mirrors the reference's black card) */
.hcar-deep{
  background: var(--brand-deep);
  border-color: var(--brand-line);
  justify-content:center;
}
.hcar-deep p{ margin:0; font-size: 1.125rem; line-height:1.5; font-weight:700; color:var(--ink); }
.hcar-deep p span{ color:var(--ink-soft); font-weight:600; }
.hcar-deep .hc-dot{ width:12px; height:12px; margin-inline:.15em; }

/* lime accent card — the one loud card in the loop */
.hcar-lime{
  background: var(--brand);
  border-color: transparent;
  color: var(--on-brand);
  justify-content:space-between;
  box-shadow: var(--shadow-3), var(--brand-glow-sm);
}
.hcar-lime .hc-big{ color:var(--on-brand); font-size: 3.25rem; }
.hcar-lime p{ margin:0; font-weight:700; font-size: 1.0625rem; line-height:1.5; color:var(--on-brand); }

/* glass call-to-action card */
.hcar-glass{
  align-items:center; justify-content:center; text-align:center; gap:.7rem;
  background: linear-gradient(160deg, var(--glass-bg-2), var(--glass-bg));
  -webkit-backdrop-filter: blur(var(--glass-blur)); backdrop-filter: blur(var(--glass-blur));
  border-color: var(--brand-line);
}
.hcar-plus{ width:44px; height:44px; border-radius:50%; display:grid; place-items:center; background:var(--brand); color:var(--on-brand); font-size: 1.5rem; font-weight:600; line-height:1; }
.hcar-glass b{ font-family:var(--font-display); font-size:1.25rem; font-weight:800; }

/* score ring card */
.hcar-score{ align-items:center; justify-content:center; text-align:center; gap:.9rem; }

/* fade the whole rig in once the hero entrance fires */
.hero-carousel{ opacity:0; transition: opacity 1.1s var(--ease-out) .55s; }
.hero-ready .hero-carousel{ opacity:1; }

/* ---- responsive -------------------------------------------------------- */
@media (max-width: 760px){
  .hero{ gap: var(--sp-5); }
  .hero-carousel{ --cw:150px; --ch:190px; perspective:1100px; }
  .hcar-card{ padding:.75rem; }
  .hcar-card .hc-big{ font-size: 1.5rem; }
  .hcar-lime .hc-big{ font-size: 2.5rem; }
  .hcar-card .hc-ring{ width:62px; }
  .hcar-card .hc-spark, .hcar-card .hc-bars{ height:62px; }
  .hcar-deep p{ font-size: 0.95rem; }
  .hcar-lime p{ font-size: 0.78rem; }
}
@media (prefers-reduced-motion: reduce){
  .hero-carousel{ opacity:1 !important; transition:none; }
}

/* ---- rocket: sits behind the carousel (z 8) and the copy/buttons (z 10) ---- */
.hero-rocket-layer{
  z-index: 2;
  /* follows the pointer clearly (was ~6px, now up to ~40px) + a slight tilt toward it */
  transform:
    translate3d(calc(var(--fx, 0px) + var(--par-x) * 1),
                calc(var(--fy, 0px) + var(--par-y) * 1 + var(--scroll) * -30px), 0)
    rotate(var(--rocket-tilt, 0deg));
}
@media (max-width: 760px){
  .hero-rocket-layer{ width: 70vw; opacity: .55; }
}
