/* ============================================================
   AMREF Health Africa — 2025 Impact Microsite
   Step 1: HTML structure + CSS layout, desktop, no animation
   ============================================================ */

/* ---- Font: Neue Kabel via Adobe Fonts (Typekit) ---- */

/* ---- Custom properties ---- */
:root {
  /* Brand colours */
  --clr-red: #cf2e2e;
  --clr-white: #fefefe;
  --clr-black: #0e0e0e;

  /* Story-category colours */
  --clr-yellow: #ffad3b; /* Healthworkers & Training  */
  --clr-mauve: #94577d; /* Healthy Women             */
  --clr-blue: #a3cff2; /* Water & Disease Prevention*/
  --clr-green: #8fb087; /* Pioneering Healthcare     */
  --clr-orange: #d4603a; /* Social Determinants       */

  /* Typography */
  --font-display: 'neue-kabel', 'Neue Kabel', 'Arial Black', sans-serif;
  --font-body: 'libre-franklin', system-ui, -apple-system, sans-serif;

  /* Font sizes */
  /* Desktop — font sizes */
  --fs-h1-desktop: 120px;
  --fs-h2-desktop: 80px;
  --fs-h3-desktop: 56px;
  --fs-h4-desktop: 24px;
  --fs-cta-desktop: 16px;
  --fs-menu-desktop: 68px;
  --fs-story-copy-desktop: 24px;
  --fs-body-copy-desktop: 16px;

  /* Desktop — line heights */
  --lh-h1-desktop: 100px;
  --lh-h2-desktop: 70px;
  --lh-h3-desktop: 50px;
  --lh-h4-desktop: 24px;
  --lh-cta-desktop: 20px;
  --lh-menu-desktop: 68px;
  --lh-story-copy-desktop: 34px;
  --lh-body-copy-desktop: 22px;

  /* Mobile — font sizes */
  --fs-h1-mobile: 50px;
  --fs-h2-mobile: 36px;
  --fs-h3-mobile: 30px;
  --fs-h4-mobile: 16px;
  --fs-cta-mobile: 20px;
  --fs-menu-mobile: 32px;
  --fs-story-copy-mobile: 18px;
  --fs-body-copy-mobile: 14px;

  /* Mobile — line heights */
  --lh-h1-mobile: 42px;
  --lh-h2-mobile: 32px;
  --lh-h3-mobile: 26px;
  --lh-h4-mobile: 14px;
  --lh-cta-mobile: 14px;
  --lh-menu-mobile: 28px;
  --lh-story-copy-mobile: 26px;
  --lh-body-copy-mobile: 20px;

  /* Layout */
  --max-w: clamp(1600px, 100vw, 2200px);
  --gutter: 48px; /* clamp(24px, 3vw, 72px) */
  --space-section: clamp(72px, 7vw, 168px);
  --space-gap-md: clamp(24px, 2vw, 48px);
  --space-gap-lg: clamp(96px, 10vw, 220px);
  --space-gap-sm: clamp(16px, 1.5vw, 32px);
  --space-offset-md: clamp(40px, 4vw, 96px);
  --space-offset-lg: clamp(56px, 5vw, 120px);
  --space-overlap-lg: clamp(-96px, -4vw, -40px);

  /* The brand tilt angle */
  --tilt: -14.5deg;

  /* Utility */
  --viewport-minus-nav: calc(100svh - var(--nav-h, 0px));
}

/* ---- Reset ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--clr-black);
  background: var(--clr-white);
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
.h1,
.h2,
.h3,
.h4,
.cta,
.menu {
  font-family: var(--font-display);
  font-weight: 900;
  color: var(--clr-black);
  text-transform: uppercase;
}

/* Desktop type styles */
h1,
.h1 {
  font-size: clamp(64px, 7.5vw, 150px);
  line-height: clamp(54px, 6.25vw, 125px);
  letter-spacing: -1px;
}
h2,
.h2 {
  font-size: clamp(44px, 5vw, 104px);
  line-height: clamp(38px, 4.375vw, 91px);
  letter-spacing: -1px;
}
h3,
.h3 {
  font-size: clamp(32px, 3.5vw, 72px);
  line-height: clamp(28px, 3.125vw, 64px);
  letter-spacing: -0.5px;
}
h4,
.h4 {
  font-size: clamp(16px, 1.5vw, 32px);
  line-height: clamp(16px, 1.5vw, 32px);
  letter-spacing: -0.2px;
}
.cta {
  font-size: clamp(14px, 1vw, 22px);
  line-height: clamp(18px, 1.25vw, 28px);
}
.menu {
  font-size: clamp(40px, 4.25vw, 88px);
  line-height: clamp(40px, 4.25vw, 88px);
  letter-spacing: -1px;
}
.story-copy {
  font-size: clamp(20px, 1.5vw, 32px);
  line-height: clamp(28px, 2.125vw, 44px);
}
.body-copy {
  font-size: clamp(14px, 1vw, 22px);
  line-height: clamp(20px, 1.375vw, 30px);
}

/* Mobile type styles */
@media (max-width: 768px) {
  h1,
  .h1 {
    font-size: var(--fs-h1-mobile);
    line-height: var(--lh-h1-mobile);
    letter-spacing: -0.5px;
  }
  h2,
  .h2 {
    font-size: var(--fs-h2-mobile);
    line-height: var(--lh-h2-mobile);
    letter-spacing: -0.5px;
  }
  h3,
  .h3 {
    font-size: var(--fs-h3-mobile);
    line-height: var(--lh-h3-mobile);
    letter-spacing: -0.2px;
  }
  h4,
  .h4 {
    font-size: var(--fs-h4-mobile);
    line-height: var(--lh-h4-mobile);
    letter-spacing: -0.5px;
  }
  .cta {
    font-size: var(--fs-cta-mobile);
    line-height: var(--lh-cta-mobile);
    letter-spacing: -0.2px;
  }
  .menu {
    font-size: var(--fs-menu-mobile);
    line-height: var(--lh-menu-mobile);
    letter-spacing: -1px;
  }
  .story-copy {
    font-size: var(--fs-story-copy-mobile);
    line-height: var(--lh-story-copy-mobile);
  }
  .body-copy {
    font-size: var(--fs-body-copy-mobile);
    line-height: var(--lh-body-copy-mobile);
  }
}

img,
video {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  cursor: pointer;
  font-family: inherit;
}

