/* =============================================================
   HZL Microsite — Sections 15·16·17: ESG
   Scroll-driven crossfade — text slides up, photo fades
   p 0.00→0.28  Env holds
   p 0.28→0.42  Env→Social  (crossfade + slide)
   p 0.42→0.62  Social holds
   p 0.62→0.76  Social→Gov
   p 0.76→1.00  Gov holds
   ============================================================= */

/* ── Section shell ──────────────────────────────────────────── */
.esg {
  position: relative;
  background: #020c04;
  z-index: 0;
}

/* ── Scroll track ───────────────────────────────────────────── */
.esg__track {
  position: relative;
  height: 400vh;
}

/* ── Sticky viewport ────────────────────────────────────────── */
.esg__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  background: #020c04;
}

/* ── Scene container ────────────────────────────────────────── */
.esg__scene {
  position: absolute;
  inset: 0;
}

/* ════════════════════════════════════════════════════════════
   FACE BASE
   ════════════════════════════════════════════════════════════ */
.esg__face-l,
.esg__face-r {
  position: absolute;
  top: 0;
  height: 100%;
  will-change: opacity, transform;
  pointer-events: none;
}

/* ── Left content face ─────────────────────────────────────── */
.esg__face-l {
  left: 0;
  width: 45%;
  background: #020c04;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 1.4rem;
  padding:
    clamp(3rem, 8vh, 6rem)
    clamp(2rem, 5vw, 4.5rem)
    clamp(3rem, 8vh, 6rem)
    clamp(2rem, 6vw, 5.5rem);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

/* Accent stripe */
.esg__face-l::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 2px; height: 100%;
}
.esg__face-l--env::before    { background: rgba(127,185,66,0.35); }
.esg__face-l--social::before { background: rgba(79,224,207,0.35); }
.esg__face-l--gov::before    { background: rgba(77,143,212,0.35); }

/* ── Right photo face ──────────────────────────────────────── */
.esg__face-r {
  left: 45%;
  width: 55%;
  overflow: hidden;
}

/* ── Initial states (JS overrides on scroll) ────────────────── */
.esg__face-l--env    { opacity: 1;  transform: translateY(0);    }
.esg__face-r--env    { opacity: 1;  }
.esg__face-l--social { opacity: 0;  transform: translateY(28px); }
.esg__face-r--social { opacity: 0;  }
.esg__face-l--gov    { opacity: 0;  transform: translateY(28px); }
.esg__face-r--gov    { opacity: 0;  }

/* ════════════════════════════════════════════════════════════
   LEFT FACE CONTENT
   ════════════════════════════════════════════════════════════ */
.esg__tag { display: none; }

