/* =============================================================
   HZL Microsite — Section 9: Investment Case
   PART 1 — Hero scroll reveal (240vh sticky)
   PART 2 — 3D card deck scroll animation (420vh sticky)
   ============================================================= */

/* ── Section shell ───────────────────────────────────────────── */
.inv-case {
  position: relative;
  background: transparent;
  z-index: 1;
  /* On mobile this section is pulled OVER Strategic Priorities (SP margin-top
     -100vh) and stays on top to cover it during the card fly-off — but that
     made the whole (even faded) section eat taps meant for the SP arrows/CTA
     beneath. The section has no interactive elements except the cards, so make
     it transparent to pointer events and re-enable just the cards below. */
  pointer-events: none;
}

/* ════════════════════════════════════════════════════════════
   PART 1 — HERO SCROLL REVEAL
   150vh track: first 100vh = pure image,
   next 50vh = text fades in + image fades out
   ════════════════════════════════════════════════════════════ */
.inv-case__hero-track {
  position: relative;
  height: 150vh;
}

.inv-case__sticky-hero {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 72px;
}

/* Full-bleed background canvas — JS draws video frames, fades opacity 1 → 0 */
.inv-case__hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  user-select: none;
  will-change: opacity;
}

.inv-case__hero-overlay { display: none; }

/* Text — starts invisible; JS drives opacity + translateY */
.inv-case__hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 var(--gutter);
  opacity: 0;
  transform: translateY(14px);
}

.inv-case__eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: #7fb942;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin: 0 0 22px;
}

/* Title — photo texture bleeds through the letters */
.inv-case__title {
  font-family: var(--font-display);
  font-size: 35px;
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 auto;
  max-width: 1000px;
  text-transform: uppercase;
  color: #ffffff;
}


.inv-case__title-line {
  display: none;
}

/* ════════════════════════════════════════════════════════════
   PART 2 — 3D CARD DECK
   420vh scroll track, sticky 100vh viewport
   ════════════════════════════════════════════════════════════ */
.inv-case__track {
  position: relative;
  height: 420vh;
}

.inv-case__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: clip;   /* clips bars without breaking sticky children */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 52px;
  gap: 28px;
}

.inv-case__scene {
  position: relative;
  flex-shrink: 0;
}

/* Deck — perspective root; no preserve-3d; z-index controls paint order */
.inv-case__deck {
  position: relative;
  width: 480px;
  height: 500px;
  perspective: 1000px;
  perspective-origin: 50% 50%;
}

/* ── Cards ─────────────────────────────────────────────────── */
.inv-case__card {
  position: absolute;
  pointer-events: auto;   /* re-enable taps on the cards (section is none above) */
  left: 0;
  right: 0;
  min-height: 440px;
  height: auto;
  padding: 36px 44px 36px 40px;
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  background: linear-gradient(135deg, #0060a3 0%, #7fb942 100%);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(238, 242, 246, 0.08);
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow:
    0 28px 72px rgba(0, 0, 0, 0.65),
    inset 0 1px 0 rgba(238, 242, 246, 0.06);
}

/* Coloured top-line accent */
.inv-case__card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 1.5px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--cc, #0060a3) 35%,
    var(--cc, #0060a3) 65%,
    transparent
  );
  opacity: 0.6;
  border-radius: 0 0 2px 2px;
}

/* Watermark number */
.inv-case__card-num {
  display: block;
  font-family: var(--font-display);
  font-size: 80px;
  font-weight: 900;
  color: rgba(238, 242, 246, 0.04);
  line-height: 1;
  letter-spacing: -0.04em;
  margin: 0 0 14px;
  user-select: none;
  pointer-events: none;
}

/* Card title */
.inv-case__card-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: rgba(238, 242, 246, 0.95);
  margin: 0 0 16px;
  line-height: 1.25;
}

/* Card body */
.inv-case__card-body {
  font-family: var(--font-body);
  font-size: 18px;
  font-style: normal;
  line-height: 1.35;
  color: rgba(238, 242, 246, 0.78);
  margin: 0 0 20px;
  flex: 1;
}