/* ---- Utility: centred max-width container ---- */
.wrap {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---- Utility: visually hidden (accessible text) ---- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Utility: the Amref tilt ---- */
/* Wrap the element you want tilted in a flex centering parent,
   then apply .tilt to the inner element                        */
.tilt {
  transform: none;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 14px 11px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
  line-height: 20px;
  text-transform: uppercase;
  letter-spacing: 0;
  white-space: nowrap;
  border: none;
  background: none;
  text-decoration: none;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  clip-path: polygon(1.19px 4.26px, 100% 0%, 100% 100%, 0% 100%);
  transition:
    clip-path 0.3s ease,
    transform 0.3s ease;
}

.btn:hover::before {
  clip-path: polygon(0.19px 0px, 98% 3.5%, 100% 95.5%, 0% 99.5%);
  transform: scale(1.05);
}

/* Colour variants — text colour on .btn, fill on ::before */
.btn--red {
  color: var(--clr-white);
}
.btn--red::before {
  background: var(--clr-red);
}

.btn--dark {
  color: var(--clr-white);
}
.btn--dark::before {
  background: var(--clr-black);
}

.btn--white {
  color: var(--clr-white);
}
.btn--white::before {
  outline: 2px solid var(--clr-white);
  outline-offset: -2px;
}

.btn--mauve {
  color: var(--clr-white);
}
.btn--mauve::before {
  background: var(--clr-mauve);
}

.btn--yellow {
  color: var(--clr-black);
}
.btn--yellow::before {
  background: var(--clr-yellow);
}

.btn--green {
  color: var(--clr-black);
}
.btn--green::before {
  background: var(--clr-green);
}

.btn--blue {
  color: var(--clr-black);
}
.btn--blue::before {
  background: var(--clr-blue);
}

.btn--orange {
  color: var(--clr-black);
}
.btn--orange::before {
  background: var(--clr-orange);
}

/* ============================================================
   NAVIGATION
   ============================================================ */

.site-nav {
  position: relative;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px var(--gutter) 32px;
  background: #fefefe;
  pointer-events: none;
}

/* Dark navigation variant for pages that sit on dark surfaces */
.site-nav--dark {
  background: var(--clr-black);
}

.site-nav > * {
  pointer-events: auto;
}

.site-nav__logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 20px;
}

.site-nav__logo img {
  width: 128px;
  height: auto;
}

/* ── Phone (≤540px) ──── */
@media (max-width: 540px) {
  /* Hide donate, pull logo into flex flow so it sits left of Menu */
  .site-nav .btn:first-child {
    display: none;
  }

  .site-nav__logo {
    position: static;
    transform: none;
    top: auto;
  }
}

/* ── Narrow phone (≤376px) ──── */
@media (max-width: 376px) {
  /* Nav: tighten gutter at narrowest phones */
  .site-nav {
    padding-inline: 18px;
  }
}

/* ============================================================
   SITE MENU OVERLAY
   ============================================================ */

.site-menu {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: var(--clr-red);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding-top: 107px;
  padding-bottom: 32px;
  /* Closed: zero height at top */
  clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
  transition: clip-path 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.site-menu.is-open {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  transition: clip-path 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: all;
}

@media (prefers-reduced-motion: reduce) {
  .site-menu {
    clip-path: none !important;
    transition: none !important;
  }
  .site-menu:not(.is-open) {
    display: none;
  }
}

/* ---- Icon toggle: burger morphs into X ---- */
.site-nav__icon-close {
  display: none;
}

.site-nav__icon-burger {
  overflow: visible;
}

.site-nav__icon-burger rect {
  transform-box: fill-box;
  transform-origin: center;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease,
    fill 0.3s ease;
}

.menu-is-open .site-nav__icon-burger rect {
  fill: var(--clr-red);
}

.site-nav__menu[aria-expanded='true'] .site-nav__icon-burger rect:nth-child(1) {
  transform: translateY(4px) rotate(45deg);
}
.site-nav__menu[aria-expanded='true'] .site-nav__icon-burger rect:nth-child(2) {
  transform: scaleX(0);
  opacity: 0;
}
.site-nav__menu[aria-expanded='true'] .site-nav__icon-burger rect:nth-child(3) {
  transform: translateY(-4px) rotate(-45deg);
}

/* ---- Nav open state ---- */
.site-nav__logo-open {
  display: none;
}
.menu-is-open .site-nav {
  background: transparent;
}
.menu-is-open .site-nav__logo-default {
  display: none;
}
.menu-is-open .site-nav__logo-open {
  display: block;
}
.menu-is-open .site-nav .btn--red {
  color: var(--clr-red);
}
.menu-is-open .site-nav .btn--red::before {
  background: var(--clr-white);
  outline: none;
}

.site-menu__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 42px;
  width: 100%;
  padding-inline: var(--gutter);
  flex: 1;
}

/* Logo inside the menu — centred at top, always accessible in focus cycle */
.site-menu__logo {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
}

