/* ── Cubiq Sector Hero ──────────────────────────────────────────────────────
   Layout mirrors the Cubiq Hero Glow element exactly. The only difference:
   a looping PNG-sequence video fills the background instead of the aurora.
   ─────────────────────────────────────────────────────────────────────────── */

.csh, .csh *, .csh *::before, .csh *::after { box-sizing: border-box; }

.csh {
  --c1: 20, 171, 218;
  --c2: 3, 139, 241;
  --c3: 114, 89, 191;

  /* Aura anchor — JS orbits this gently. Starts near the animation focal point. */
  --mx: 68%;
  --my: 50%;
  /* Cursor parallax — JS eases these from mouse position. */
  --px: 0;
  --py: 0;

  position: relative;
  overflow: hidden;
  isolation: isolate;
  min-height: clamp(560px, 92vh, 980px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(140px, 20vh, 240px) 0 clamp(80px, 10vh, 140px);
  background: radial-gradient(120% 90% at 50% 8%, #0a1845 0%, #020b31 58%);
  font-family: 'Open Sauce One', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: #eaf1f8;
  text-align: left;
}

/* ── Canvas: full-bleed background ──────────────────────────────────────────
   Starts invisible — JS pre-decodes all frames in the background, then fades
   the canvas in when ready. The section's CSS gradient shows through during
   load so there's no buffering look. */
.csh-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.csh--ready .csh-canvas {
  opacity: 1;
}

/* ── Ambient colour aura ─────────────────────────────────────────────────────
   Three brand-coloured blobs orbit gently on their own; the mouse adds a
   subtle depth-parallax shift. More subdued than the Hero Glow version —
   the canvas animation is the focal point; this just lifts the flatness.
   Overscanned so soft blob edges never reveal a hard clip. */
.csh-aura {
  position: absolute;
  inset: -15%;
  z-index: 1;
  filter: blur(36px) saturate(120%);
  transform: translateZ(0);
  backface-visibility: hidden;
  pointer-events: none;
  /* Fade the aura out before it reaches the section's bottom edge so
     overflow:hidden gives a soft dissolve rather than a hard clip.
     The section bottom sits at ~77% of this overscanned div's height. */
  -webkit-mask-image: linear-gradient(to bottom, black 55%, transparent 78%);
          mask-image: linear-gradient(to bottom, black 55%, transparent 78%);
}

.csh-aura-l1 {
  position: absolute;
  inset: 0;
  background: radial-gradient(40% 50% at var(--mx) var(--my),
    rgba(var(--c1), .22), transparent 68%);
  transform: translate(calc(var(--px) * -3%), calc(var(--py) * -3%));
}
.csh-aura-l2 {
  position: absolute;
  inset: 0;
  background: radial-gradient(36% 46% at calc(var(--mx) - 12%) calc(var(--my) + 14%),
    rgba(var(--c2), .18), transparent 70%);
  transform: translate(calc(var(--px) * -2%), calc(var(--py) * -2%));
}
.csh-aura-l3 {
  position: absolute;
  inset: 0;
  background: radial-gradient(42% 50% at calc(var(--mx) + 14%) calc(var(--my) + 6%),
    rgba(var(--c3), .16), transparent 72%);
  transform: translate(calc(var(--px) * -1%), calc(var(--py) * -1%));
}

/* Slow ambient spin — keeps the glow alive without demanding attention */
.csh-aura::before {
  content: '';
  position: absolute;
  inset: -30%;
  background: conic-gradient(
    from 0deg,
    rgba(var(--c1), 0) 0%,
    rgba(var(--c2), .10) 28%,
    rgba(var(--c3), .08) 55%,
    rgba(var(--c1), .06) 78%,
    rgba(var(--c1), 0) 100%
  );
  filter: blur(64px);
  opacity: .55;
  animation: csh-aura-spin 36s linear infinite;
}

@keyframes csh-aura-spin { to { transform: rotate(360deg); } }

/* Freeze while page is hidden (set by JS) */
.csh-paused .csh-aura::before { animation-play-state: paused; }

/* Film grain — very faint overlay gives the glow a premium glass quality */
.csh-grain {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: .032;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Dark overlay ────────────────────────────────────────────────────────────
   Vignette + top/bottom fades so the heading is always legible over any
   animation. Sits above the aura, below content. */
.csh-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    radial-gradient(ellipse 100% 100% at 50% 50%, rgba(2,11,49,.25) 0%, rgba(2,11,49,.60) 100%),
    linear-gradient(to bottom, rgba(2,11,49,.55) 0%, transparent 30%, transparent 70%, rgba(2,11,49,.55) 100%);
}

/* ── Content ─────────────────────────────────────────────────────────────────
   Same max-width and padding as .cqh-inner in the Hero Glow plugin. */
.csh-inner {
  position: relative;
  z-index: 4;
  width: 100%;
  max-width: 92rem;
  margin: 0 auto;
  padding: 0 20px;
}
@media (min-width: 1536px) {
  .csh-inner { padding: 0; }
}

/* ── Eyebrow ─────────────────────────────────────────────────────────────── */
.csh-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0;
  font-size: 12px;
  letter-spacing: .3em;
  text-transform: uppercase;
  font-weight: 600;
  color: rgba(120, 200, 240, .85);
  margin-bottom: 22px;
}

.csh-eyebrow-img {
  height: 26px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
  margin-right: 12px;
}

/* Thin vertical rule between the icon and the sector name */
.csh-eyebrow-divider {
  display: inline-block;
  width: 1px;
  height: 14px;
  background: rgba(120, 200, 240, .35);
  margin-right: 12px;
}

/* ── Heading ─────────────────────────────────────────────────────────────── */
.csh-title {
  margin: 0;
  max-width: 24ch;
  font-size: clamp(46px, 6.8vw, 120px);
  /* Metallic white gradient — matches .cqh-title */
  background: linear-gradient(180deg, #ffffff 0%, #c4d2e6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  /* Shared display-heading treatment — matches .cqh-title in cubiq-hero-glow.
     Grep "display-heading treatment" to find every module using it. */
  font-weight: 300;
  line-height: 1.06;
  letter-spacing: -.032em;
  /* background-clip:text cuts the gradient at the box edge, and 1.06 leading
     leaves the last line's descenders outside it. */
  padding-bottom: .13em;
}

/* *Asterisk-wrapped* words render as the three-colour brand gradient */
.csh-hl {
  background: linear-gradient(100deg, rgb(var(--c1)) 0%, rgb(var(--c2)) 52%, rgb(var(--c3)) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ── Body / sub ──────────────────────────────────────────────────────────── */
.csh-sub {
  margin: clamp(20px, 2.5vw, 30px) 0 0;
  max-width: 540px;
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.6;
  font-weight: 400;
  color: rgba(206, 224, 245, .72);
}

/* ── CTAs ────────────────────────────────────────────────────────────────── */
.csh-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: flex-start;
  margin-top: clamp(32px, 4vw, 46px);
}

.csh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 32px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .01em;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform .28s cubic-bezier(.2,.7,.2,1),
    box-shadow .28s ease,
    background .28s ease,
    border-color .28s ease;
}

/* Primary — brand gradient pill */
.csh-btn--gradient {
  color: #02101f;
  background: linear-gradient(100deg, rgb(var(--c1)) 0%, rgb(var(--c2)) 55%, rgb(var(--c3)) 120%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.35),
    0 16px 40px -16px rgba(var(--c2), .8);
}
.csh-btn--gradient:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.45),
    0 22px 52px -16px rgba(var(--c2), .95);
}