.esg__section-no {
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  line-height: 1;
}
.esg__face-l--env    .esg__section-no { color: #7fb942; }
.esg__face-l--social .esg__section-no { color: #4fe0cf; }
.esg__face-l--gov    .esg__section-no { color: #4d8fd4; }

.esg__tag-line {
  display: block;
  width: 26px; height: 1.5px;
  flex-shrink: 0;
}
.esg__face-l--env    .esg__tag-line { background: rgba(127,185,66,0.38); }
.esg__face-l--social .esg__tag-line { background: rgba(79,224,207,0.38); }
.esg__face-l--gov    .esg__tag-line { background: rgba(77,143,212,0.38); }

.esg__eyebrow {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #7fb942;
  line-height: 1;
}

.esg__heading-group {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  line-height: 1;
}

.esg__big-num { display: none; }

.esg__title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  line-height: 1;
  margin: 0;
}
.esg__face-l--env    .esg__title { color: #7fb942; }
.esg__face-l--social .esg__title { color: #4fe0cf; }
.esg__face-l--gov    .esg__title { color: #4d8fd4; }

.esg__subtitle {
  font-family: var(--font-display);
  font-size: 35px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: rgba(238,242,246,0.90);
  margin: 0;
  max-width: 420px;
}

.esg__body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  color: rgba(238,242,246,0.78);
  margin: 0;
  max-width: 400px;
}

/* ── Stats ──────────────────────────────────────────────────── */
.esg__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem 1.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(255,255,255,0.07);
  width: 100%;
}
.esg__stat { display: flex; flex-direction: column; }
.esg__stat-value {
  font-family: var(--font-display);
  font-size: 35px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
  display: block;
  margin-bottom: 5px;
}
.esg__face-l--env    .esg__stat-value { color: #7fb942; }
.esg__face-l--social .esg__stat-value { color: #4fe0cf; }
.esg__face-l--gov    .esg__stat-value { color: #4d8fd4; }
.esg__stat-sup { font-size: 0.52em; font-weight: 700; vertical-align: super; letter-spacing: 0; }
.esg__stat-label {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(238,242,246,0.70);
  line-height: 1.45;
  margin: 0;
}

/* ── CTA ────────────────────────────────────────────────────── */
@keyframes esgCtaShimmer {
  0%   { background-position: 0 0, 0%   50%; }
  50%  { background-position: 0 0, 100% 50%; }
  100% { background-position: 0 0, 0%   50%; }
}
.esg__cta {
  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(#020c04, #020c04) 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: esgCtaShimmer 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;
  flex-shrink: 0;
  align-self: flex-start;
  transition: color 0.22s;
  pointer-events: auto;
}
.esg__cta:hover {
  color: #ffffff;
  background:
    linear-gradient(rgba(0,96,163,0.18), rgba(0,96,163,0.18)) padding-box,
    linear-gradient(135deg, #0060a3 0%, #4fe0cf 22%, #ffffff 44%, #7fb942 66%, #4fe0cf 82%, #0060a3 100%) border-box;
  background-size: 100%, 300% 300%;
}
.esg__cta-arrow { display: inline-block; transition: transform 0.22s; }
.esg__cta:hover .esg__cta-arrow { transform: translateX(5px); }

/* ── Progress dots ──────────────────────────────────────────── */
.esg__progress {
  display: flex;
  align-items: center;
  gap: 6px;
  position: absolute;
  bottom: 2rem;
  left: clamp(2rem, 6vw, 5.5rem);
}
.esg__progress-dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: rgba(238,242,246,0.18);
  transition: background 0.3s, transform 0.3s;
}
.esg__face-l--env    .esg__progress-dot:nth-child(1) { background: #7fb942; transform: scale(1.5); }
.esg__face-l--social .esg__progress-dot:nth-child(2) { background: #4fe0cf; transform: scale(1.5); }
.esg__face-l--gov    .esg__progress-dot:nth-child(3) { background: #4d8fd4; transform: scale(1.5); }

/* ════════════════════════════════════════════════════════════
   RIGHT FACE — photo
   ════════════════════════════════════════════════════════════ */

/* Zoom in once, stop at zoomed state */
@keyframes esgPhotoZoom {
  from { transform: scale(1);    }
  to   { transform: scale(1.10); }
}

.esg__photo {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  transform-origin: center center;
  transform: scale(1);
  will-change: transform;
}

/* Trigger zoom when left face gets anim-in — stops at scale(1.10), never zooms out */
/*.esg__face-l--env.anim-in    ~ .esg__face-r--env    .esg__photo,
.esg__face-l--social.anim-in ~ .esg__face-r--social .esg__photo,
.esg__face-l--gov.anim-in    ~ .esg__face-r--gov    .esg__photo {
  animation: esgPhotoZoom 3.5s ease-in-out forwards;
}*/
.esg__photo-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, rgba(2,12,4,0.55) 0%, rgba(2,12,4,0.18) 22%, transparent 55%),
    linear-gradient(to top, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.18) 30%, transparent 55%);
  pointer-events: none;
}
.esg__face-r--social .esg__photo-scrim {
  background:
    linear-gradient(to right, rgba(2,12,4,0.55) 0%, rgba(2,12,4,0.18) 22%, transparent 55%),
    linear-gradient(to top, rgba(0,0,0,0.60) 0%, rgba(0,0,0,0.35) 35%, rgba(0,0,0,0.08) 60%, transparent 80%);
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 860px) {
  .esg__face-l { width: 48%; }
  .esg__face-r { left: 48%; width: 52%; }
  .esg__title  { font-size: 24px; }
  .esg__body   { font-size: 14px; }
}

@media (max-width: 640px) {
  .esg__scene { perspective: none; }
  .esg__face-l,
  .esg__face-r { left: 0; width: 100%; }
  .esg__face-l {
    top: 0; height: 46%;
    padding:
      calc(var(--utility-h,0px) + var(--bar-h,76px) + 1rem)
      1.75rem 1.25rem;
    gap: 0.9rem;
    justify-content: flex-start;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.05);
  }
  .esg__face-r { top: 46%; height: 54%; }
  .esg__title    { font-size: 22px; }
  .esg__subtitle { font-size: 13px; }
  .esg__body     { display: none; }
  .esg__stats    { gap: 0.8rem 1rem; }
  .esg__stat-value { font-size: 22px; }
  .esg__progress { bottom: 0.75rem; }
}

/* ── Social photo overlay ───────────────────────────────────── */
.social-photo-overlay {
  position: absolute;
  bottom: calc(var(--arc-nav-h,88px) + 2.5rem);
  left: 0; right: 0;
  z-index: 4;
  padding: 0 2rem;
  pointer-events: auto;
  transition: opacity 0.25s ease;
}
.social-photo-overlay__sub {
  font-family: var(--font-display);
  font-size: 35px;
  font-weight: 900;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: #ffffff;
  margin: 0 0 1rem;
  line-height: 1.1;
  text-shadow: 0 2px 16px rgba(0,0,0,0.70);
}
.social-photo-overlay__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.55em 1.4em;
  border-radius: 999px;
  border: 1.5px solid #4fe0cf;
  background: transparent;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #4fe0cf;
  text-decoration: none;
  transition: background 0.22s, color 0.22s, gap 0.22s;
}
.social-photo-overlay__cta:hover { background: #4fe0cf; color: #0a1628; gap: 0.85em; }

/* ── Social sub-tabs ────────────────────────────────────────── */
.social-tabs { display: flex; flex-direction: column; gap: 0.9rem; }
.social-tabs__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }

/* Shimmer sweep keyframe */
@keyframes socialTabShimmer {
  0%   { transform: translateX(-120%) skewX(-15deg); opacity: 1; }
  100% { transform: translateX(260%)  skewX(-15deg); opacity: 1; }
}

/* Idle border-glow pulse for non-active tabs */
@keyframes socialTabPulse {
  0%, 100% { border-color: rgba(255,255,255,0.08); box-shadow: none; }
  50%       { border-color: rgba(79,224,207,0.40);  box-shadow: 0 0 10px rgba(79,224,207,0.14), inset 0 0 6px rgba(79,224,207,0.06); }
}

/* Click ripple */
@keyframes socialTabRipple {
  0%   { transform: scale(0); opacity: 0.45; }
  100% { transform: scale(3.5); opacity: 0; }
}

.social-tabs__btn {
  position: relative;
  overflow: hidden;
  display: flex; flex-direction: column; gap: 0.22rem;
  padding: 0.65rem 0.85rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  text-align: left; cursor: pointer;
  transition: background 0.22s, border-color 0.22s, box-shadow 0.22s;
  /* No idle pulse: the looping teal border-glow on non-active tabs made it
     ambiguous which tab is active (the active tab also uses a teal border).
     Non-active tabs now stay static — only .is-active shows the teal state. */
}

/* Active tab — stop pulse, show solid teal border */
.social-tabs__btn.is-active {
  animation: none;
  background: rgba(79,224,207,0.12);
  border-color: rgba(79,224,207,0.55);
  box-shadow: 0 0 14px rgba(79,224,207,0.18), inset 0 0 8px rgba(79,224,207,0.08);
}

.social-tabs__btn:hover {
  background: rgba(79,224,207,0.07);
  border-color: rgba(79,224,207,0.30);
  box-shadow: 0 0 10px rgba(79,224,207,0.12);
  animation: none;
}

/* Shimmer streak — runs once when social panel enters */
.social-tabs__btn::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 38%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(79,224,207,0.22), transparent);
  transform: translateX(-120%) skewX(-15deg);
  pointer-events: none;
}
.esg__face-l--social.anim-in .social-tabs__grid .social-tabs__btn:nth-child(1)::before {
  animation: socialTabShimmer 0.75s ease 0.55s forwards;
}
.esg__face-l--social.anim-in .social-tabs__grid .social-tabs__btn:nth-child(2)::before {
  animation: socialTabShimmer 0.75s ease 0.75s forwards;
}
.esg__face-l--social.anim-in .social-tabs__grid .social-tabs__btn:nth-child(3)::before {
  animation: socialTabShimmer 0.75s ease 0.95s forwards;
}
.esg__face-l--social.anim-in .social-tabs__grid .social-tabs__btn:nth-child(4)::before {
  animation: socialTabShimmer 0.75s ease 1.15s forwards;
}

/* Click ripple element (injected by JS) */
.social-tab-ripple {
  position: absolute;
  border-radius: 50%;
  width: 60px; height: 60px;
  background: rgba(79,224,207,0.30);
  pointer-events: none;
  transform: scale(0);
  animation: socialTabRipple 0.55s ease-out forwards;
  margin-left: -30px;
  margin-top: -30px;
}

.social-tabs__btn-num {
  font-family: var(--font-display);
  font-size: 0.55rem; font-weight: 800;
  letter-spacing: 0.20em; color: #4fe0cf; line-height: 1;
}
.social-tabs__btn-name {
  font-family: var(--font-display);
  font-size: clamp(11px,0.85vw,13px); font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: rgba(238,242,246,0.85); line-height: 1.2;
}

/* ════════════════════════════════════════════════════════════
   LEFT TEXT ANIMATIONS
   ════════════════════════════════════════════════════════════ */

/* 1. Base slide-up fade (existing, enhanced) */
@keyframes esgTextIn {
  from { opacity: 0; transform: translateY(28px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

/* 2. Accent stripe: fills top→bottom when panel enters */
@keyframes esgStripeIn {
  from { transform: scaleY(0); transform-origin: top center; }
  to   { transform: scaleY(1); transform-origin: top center; }
}

/* 3. Eyebrow shimmer sweep — light streak across label text */
@keyframes esgEyebrowShimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  300% center; }
}

/* 4. Subtitle word-scale pulse */
@keyframes esgSubtitleIn {
  0%   { opacity: 0; transform: translateX(-18px); letter-spacing: -0.06em; }
  60%  { letter-spacing: -0.015em; }
  100% { opacity: 1; transform: translateX(0);     letter-spacing: -0.02em; }
}

/* 5. CTA breathe glow */
@keyframes esgCtaBreathe {
  0%, 100% { box-shadow: 0 0 0px rgba(79,224,207,0);   }
  50%       { box-shadow: 0 0 18px rgba(79,224,207,0.28); }
}

/* 6. Stats count-rise */
@keyframes esgStatIn {
  from { opacity: 0; transform: translateY(16px) scale(0.92); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

/* ── Accent stripe animation ── */
.esg__face-l::before {
  transform: scaleY(0);
  transform-origin: top center;
}
.esg__face-l.anim-in::before {
  animation: esgStripeIn 0.7s cubic-bezier(0.22,1,0.36,1) forwards 0.05s;
}

/* ── Eyebrow shimmer on entry ── */
.esg__face-l--env.anim-in    .esg__eyebrow,
.esg__face-l--social.anim-in .esg__eyebrow,
.esg__face-l--gov.anim-in    .esg__eyebrow {
  background: linear-gradient(
    90deg,
    currentColor 20%,
    rgba(255,255,255,0.85) 50%,
    currentColor 80%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: esgEyebrowShimmer 1.4s ease 0.1s forwards;
}

/* ── Children start hidden ── */
.esg__face-l .esg__heading-group,
.esg__face-l .esg__subtitle,
.esg__face-l .esg__body,
.esg__face-l .esg__stats,
.esg__face-l .social-tabs,
.esg__face-l .esg__cta,
.esg__face-l .esg__progress {
  opacity: 0;
  transform: translateY(24px);
}

/* ── Staggered reveal on anim-in ── */
.esg__face-l.anim-in .esg__heading-group {
  animation: esgTextIn 0.60s cubic-bezier(0.22,1,0.36,1) forwards 0.10s;
}
.esg__face-l.anim-in .esg__subtitle {
  animation: esgSubtitleIn 0.65s cubic-bezier(0.22,1,0.36,1) forwards 0.22s;
}
.esg__face-l.anim-in .esg__body {
  animation: esgTextIn 0.55s cubic-bezier(0.22,1,0.36,1) forwards 0.34s;
}
.esg__face-l.anim-in .esg__stats {
  animation: esgStatIn  0.55s cubic-bezier(0.22,1,0.36,1) forwards 0.44s;
}
.esg__face-l.anim-in .social-tabs {
  animation: esgTextIn  0.55s cubic-bezier(0.22,1,0.36,1) forwards 0.44s;
}
.esg__face-l.anim-in .esg__cta {
  animation: esgTextIn    0.55s cubic-bezier(0.22,1,0.36,1) forwards 0.54s,
             esgCtaBreathe 2.6s ease-in-out                  infinite 1.2s;
}
.esg__face-l.anim-in .esg__progress {
  animation: esgTextIn 0.50s cubic-bezier(0.22,1,0.36,1) forwards 0.62s;
}

@media (prefers-reduced-motion: reduce) {
  .esg__face-l, .esg__face-r { will-change: auto; transition: none; }
  .esg__face-l .esg__heading-group,
  .esg__face-l .esg__subtitle,
  .esg__face-l .esg__body,
  .esg__face-l .esg__stats,
  .esg__face-l .social-tabs,
  .esg__face-l .esg__cta,
  .esg__face-l .esg__progress { opacity: 1; transform: none; }
}