.site-menu__links {
  list-style: none;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

@media (prefers-reduced-motion: no-preference) {
  /* Links hidden until animation reveals them */
  .site-menu.is-open .site-menu__link,
  .site-menu.is-open .site-menu__donate,
  .site-menu.is-open .site-menu__share {
    opacity: 0;
  }
  @keyframes link-rise {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Story links — top to bottom so Coumba (first in DOM) animates first and is focusable */
  .site-menu.is-open .site-menu__links li:nth-child(1) .site-menu__link {
    animation: link-rise 0.5s ease 0.08s both;
  }
  .site-menu.is-open .site-menu__links li:nth-child(2) .site-menu__link {
    animation: link-rise 0.5s ease 0.16s both;
  }
  .site-menu.is-open .site-menu__links li:nth-child(3) .site-menu__link {
    animation: link-rise 0.5s ease 0.24s both;
  }
  .site-menu.is-open .site-menu__links li:nth-child(4) .site-menu__link {
    animation: link-rise 0.5s ease 0.32s both;
  }
  .site-menu.is-open .site-menu__links li:nth-child(5) .site-menu__link {
    animation: link-rise 0.5s ease 0.4s both;
  }

  /* Donate button + share row */
  .site-menu.is-open .site-menu__donate {
    animation: link-rise 0.5s ease 0.5s both;
  }
  .site-menu.is-open .site-menu__share {
    animation: link-rise 0.5s ease 0.56s both;
  }
}

.site-menu__link {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(40px, 5vw, 120px);
  font-weight: 800;
  text-transform: uppercase;
  color: var(--clr-white);
  letter-spacing: -2px;
  line-height: 1;
}

@media (hover: hover) {
  .site-menu__link:hover,
  .site-menu.is-open .site-menu__link:hover {
    opacity: 0.7 !important;
  }
}

/* ── Tablet (≤1024px) ──── */
@media (max-width: 1024px) {
  .site-menu__link {
    font-size: 56px;
    letter-spacing: -1.5px;
  }
}

/* ── Phone (≤540px) ──── */
@media (max-width: 540px) {
  .site-menu__donate {
    display: inline-flex;
  }
  .site-menu__inner {
    gap: 32px;
    padding-inline: 24px;
  }
  .site-menu__links {
    gap: 24px;
  }
  .site-menu__link {
    font-size: 32px;
    font-weight: 900;
    letter-spacing: -1px;
    line-height: 1;
  }
  .site-menu {
    padding-top: 90px;
  }
}

.site-menu__donate {
  display: none;
  color: var(--clr-red);
}
.site-menu__donate::before {
  background: var(--clr-white);
  outline: none;
}

.site-menu__share {
  display: flex;
  align-items: center;
  gap: 20px;
}

.site-menu__share-label {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--clr-white);
}

.site-menu__social {
  display: flex;
  align-items: center;
  color: var(--clr-white);
  opacity: 0.9;
}

.site-menu__social:hover {
  opacity: 1;
}

/* ============================================================
   HERO
   ============================================================ */

.hero {
  position: relative;
  background: var(--clr-white);
  height: calc(100svh - var(--nav-h, 0px));
  overflow: visible;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-bottom: 5%;
}

.hero__stack {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero__text-top {
  position: relative;
  z-index: 1;
  margin-bottom: -1.875vw;
  transform: translateY(0px);
}

.hero__text-bottom {
  position: relative;
  z-index: 3;
  margin-top: -2.5625vw;
  transform: translateY(0px);
}

.hero__text-top > span.tilt,
.hero__text-bottom > span.tilt {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(32px, 7.5vw, 200px);
  font-weight: 900;
  line-height: clamp(28px, 6.25vw, 170px);
  letter-spacing: -1px;
  text-transform: uppercase;
  color: var(--clr-red);
  text-align: center;
  white-space: nowrap;
}

/* ── Tablet (≤1024px) ──── */
@media (max-width: 1024px) {
  .hero__subtitle {
    margin-top: 12px;
  }

  /* Switch video to portrait crop */
  .hero__media {
    aspect-ratio: 222 / 300;
    clip-path: polygon(0 0, 100% 2.87%, 94.88% 98.08%, 0 100%);
  }

  .hero__text-top,
  .hero__text-bottom {
    transform: none;
  }

  .hero__subtitle {
    font-size: 14px;
    line-height: 20px;
    width: 281px;
    white-space: normal;
  }
}

/* ── Phone (≤540px) ──── */
@media (max-width: 540px) {
  .hero {
    padding-bottom: 10%;
  }

  .hero__subtitle {
    margin-top: 12px;
  }

  .hero__text-top span,
  .hero__text-bottom span {
    font-size: clamp(44px, 12vw, 65px);
    line-height: clamp(37px, 10vw, 54px);
  }
}

/* ── Narrow phone (≤376px) ──── */
@media (max-width: 376px) {
  .hero__text-top {
    margin-bottom: -10px;
  }

  .hero__text-bottom {
    margin-top: -15px;
  }

  .hero__media {
    width: 221px;
    aspect-ratio: 221 / 302; /* portrait crop at mobile */
  }

  .hero__subtitle {
    font-size: 14px;
    line-height: 20px;
    width: 281px;
    white-space: normal;
  }
}

/* ---- Hero letter reveal ---- */
.char-wrap {
  display: inline-block;
  overflow: hidden;
  line-height: 1;
  vertical-align: bottom;
}

.char {
  display: inline-block;
}

[data-rollup] .char,
.rollup-text .char {
  display: inline-block;
  transform: translateY(115%);
}

[data-rollup] .rollup-word,
.rollup-text .rollup-word {
  display: inline-block;
  white-space: nowrap;
}

.line-mask {
  display: block;
  overflow: hidden;
}

.line-inner {
  display: block;
}

@media (prefers-reduced-motion: no-preference) {
  /* Hero chars animate on page load */
  .hero .char {
    animation: char-rise 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  [data-rollup].is-revealed .char,
  .rollup-text.is-revealed .char {
    animation: char-rise 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  /* Stat chars animate only once .is-revealed is added by JS */
  .stats__number.is-revealed .char {
    animation: char-rise 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  @keyframes char-rise {
    from {
      transform: translateY(115%);
    }
    to {
      transform: translateY(0);
    }
  }

  .line-inner {
    transform: translateY(110%);
  }

  [data-rollup-lines].is-revealed .line-inner {
    animation: line-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  @keyframes line-rise {
    from {
      transform: translateY(110%);
    }
    to {
      transform: translateY(0);
    }
  }

  .hero__media {
    animation: media-reveal 0.9s ease 0ms both;
  }

  .story-hero__media.is-revealed {
    animation: media-reveal 0.9s ease 0ms both;
  }

  @keyframes media-reveal {
    from {
      clip-path: polygon(99.95% 50%, 0% 50%, 0% 50%, 98.79% 50%);
      -webkit-clip-path: polygon(99.95% 50%, 0% 50%, 0% 50%, 98.79% 50%);
    }
    to {
      clip-path: polygon(99.95% 2.06%, 0% 0%, 0% 100%, 98.79% 97.31%);
      -webkit-clip-path: polygon(99.95% 2.06%, 0% 0%, 0% 100%, 98.79% 97.31%);
    }
  }

  .hero__subtitle {
    animation: subtitle-reveal 1.2s ease 650ms both;
  }

  .fade-in-text,
  [data-reveal-text] {
    opacity: 0;
  }

  .fade-in-text {
    opacity: 0;
  }

  [data-reveal-text].is-revealed,
  .fade-in-text.is-revealed {
    animation: subtitle-reveal 1.2s ease 650ms both;
  }

  [data-reveal-media] {
    opacity: 0;
    clip-path: polygon(99.95% 50%, 0% 50%, 0% 50%, 98.79% 50%);
    -webkit-clip-path: polygon(99.95% 50%, 0% 50%, 0% 50%, 98.79% 50%);
  }

  [data-reveal-media].is-revealed,
  .story-hero__media.is-revealed {
    opacity: 1;
    animation: media-reveal 0.9s ease 0ms both;
  }

  .fade-in-text.is-revealed {
    animation: subtitle-reveal 1.2s ease both;
  }

  @keyframes subtitle-reveal {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }
}

.hero__media {
  position: relative;
  width: 27.8125vw;
  min-width: 221px;
  height: auto;
  aspect-ratio: 445 / 301;
  overflow: hidden;
  z-index: 2;
  clip-path: polygon(0 0, 100% 7.03%, 96.96% 96.66%, 0 100%);
}

.hero__video,
.hero__poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__subtitle {
  margin-top: 22px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  line-height: 22px;
  color: var(--clr-black);
  text-align: center;
  white-space: nowrap;
}

/* ============================================================
   STORY HERO
   ============================================================ */

.story-hero {
  --story-hero-composition-h: min(
    var(--viewport-minus-nav),
    calc(100vw * 9 / 16)
  );
  position: relative;
  background: var(--clr-white);
  overflow: visible;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* justify-content: center; */
  overflow: hidden;
  padding: 0 0 var(--space-section) 0;
}

.story-hero::after {
  content: '';
  position: absolute;
  height: var(--story-hero-composition-h);
  width: 100%;
  top: 0;
  background: var(--clr-black);
  z-index: 0;
}

.story-hero__stack {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, calc(992 / 1600 * 100vw));
}

.story-hero__art {
  position: relative;
  width: 100%;
}

.story-hero__lines {
  display: block;
  width: 100%;
  height: auto;
  position: relative;
  z-index: 1;
}

.story-hero__media {
  position: absolute;
  width: 100%;
  left: 50%;
  transform: translateX(-50%);
  top: 35vw;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  z-index: 2;
  clip-path: polygon(99.95% 2.06%, 0% 0%, 0% 100%, 98.79% 97.31%);
  -webkit-clip-path: polygon(99.95% 2.06%, 0% 0%, 0% 100%, 98.79% 97.31%);
  cursor: pointer;
  transition:
    clip-path 0.2s ease,
    -webkit-clip-path 0.2s ease;
}

.story-hero__media:hover,
.story-hero__media:focus-within,
.story-hero__media.is-playing {
  clip-path: polygon(100% 0%, 0% 0%, 0% 100%, 100% 100%);
  -webkit-clip-path: polygon(100% 0%, 0% 0%, 0% 100%, 100% 100%);
}

.story-hero__video {
  position: relative;
}

.story-hero__media .hero__poster,
.story-hero__media .hero__video {
  position: absolute;
  inset: 0;
}

.story-hero__media .hero__poster {
  z-index: 1;
  transition: transform 0.4s ease;
}

.story-hero__media .hero__video {
  z-index: 2;
}

.hero__video--youtube {
  border: 0;
  background: #000;
}

.story-hero__media:not(.is-playing) .hero__video--youtube {
  display: none;
}

.hero__video {
  transition: transform 0.4s ease;
}

.story-hero__media:hover .hero__video,
.story-hero__media:hover .hero__poster {
  transform: scale(1.06);
}

.story-hero__media.is-playing .hero__video {
  transform: none;
  transition: none;
}

.story-hero__media.is-playing .hero__poster {
  opacity: 0;
  pointer-events: none;
}

.story-hero__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  width: clamp(64px, 5.75vw, 132px);
  height: clamp(48px, 4.25vw, 98px);
  isolation: isolate;
  transition: opacity 0.2s ease;
}

.story-hero__play::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: #94577d;
  clip-path: polygon(1.3% 9.9%, 100% 0%, 100% 100%, 0% 100%);
  transition:
    clip-path 0.3s ease,
    transform 0.3s ease;
}

.story-hero__media:hover .story-hero__play::before,
.story-hero__play:focus-visible::before {
  clip-path: polygon(0% 0%, 98% 3.5%, 100% 95.5%, 0% 99.5%);
  transform: scale(1.05);
}

.story-hero__play:focus-visible {
  outline: 2px solid #fefefe;
  outline-offset: 3px;
}

.story-hero__play svg {
  width: 100%;
  height: 100%;
}

.story-hero__media.is-playing .story-hero__play {
  opacity: 0;
  pointer-events: none;
}

/* ── Tablet (≤768px) ──── */
@media (max-width: 768px) {
  /* Taller black backdrop: ~680px at 768px (vs the 9:16 desktop formula) */
  .story-hero {
    --story-hero-composition-h: min(
      var(--viewport-minus-nav),
      calc(100vw * 0.885)
    );
    /* Section must be tall enough that overflow:hidden doesn't clip the video.
       Figma tablet: content starts at 984px → hero ≈ 984px tall. */
    min-height: clamp(850px, 128vw, 984px);
  }
}

/* ── Mobile (≤540px) ──── */
@media (max-width: 540px) {
  /* Backdrop fills ~632px at 375px (1.685 × 375 = 631.9px) */
  .story-hero {
    --story-hero-composition-h: min(
      var(--viewport-minus-nav),
      calc(100vw * 1.685)
    );
    /* Figma mobile: content starts at 847px → hero ≈ 847px tall */
    min-height: clamp(650px, 226vw, 847px);
  }

  /* Widen the stack so the SVG art fills more of the narrow screen */
  .story-hero__stack {
    width: min(100%, calc(100vw * 0.813));
  }

  /* Video: 549px at 375px (146.5vw), scales down on very narrow screens */
  .story-hero__media {
    width: min(282px, 75.2vw);
  }
}

/* ============================================================
   DARK SECTION — sticky lines animation + horizontal card pan
   ============================================================ */

.dark-section {
  position: relative;
  background: var(--clr-black);
}

.dark-section__stage {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: visible;
}

/* ── Tablet (≤1024px) ──── */
@media (max-width: 1024px) {
  html,
  body {
    overflow-x: hidden;
  }

  /* Dark section: disable sticky, stack cards vertically.
     overflow: visible lets the mobile SVG layers extend upward into the hero.
     overflow-x is handled by html/body { overflow-x: hidden } already. */
  .dark-section {
    overflow: visible;
  }

  .dark-section__stage {
    position: relative;
    height: auto;
    overflow: visible;
  }
}

/* Lines background — home-lines.svg, pans left in sync with card track */
.lines-bg {
  position: absolute;
  top: -15vh;
  left: 0;
  height: 100%;
  z-index: 3;
  pointer-events: none;
  will-change: transform;
}

.lines-bg--under {
  z-index: 1;
}

/* Hide lines until JS has initialised strokeDashoffset — prevents flash on load */
#lines-bg,
#lines-bg-under {
  opacity: 0;
}

/* ── Tablet (≤1024px) ──── */
@media (max-width: 1024px) {
  .lines-bg {
    display: none;
  }
}

/* Mobile "FIVE STORIES / ONE MISSION" text overlay — positioned by JS */
.dark-section__text-mobile {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  white-space: nowrap;
  text-align: left;
  display: none; /* shown only on mobile via JS */
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.5px;
  text-transform: uppercase;
  color: #fefefe;
  line-height: 1;
  transform: rotate(-14.5deg);
  transform-origin: center center;
}

.dark-section__text-mobile .char {
  display: inline-block;
  transform: translateY(115%);
}

.dark-section__text-mobile .dark-text__line + .dark-text__line {
  margin-top: -4px; /* ← tune this to adjust line spacing */
}

@media (prefers-reduced-motion: no-preference) {
  .dark-section__text-mobile.is-revealed .char {
    animation: char-rise 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dark-section__text-mobile.is-revealed .char {
    transform: translateY(0);
  }
}

/* "FIVE STORIES / ONE MISSION" text overlay — positioned by JS */
.dark-section__text {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  white-space: nowrap;
  text-align: center;
  display: none; /* shown only on desktop via JS */
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: #fefefe;
  line-height: 1;
  transform: rotate(-14.5deg);
  transform-origin: center center;
}

.dark-text__line + .dark-text__line {
  margin-top: -0.08em; /* tight overlap matching original design */
}

.dark-section__text .char {
  display: inline-block;
  transform: translateY(115%);
}

.dark-text__line {
  display: block;
  overflow: hidden;
}

@media (prefers-reduced-motion: no-preference) {
  .dark-section__text.is-revealed .char {
    animation: char-rise 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dark-section__text.is-revealed .char {
    transform: translateY(0);
  }
}

#home-lines-svg,
#home-lines-under-svg {
  height: 100%;
  width: auto;
  display: block;
}

/* Mobile line layers — hidden on desktop, shown via mobile media query */
.lines-mobile-under,
.lines-mobile-top {
  display: none;
}

/* ── Tablet (≤1024px) ──── */
@media (max-width: 1024px) {
  /* Mobile SVG depth layers — absolutely positioned inside .dark-section__stage.
     top: negative value extends the SVGs upward into the hero by 90px at native 375px width,
     matching the old negative-margin overlap. max() caps at native px on wider viewports.
     Depth order: under-lines(z:1) → portraits/track(z:2) → top-lines(z:3) */
  .lines-mobile-under,
  .lines-mobile-top {
    display: block;
    position: absolute;
    top: max(calc(-90 / 375 * 100vw), -90px);
    left: 0;
    right: 0;
    width: 375px;
    max-width: 100%;
    margin: 0 auto;
    pointer-events: none;
  }
  .lines-mobile-under svg,
  .lines-mobile-top svg {
    display: block;
    width: 100%;
    height: auto;
  }
  .lines-mobile-under {
    z-index: 1;
    opacity: 0;
  }
  .lines-mobile-top {
    z-index: 3;
    opacity: 0;
  }
}

/* Image wrapper — transparent to layout on desktop so portrait
   participates directly in .story-card flexbox as before.
   On mobile (≤1024px) overridden to display:block with fixed dimensions. */
.story-card__image-wrap {
  display: contents;
}

/* Cards pan container */
.cards-pan {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

/* ── Tablet (≤1024px) ──── */
@media (max-width: 1024px) {
  .cards-pan {
    position: static;
    opacity: 1;
    overflow: visible;
    /* First card aligns with SVG y=950, offset by 90px overlap — capped at native px */
    padding: min(calc(820 / 375 * 100vw), 820px) 0 80px;
  }
}

/* Horizontal card strip — z-index:2 anchors the track's stacking context (created at
   runtime when JS applies translateX) between under-lines(z:1) and top-lines(z:3).
   Without an explicit z-index, a JS-applied transform creates a z:auto stacking context
   which paints below z:1, burying portraits under both SVG line layers. */
.stories__track {
  position: absolute;
  top: 30px;
  left: 0;
  display: flex;
  align-items: center;
  height: 100%;
  list-style: none;
  padding: 0;
  margin: 0;
  z-index: 2;
}

/* ── Tablet (≤1024px) ──── */
@media (max-width: 1024px) {
  .stories__track {
    position: relative; /* needs position for z-index:2 to participate in stacking */
    z-index: 2;
    flex-direction: column;
    align-items: center;
    height: auto;
    transform: none !important;
    /* 240px gap in SVG native coordinates — capped at native px */
    gap: min(calc(210 / 375 * 100vw), 210px);
  }
}

/* ── Backdrop track (z:auto) ────────────────────────────────
   Separate layer for backdrop images. Mirrors stories-track layout exactly
   (same padding/gap/flex so each backdrop aligns with its portrait).
   JS applies the same translateX as stories-track.
   No z-index in CSS → when JS sets transform, stacking context at z:auto
   (below all positive z-index elements), so backdrops sit behind everything. */
.backdrop-track {
  position: absolute;
  top: 30px;
  left: 0;
  display: flex;
  align-items: center;
  height: 100%;
  pointer-events: none;
}

/* ── Tablet (≤1024px) ──── */
@media (max-width: 1024px) {
  /* Backdrop track on mobile: JS positions each .backdrop-slot absolutely
     to exactly overlay each portrait. z-index:auto keeps it below z:1 under-lines.
     Depth order: backdrop(z:auto) → under-lines(z:1) → portrait/track(z:2) → top-lines(z:3) */
  .backdrop-track {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0; /* no layout footprint — slots are absolutely positioned by JS */
    pointer-events: none;
  }
}

.backdrop-slot {
  flex: 0 0 calc(1040 / 1130 * 100vh);
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(72px, 6.25vw, 150px) clamp(24px, 2.5vw, 56px)
    clamp(24px, 2.5vw, 56px); /* mirrors .story-card padding exactly */
  gap: var(--space-gap-md);
}

/* ── Tablet (≤1024px) ──── */
@media (max-width: 1024px) {
  .backdrop-slot {
    position: absolute; /* JS sets top/left/width/height */
    padding: 0;
    gap: 0;
    align-items: stretch;
    justify-content: flex-start;
    overflow: hidden;
  }
}

/* Filler — height set by JS to match story-card__content so flex centering aligns */
.backdrop-slot__filler {
  flex-shrink: 0;
}

/* ── Tablet (≤1024px) ──── */
@media (max-width: 1024px) {
  .backdrop-slot__filler {
    display: none;
  }
}

/* Backdrop image — rounded rect, same size as portrait */
.story-card__backdrop {
  width: calc(490 / 1130 * 100vh);
  height: calc(330 / 1130 * 100vh);
  object-fit: cover;
  display: block;
  border-radius: 3px;
  flex-shrink: 0;
}

/* ── Tablet (≤1024px) ──── */
@media (max-width: 1024px) {
  /* Backdrop image fills its JS-sized slot exactly */
  .story-card__backdrop {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    flex-shrink: 0;
  }
}

/* ── Story Card (z:2 stacking context, via JS transform + z-index) ── */
.story-card {
  flex: 0 0 calc(1040 / 1130 * 100vh);
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(72px, 6.25vw, 150px) clamp(24px, 2.5vw, 56px)
    clamp(24px, 2.5vw, 56px);
  gap: var(--space-gap-md);
}

/* ── Tablet (≤1024px) ──── */
@media (max-width: 1024px) {
  .story-card {
    flex: none;
    width: 100%;
    max-width: clamp(320px, 56.640625vw, 580px);
    height: auto;
    padding: 0 var(--gutter);
    gap: 0;
    justify-content: flex-start;
  }
}

/* Portrait — plain flex item, no position/z-index needed.
   The whole stories-track stacking context (z:2) sits between
   under-lines (z:1) and top-lines (z:3) at the stage level.
   Depth: backdrop(z:auto) → under-lines(z:1) → portrait/track(z:2) → top-lines(z:3) */
.story-card__portrait {
  width: calc(490 / 1130 * 100vh);
  height: calc(330 / 1130 * 100vh);
  object-fit: cover;
  display: block;
  border-radius: 3px;
  flex-shrink: 0;
}

/* ── Tablet (≤1024px) ──── */
@media (max-width: 1024px) {
  /* Portrait fills the wrapper exactly */
  .story-card__portrait {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 0;
  }

  /* Image wrapper: fixed 280×416 frame, clips both portrait and any overflow.
     margin-bottom: -22px makes the text content overlap the bottom of the image. */
  .story-card__image-wrap {
    display: block;
    width: clamp(220px, 74.67vw, 320px);
    height: clamp(328px, 110.93vw, 475px);
    overflow: hidden;
    margin-bottom: -22px;
    flex-shrink: 0;
  }
}

.story-card__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-gap-md);
  text-align: center;
  color: var(--clr-white);
  max-width: calc(490 / 1130 * 100vh);
  width: 100%;
  transform: translateY(-47px);
}

/* ── Tablet (≤1024px) ──── */
@media (max-width: 1024px) {
  .story-card__content {
    position: relative;
    z-index: 1;
    transform: none;
    gap: 19px; /* Figma: Story detail gap between heading group and CTA */
  }
}

.story-card__name-wrap {
  display: flex;
  justify-content: center;
}

.story-card__name {
  font-family: var(--font-display);
  font-size: calc(56 / 1130 * 100vh);
  font-weight: 900;
  line-height: calc(50 / 1130 * 100vh);
  letter-spacing: -0.5px;
  text-transform: uppercase;
  color: var(--clr-white);
  white-space: nowrap;
  display: inline-block;
}

/* ── Tablet (≤1024px) ──── */
@media (max-width: 1024px) {
  .story-card__name {
    font-size: 30px;
    line-height: 26px;
    letter-spacing: -0.2px;
    white-space: normal;
  }
}

.story-card__desc {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 22px;
  font-weight: 600;
  letter-spacing: 0px;
  color: var(--clr-white);
  max-width: 30.625vw;
  margin: 8px auto 0;
  white-space: nowrap;
}

/* ── Tablet (≤1024px) ──── */
@media (max-width: 1024px) {
  .story-card__desc {
    font-size: 14px;
    line-height: 20px;
    max-width: clamp(180px, 59.2vw, 222px);
    margin: 6px auto 0; /* Figma: 6px gap between name and description */
    white-space: normal;
  }
}

.story-card .btn {
  min-width: clamp(132px, 10.0625vw, 220px);
  margin-top: calc(-0.5 * var(--space-gap-md));
}

/* ── Tablet (≤1024px) ──── */
@media (max-width: 1024px) {
  .story-card .btn {
    margin-top: 0; /* reset desktop negative offset — gap handles spacing on mobile */
  }
}

/* ============================================================
   SCROLL TEXT
   ============================================================ */

.scroll-text {
  padding: 0 0 var(--space-section) 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.scroll-text__content {
  text-align: center;
  max-width: min(100%, 12.4em);
  width: 100%;
  margin: 0 auto;
  color: var(--clr-black);
}

.scroll-text__content.h3 {
  max-width: min(100%, 17.72em);
}

/* Dark theming */

.scroll-text.dark {
  background: var(--clr-black);
}

.scroll-text.dark .scroll-text__content {
  color: var(--clr-white);
}

/* ── Tablet (≤768px) ──── */
@media (max-width: 768px) {
  .scroll-text {
    padding-bottom: 64px;
  }

  /* Matches Figma tablet: 142px each side on 768px canvas */
  .scroll-text .wrap {
    padding-inline: clamp(48px, 18.5vw, 142px);
  }
}

/* ── Mobile (≤540px) ──── */
@media (max-width: 540px) {
  .scroll-text {
    padding-bottom: 32px;
  }

  /* Matches Figma mobile: 47px each side on 375px canvas */
  .scroll-text .wrap {
    padding-inline: 47px;
  }
}

/* ============================================================
   PATTERN
   ============================================================ */

.pattern {
  padding: 0 0 var(--space-section) 0;
  display: flex;
  justify-content: center;
}

.pattern svg {
  display: block;
  height: auto;
}

.pattern svg[viewBox='0 0 287 168'] {
  width: min(100%, calc(287 / 1600 * 100vw));
}

.pattern svg[viewBox='0 0 188 150'] {
  width: min(100%, calc(188 / 1600 * 100vw));
}

.pattern svg[viewBox='0 0 238 168'] {
  width: min(100%, calc(238 / 1600 * 100vw));
}

/* Dark theming */

.pattern.dark {
  background: var(--clr-black);
}

/* ── Tablet (≤768px) ──── */
@media (max-width: 768px) {
  .pattern {
    padding-bottom: 64px;
  }

  /* (The desktop formula calc(xxx/1600*100vw) is too big at tablet.) */
  .pattern svg[viewBox='0 0 287 168'] {
    width: 104px;
  }

  .pattern svg[viewBox='0 0 188 150'] {
    width: 65px;
  }

  .pattern svg[viewBox='0 0 238 168'] {
    width: 86px;
  }
}

/* ── Mobile (≤540px) ──── */
@media (max-width: 540px) {
  .pattern {
    padding-bottom: 32px;
  }
}

/* ============================================================
   GALLERY
   ============================================================ */

.gallery {
  position: relative;
  padding: 0 0 var(--space-section) 0;
}

.gallery::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background: var(--clr-black);
  z-index: -1;
}

.gallery__grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-gap-md);
}