/* Secondary — frosted glass pill */
.csh-btn--glass {
  color: #eaf1f8;
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.04));
  -webkit-backdrop-filter: blur(16px) saturate(140%);
          backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid rgba(160, 200, 235, .22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}
.csh-btn--glass:hover {
  transform: translateY(-2px);
  background: linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,.07));
  border-color: rgba(160, 200, 235, .4);
}

/* ── Alignment: centre variant ───────────────────────────────────────────── */
.csh--center { text-align: center; }
.csh--center .csh-eyebrow { display: flex; justify-content: center; }
.csh--center .csh-title   { margin-left: auto; margin-right: auto; }
.csh--center .csh-sub     { margin-left: auto; margin-right: auto; }
.csh--center .csh-ctas    { justify-content: center; }

/* ── Stats row ───────────────────────────────────────────────────────────────
   Four glassmorphic cards spanning the full content width. Each card receives
   a slightly different translateY from JS on scroll for a parallax depth effect.
   ─────────────────────────────────────────────────────────────────────────── */
.csh-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 0 0 clamp(60px, 9vh, 100px);
  margin-top: clamp(100px, 16vh, 200px);
}

/* Glassmorphic card — flex column so the label is always pinned to the bottom */
.csh-stat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: clamp(190px, 20vw, 260px);
  padding: clamp(28px, 3vw, 40px) clamp(24px, 2.5vw, 36px);
  border-radius: 20px;
  /* Navy-tinted glass — matches the reference image's deeper blue tone */
  background: rgba(8, 18, 58, 0.58);
  -webkit-backdrop-filter: blur(24px) saturate(130%);
          backdrop-filter: blur(24px) saturate(130%);
  border: 1px solid rgba(255, 255, 255, .09);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .10),
    inset 0 -1px 0 rgba(0, 0, 0, .10),
    0 12px 48px rgba(2, 11, 49, .55);
  /* JS drives translateY for the convergence parallax */
  will-change: transform, translate;
  /* translate is a separate CSS property — it composes with the JS-driven
     transform so hover lift and parallax offset both apply simultaneously */
  transition: translate .4s cubic-bezier(.2,.7,.2,1), box-shadow .4s ease;
}