/* Card-level CTA — shimmer pill from base.css, layout overrides only */
.inv-case__card-cta {
  align-self: flex-start;
  flex-shrink: 0;
}

/* ── Section CTA (removed — replaced by per-card CTAs) ───── */
.inv-case__cta { display: none; }

@keyframes invCtaShimmer {
  0%   { background-position: 0 0, 0%   50%; }
  50%  { background-position: 0 0, 100% 50%; }
  100% { background-position: 0 0, 0%   50%; }
}

.inv-case__read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.68em 1.6em;
  border-radius: 999px;
  border: 1.5px solid transparent;
  background:
    linear-gradient(var(--navy-900), var(--navy-900)) padding-box,
    linear-gradient(
      135deg,
      #0060a3  0%,
      #4fe0cf 22%,
      #ffffff 44%,
      #7fb942 66%,
      #4fe0cf 82%,
      #0060a3 100%
    ) border-box;
  background-size: 100%, 300% 300%;
  animation: invCtaShimmer 2.8s ease-in-out infinite;
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(238, 242, 246, 0.88);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.22s;
}

.inv-case__read-more:hover { color: #ffffff; }

.inv-case__read-more-arrow {
  display: inline-block;
  transition: transform 0.22s;
}

.inv-case__read-more:hover .inv-case__read-more-arrow {
  transform: translateX(5px);
}

/* ════════════════════════════════════════════════════════════
   GRADIENT BARS BACKGROUND  (wisedev component pattern)
   Populated by inv-case.js — same approach as casestudies.js
   ════════════════════════════════════════════════════════════ */
.inv-case__bars {
  position: absolute;
  inset: 0;
  display: flex;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

@keyframes icPulseBar {
  0%   { transform: scaleY(var(--bar-h)); }
  100% { transform: scaleY(calc(var(--bar-h) * 0.55)); }
}

.inv-case__bar {
  flex: 1 0 0;
  height: 100%;
  background: linear-gradient(
    to top,
    rgba(0,  96, 163, 0.55) 0%,
    rgba(127,185, 66, 0.18) 55%,
    transparent              100%
  );
  transform-origin: bottom;
  transform: scaleY(var(--bar-h, 0.5));
  animation: icPulseBar 2.8s ease-in-out infinite alternate;
  will-change: transform;
}

/* Top + bottom scrim to blend bars seamlessly */
.inv-case__bars-fade {
  position: absolute;
  left: 0; right: 0;
  z-index: 1;
  pointer-events: none;
}
.inv-case__bars-fade--top {
  top: 0;
  height: 140px;
  background: linear-gradient(to bottom, var(--navy-900) 0%, transparent 100%);
}
.inv-case__bars-fade--bottom {
  bottom: 0;
  height: 140px;
  background: linear-gradient(to top, var(--navy-900) 0%, transparent 100%);
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .inv-case__deck { width: 420px; }
}

@media (max-width: 768px) {
  .inv-case__hero-content { padding: 0 var(--gutter); }
  .inv-case__sticky       { gap: 28px; }
  .inv-case__deck         { width: 320px; height: auto; min-height: 420px; }
  .inv-case__card         { min-height: 360px; height: auto; padding: 24px 28px; }
  .inv-case__card-title   { font-size: 22px; }
  .inv-case__card-body    { font-size: 14px; }
  .inv-case__card-num     { font-size: 60px; margin-bottom: 10px; }
}

@media (max-width: 480px) {
  .inv-case__sticky       { gap: 20px; }
  .inv-case__deck         { width: 290px; height: auto; min-height: 380px; }
  .inv-case__card         { min-height: 320px; height: auto; padding: 20px 22px; }
  .inv-case__card-title   { font-size: 18px; }
  .inv-case__card-body    { font-size: 13px; }
  .inv-case__card-num     { font-size: 48px; }
}

/* ── Reduced motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .inv-case__read-more    { animation: none; }
  .inv-case__hero-bg      { will-change: auto; }
  .inv-case__card         { will-change: auto; }
}