.gallery__image {
  clip-path: polygon(100% 2.061%, 0% 0%, 0% 100%, 98.839% 97.312%, 100% 2.061%);
}

.gallery__image:nth-child(1) {
  grid-column: 1 / span 3;
}

.gallery__image:nth-child(2) {
  grid-column: 5 / span 4;
  margin-top: var(--space-section);
}

.gallery__image:nth-child(3) {
  grid-column: 10 / span 3;
  margin-top: calc(2 * var(--space-section));
}

.gallery__image.image--3-4 {
  aspect-ratio: 3 / 4;
}

.gallery__image.image--1-1 {
  aspect-ratio: 1 / 1;
}

.gallery__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Tablet (≤768px) ──── */
@media (max-width: 768px) {
  /* Image area min-height is separate from section padding */
  .gallery {
    padding-bottom: 64px;
    min-height: clamp(260px, 49.5vw, 380px);
  }

  .gallery .wrap {
    padding-inline: 0;
    position: relative;
    min-height: inherit;
  }

  .gallery__grid {
    display: block;
    position: relative;
    min-height: clamp(260px, 49.5vw, 380px);
  }

  /* Black covers the top ~210px of the image area (≈55% of 380px at 768px).
     Use absolute height so padding-bottom doesn't inflate the percentage. */
  .gallery::after {
    height: clamp(145px, 27.35vw, 210px);
  }

  .gallery__image {
    position: absolute;
    margin-top: 0;
    grid-column: unset;
  }

  /* 1st image (3:4) — top-left */
  .gallery__image:nth-child(1) {
    left: clamp(20px, 4.95vw, 38px);
    top: 0;
    width: clamp(120px, 22.9vw, 176px);
    aspect-ratio: 3 / 4;
    z-index: 2;
  }

  /* 2nd image (3:4) — centred, bottom-pinned (tallest, front) */
  .gallery__image:nth-child(2) {
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    top: auto;
    width: clamp(160px, 31.25vw, 240px);
    aspect-ratio: 3 / 4;
    z-index: 3;
  }

  /* 3rd image (1:1) — right, vertically centred (behind others) */
  .gallery__image:nth-child(3) {
    right: clamp(20px, 4.95vw, 38px);
    top: 50%;
    transform: translateY(-50%);
    width: clamp(120px, 22.9vw, 176px);
    aspect-ratio: 1 / 1;
    z-index: 1;
  }
}