/* Subtle per-card brand-tint on the top edge */
.csh-stat-card:nth-child(1) { border-top-color: rgba(var(--c1), .30); }
.csh-stat-card:nth-child(2) { border-top-color: rgba(var(--c2), .28); }
.csh-stat-card:nth-child(3) { border-top-color: rgba(var(--c3), .25); }
.csh-stat-card:nth-child(4) { border-top-color: rgba(var(--c1), .22); }

@media (hover: hover) {
  .csh-stat-card:hover {
    translate: 0 -6px;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .18),
      inset 0 -1px 0 rgba(0, 0, 0, .10),
      0 28px 64px -20px rgba(2, 11, 49, .80),
      0 0 0 1px rgba(20, 171, 218, .12);
  }
}

/* Initial translateY offsets — must match JS INIT_OFFSETS [52,96,38,78].
   Set in CSS so the cards paint in the correct position on first frame,
   before JS's requestAnimationFrame fires. JS overrides via inline style. */
.csh-stats .csh-stat-card:nth-child(1) { transform: translateY(52px); }
.csh-stats .csh-stat-card:nth-child(2) { transform: translateY(96px); }
.csh-stats .csh-stat-card:nth-child(3) { transform: translateY(38px); }
.csh-stats .csh-stat-card:nth-child(4) { transform: translateY(78px); }

/* Value wrapper — number + suffix inline */
.csh-stat-value {
  display: block;
  line-height: 1;
  letter-spacing: -.03em;
  color: #fff;
}

/* The big number — very light weight, full focus on the figure */
.csh-stat-num {
  font-size: clamp(52px, 6.5vw, 92px);
  font-weight: 200;
  letter-spacing: -.035em;
}

/* Suffix (%, days, +, etc.) — noticeably smaller, same baseline */
.csh-stat-suffix {
  font-size: clamp(22px, 2.8vw, 40px);
  font-weight: 300;
  letter-spacing: -.01em;
  vertical-align: baseline;
  margin-left: 3px;
  opacity: .9;
}

/* Label pinned to bottom by space-between — already has generous gap from the number */
.csh-stat-label {
  display: block;
  font-size: clamp(13px, 1vw, 15px);
  font-weight: 400;
  line-height: 1.55;
  color: rgba(234, 241, 248, .50);
  max-width: 22ch;
}

/* ── Statement / SEO text ────────────────────────────────────────────────────
   Long-form editorial block below the stats. Sits in normal flow so it
   elongates the section and gives the scroll-scrub animation more runway.
   ─────────────────────────────────────────────────────────────────────────── */
.csh-statement {
  padding: clamp(72px, 11vh, 140px) 0 clamp(80px, 12vh, 140px);
  max-width: 860px;
}

.csh-statement-text,
.csh-statement-text p {
  margin: 0 0 1.2em;
  font-size: clamp(17px, 1.45vw, 21px);
  line-height: 1.75;
  font-weight: 400;
  color: rgba(206, 224, 245, .60);
  letter-spacing: .005em;
}
.csh-statement-text p:last-child { margin-bottom: 0; }

/* Bold text — white by default */
.csh-statement-text strong,
.csh-statement-text b {
  font-weight: 600;
  color: #fff;
}

/* Gradient variant — toggled via ACF field */
.csh-statement--bold-gradient .csh-statement-text strong,
.csh-statement--bold-gradient .csh-statement-text b {
  background: linear-gradient(100deg, rgb(var(--c1)) 0%, rgb(var(--c2)) 55%, rgb(var(--c3)) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  font-weight: 600;
}

/* ── Reduced motion ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .csh-btn        { transition: none; }
  .csh-stat-card  { will-change: auto; transform: none !important; translate: none !important; transition: none; }
  .csh-aura::before { animation: none; }
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .csh-title    { max-width: none; }
  .csh-ctas     { flex-direction: column; align-items: flex-start; }
  .csh--center .csh-ctas { align-items: center; }
}

@media (max-width: 900px) {
  .csh-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .csh-stats    { grid-template-columns: 1fr; gap: 12px; }
  /* Parallax disabled on small touch screens — cards sit in natural flow */
  .csh-stat-card { will-change: auto; transform: none !important; translate: none !important; transition: none; }
  .csh-stat-num  { font-size: clamp(48px, 14vw, 72px); }
}