/* ── Mobile (≤540px) ──── */
@media (max-width: 540px) {
  /* Taller layout (777px image area at 375px) */
  .gallery {
    padding-bottom: 32px;
    min-height: clamp(500px, 207vw, 777px);
  }

  .gallery .wrap,
  .gallery__grid {
    min-height: clamp(500px, 207vw, 777px);
  }

  /* Black covers top ~430px of the image area (≈55% of 777px at 375px) */
  .gallery::after {
    height: clamp(280px, 114.7vw, 430px);
  }

  /* Use mobile-specific image widths (Figma: 176/176/240px at 375px) */
  .gallery__image:nth-child(1) {
    width: clamp(120px, 46.9vw, 176px);
  }

  /* 2nd image (3:4) — raised from bottom */
  .gallery__image:nth-child(2) {
    width: clamp(160px, 64vw, 240px);
    bottom: clamp(130px, 53.2vw, 199.5px);
  }

  /* 3rd image (1:1) — pinned to bottom-right */
  .gallery__image:nth-child(3) {
    width: clamp(120px, 46.9vw, 176px);
    top: auto;
    bottom: 0;
    transform: none;
  }
}

/* ============================================================
   TEXT
   ============================================================ */
.text {
  padding: 0 0 var(--space-section) 0;
}

.text .wrap {
  display: flex;
  align-items: start;
  gap: var(--space-gap-lg);
}

.text__heading {
  width: 38vw;
}

.text__content {
  display: flex;
  flex-direction: column;
  gap: var(--space-gap-sm);
  width: 46vw;
}

/* Dark theming */

.text.dark {
  background: var(--clr-black);
}

.text.dark .text__heading,
.text.dark .text__content {
  color: var(--clr-white);
}

/* ── Tablet (≤768px) ──── */
@media (max-width: 768px) {
  .text {
    padding-bottom: 64px;
  }

  /* Matches Figma tablet: 142px each side on 768px canvas */
  .text .wrap {
    padding-inline: clamp(48px, 18.5vw, 142px);
    flex-direction: column;
    gap: 48px;
  }

  .text__heading,
  .text__content {
    width: 100%;
  }
}

/* ── Mobile (≤540px) ──── */
@media (max-width: 540px) {
  .text {
    padding-bottom: 32px;
  }

  /* Matches Figma mobile: 47px each side on 375px canvas */
  .text .wrap {
    padding-inline: 47px;
    gap: 32px;
  }
}

/* ============================================================
   TEXT & MEDIA
   ============================================================ */
.text-media {
  padding: 0 0 var(--space-section) 0;
}

.text-media .wrap {
  display: flex;
  align-items: center;
  gap: var(--space-gap-lg);
}

.text-media__media {
  width: 38vw;
  height: 50.625vw;
  clip-path: polygon(100% 2.061%, 0% 0%, 0% 100%, 98.839% 97.312%, 100% 2.061%);
}

.text-media__media[data-reveal-media] {
  opacity: 0;
  clip-path: polygon(99.95% 50%, 0% 50%, 0% 50%, 98.79% 50%);
  -webkit-clip-path: polygon(99.95% 50%, 0% 50%, 0% 50%, 98.79% 50%);
}

.text-media__media[data-reveal-media].is-revealed {
  opacity: 1;
}

.text-media__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.text-media__content {
  display: flex;
  flex-direction: column;
  gap: var(--space-gap-sm);
  width: 46vw;
}

/* Dark theming */

.text-media.dark {
  background: var(--clr-black);
}

.text-media.dark .text-media__content {
  color: var(--clr-white);
}

/* ── Tablet (≤768px) ──── */
@media (max-width: 768px) {
  .text-media {
    padding-bottom: 64px;
  }

  /* Matches Figma tablet: 142px each side on 768px canvas */
  .text-media .wrap {
    padding-inline: clamp(48px, 18.5vw, 142px);
    flex-direction: column;
    align-items: center;
    gap: 48px;
  }

  /* Image becomes a centred portrait block */
  .text-media__media {
    width: min(280px, 100%);
    height: auto;
    aspect-ratio: 3 / 4;
    flex-shrink: 0;
    align-self: center;
  }

  .text-media__content {
    width: 100%;
  }
}

/* ── Mobile (≤540px) ──── */
@media (max-width: 540px) {
  .text-media {
    padding-bottom: 32px;
  }

  /* Matches Figma mobile: 47px each side on 375px canvas */
  .text-media .wrap {
    padding-inline: 47px;
    gap: 32px;
  }
}

/* ============================================================
   MEDIA
   ============================================================ */
.media {
  position: relative;
  padding: 0 0 var(--space-section) 0;
}

.media img {
  width: 100%;
  height: auto;
}

.media::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background: var(--clr-black);
  z-index: -1;
}

/* ── Tablet (≤768px) ──── */
@media (max-width: 768px) {
  .media {
    padding-bottom: 64px;
  }

  .media .wrap {
    padding-inline: 18px;
  }
}

/* ── Mobile (≤540px) ──── */
@media (max-width: 540px) {
  .media {
    padding-bottom: 32px;
  }

  .media .wrap {
    padding-inline: 18px;
  }
}

/* ============================================================
   QUOTE
   ============================================================ */

.quote .wrap {
  display: flex;
  justify-content: center;
  gap: var(--space-gap-md);
  padding: 0 0 var(--space-section) 0;
}

.quote__content {
  padding-top: var(--space-offset-md);
  max-width: 53.75vw;
  width: 100%;
}

.quote__author {
  margin-top: var(--space-gap-md);
}

.quote__mark {
  font-family: var(--font-display);
  font-size: 14rem;
  line-height: 1;
  color: #0e0e0e;
  flex-shrink: 0;
  align-self: flex-start;
}

@media (prefers-reduced-motion: no-preference) {
  .quote__author.is-revealed {
    animation-delay: 1500ms;
  }
}

/* ── Tablet (≤768px) ──── */
@media (max-width: 768px) {
  .quote .wrap {
    padding-bottom: 64px;
    padding-inline: clamp(48px, 18.5vw, 142px);
    gap: 12px;
  }

  .quote__mark {
    font-size: 6rem;
  }

  .quote__content {
    max-width: 100%;
    padding-top: 12px;
  }
}

/* ── Mobile (≤540px) ──── */
@media (max-width: 540px) {
  .quote .wrap {
    padding-bottom: 32px;
    padding-inline: 19px;
    gap: 4px;
  }

  .quote__mark {
    font-size: 3rem;
  }
}

/* ============================================================
   STATS
   ============================================================ */

.stats {
  background: var(--clr-white);
  padding: var(--space-offset-lg) 0 0;
}

.stats__inner {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Shared scaling container — SVG and text both derive size from this width.
   aspect-ratio locks the canvas to the SVG's proportions so frames never distort. */
.stats__canvas {
  position: relative;
  width: 100%;
  max-width: 42.8125vw;
  aspect-ratio: 685 / 1200;
  margin-inline: auto;
  container-type: inline-size;
}

.stats__lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.stats__list {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18cqw;
  list-style: none;
  margin: 0;
  padding-top: 15cqw;
  padding-bottom: 8cqw;
}

.stats__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4cqw;
  text-align: left;
  transform: rotate(var(--tilt));
}

.stats__number {
  font-family: var(--font-display);
  font-size: 16cqw;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--clr-black);
  display: flex; /* chars sit side-by-side */
}

.stats__number .char-wrap {
  display: inline-block;
  overflow: hidden;
  line-height: 1;
  vertical-align: bottom;
}

.stats__number .char {
  display: inline-block;
  transform: translateY(115%); /* hidden below container by default */
}

@media (prefers-reduced-motion: reduce) {
  [data-rollup].is-revealed .char,
  .rollup-text.is-revealed .char {
    transform: translateY(0);
  }

  .stats__number.is-revealed .char {
    transform: translateY(0);
  }
}

.stats__desc {
  font-family: var(--font-display);
  font-size: 3.2cqw;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.2px;
  text-transform: uppercase;
  color: var(--clr-red);
  width: 14em;
  display: block;
}

/* ── Mobile (≤600px) ──── */
@media (max-width: 600px) {
  .stats__inner {
    padding-inline: 0;
  }
}

/* ============================================================
   STORY PROMO
   ============================================================ */
.story-promo {
  position: relative;
  padding: 0 0 var(--space-section) 0;
}

.story-promo::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background: var(--clr-black);
  z-index: -1;
}

.story-promo .wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.story-promo__media {
  position: relative;
  width: 61.25vw;
  height: 41.25vw;
}

.story-promo__backdrop,
.story-promo__person,
.story-promo__lines-background,
.story-promo__lines-foreground {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.story-promo__backdrop {
  z-index: 0;
}

.story-promo__person {
  z-index: 2;
}

.story-promo__lines-background {
  z-index: 1;
}

.story-promo__lines-foreground {
  z-index: 3;
}

.story-promo__eyebrow {
  color: var(--clr-white);
}

.story-promo__heading {
  color: var(--clr-white);
  margin-top: 12px;
}

.story-promo__body {
  color: var(--clr-white);
  margin-top: 8px;
}

.story-promo .btn {
  margin-top: var(--space-gap-sm);
}

.story-promo__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: var(--space-overlap-lg);
  position: relative;
  z-index: 4;
}

/* ── Tablet (≤768px) ──── */
@media (max-width: 768px) {
  /* Desktop uses a wide landscape container; tablet/mobile uses a
     centred 280×416 portrait image with story details in the black area below. */
  .story-promo {
    min-height: 539px;
    padding: 0;
    overflow: hidden;
  }

  .story-promo::after {
    /* Black fills the bottom 340px (y=199 to y=539 at tablet) */
    height: 340px;
    top: auto;
  }

  .story-promo .wrap {
    position: relative;
    min-height: 539px;
    padding: 0;
  }

  /* Portrait 3:4 image centred at the top of the section */
  .story-promo__media {
    position: absolute;
    width: 280px;
    height: auto;
    aspect-ratio: 3 / 4;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    overflow: hidden;
  }

  /* Story details sit in the black area */
  .story-promo__content {
    position: absolute;
    top: 399px;
    left: 0;
    right: 0;
    width: 100%;
    margin-top: 0;
    padding-inline: var(--gutter);
  }
}

/* ── Mobile (≤540px) ──── */
@media (max-width: 540px) {
  .story-promo::after {
    /* Black fills bottom 319px (y=220 to y=539 at mobile) */
    height: 319px;
  }

  /* Image aligns to the left with 48px margin (matches Figma) */
  .story-promo__media {
    left: 48px;
    transform: none;
  }
}

/* ============================================================
   PROMO  —  Beyond the Stories
   ============================================================ */

.promo {
  position: relative;
  height: 100svh;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: var(--space-section);
  background: var(--clr-white);
}

.promo__bg {
  position: absolute;
  inset: var(--gutter);
  z-index: 0;
  overflow: hidden;
}

.promo__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
}

.promo__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.promo__title-wrap {
  display: flex;
  justify-content: center;
}

.promo__title {
  font-family: var(--font-display);
  font-size: clamp(50px, 7.5vw, 120px); /* Figma Mobile/H1: 50px */
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.5px; /* Figma: -0.5px */
  text-transform: uppercase;
  color: var(--clr-white);
  text-align: center;
  display: inline-block;
}

.promo__title-line {
  display: block;
}

.promo__title-line + .promo__title-line {
  margin-top: -0.16em; /* Figma line-height 42/50 = 0.84 → overlap = 0.16em */
}

.promo__title .char {
  display: inline-block;
  transform: translateY(115%);
}

@media (prefers-reduced-motion: no-preference) {
  .promo__title.is-revealed .char {
    animation: char-rise 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
}

@media (prefers-reduced-motion: reduce) {
  .promo__title.is-revealed .char {
    transform: translateY(0);
  }
}

.promo__subtitle {
  font-size: 16px;
  line-height: 22px;
  font-weight: 600;
  color: var(--clr-white);
  margin-bottom: 4px;
}

/* Dark theming */

.promo.dark {
  background: var(--clr-black);
}

/* ── Mobile (≤540px) ──── */
@media (max-width: 540px) {
  .promo {
    /* portrait: image fills (100vw - 36px) wide at ~1.92:1 ratio, plus 18px bottom border */
    height: calc((100vw - 36px) * 1.92 + 18px);
    min-height: unset;
    padding-bottom: 48px;
  }

  .promo__bg {
    inset: 0 18px 18px;
  }

  .promo__content {
    max-width: calc(100vw - 36px);
    padding-inline: 16px;
  }
}

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
  background: var(--clr-black);
  color: var(--clr-white);
}

/* Top bar: logo | url | back-to-top */
.site-footer__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 48px var(--gutter) 0;
}

.site-footer__logo {
  width: 150px;
  height: auto;
}

.site-footer__url {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--clr-white);
}

/* CTA block: "NOW IT'S YOUR TURN" + donate */
.footer-cta__canvas {
  position: relative;
  width: 100%;
  max-width: 35vw;
  aspect-ratio: 430 / 330;
  container-type: inline-size;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Tablet/desktop (min-width: 541px) ──── */
@media (min-width: 541px) {
  .footer-cta__canvas {
    max-width: min(560px, 50vw);
  }
}

.footer-cta__lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* Footer heading chars — hidden until .is-revealed fires */
.site-footer__cta-heading .char {
  display: inline-block;
  transform: translateY(115%);
}

.footer-cta__heading-line {
  display: block;
}

.footer-cta__heading-line + .footer-cta__heading-line {
  margin-top: -0.16em; /* preserve original line-height: 0.84 overlap */
}

@media (prefers-reduced-motion: no-preference) {
  .site-footer__cta-heading.is-revealed .char {
    animation: char-rise 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-footer__cta-heading.is-revealed .char {
    transform: translateY(0);
  }
}

/* Donate button — fades in with the text */
#footer-cta-btn {
  opacity: 0;
  transition: opacity 0.6s ease;
}

#footer-cta-btn.is-revealed {
  opacity: 1;
}

.footer-cta__canvas .site-footer__cta-inner {
  position: relative;
  z-index: 1;
}

.site-footer__cta-block {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px var(--gutter) 40px;
  max-width: var(--max-w);
  margin-inline: auto;
}

.site-footer__cta-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.8cqw;
  transform: rotate(-14.5deg);
  transform-origin: center center;
}

.site-footer__cta-inner .btn {
  align-self: flex-end;
  font-size: max(11px, 3.5cqw);
  line-height: 1.2;
  padding: 2cqw 3.5cqw;
}

.site-footer__cta-heading-wrap {
  display: flex;
  justify-content: flex-start;
}

.site-footer__cta-heading {
  font-family: var(--font-display);
  font-size: 14cqw;
  font-weight: 900;
  line-height: 0.84;
  letter-spacing: -0.5px;
  text-transform: uppercase;
  color: var(--clr-white);
  text-align: left;
  display: inline-block;
}

/* Bottom bar: share + legal stacked, centred */
.site-footer__bottom-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: var(--max-w);
  margin-inline: auto;
  padding: 0 var(--gutter) 40px;
}

/* Share row */
.site-footer__share {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  padding: 0;
  max-width: none;
  margin-inline: 0;
}

.site-footer__share-label {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--clr-white);
}

.site-footer__social {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
  transition: opacity 0.15s ease;
}

.site-footer__social:hover,
.site-footer__social:focus-visible {
  opacity: 1;
}

/* Legal bar */
.site-footer__legal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  max-width: none;
  margin-inline: 0;
  padding: 0;
  margin-top: 24px;
  border-top: none;
  text-align: center;
}

.site-footer__legal p,
.site-footer__legal a {
  font-size: 14px;
  line-height: 18px;
  font-weight: 600;
  color: rgba(255 255 255 / 0.7);
}

.site-footer__legal a {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.site-footer__legal a:hover {
  color: var(--clr-white);
}

/* Mobile-only footer elements — hidden by default, shown inside media query below */
.site-footer__url--mobile,
.site-footer__back-top--mobile {
  display: none;
}

/* ── Mobile (≤540px) ──── */
@media (max-width: 540px) {
  /* Top bar: logo only, centred */
  .site-footer__top {
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding-bottom: 0;
  }

  .site-footer__url--desktop,
  .site-footer__back-top--desktop {
    display: none;
  }

  /* Mobile-only url */
  .site-footer__url--mobile {
    display: block;
    text-align: center;
    padding: 48px var(--gutter) 0;
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--clr-white);
  }

  /* Mobile-only back-to-top */
  .site-footer__back-top--mobile {
    display: block;
    width: fit-content;
    margin-inline: auto;
    margin-top: 48px;
  }

  /* Bottom bar stacks on mobile */
  .site-footer__bottom-bar {
    flex-direction: column;
    align-items: center;
    padding-bottom: 32px;
  }

  /* Share: centre */
  .site-footer__share {
    justify-content: center;
  }

  /* Legal: full width, break out of bar padding */
  .site-footer__legal {
    align-items: center;
    text-align: center;
    margin-top: 24px;
    width: calc(100% + 2 * var(--gutter));
    margin-inline: calc(-1 * var(--gutter));
    padding-inline: 18px;
  }
}

/* ============================================================
   FOCUS STYLES
   ============================================================ */

:focus-visible {
  outline: 3px solid var(--clr-red);
  outline-offset: 2px;
}

/* White focus ring inside the red menu overlay */
.site-menu :focus-visible,
.site-nav__menu[aria-expanded='true']:focus-visible {
  outline-color: var(--clr-white);
}

/* ============================================================
   PRINT  —  basic clean-up
   ============================================================ */

@media print {
  .site-nav,
  .site-footer__share {
    display: none;
  }
}
