﻿/* =============================================================
   Shepherd's House — Recovery Community
   ----------------------------------------------------------------
   Palette — UNC Chapel Hill brand system
     carolina    #4B9CD3   primary brand (Carolina Blue)
     navy        #13294B   dark accent / CTAs (replaces orange)
     bolin       #2C5080   mid navy
     cloud       #EDF5FB   page / section tints
     header-green #98C42F  header accent only (unchanged)
     text        #151515   web black
   Derived shades for hover, soft tints, and section variation.
   ============================================================= */

/* Self-hosted Satoshi (heading font). Served locally so it loads
   reliably even when third-party CDNs are blocked. */
@font-face {
  font-family: "Satoshi";
  src: url("assets/fonts/satoshi-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("assets/fonts/satoshi-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
/* Satoshi has no 600 weight; alias 600 to the 700 file so 600-weight
   headings still render as Satoshi instead of falling back. */
@font-face {
  font-family: "Satoshi";
  src: url("assets/fonts/satoshi-700.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  /* UNC Carolina Blue + Navy */
  --blue: #4b9cd3;
  --blue-deep: #13294b;
  --blue-mid: #2c5080;
  --blue-soft: #edf5fb;
  --blue-link: #007fae;
  --blue-fountain: #b7d7ed;

  /* primary CTAs — Carolina blue (swapped from navy) */
  --orange: #4b9cd3;
  --orange-deep: #3a8bc2;
  --orange-soft: #d4eaf7;
  --orange-mid: #7ec0e8;

  --panel: #4b9cd3;
  --panel-deep: #4b9cd3;
  --panel-soft: #edf5fb;
  --panel-mid: #b7d7ed;

  --green: var(--panel);
  --green-deep: var(--panel-deep);
  --green-soft: var(--panel-soft);
  --green-mid: var(--panel-mid);

  /* preserved for header — not used in page gradients */
  --header-green: #98c42f;
  --header-green-deep: #7aa422;

  --cream: #edf5fb;
  --cream-deep: #b7d7ed;
  --cream-soft: #f5fafd;
  --white: #ffffff;

  --dark: #151515;
  --dark-2: #414141;

  /* legacy token aliases — keep semantic names consistent across the file */
  --navy: #13294b;
  --slate: var(--dark-2);
  --ivory: var(--cream);
  --charcoal: var(--dark);
  --gray: #5b6670;
  --gold: var(--orange);
  --gold-deep: var(--orange-deep);
  --gold-soft: var(--orange-soft);
  --sage: var(--green);
  --sage-deep: var(--green-deep);
  --sage-soft: var(--green-soft);
  --sand: var(--cream-deep);
  --sand-soft: var(--cream-soft);
  --rust: var(--orange-deep);
  --rust-soft: var(--orange-mid);
  --heading: var(--blue-deep);
  --heading-deep: var(--orange-deep);

  --header-offset: 5.5rem;

  /* Hero intro overlay — capped hold + quick fade (--hero-intro-hold set via JS) */
  --hero-intro-hold: 2.5s;
  --hero-intro-animate: 1.4s;
  --hero-intro-total: calc(var(--hero-intro-hold) + var(--hero-intro-animate));

  /* semantic */
  --bg: var(--ivory);
  --surface: var(--white);
  --text: var(--charcoal);
  --muted: var(--gray);
  --line: rgba(21, 21, 21, 0.1);
  --line-strong: rgba(21, 21, 21, 0.18);
  --line-onDark: rgba(255, 255, 255, 0.12);

  /* shadows */
  --shadow-xs: 0 2px 8px rgba(21, 21, 21, 0.05);
  --shadow-sm: 0 6px 18px rgba(21, 21, 21, 0.07);
  --shadow-md: 0 14px 36px rgba(21, 21, 21, 0.08);
  --shadow-lg: 0 28px 60px rgba(21, 21, 21, 0.12);

  /* shape */
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-pill: 999px;

  /* spacing scale (base 4) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-7: 1.75rem;
  --space-8: 2rem;
  --space-9: 2.25rem;
  --space-11: 2.75rem;
  --space-14: 3.5rem;
  --space-18: 4.5rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* layout */
  --container-max: 1200px;
  --container-gutter: 1.5rem;
  --section-y: clamp(4rem, 8vw, 6.5rem);

  /* type */
  --font-display: "Satoshi", system-ui, -apple-system, sans-serif;
  --font-sans:
    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, sans-serif;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-cinematic: cubic-bezier(0.22, 1, 0.36, 1);

  /* image zoom (cinematic slow-scale on hover) */
  --zoom-duration: 2400ms;
  --zoom-scale: 1.08;
}

/* ---------------------------------------------------------------
   Reset & base
   --------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  font-size: 16px;
  line-height: 1.65;
  background: var(--ivory);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

/* ---------------------------------------------------------------
   Shared image component
   --------------------------------------------------------------- */
.img {
  position: relative;
  display: block;
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--sand-soft), var(--ivory));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  isolation: isolate;
}

.img > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--zoom-duration) var(--ease-cinematic);
  display: block;
}

.img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(30, 42, 51, 0) 45%,
    rgba(30, 42, 51, 0.62) 100%
  );
  pointer-events: none;
  z-index: 1;
}

.img:hover > img {
  transform: scale(var(--zoom-scale));
  will-change: transform;
}

@media (hover: none) {
  .img:hover > img {
    will-change: auto;
  }
}

.img figcaption {
  position: absolute;
  left: 1.1rem;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 2;
  display: grid;
  gap: 0.25rem;
  color: var(--white);
}

.img figcaption span {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
}

.img figcaption strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--white);
  letter-spacing: -0.005em;
}

.img-aspect-43 {
  aspect-ratio: 4 / 3;
}

.img-aspect-169 {
  aspect-ratio: 16 / 9;
}

.img-aspect-219 {
  aspect-ratio: 21 / 9;
}

.img-aspect-11 {
  aspect-ratio: 1 / 1;
}

a {
  color: inherit;
}

::selection {
  background: rgba(19, 41, 75, 0.4);
  color: var(--slate);
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link,
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  clip: auto;
  width: auto;
  height: auto;
  margin: 1rem;
  padding: 0.75rem 1rem;
  background: var(--navy);
  color: var(--white);
  border-radius: var(--radius-pill);
  z-index: 1000;
}

/* ---------------------------------------------------------------
   Page glows
   --------------------------------------------------------------- */
.page-glow {
  position: fixed;
  width: 28rem;
  height: 28rem;
  filter: blur(72px);
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
  contain: strict;
}

.page-glow-left {
  top: 6rem;
  left: -10rem;
  background: radial-gradient(
    circle,
    rgba(75, 156, 211, 0.38),
    transparent 70%
  );
}

.page-glow-right {
  top: 38rem;
  right: -10rem;
  background: radial-gradient(
    circle,
    rgba(19, 41, 75, 0.18),
    transparent 70%
  );
}

.site-header,
.hero,
.section,
.site-footer {
  position: relative;
  z-index: 1;
}

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

/* ---------------------------------------------------------------
   Typography helpers
   --------------------------------------------------------------- */
/* Canonical light-section eyebrow — all sections inherit this; dark sections override below */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 var(--space-5);
  max-width: none;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dark);
}

.eyebrow::before {
  content: "";
  flex-shrink: 0;
  width: 1.8rem;
  height: 1px;
  background: var(--dark);
}

/* Light eyebrow on dark navy sections (YouTube, etc.) */
.section-black-sheep .eyebrow,
.on-dark .eyebrow {
  color: var(--gold-soft);
}

.section-black-sheep .eyebrow::before,
.on-dark .eyebrow::before {
  background: var(--rust-soft);
}

.panel-label {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 var(--space-3);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dark);
}

.panel-label::before {
  content: "";
  flex-shrink: 0;
  width: 1.8rem;
  height: 1px;
  background: var(--dark);
}

.text-accent {
  position: relative;
  display: inline-block;
  color: var(--blue);
  font-style: italic;
  font-size: 1.08em;
  padding: 0 0.18em 0 0.04em;
  line-height: inherit;
  text-transform: capitalize;
  text-shadow: 0 2px 6px rgba(19, 41, 75, 0.25);
}

/* Heading accents inherit parent h1/h2/h3 shadow */
h1 .text-accent,
h2 .text-accent,
h3 .text-accent {
  text-shadow: inherit;
}

/* Underline on hero accent word only */
.hero .text-accent {
  padding-bottom: 0.12em;
}

.hero .text-accent::after {
  content: "";
  position: absolute;
  left: 0.04em;
  right: 0.18em;
  bottom: 0;
  height: 3px;
  background: var(--blue);
  border-radius: 999px;
  opacity: 1;
  box-shadow: none;
  transform-origin: left center;
  transform: scaleX(0);
  animation: hero-accent-underline 1.4s var(--ease)
    calc(var(--hero-intro-total) + 0.2s) forwards;
}

@keyframes hero-accent-underline {
  to {
    transform: scaleX(1);
  }
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  color: var(--heading);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0;
  font-weight: 600;
  text-shadow: 0 2px 3px rgba(29, 26, 5, 0.22),
    0 3px 6px rgba(29, 26, 5, 0.16);
}

.section-black-sheep h1,
.section-black-sheep h2,
.section-black-sheep h3,
.section-black-sheep h4,
.site-footer h1,
.site-footer h2,
.site-footer h3,
.site-footer h4 {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.55),
    0 4px 10px rgba(0, 0, 0, 0.4);
}

/* Softer shadow on light sections so the headings stay airy */
.section-mission h1,
.section-mission h2,
.section-mission h3,
.section-history h1,
.section-history h2,
.section-history h3,
.section-programs h1,
.section-programs h2,
.section-community h1,
.section-community h2 {
  text-shadow: 0 1px 2px rgba(29, 26, 5, 0.12),
    0 2px 5px rgba(29, 26, 5, 0.08);
}

.hero h1,
.hero h2 {
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.55),
    0 8px 24px rgba(0, 0, 0, 0.5),
    0 16px 42px rgba(0, 0, 0, 0.38);
}

p {
  margin: 0;
}

/* ---------------------------------------------------------------
   Header — utility bar + nav
   --------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  margin-top: 0;
  padding: clamp(0.65rem, 1.5vw, 0.85rem) 0 0;
  background: transparent;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  animation: siteHeaderReveal 0.45s ease 0.15s forwards;
}

/* On the homepage, the header waits for the hero intro to finish before
   revealing. Other pages have no intro, so the short default delay above
   gives them a quick, smooth fade-in. */
@media (prefers-reduced-motion: no-preference) {
  body:has(.hero-intro) .site-header {
    animation-delay: var(--hero-intro-total);
  }
}

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

.site-header > .container {
  --header-shell-fill: var(--white);
  --header-shell-border: linear-gradient(
    90deg,
    var(--gold) 0%,
    var(--header-green) 50%,
    var(--rust) 100%
  );
  max-width: min(1640px, 100% - 3rem);
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  padding-inline: 0;
}

/* Nav shell — compact bar on mobile; contents wrapper on desktop */
.nav-shell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

@media (min-width: 1281px) {
  .site-header > .container {
    position: relative;
    display: flex;
    align-items: center;
    gap: clamp(0.45rem, 1.2vw, 1rem);
    padding: 0.55rem clamp(0.55rem, 1vw, 0.65rem) 0.55rem
      clamp(0.75rem, 1.4vw, 1rem);
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    background:
      linear-gradient(var(--header-shell-fill), var(--header-shell-fill))
        padding-box,
      var(--header-shell-border) border-box;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset,
      0 6px 20px rgba(30, 42, 51, 0.05);
    min-width: 0;
    transition: box-shadow 320ms var(--ease);
  }

  .site-header.is-scrolled > .container {
    box-shadow: 0 10px 30px rgba(30, 42, 51, 0.12);
  }

  .nav-shell {
    display: contents;
  }
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  flex-shrink: 0;
  min-width: 0;
  position: relative;
}

.brand-logo {
  display: block;
  height: 2.4rem;
  width: auto;
  flex-shrink: 0;
  transition:
    transform 240ms var(--ease),
    opacity 200ms var(--ease);
}

.brand-logo:hover {
  transform: rotate(-2deg) scale(1.03);
}

.brand-tagline {
  display: inline-flex;
  flex-direction: column;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1.45;
  color: var(--muted);
  padding-left: 0.85rem;
  border-left: 1px solid var(--line-strong);
}

.brand-tagline > span:first-child {
  color: var(--heading);
}

.site-navigation {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.92rem;
  margin: 0 auto;
}

.site-navigation a:not(.button) {
  position: relative;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-pill);
  color: var(--charcoal);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition:
    background 220ms var(--ease),
    color 220ms var(--ease);
}

.site-navigation a:not(.button)::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0.3rem;
  width: 0.3rem;
  height: 0.3rem;
  border-radius: 50%;
  background: var(--gold);
  transform: translateX(-50%) scale(0);
  transition: transform 220ms var(--ease);
}

.site-navigation a:not(.button):hover {
  color: var(--heading);
  background: rgba(75, 156, 211, 0.06);
}

.site-navigation a:not(.button):hover::before {
  transform: translateX(-50%) scale(1);
}

/* Right-side actions: phone + CTA */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.nav-phone {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.55rem;
  color: var(--charcoal);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: var(--radius-pill);
  transition: color 200ms var(--ease);
}

.nav-phone svg {
  width: 14px;
  height: 14px;
  stroke: var(--blue);
  stroke-width: 1.7;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 220ms var(--ease);
}

.nav-phone:hover {
  color: var(--heading);
}

.nav-phone:hover svg {
  transform: rotate(-8deg) scale(1.05);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-pill);
  background: var(--blue);
  color: var(--white);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.86rem;
  letter-spacing: 0.01em;
  text-shadow: none;
  box-shadow: 0 2px 8px rgba(19, 41, 75, 0.15);
  transition:
    background 200ms var(--ease),
    transform 200ms var(--ease),
    box-shadow 200ms var(--ease);
}

.nav-cta svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 200ms var(--ease);
}

.nav-cta:hover {
  background: var(--blue-mid);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(19, 41, 75, 0.2);
}

.nav-cta:hover svg {
  transform: translateX(3px);
}

/* Prominent donate CTA */
.nav-donate {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--header-green), var(--header-green-deep));
  color: var(--white);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.86rem;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 18px rgba(152, 196, 47, 0.35);
  transition:
    background 200ms var(--ease),
    transform 200ms var(--ease),
    box-shadow 200ms var(--ease);
}

.nav-donate svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex-shrink: 0;
}

.nav-donate:hover {
  background: linear-gradient(135deg, var(--header-green-deep), var(--header-green));
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(122, 164, 34, 0.42);
}

.nav-donate-compact {
  display: none;
}

/* Nav drawer — inline on desktop, slide-over on mobile */
.mobile-nav-panel {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1;
  min-width: 0;
}

.nav-backdrop {
  display: none;
}

/* Animated hamburger */
.nav-toggle {
  display: none;
  position: relative;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--line-strong);
  background: var(--white);
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  transition:
    background 200ms var(--ease),
    border-color 200ms var(--ease);
}

.nav-toggle:hover {
  background: var(--sand-soft);
  border-color: var(--gold);
}

.nav-toggle span:not(.sr-only) {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1.05rem;
  height: 2px;
  background: var(--heading);
  border-radius: var(--radius-pill);
  transform: translate(-50%, -50%);
  transition:
    transform 240ms var(--ease),
    opacity 200ms var(--ease),
    top 240ms var(--ease);
}

.nav-toggle span:not(.sr-only):nth-child(1) {
  top: calc(50% - 6px);
}
.nav-toggle span:not(.sr-only):nth-child(2) {
  top: 50%;
}
.nav-toggle span:not(.sr-only):nth-child(3) {
  top: calc(50% + 6px);
}

.nav-toggle[aria-expanded="true"] span:not(.sr-only):nth-child(1) {
  top: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:not(.sr-only):nth-child(2) {
  opacity: 0;
  transform: translate(-50%, -50%) scaleX(0);
}
.nav-toggle[aria-expanded="true"] span:not(.sr-only):nth-child(3) {
  top: 50%;
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* ---------------------------------------------------------------
   Buttons
   --------------------------------------------------------------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.95rem 1.5rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: var(--gold);
  color: var(--white);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  text-shadow: none;
  box-shadow: 0 2px 8px rgba(19, 41, 75, 0.15);
  transition:
    transform 220ms var(--ease),
    background 220ms var(--ease),
    color 220ms var(--ease),
    box-shadow 220ms var(--ease);
}

.button:hover {
  background: var(--gold-deep);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(19, 41, 75, 0.2);
}

.button-secondary {
  background: transparent;
  border-color: rgba(75, 156, 211, 0.45);
  color: var(--blue-mid);
  box-shadow: none;
}

.button-secondary:hover {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(19, 41, 75, 0.15);
}

.button.light {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--white);
  box-shadow: none;
}

.button.light:hover {
  background: rgba(255, 255, 255, 0.16);
}

.button-small {
  padding: 0.6rem 1.1rem;
  font-size: 0.85rem;
  box-shadow: 0 2px 8px rgba(19, 41, 75, 0.15);
}

/* ---------------------------------------------------------------
   Hero — centered cinematic with full-bleed video background
   --------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  background: var(--blue-deep);
  color: var(--white);
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--blue-deep);
}

.hero-bg-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transform: scale(1.02);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(
      ellipse 85% 65% at 50% 44%,
      rgba(10, 20, 38, 0.22) 0%,
      rgba(10, 20, 38, 0.06) 52%,
      transparent 100%
    ),
    linear-gradient(
      180deg,
      rgba(10, 20, 38, 0.18) 0%,
      rgba(10, 20, 38, 0.04) 45%,
      rgba(10, 20, 38, 0.2) 100%
    );
}

html.is-hero-intro-active,
body.is-hero-intro-active {
  overflow: hidden;
}

body.is-hero-intro-active #top.hero,
body.is-hero-intro-active .homepage-scrolly #top.scrolly-section,
body.is-hero-intro-active .hero {
  z-index: 10000;
}

/* Pure-CSS guard: while the hero intro overlay is still showing, lift #top
   above the next stacked panel so #story can't paint over the intro video.
   The .hero-intro is position:fixed but lives inside #top's stacking context,
   so #top itself must outrank #story until the intro completes. No JS timing
   dependency — reverts automatically when .is-complete is added. */
.homepage-scrolly #top.scrolly-section:has(.hero-intro:not(.is-complete)) {
  z-index: 10000;
}

/* Page-load intro: full-viewport video plays completely, then fades out. */
.hero-intro {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: auto;
  cursor: pointer;
  background-color: var(--cream);
  opacity: 1;
  overflow: hidden;
}

.hero-intro-skip {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 10001;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  border: 1px solid rgba(75, 156, 211, 0.45);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--blue-mid);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition:
    background 200ms var(--ease),
    transform 200ms var(--ease),
    opacity 200ms var(--ease);
}

.hero-intro-skip:hover {
  background: var(--white);
  transform: translateY(-1px);
}

.hero-intro.is-complete ~ .hero-intro-skip,
.hero-intro-skip.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.hero-intro-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  background: var(--cream);
}

/* Cover crops on-screen text on portrait / narrow viewports — show full frame instead */
@media (max-width: 720px), (orientation: portrait) and (max-width: 1024px) {
  .hero-intro-video {
    object-fit: contain;
  }
}

.hero-intro.is-fading {
  animation: heroIntroFade var(--hero-intro-animate)
    cubic-bezier(0.4, 0, 0.6, 1) forwards;
}

.hero-intro.is-complete {
  visibility: hidden;
  pointer-events: none;
}

@keyframes heroIntroFade {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes siteHeaderReveal {
  to {
    opacity: 1;
    visibility: visible;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-intro {
    display: none;
  }

  .hero-intro-skip {
    display: none;
  }

  .hero .text-accent::after {
    animation: none;
    transform: scaleX(1);
  }

  .site-header {
    animation: none;
    opacity: 1;
    visibility: visible;
  }
}

.hero-inner {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: min(100vh, 56rem);
  min-height: min(100dvh, 56rem);
  padding: clamp(6.5rem, 14vh, 9rem) var(--container-gutter)
    clamp(2rem, 5vh, 3rem);
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, 46rem);
  gap: 0;
}

.hero-eyebrow {
  margin: 0 0 var(--space-4);
  font-family: var(--font-sans);
  font-size: clamp(0.78rem, 1.1vw, 0.92rem);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.55),
    0 4px 14px rgba(0, 0, 0, 0.45);
}

.hero h1 {
  font-size: clamp(2.5rem, 5.8vw, 4.5rem);
  margin-bottom: var(--space-5);
  max-width: 16ch;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.08;
  color: var(--white);
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.55),
    0 8px 24px rgba(0, 0, 0, 0.5),
    0 16px 42px rgba(0, 0, 0, 0.38);
}

.hero-lede {
  font-size: clamp(1rem, 1.35vw, 1.15rem);
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.92);
  max-width: 38rem;
  margin: 0 0 var(--space-6);
  text-shadow:
    0 1px 3px rgba(0, 0, 0, 0.55),
    0 4px 16px rgba(0, 0, 0, 0.45);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  margin-bottom: 0;
}

.hero-actions .button svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 220ms var(--ease);
}

.hero-actions .button:hover svg {
  transform: translateX(4px);
}

.button-on-dark {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.28);
  color: var(--white);
  box-shadow: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.button-on-dark:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.42);
  color: var(--white);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.hero-stats {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
  margin: 0 auto;
  padding: var(--space-5) clamp(1.25rem, 4vw, 3rem)
    clamp(2.5rem, 6vh, 4rem);
  list-style: none;
  max-width: var(--container-max);
  flex-shrink: 0;
}

.hero-stats li {
  padding: var(--space-4) var(--space-5);
  display: grid;
  gap: 0.35rem;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
  transition:
    transform 280ms var(--ease),
    box-shadow 280ms var(--ease),
    border-color 280ms var(--ease),
    background 280ms var(--ease);
}

.hero-stats li:hover {
  transform: translateY(-3px);
  border-color: rgba(75, 156, 211, 0.45);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.24);
}

.hero-stats li + li {
  border-left: 0;
  padding-left: var(--space-5);
}

.hero-stats strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 2.6vw, 2.35rem);
  color: var(--blue-fountain);
  font-weight: 600;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  text-shadow:
    0 1px 3px rgba(0, 0, 0, 0.5),
    0 4px 12px rgba(0, 0, 0, 0.4);
}

.hero-stats span {
  display: block;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.4;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}


/* ---------------------------------------------------------------
   Accreditations
   --------------------------------------------------------------- */
.section-accreditations {
  scroll-margin-top: 5rem;
}

.section-accreditations::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(
    180deg,
    var(--cream) 0%,
    rgba(75, 156, 211, 0.08) 40%,
    rgba(75, 156, 211, 0.08) 60%,
    var(--cream) 100%
  );
}

.accreditations-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr);
  gap: var(--space-10);
  align-items: center;
  padding: var(--space-10);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--white);
  box-shadow: var(--shadow-md);
}

.accreditations-copy {
  display: grid;
  gap: var(--space-4);
}

.accreditations-copy h2 {
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  max-width: 22ch;
}

.accreditations-copy > p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.7;
  max-width: 38ch;
}

.accreditations-copy .button svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.accreditation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.accreditation-card {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--cream-soft);
  text-align: center;
  transition:
    transform 240ms var(--ease),
    box-shadow 240ms var(--ease);
}

.accreditation-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
}

.accreditation-card img {
  width: 100%;
  height: auto;
  max-height: 9rem;
  object-fit: contain;
  margin-inline: auto;
  border-radius: var(--radius-sm);
}

.accreditation-card p {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--heading);
  line-height: 1.4;
}


/* ---------------------------------------------------------------
   Sections
   --------------------------------------------------------------- */
.section {
  padding-block: var(--section-y);
  scroll-margin-top: 5rem;
}

#run-for-recovery,
#donate,
#history,
#youtube,
#accreditations {
  scroll-margin-top: 6.5rem;
}

.section-heading {
  display: grid;
  gap: var(--space-3);
  margin-bottom: var(--space-12);
  max-width: var(--container-max);
}

.section-heading h2 {
  font-size: clamp(2rem, 3.6vw, 3rem);
  max-width: 28ch;
  font-weight: 600;
}

.section-heading > p:not(.eyebrow),
.section-lede {
  color: var(--muted);
  line-height: 1.7;
  max-width: 40rem;
}

.section-lede {
  margin: 0;
  font-size: 1.02rem;
}

/* ---------------------------------------------------------------
   Mission / Story
   --------------------------------------------------------------- */
.section-mission {
  background: linear-gradient(180deg, var(--white) 0%, var(--blue-soft) 100%);
  position: relative;
  z-index: 2;
  padding-bottom: clamp(2rem, 4vw, 3.5rem);
}

.section-history {
  z-index: 3;
  --chapter-surface: var(--white);
  padding-bottom: clamp(3rem, 6vw, 5rem);
}

.section-programs {
  z-index: 4;
  --chapter-surface: var(--white);
}

.section-community {
  z-index: 5;
  --chapter-surface: var(--white);
}

.section-black-sheep {
  z-index: 6;
  --chapter-surface: #13294b;
}

.section-accreditations {
  z-index: 7;
  --chapter-surface: var(--white);
}

.section-testimonials {
  z-index: 8;
  --chapter-surface: var(--white);
}

.story-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: var(--space-10);
  align-items: center;
  margin-bottom: var(--space-12);
}

.story-media {
  position: relative;
}

.story-media .story-feature-image {
  margin: 0;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(30, 42, 51, 0.18);
}

.story-media .story-feature-image::after {
  display: none;
}

.story-media .story-feature-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.story-badge {
  position: absolute;
  bottom: -1.25rem;
  left: -1.25rem;
  display: grid;
  gap: 0.15rem;
  padding: 1rem 1.25rem;
  background: var(--blue-deep);
  color: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(19, 41, 75, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.story-badge-year {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 600;
  line-height: 1;
  color: var(--white);
}

.story-badge-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}

.story-content {
  display: grid;
  gap: var(--space-4);
}

.story-content h2 {
  font-size: clamp(1.9rem, 3.2vw, 2.6rem);
  margin: 0;
  max-width: 26ch;
}

.story-content > p:not(.eyebrow) {
  color: var(--text);
  line-height: 1.7;
  margin: 0;
}

.story-content .story-lede {
  font-size: 1.08rem;
  color: var(--slate);
  font-weight: 500;
}

.story-facts {
  display: grid;
  gap: 0;
  margin: var(--space-3) 0 0;
  padding: var(--space-5) 0 0;
  border-top: 1px solid var(--line);
}

.story-facts > div {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  gap: var(--space-4);
  align-items: baseline;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
}

.story-facts > div:last-child {
  border-bottom: 0;
}

.story-facts dt {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin: 0;
}

.story-facts dd {
  margin: 0;
  color: var(--heading);
  font-weight: 500;
  line-height: 1.5;
}

/* ---------------------------------------------------------------
   Programs — alternating timeline
   --------------------------------------------------------------- */
.section-programs .section-heading {
  margin-bottom: var(--space-10);
}

.section-programs .program-timeline::before,
.section-programs .program-timeline-marker {
  display: none;
}

.program-timeline {
  --timeline-line: rgba(75, 156, 211, 0.22);
  --timeline-axis: 50%;
  --program-media-height: clamp(18rem, 32vw, 24rem);
  position: relative;
  display: grid;
  gap: 0;
}

.program-timeline::before {
  content: "";
  position: absolute;
  left: var(--timeline-axis);
  top: 0;
  bottom: 0;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(
    180deg,
    transparent 0%,
    var(--timeline-line) 8%,
    var(--timeline-line) 92%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 1;
}

.program-timeline-item {
  --accent: var(--gold);
  --accent-deep: var(--gold-deep);
  --accent-soft: var(--sand-soft);
  --accent-line: var(--sand);
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
  border-block: 1px solid var(--line);
}

.program-timeline-item + .program-timeline-item {
  border-top: 0;
}

.program-timeline-item:nth-child(even) .program-timeline-media {
  order: 2;
}

.program-timeline-media {
  position: relative;
  margin: 0;
  overflow: hidden;
  background: var(--dark);
  width: 100%;
  height: 100%;
  min-height: var(--program-media-height);
  align-self: stretch;
}

.program-timeline-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(29, 26, 5, 0) 55%,
    rgba(29, 26, 5, 0.45) 100%
  );
  pointer-events: none;
}

.program-timeline-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform var(--zoom-duration) var(--ease-cinematic);
}

.program-timeline-item:hover .program-timeline-media img {
  transform: scale(var(--zoom-scale));
}

.program-duration {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 1;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  background: var(--white);
  border: 1px solid rgba(19, 41, 75, 0.15);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--blue-deep);
  letter-spacing: 0.01em;
  box-shadow: 0 2px 8px rgba(19, 41, 75, 0.12);
}

.program-timeline-body {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-self: stretch;
  min-height: var(--program-media-height);
  gap: var(--space-3);
  padding: clamp(var(--space-6), 4vw, var(--space-9))
    clamp(var(--space-6), 5vw, var(--space-10));
  background: var(--white);
}

.program-timeline-marker {
  position: absolute;
  top: 50%;
  left: var(--timeline-axis);
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--white);
  box-shadow:
    0 0 0 1px var(--accent-line),
    0 4px 14px rgba(29, 26, 5, 0.14);
  transform: translate(-50%, -50%);
  z-index: 2;
  pointer-events: none;
}

.program-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: calc(0.62rem * 1 + 0.44rem);
  padding: 0.22rem 0.65rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--blue-deep);
  color: var(--white);
  font-size: 0.62rem;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  width: fit-content;
  margin: 0;
}

.program-timeline-body h3 {
  font-size: clamp(1.28rem, 2.2vw, 1.7rem);
  margin: 0;
  line-height: 1.2;
  text-shadow: none;
}

.program-timeline-body > p:not(.program-tag) {
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
  font-size: 0.95rem;
  max-width: 100%;
}

.program-timeline-body > .program-tag {
  color: var(--white);
}

.program-timeline-body .link-arrow {
  margin-top: var(--space-2);
  color: var(--accent-deep);
}

/* per-accent variables */
.program-timeline-item.accent-gold {
  --accent: var(--blue);
  --accent-deep: var(--blue-mid);
  --accent-soft: var(--blue-soft);
  --accent-line: rgba(75, 156, 211, 0.35);
}

.program-timeline-item.accent-sage {
  --accent: var(--blue-fountain);
  --accent-deep: var(--blue-mid);
  --accent-soft: var(--blue-soft);
  --accent-line: rgba(75, 156, 211, 0.3);
}

.program-timeline-item.accent-deep {
  --accent: var(--blue-deep);
  --accent-deep: var(--blue-deep);
  --accent-soft: rgba(75, 156, 211, 0.12);
  --accent-line: rgba(19, 41, 75, 0.22);
}

.program-timeline-item.accent-sand {
  --accent: var(--blue);
  --accent-deep: var(--blue-mid);
  --accent-soft: rgba(183, 215, 237, 0.45);
  --accent-line: rgba(75, 156, 211, 0.35);
}

/* ---------------------------------------------------------------
   Community / Get Involved
   --------------------------------------------------------------- */
.community-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
  max-width: 68rem;
  margin-inline: auto;
}

/* ----- Carousel mode (enabled via JS by setting data-carousel="active") ---- */
.community-grid[data-carousel="active"] {
  position: relative;
  display: block;
  height: clamp(22rem, 38vw, 26rem);
  max-width: 70rem;
  padding: 0;
  overflow: visible;
  perspective: 1400px;
}

.community-grid[data-carousel="active"] .community-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(20rem, 56vw, 36rem);
  height: clamp(20rem, 36vw, 24rem);
  margin: 0;
  transform-origin: center;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  transition:
    transform 900ms cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 900ms cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 1;
  filter: none;
  overflow: hidden;
}

/* Scroll-reveal must not fight carousel positioning or hide cards */
.community-grid[data-carousel="active"] .community-card[data-reveal] {
  opacity: 1;
}

.community-grid[data-carousel="active"] .community-image {
  height: 100%;
  min-height: 0;
  aspect-ratio: auto;
}

.community-grid[data-carousel="active"] .community-image.img-aspect-43 {
  aspect-ratio: auto;
}

.community-grid[data-carousel="active"] .community-image > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Override the alternating image side in carousel — keep all cards consistent */
.community-grid[data-carousel="active"] .community-card:nth-child(even) {
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
}

.community-grid[data-carousel="active"] .community-card:nth-child(even) .community-image {
  order: 0;
  border-right: 1px solid var(--line);
  border-left: 0;
}

.community-grid[data-carousel="active"] .community-card[data-state="active"] {
  transform: translate(-50%, -50%) scale(1);
  z-index: 3;
  box-shadow: var(--shadow-lg, 0 30px 60px rgba(29, 26, 5, 0.18));
  will-change: transform;
}

.community-grid[data-carousel="active"] .community-card[data-state="next"] {
  transform: translate(-2%, -50%) scale(0.74);
  z-index: 1;
  box-shadow: 0 16px 36px rgba(29, 26, 5, 0.12);
  pointer-events: none;
}

.community-grid[data-carousel="active"] .community-card[data-state="prev"] {
  transform: translate(-98%, -50%) scale(0.74);
  z-index: 1;
  box-shadow: 0 16px 36px rgba(29, 26, 5, 0.12);
  pointer-events: none;
}

.community-grid[data-carousel="active"] .community-card[data-state="hidden"] {
  transform: translate(-50%, -50%) scale(0.65);
  opacity: 0;
  z-index: 0;
  pointer-events: none;
  box-shadow: none;
}

/* Carousel arrow buttons — only visible when carousel is active */
.carousel-arrow {
  display: none;
}

.community-grid[data-carousel="active"] .carousel-arrow {
  position: absolute;
  top: 50%;
  z-index: 10;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  color: var(--dark);
  cursor: pointer;
  transform: translateY(-50%);
  transition:
    transform 200ms var(--ease),
    background 200ms var(--ease),
    border-color 200ms var(--ease),
    box-shadow 200ms var(--ease);
}

.community-grid[data-carousel="active"] .carousel-arrow-prev {
  left: clamp(0.5rem, 2vw, 1.5rem);
}

.community-grid[data-carousel="active"] .carousel-arrow-next {
  right: clamp(0.5rem, 2vw, 1.5rem);
}

.community-grid[data-carousel="active"] .carousel-arrow:hover {
  background: var(--green-soft);
  border-color: var(--green);
  transform: translateY(-50%) scale(1.08);
  box-shadow: var(--shadow-lg, 0 14px 32px rgba(29, 26, 5, 0.18));
}

.community-grid[data-carousel="active"] .carousel-arrow:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

.community-grid[data-carousel="active"] .carousel-arrow svg {
  width: 1.25rem;
  height: 1.25rem;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (prefers-reduced-motion: reduce) {
  .community-grid[data-carousel="active"] {
    display: grid;
    height: auto;
    perspective: none;
  }
  .community-grid[data-carousel="active"] .community-card {
    position: static;
    width: auto;
    height: auto;
    transform: none !important;
    opacity: 1 !important;
    filter: none !important;
    pointer-events: auto;
  }
  .community-grid[data-carousel="active"] .carousel-arrow {
    display: none;
  }
}

.community-card {
  position: relative;
  border-radius: var(--radius-lg);
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  overflow: hidden;
  transition:
    transform 280ms var(--ease),
    box-shadow 280ms var(--ease),
    border-color 280ms var(--ease);
}

.community-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}

/* Alternate image side for visual rhythm */
.community-card:nth-child(even) {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
}

.community-card:nth-child(even) .community-image {
  order: 2;
  border-right: 0;
  border-left: 1px solid var(--line);
}

.community-image {
  aspect-ratio: auto;
  height: 100%;
  min-height: 18rem;
  border-radius: 0;
  border: 0;
  border-right: 1px solid var(--line);
  box-shadow: none;
  background: var(--sand-soft);
}

.community-image::after {
  background: linear-gradient(
    180deg,
    rgba(30, 42, 51, 0) 60%,
    rgba(30, 42, 51, 0.35) 100%
  );
}

.community-body {
  position: relative;
  padding: var(--space-8) var(--space-9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-3);
}

.community-card:nth-child(1) .community-body {
  background: linear-gradient(
    180deg,
    rgba(19, 41, 75, 0.06),
    rgba(255, 255, 255, 0) 80%
  );
}

.community-card:nth-child(2) .community-body {
  background: linear-gradient(
    180deg,
    rgba(75, 156, 211, 0.08),
    rgba(255, 255, 255, 0) 80%
  );
}

.community-card:nth-child(3) .community-body {
  background: linear-gradient(
    180deg,
    rgba(227, 241, 250, 0.55),
    rgba(255, 255, 255, 0) 80%
  );
}

.community-icon {
  position: static;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: var(--space-1);
  border-radius: var(--radius-md);
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--gold-deep);
  box-shadow: var(--shadow-sm);
}

.community-card:nth-child(2) .community-icon {
  color: var(--panel-deep);
}

.community-card:nth-child(3) .community-icon {
  color: var(--navy);
}

.community-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.community-card h3 {
  font-size: 1.45rem;
  text-shadow: none;
}

.community-card p {
  color: var(--muted);
  line-height: 1.7;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--navy);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  margin-top: auto;
  transition: gap 200ms var(--ease);
}

.link-arrow::after {
  content: "→";
  transition: transform 200ms var(--ease);
}

.link-arrow:hover {
  color: var(--blue);
  gap: 0.7rem;
}

/* ---------------------------------------------------------------
   Black Sheep — cinematic editorial section (UNC navy + Carolina Blue)
   --------------------------------------------------------------- */
.section-black-sheep {
  padding-block: clamp(4rem, 6vw, 5.5rem);
  color: var(--white);
  background:
    radial-gradient(
      ellipse 50rem 26rem at 12% 12%,
      rgba(75, 156, 211, 0.14),
      transparent 60%
    ),
    radial-gradient(
      ellipse 50rem 26rem at 88% 88%,
      rgba(75, 156, 211, 0.28),
      transparent 60%
    ),
    linear-gradient(170deg, #13294b 0%, #1a3d6b 45%, #0f2444 100%);
  overflow: hidden;
}

.section-black-sheep > .container {
  width: 100%;
}

.section-black-sheep .section-heading {
  margin-bottom: var(--space-8);
}

.section-black-sheep .section-heading h2 {
  font-size: clamp(2rem, 3.4vw, 2.75rem);
  max-width: 24ch;
  font-weight: 500;
  letter-spacing: -0.015em;
}

.bs-watchall {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: var(--space-3);
  color: var(--panel-mid);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  transition: color 200ms var(--ease);
}

.bs-watchall svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 200ms var(--ease);
}

.bs-watchall:hover {
  color: var(--white);
}

.bs-watchall:hover svg {
  transform: translateX(3px);
}

.section-black-sheep::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(19, 41, 75, 0.5) 50%,
    transparent
  );
  z-index: 1;
}

.black-sheep-panel {
  position: relative;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  border: 0;
}

.on-dark h2,
.black-sheep-feature-body h3,
.story-card h4 {
  color: var(--white);
}

/* Cinematic feature card --------------------------------------- */
.black-sheep-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: var(--space-7);
  align-items: stretch;
}

.black-sheep-feature {
  position: relative;
  border-radius: var(--radius-lg);
  background: transparent;
  border: 0;
  display: block;
  overflow: hidden;
}

.black-sheep-image {
  position: relative;
  margin: 0;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
  aspect-ratio: 16 / 11;
  height: 100%;
  background: rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.black-sheep-image > img {
  height: 100%;
  object-fit: cover;
}

.black-sheep-image::after {
  background: linear-gradient(
    180deg,
    rgba(10, 24, 40, 0) 35%,
    rgba(10, 24, 40, 0.85) 100%
  );
}

.black-sheep-image figcaption {
  position: absolute;
  left: 1.4rem;
  right: 1.4rem;
  bottom: 1.4rem;
  display: grid;
  gap: 0.35rem;
  z-index: 2;
}

.black-sheep-image figcaption span {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--panel-mid);
}

.black-sheep-image figcaption strong {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 1.8vw, 1.55rem);
  line-height: 1.3;
  color: var(--white);
  font-weight: 500;
  letter-spacing: -0.005em;
}

/* Right column: editorial copy ---------------------------------- */
.black-sheep-feature-body {
  position: relative;
  padding: var(--space-2) 0;
  display: grid;
  gap: var(--space-5);
  align-content: center;
}

.black-sheep-feature-body::before {
  content: none;
}

.black-sheep-feature-body .panel-label {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--panel-mid);
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.black-sheep-feature-body .panel-label::before {
  content: "";
  width: 1.6rem;
  height: 1px;
  background: var(--blue-fountain);
}

.black-sheep-feature-body h3 {
  font-size: clamp(1.6rem, 2.4vw, 2.1rem);
  max-width: 24ch;
  font-weight: 500;
  line-height: 1.2;
  margin: 0;
  letter-spacing: -0.012em;
  color: var(--white);
}

.black-sheep-feature-body > p {
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.7;
  margin: 0;
  font-size: 0.98rem;
  max-width: 38ch;
}

.feature-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: var(--space-2);
}

.black-sheep-panel .button {
  background: var(--blue);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(19, 41, 75, 0.15);
}

.black-sheep-panel .button:hover {
  background: var(--blue-mid);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(19, 41, 75, 0.2);
}

.black-sheep-panel .button-secondary.light {
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: none;
}

.black-sheep-panel .button-secondary.light:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: none;
}

.story-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-5);
  margin: var(--space-8) 0 0;
  padding: 0;
  list-style: none;
}

.story-card {
  display: grid;
  grid-template-rows: auto auto;
  gap: var(--space-3);
  padding: 0;
  border-radius: var(--radius-md);
  background: transparent;
  border: 0;
  align-items: start;
  transition: transform 320ms var(--ease);
}

.story-card:hover {
  transform: translateY(-4px);
}

.story-thumb {
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  background: rgba(0, 0, 0, 0.3);
  aspect-ratio: 16 / 10;
}

.story-thumb::after {
  background: linear-gradient(
    180deg,
    rgba(29, 26, 5, 0) 35%,
    rgba(29, 26, 5, 0.65) 100%
  );
}

.story-play {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
}

.story-play::before {
  content: "";
  position: absolute;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  transition:
    background 240ms var(--ease),
    transform 240ms var(--ease);
}

.story-card:hover .story-play::before {
  background: var(--blue);
  transform: scale(1.06);
}

.story-card:hover .story-thumb > img {
  transform: scale(var(--zoom-scale));
}

.story-play svg {
  position: relative;
  width: 14px;
  height: 14px;
  fill: var(--slate);
  stroke: none;
  margin-left: 2px;
  z-index: 1;
}

.story-meta {
  display: grid;
  gap: 0.4rem;
  padding: 0 0.2rem;
}

.story-meta > span {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--panel-mid);
}

.story-card h4 {
  font-size: 1rem;
  margin: 0;
  line-height: 1.35;
  font-weight: 500;
  font-family: var(--font-display);
  color: var(--white);
  letter-spacing: -0.005em;
}

.story-card p {
  display: none;
}

.story-card a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--panel-mid);
  font-weight: 600;
  font-size: 0.78rem;
  text-decoration: none;
  margin-top: 0.15rem;
  transition: color 200ms var(--ease);
}

.story-card a::after {
  content: "→";
  transition: transform 200ms var(--ease);
}

.story-card:hover a {
  color: var(--panel-mid);
}

.story-card:hover a::after {
  transform: translateX(3px);
}

/* ---------------------------------------------------------------
   Testimonials
   --------------------------------------------------------------- */
.section-testimonials {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

/* Architectural photo backdrop — navy wash so heading text stays readable */
.section-testimonials::before {
  border-radius: inherit;
  background-image:
    radial-gradient(
      ellipse 40rem 25rem at 20% 25%,
      rgba(75, 156, 211, 0.22),
      transparent 65%
    ),
    radial-gradient(
      ellipse 40rem 25rem at 85% 80%,
      rgba(75, 156, 211, 0.18),
      transparent 65%
    ),
    linear-gradient(
      180deg,
      rgba(19, 41, 75, 0.84) 0%,
      rgba(19, 41, 75, 0.72) 28%,
      rgba(19, 41, 75, 0.66) 50%,
      rgba(19, 41, 75, 0.74) 72%,
      rgba(19, 41, 75, 0.88) 100%
    ),
    url("assets/aerial-view-of-condo-and-apartment-buildings-in-do-2026-03-17-05-06-32-utc%20(1).webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.section-testimonials::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(
    180deg,
    rgba(15, 36, 68, 0.55) 0%,
    transparent 8%,
    transparent 92%,
    rgba(15, 36, 68, 0.65) 100%
  );
}

.section-testimonials .eyebrow {
  color: var(--gold-soft);
}

.section-testimonials .eyebrow::before {
  background: var(--rust-soft);
}

.section-testimonials .section-heading {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
  justify-items: center;
}

.section-testimonials .section-heading h2 {
  max-width: 32ch;
  color: var(--white);
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.55),
    0 4px 10px rgba(0, 0, 0, 0.4);
}

.section-testimonials .text-accent {
  color: var(--panel-mid);
  text-shadow:
    0 2px 6px rgba(0, 0, 0, 0.45),
    0 0 18px rgba(75, 156, 211, 0.35);
}

/* ---------------------------------------------------------------
   Testimonials
   --------------------------------------------------------------- */
.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-5);
}

.testimonial-card {
  position: relative;
  padding: var(--space-8);
  padding-top: var(--space-10);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: 0 12px 30px rgba(29, 26, 5, 0.08);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  overflow: hidden;
  /* RGB values fed into the sequential glow animation below */
  --glow-color: 39, 106, 165;
  transition:
    transform 280ms var(--ease),
    box-shadow 280ms var(--ease);
}

.testimonial-card::before {
  content: "\201C";
  position: absolute;
  top: -1rem;
  left: 1rem;
  font-family: var(--font-display);
  font-size: 8rem;
  line-height: 1;
  color: var(--green-soft);
  opacity: 0.8;
  z-index: 0;
}

.testimonial-card > * {
  position: relative;
  z-index: 1;
}

.testimonial-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.testimonial-card p {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.55;
  color: var(--dark);
  font-weight: 500;
}

.testimonial-card footer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: var(--space-4);
  margin-top: auto;
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
}

.testimonial-card footer .avatar {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  background: var(--blue-deep);
  color: var(--white);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  border: 1px solid rgba(19, 41, 75, 0.5);
}

.testimonial-card footer > div {
  display: grid;
  gap: 0.1rem;
}

.testimonial-card footer .who {
  color: var(--blue-deep);
  font-weight: 600;
  font-size: 0.95rem;
}

.testimonial-card footer small {
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Sequential glow-border entrance ------------------------------ */
.testimonial-card:nth-child(2) {
  --glow-color: 75, 156, 211;
}

.testimonial-card:nth-child(3) {
  --glow-color: 19, 41, 75;
}

.testimonial-card.is-visible:not(.glow-done) {
  animation: testimonialGlow 1.8s cubic-bezier(0.25, 0.46, 0.45, 0.94)
    forwards;
}

.testimonial-card.is-visible:not(.glow-done):nth-child(2) {
  animation-delay: 600ms;
}

.testimonial-card.is-visible:not(.glow-done):nth-child(3) {
  animation-delay: 1200ms;
}

@keyframes testimonialGlow {
  0% {
    border-color: var(--line);
    box-shadow:
      0 12px 30px rgba(29, 26, 5, 0.08),
      0 0 0 0 rgba(var(--glow-color), 0);
  }
  18% {
    border-color: rgb(var(--glow-color));
    box-shadow:
      0 12px 30px rgba(29, 26, 5, 0.08),
      0 0 32px 8px rgba(var(--glow-color), 0.6),
      0 0 0 1px rgb(var(--glow-color));
  }
  50% {
    border-color: rgba(var(--glow-color), 0.5);
    box-shadow:
      0 12px 30px rgba(29, 26, 5, 0.08),
      0 0 24px 4px rgba(var(--glow-color), 0.25),
      0 0 0 0 rgba(var(--glow-color), 0);
  }
  100% {
    border-color: var(--line);
    box-shadow:
      0 12px 30px rgba(29, 26, 5, 0.08),
      0 0 0 0 rgba(var(--glow-color), 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .testimonial-card.is-visible {
    animation: none;
  }
}

/* ---------------------------------------------------------------
   Footer
   --------------------------------------------------------------- */
.site-footer {
  position: relative;
  margin-top: 0;
  padding-block: var(--space-12);
  background:
    radial-gradient(
      ellipse 50rem 25rem at 10% 0%,
      rgba(19, 41, 75, 0.12),
      transparent 60%
    ),
    radial-gradient(
      ellipse 40rem 25rem at 100% 100%,
      rgba(75, 156, 211, 0.1),
      transparent 60%
    ),
    linear-gradient(180deg, var(--blue-deep) 0%, #0c1a31 100%);
  color: rgba(255, 255, 255, 0.85);
  overflow: hidden;
}

.footer-stripe {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1;
  height: 6px;
  width: 100%;
  background: linear-gradient(
    90deg,
    var(--blue-mid) 0%,
    var(--blue) 35%,
    var(--panel-mid) 70%,
    var(--blue-fountain) 100%
  );
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.site-footer > .container {
  position: relative;
  padding-inline: clamp(1.5rem, 4vw, 2.5rem);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
  gap: var(--space-8) var(--space-7);
  align-items: start;
}

.footer-brand {
  display: grid;
  gap: var(--space-4);
  align-content: start;
}

.brand-logo-light {
  height: 4.75rem;
  padding: 0.65rem 1.1rem;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
  width: fit-content;
  transition:
    transform 220ms var(--ease),
    box-shadow 220ms var(--ease);
}

.brand-logo-light:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.32);
}

.footer-brand > p {
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.7;
  max-width: 38ch;
  margin: 0;
  font-size: 0.94rem;
}

.footer-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: var(--space-2);
  padding: 0.65rem 1.1rem;
  background: var(--blue);
  color: var(--white);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  border-radius: var(--radius-pill);
  width: fit-content;
  transition:
    transform 200ms var(--ease),
    background 200ms var(--ease);
}

.footer-cta svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 200ms var(--ease);
}

.footer-cta:hover {
  transform: translateY(-2px);
  background: var(--white);
  color: var(--navy);
}

.footer-cta:hover svg {
  transform: translateX(3px);
}

.footer-col {
  display: grid;
  gap: var(--space-3);
  align-content: start;
}

.site-footer h3 {
  margin: 0 0 var(--space-2);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--blue);
}

.footer-list {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-line {
  display: grid;
  grid-template-columns: 1.25rem minmax(0, 1fr);
  gap: 0.7rem;
  align-items: start;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.5;
  font-size: 0.92rem;
}

.footer-line svg {
  width: 18px;
  height: 18px;
  fill: var(--blue);
  stroke: none;
  margin-top: 0.15rem;
}

.footer-line a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  transition: color 180ms var(--ease);
  word-break: break-word;
}

.footer-line a:hover {
  color: var(--blue);
}

.social-list {
  display: flex;
  gap: 0.7rem;
  margin: 0;
  padding: 0;
  list-style: none;
  flex-wrap: wrap;
}

.social-list a {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
  transition:
    background 200ms var(--ease),
    color 200ms var(--ease),
    transform 200ms var(--ease),
    border-color 200ms var(--ease);
}

.social-list svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  stroke: none;
}

.social-list a[aria-label="Facebook"] svg {
  width: 24px;
  height: 24px;
}

.social-list a:hover {
  background: var(--blue);
  color: var(--white);
  border-color: var(--blue);
  transform: translateY(-2px);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: var(--space-10);
  padding-top: var(--space-5);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.55);
}

.footer-bottom a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
}

.footer-bottom a:hover {
  color: var(--blue-fountain);
}

/* ---------------------------------------------------------------
   Homepage scrolly — CSS-only stacked sticky panels
   --------------------------------------------------------------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 50;
  pointer-events: none;
  background: rgba(19, 41, 75, 0.06);
}

.scroll-progress-bar {
  display: block;
  height: 100%;
  width: calc(var(--scroll-progress, 0) * 100%);
  background: linear-gradient(90deg, var(--blue) 0%, var(--header-green) 100%);
  box-shadow: 0 0 12px rgba(75, 156, 211, 0.45);
}

.homepage-scrolly {
  position: relative;
  --reveal-radius: clamp(1.75rem, 4vw, 2.5rem);
}

/* Short panels — sticky full-screen stack */
.homepage-scrolly .scrolly-section {
  min-height: 100vh;
  min-height: 100dvh;
  position: sticky;
  top: 0;
  isolation: isolate;
}

/* Long sections — relative overlay, natural height, reveal-over previous */
.homepage-scrolly .normal-scroll-section {
  position: relative;
  min-height: auto;
  isolation: isolate;
  margin-top: calc(var(--reveal-radius) * -1.1);
  padding-top: calc(var(--section-y) + var(--reveal-radius));
  border-radius: var(--reveal-radius) var(--reveal-radius) 0 0;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.75) inset,
    0 -32px 72px rgba(19, 41, 75, 0.08);
}

.homepage-scrolly .normal-scroll-section.section-history {
  overflow: visible;
}

.homepage-scrolly .normal-scroll-section:not(.section-history) {
  overflow: hidden;
}

/* Stacked scrolly panels after the hero get the same reveal edge */
.homepage-scrolly .scrolly-section:not(#top) {
  margin-top: calc(var(--reveal-radius) * -1.1);
  padding-top: calc(var(--section-y) + var(--reveal-radius));
  border-radius: var(--reveal-radius) var(--reveal-radius) 0 0;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.75) inset,
    0 -32px 72px rgba(19, 41, 75, 0.08);
}

.homepage-scrolly #top.scrolly-section {
  margin-top: 0;
  padding-top: 0;
  border-radius: 0;
  box-shadow: none;
}

.homepage-scrolly .scrolly-section.section-accreditations,
.homepage-scrolly .scrolly-section.section-testimonials,
.homepage-scrolly .scrolly-section.section-black-sheep {
  overflow: hidden;
}

.homepage-scrolly .scrolly-section.section-black-sheep,
.homepage-scrolly .normal-scroll-section.section-black-sheep,
.homepage-scrolly .scrolly-section.section-testimonials,
.homepage-scrolly .normal-scroll-section.section-testimonials {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.1) inset,
    0 -32px 72px rgba(0, 0, 0, 0.2);
}

.homepage-scrolly .scrolly-section.section:not(#top),
.homepage-scrolly .normal-scroll-section.section {
  padding-bottom: var(--section-y);
  padding-top: calc(var(--section-y) + var(--reveal-radius));
}

/* Document-order stacking so each section covers the one before it */
.homepage-scrolly #top { z-index: 1; }
.homepage-scrolly #story { z-index: 2; }
.homepage-scrolly #history { z-index: 3; }
.homepage-scrolly #programs { z-index: 4; }
.homepage-scrolly #community { z-index: 5; }
.homepage-scrolly #youtube { z-index: 6; }
.homepage-scrolly #accreditations { z-index: 7; }
.homepage-scrolly #testimonials { z-index: 8; }

.homepage-scrolly .scrolly-section.hero,
.homepage-scrolly .normal-scroll-section.hero {
  background: var(--blue-deep);
}

.homepage-scrolly .scrolly-section.section-mission,
.homepage-scrolly .normal-scroll-section.section-mission {
  background: linear-gradient(180deg, var(--white) 0%, var(--blue-soft) 100%);
}

.homepage-scrolly .normal-scroll-section.section-history {
  background: var(--white);
}

.homepage-scrolly .normal-scroll-section.section-programs {
  background: var(--white);
}

.homepage-scrolly .normal-scroll-section.section-community {
  background: var(--white);
}

.homepage-scrolly .normal-scroll-section.section-black-sheep,
.homepage-scrolly .scrolly-section.section-black-sheep {
  background:
    radial-gradient(
      ellipse 50rem 26rem at 12% 12%,
      rgba(75, 156, 211, 0.14),
      transparent 60%
    ),
    radial-gradient(
      ellipse 50rem 26rem at 88% 88%,
      rgba(75, 156, 211, 0.28),
      transparent 60%
    ),
    linear-gradient(170deg, #13294b 0%, #1a3d6b 45%, #0f2444 100%);
}

.homepage-scrolly .scrolly-section.section-accreditations,
.homepage-scrolly .normal-scroll-section.section-accreditations {
  background: var(--white);
}

.homepage-scrolly .scrolly-section.section-testimonials,
.homepage-scrolly .normal-scroll-section.section-testimonials {
  background: transparent;
}

/* ---------------------------------------------------------------
   Pinned tail-cover for tall sections (JS toggles .is-pinned)
   Fix the section in place showing its already-visible bottom
   slice so the next section (higher z-index) can slide up over
   it, matching the short sticky-panel handoff.
   --------------------------------------------------------------- */
.homepage-scrolly .normal-scroll-section.is-pinned {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: auto;
  margin-top: 0;
  transform: translateY(calc(var(--pin-shift, 0) * 1px));
  will-change: transform;
}

.pin-spacer {
  display: block;
  /* height is set inline by JS (0 when idle, section height when pinned) */
}

/* ---------------------------------------------------------------
   80vh fit for hero / story / youtube sticky panels
   Keeps them full-screen sticky but constrains inner content to
   ~80vh so nothing overflows the viewport.
   --------------------------------------------------------------- */
.homepage-scrolly #story.scrolly-section.section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: calc(var(--reveal-radius) + clamp(1rem, 2vw, 1.75rem));
  padding-bottom: clamp(1rem, 2vw, 1.75rem);
}

.homepage-scrolly #story.scrolly-section > .container {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-height: 80vh;
  max-height: 80dvh;
}

/* YouTube: use a wider canvas so the editorial layout fills the section
   instead of clustering in a narrow centered column. */
.homepage-scrolly #youtube.normal-scroll-section > .container {
  width: 100%;
  max-width: min(1440px, 92vw);
}

/* Hero: let the inner content size to itself instead of forcing 100vh.
   Center the hero-inner + stats stack vertically so nothing is pushed
   past the bottom edge and clipped by the next sticky panel. */
.homepage-scrolly #top.scrolly-section.hero {
  justify-content: center;
}

.homepage-scrolly #top.scrolly-section .hero-inner {
  min-height: auto;
  flex: 0 0 auto;
  padding-top: clamp(3.5rem, 7vh, 5.25rem);
  padding-bottom: clamp(0.4rem, 1vh, 0.9rem);
}

.homepage-scrolly #top.scrolly-section .hero-eyebrow {
  margin-bottom: var(--space-3);
}

.homepage-scrolly #top.scrolly-section .hero h1 {
  font-size: clamp(1.85rem, 4vw, 3.1rem);
  margin-bottom: var(--space-3);
  line-height: 1.06;
  max-width: 18ch;
}

.homepage-scrolly #top.scrolly-section .hero-lede {
  font-size: clamp(0.88rem, 1.1vw, 1rem);
  line-height: 1.55;
  margin-bottom: var(--space-4);
}

.homepage-scrolly #top.scrolly-section .hero-actions {
  gap: 0.7rem;
}

.homepage-scrolly #top.scrolly-section .hero-stats {
  padding-top: clamp(0.5rem, 1vh, 1rem);
  padding-bottom: clamp(0.5rem, 1.2vh, 1.25rem);
  gap: var(--space-3);
}

.homepage-scrolly #top.scrolly-section .hero-stats li {
  padding: clamp(0.55rem, 1.1vh, 0.95rem) clamp(0.7rem, 1.4vw, 1.1rem);
  gap: 0.2rem;
}

.homepage-scrolly #top.scrolly-section .hero-stats li + li {
  padding-left: clamp(0.7rem, 1.4vw, 1.1rem);
}

.homepage-scrolly #top.scrolly-section .hero-stats strong {
  font-size: clamp(1.15rem, 1.7vw, 1.55rem);
}

.homepage-scrolly #top.scrolly-section .hero-stats span {
  font-size: 0.72rem;
  line-height: 1.35;
}

/* Short laptop viewports: compress the hero further so the stat cards
   stay fully visible inside ~80vh. */
@media (max-height: 820px) and (min-width: 1081px) {
  .homepage-scrolly #top.scrolly-section .hero-inner {
    padding-top: clamp(3rem, 6vh, 4.5rem);
  }
  .homepage-scrolly #top.scrolly-section .hero h1 {
    font-size: clamp(1.6rem, 3.4vw, 2.6rem);
    margin-bottom: var(--space-2);
  }
  .homepage-scrolly #top.scrolly-section .hero-lede {
    margin-bottom: var(--space-3);
  }
  .homepage-scrolly #top.scrolly-section .hero-stats li {
    padding: clamp(0.45rem, 0.9vh, 0.75rem) clamp(0.6rem, 1.2vw, 0.95rem);
  }
  .homepage-scrolly #top.scrolly-section .hero-stats strong {
    font-size: clamp(1rem, 1.5vw, 1.35rem);
  }
}

@media (max-height: 620px) and (min-width: 1081px) {
  .homepage-scrolly #top.scrolly-section .hero h1 {
    font-size: clamp(1.4rem, 3vw, 2.1rem);
  }
  .homepage-scrolly #top.scrolly-section .hero-lede {
    font-size: 0.86rem;
  }
  .homepage-scrolly #top.scrolly-section .hero-stats span {
    font-size: 0.68rem;
  }
}

/* Story: cap the tall 4/5 portrait image so the row fits ~80vh */
.homepage-scrolly #story.scrolly-section .section-heading {
  margin-bottom: var(--space-6);
}

.homepage-scrolly #story.scrolly-section .story-layout {
  margin-bottom: 0;
  gap: var(--space-8);
  align-items: center;
}

.homepage-scrolly #story.scrolly-section .story-media .story-feature-image {
  aspect-ratio: 4 / 5;
  max-height: 70vh;
  max-height: 70dvh;
}

.homepage-scrolly #story.scrolly-section .story-media .story-feature-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.homepage-scrolly #story.scrolly-section .story-content {
  gap: var(--space-3);
}

.homepage-scrolly #story.scrolly-section .story-content h2 {
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
}

.homepage-scrolly #story.scrolly-section .story-content > p:not(.eyebrow) {
  font-size: 0.96rem;
  line-height: 1.6;
}

/* YouTube: featured image + vertical story stack side by side */
.homepage-scrolly #youtube.normal-scroll-section .section-heading {
  margin-bottom: var(--space-4);
}

.homepage-scrolly #youtube.normal-scroll-section .section-heading h2 {
  font-size: clamp(2rem, 3.6vw, 3rem);
  max-width: 30ch;
}

/* Fill the container width: generous featured image on the left, right
   column takes the rest. Remove center-clustering max-widths so the
   copy and cards use the full right column. */
.homepage-scrolly #youtube.normal-scroll-section .black-sheep-layout {
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: clamp(1.75rem, 3vw, 3rem);
  align-items: stretch;
  width: 100%;
}

.homepage-scrolly #youtube.normal-scroll-section .black-sheep-image {
  aspect-ratio: 16 / 11;
  height: auto;
  max-height: none;
  margin: 0;
}

.homepage-scrolly #youtube.normal-scroll-section .black-sheep-side {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: clamp(0.75rem, 1.5vh, 1.25rem);
  min-width: 0;
  width: 100%;
}

.homepage-scrolly #youtube.normal-scroll-section .black-sheep-feature-body {
  gap: var(--space-3);
  padding: 0;
  align-content: start;
}

.homepage-scrolly #youtube.normal-scroll-section .black-sheep-feature-body .panel-label {
  font-size: 0.66rem;
}

.homepage-scrolly #youtube.normal-scroll-section .black-sheep-feature-body h3 {
  font-size: clamp(1.25rem, 1.8vw, 1.7rem);
  max-width: none;
  line-height: 1.22;
}

.homepage-scrolly #youtube.normal-scroll-section .black-sheep-feature-body > p {
  font-size: 0.95rem;
  line-height: 1.55;
  max-width: none;
}

.homepage-scrolly #youtube.normal-scroll-section .feature-actions {
  gap: 0.7rem;
  margin-top: 0;
}

.homepage-scrolly #youtube.normal-scroll-section .black-sheep-panel .button {
  padding: 0.6rem 1.15rem;
  font-size: 0.9rem;
}

.homepage-scrolly #youtube.normal-scroll-section .bs-watchall {
  margin-top: 0;
  font-size: 0.86rem;
}

/* Full-width 3-column row of story cards below the featured + copy row */
.homepage-scrolly #youtube.normal-scroll-section .story-card-stack {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.75rem);
  margin: clamp(1rem, 2vw, 1.5rem) 0 0;
  align-content: start;
}

.homepage-scrolly #youtube.normal-scroll-section .story-card-stack .story-card {
  grid-template-columns: 1fr;
  grid-template-rows: auto auto;
  gap: var(--space-3);
  align-items: stretch;
}

.homepage-scrolly #youtube.normal-scroll-section .story-card-stack .story-thumb {
  aspect-ratio: 16 / 10;
}

.homepage-scrolly #youtube.normal-scroll-section .story-card-stack .story-meta {
  gap: 0.3rem;
}

.homepage-scrolly #youtube.normal-scroll-section .story-card-stack .story-card h4 {
  font-size: clamp(0.95rem, 1.15vw, 1.1rem);
  line-height: 1.3;
}

.homepage-scrolly #youtube.normal-scroll-section .story-card-stack .story-card a {
  font-size: 0.8rem;
}

.homepage-scrolly #youtube.normal-scroll-section .story-card-stack .story-card p {
  display: block;
  font-size: 0.82rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}

/* On shorter desktop viewports, compress the YouTube panel so nothing clips */
@media (max-height: 820px) and (min-width: 1081px) {
  .homepage-scrolly #youtube.normal-scroll-section .section-heading {
    margin-bottom: var(--space-3);
  }
  .homepage-scrolly #youtube.normal-scroll-section .black-sheep-side {
    gap: var(--space-3);
  }
  .homepage-scrolly #youtube.normal-scroll-section .black-sheep-feature-body {
    gap: var(--space-2);
  }
  .homepage-scrolly #youtube.normal-scroll-section .black-sheep-feature-body > p {
    display: none;
  }
  .homepage-scrolly #youtube.normal-scroll-section .story-card-stack {
    gap: clamp(0.6rem, 1vw, 0.85rem);
    margin-top: clamp(0.6rem, 1vw, 0.85rem);
  }
  .homepage-scrolly #youtube.normal-scroll-section .story-card-stack .story-card {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: var(--space-2);
  }
  .homepage-scrolly #youtube.normal-scroll-section .story-card-stack .story-card h4 {
    font-size: 0.9rem;
  }
  .homepage-scrolly #youtube.normal-scroll-section .story-card-stack .story-card p {
    display: none;
  }
  .homepage-scrolly #youtube.normal-scroll-section .black-sheep-image {
    max-height: none;
  }
  .homepage-scrolly #story.scrolly-section .story-media .story-feature-image {
    max-height: 60vh;
    max-height: 60dvh;
  }
}

@media (max-height: 620px) and (min-width: 1081px) {
  .homepage-scrolly #youtube.normal-scroll-section .section-heading h2 {
    font-size: 1.2rem;
  }
  .homepage-scrolly #youtube.normal-scroll-section .black-sheep-feature-body h3 {
    font-size: 0.98rem;
  }
  .homepage-scrolly #youtube.normal-scroll-section .story-card-stack .story-card h4 {
    font-size: 0.78rem;
  }
  .homepage-scrolly #youtube.normal-scroll-section .story-card-stack .story-card {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: var(--space-1);
  }
  .homepage-scrolly #youtube.normal-scroll-section .story-card-stack .story-card p {
    display: none;
  }
  .homepage-scrolly #youtube.normal-scroll-section .black-sheep-image {
    max-height: none;
  }
}

/* ---------------------------------------------------------------
   History split layout (inside scrolly section)
   --------------------------------------------------------------- */
.scroll-chapter-shell {
  position: relative;
}

.scroll-chapter-shell--split {
  display: grid;
  grid-template-columns: minmax(0, 0.38fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
  max-width: min(1440px, 100%);
  margin-inline: auto;
  padding-inline: var(--container-gutter);
  padding-block: var(--section-y);
}

.section-history .scroll-chapter-pin {
  position: sticky;
  top: calc(var(--header-offset) + 0.75rem);
  z-index: 4;
  align-self: start;
  padding-bottom: var(--space-4);
  grid-column: 1;
  grid-row: 1 / -1;
  max-height: calc(100vh - var(--header-offset) - 2rem);
  max-height: calc(100dvh - var(--header-offset) - 2rem);
  overflow: visible;
}

.section-history .scroll-chapter-pin .section-heading {
  margin-bottom: 0;
}

.section-history .scroll-chapter-flow {
  grid-column: 2;
  grid-row: 1 / -1;
  min-width: 0;
}

.section-history [data-scroll-layer] {
  transform: translate3d(0, calc(var(--layer-shift, 0) * 1px), 0);
  will-change: transform;
}

.section-history .scroll-chapter-flow .program-timeline-item {
  --item-proximity: 0;
  transition:
    opacity 500ms var(--ease-cinematic),
    filter 500ms var(--ease-cinematic);
  opacity: calc(0.58 + var(--item-proximity) * 0.42);
  filter: saturate(calc(0.82 + var(--item-proximity) * 0.18));
}

.section-history .scroll-chapter-flow .program-timeline-item[data-reveal].is-visible:not(.is-revealed) {
  opacity: calc(0.58 + var(--item-proximity) * 0.42);
  filter: saturate(calc(0.82 + var(--item-proximity) * 0.18));
}

.section-history .scroll-chapter-flow .program-timeline-item.is-revealed {
  opacity: calc(0.58 + var(--item-proximity) * 0.42) !important;
  filter: saturate(calc(0.82 + var(--item-proximity) * 0.18)) !important;
  transform: none !important;
}

.section-history .scroll-chapter-flow .program-timeline-item.is-scroll-active,
.section-history .scroll-chapter-flow .program-timeline-item.is-revealed.is-scroll-active {
  opacity: 1 !important;
  filter: saturate(1) !important;
}

.section-history .scroll-chapter-flow .program-timeline-item.is-scroll-active .program-timeline-media {
  box-shadow: 0 24px 48px rgba(75, 156, 211, 0.2);
}

.section-history .scroll-chapter-flow .program-timeline-item .program-timeline-media {
  transition: box-shadow 500ms var(--ease-cinematic);
}

.section-history .scroll-chapter-flow .program-timeline-item .program-timeline-media img {
  transform: scale(calc(1 + var(--item-proximity, 0) * 0.045));
  transition: transform 600ms var(--ease-cinematic);
}

.section-history .scroll-chapter-flow .program-timeline-item.is-scroll-active .program-timeline-marker {
  transform: translate(-50%, -50%) scale(1.15);
  box-shadow:
    0 0 0 4px rgba(75, 156, 211, 0.22),
    0 4px 14px rgba(75, 156, 211, 0.25);
}

.section-history .scroll-chapter-flow .program-timeline-marker {
  transition:
    transform 500ms var(--ease-cinematic),
    box-shadow 500ms var(--ease-cinematic);
}

@media (max-width: 1080px) {
  .homepage-scrolly .scrolly-section {
    position: relative;
    top: auto;
    min-height: auto;
  }

  .homepage-scrolly .scrolly-section:not(#top),
  .homepage-scrolly .normal-scroll-section {
    margin-top: calc(var(--reveal-radius, 1.5rem) * -1.05);
    padding-top: var(--section-y);
  }

  .homepage-scrolly #top.scrolly-section {
    margin-top: 0;
    padding-top: 0;
    border-radius: 0;
    box-shadow: none;
  }

  /* Reset the 80vh fit so mobile scrolls naturally */
  .homepage-scrolly #story.scrolly-section.section,
  .homepage-scrolly #youtube.normal-scroll-section.section {
    display: block;
    padding-top: var(--section-y);
    padding-bottom: var(--section-y);
  }

  .homepage-scrolly #story.scrolly-section > .container,
  .homepage-scrolly #youtube.normal-scroll-section > .container {
    max-height: none;
    display: block;
  }

  .homepage-scrolly #top.scrolly-section .hero-inner {
    min-height: min(100vh, 56rem);
    min-height: min(100dvh, 56rem);
    padding-top: clamp(6.5rem, 14vh, 9rem);
    padding-bottom: clamp(2rem, 5vh, 3rem);
  }

  .homepage-scrolly #story.scrolly-section .story-media .story-feature-image,
  .homepage-scrolly #youtube.normal-scroll-section .black-sheep-image {
    max-height: none;
  }

  /* YouTube: single-column stack on mobile — featured, then 3 cards */
  .homepage-scrolly #youtube.normal-scroll-section .black-sheep-layout {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .homepage-scrolly #youtube.normal-scroll-section .black-sheep-image {
    aspect-ratio: 16 / 9;
  }

  .homepage-scrolly #youtube.normal-scroll-section .black-sheep-side {
    gap: var(--space-6);
  }

  .homepage-scrolly #youtube.normal-scroll-section .story-card-stack {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }

  .homepage-scrolly #youtube.normal-scroll-section .story-card-stack .story-card {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .homepage-scrolly #youtube.normal-scroll-section .story-card-stack .story-card p {
    display: block;
  }

  .scroll-chapter-shell--split {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .section-history .scroll-chapter-pin,
  .section-history .scroll-chapter-flow {
    grid-column: 1;
    grid-row: auto;
    max-height: none;
    position: relative;
    top: auto;
    overflow: visible;
  }
}

@media (prefers-reduced-motion: reduce) {
  .homepage-scrolly .scrolly-section {
    position: relative;
    top: auto;
    min-height: auto;
  }

  .homepage-scrolly .scrolly-section:not(#top),
  .homepage-scrolly .normal-scroll-section {
    margin-top: 0;
    padding-top: var(--section-y);
    border-radius: 0;
    box-shadow: none;
  }

  .homepage-scrolly #top.scrolly-section {
    padding-top: 0;
  }

  /* Reset 80vh fit for reduced motion — natural scroll */
  .homepage-scrolly #story.scrolly-section.section,
  .homepage-scrolly #youtube.normal-scroll-section.section {
    display: block;
    padding-top: var(--section-y);
    padding-bottom: var(--section-y);
  }

  .homepage-scrolly #story.scrolly-section > .container,
  .homepage-scrolly #youtube.normal-scroll-section > .container {
    max-height: none;
    display: block;
  }

  .homepage-scrolly #top.scrolly-section .hero-inner {
    min-height: min(100vh, 56rem);
    min-height: min(100dvh, 56rem);
  }

  .homepage-scrolly #story.scrolly-section .story-media .story-feature-image,
  .homepage-scrolly #youtube.normal-scroll-section .black-sheep-image {
    max-height: none;
  }

  .homepage-scrolly #youtube.normal-scroll-section .black-sheep-layout {
    grid-template-columns: 1fr;
  }

  .homepage-scrolly #youtube.normal-scroll-section .black-sheep-image {
    aspect-ratio: 16 / 9;
  }

  .homepage-scrolly #youtube.normal-scroll-section .story-card-stack .story-card {
    grid-template-columns: 1fr;
  }

  .homepage-scrolly #youtube.normal-scroll-section .story-card-stack .story-card p {
    display: block;
  }

  .section-history [data-scroll-layer] {
    transform: none !important;
  }

  .section-history .scroll-chapter-flow .program-timeline-item {
    opacity: 1 !important;
    filter: none !important;
  }
}

/* ---------------------------------------------------------------
   Scroll-reveal animations
   --------------------------------------------------------------- */
[data-reveal]:not(.is-revealed) {
  opacity: 0;
  transform: translateY(36px) scale(0.965);
  filter: blur(10px);
  transition:
    opacity 850ms var(--ease),
    transform 950ms var(--ease-cinematic),
    filter 900ms var(--ease);
}

[data-reveal].is-visible:not(.is-revealed) {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

/* Locked in after first reveal — never re-hide or re-animate on scroll */
.is-revealed {
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
  transition: none !important;
}

/* Keep glow animation; allow hover lift after reveal */
.testimonial-card.is-revealed:not(.glow-done) {
  transform: translateY(0) scale(1) !important;
}

.testimonial-card.is-revealed.glow-done:hover {
  transform: translateY(-4px) !important;
}

/* Carousel cards must keep state-based transforms, not scroll-reveal reset */
.community-grid[data-carousel="active"] .community-card.is-revealed {
  transition:
    transform 900ms cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 900ms cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.community-grid[data-carousel="active"]
  .community-card.is-revealed[data-state="active"] {
  transform: translate(-50%, -50%) scale(1) !important;
}

.community-grid[data-carousel="active"]
  .community-card.is-revealed[data-state="next"] {
  transform: translate(-2%, -50%) scale(0.74) !important;
}

.community-grid[data-carousel="active"]
  .community-card.is-revealed[data-state="prev"] {
  transform: translate(-98%, -50%) scale(0.74) !important;
}

.community-grid[data-carousel="active"]
  .community-card.is-revealed[data-state="hidden"] {
  transform: translate(-50%, -50%) scale(0.65) !important;
  opacity: 0 !important;
  pointer-events: none;
  z-index: 0;
}

[data-reveal-from="left"]:not(.is-revealed) {
  transform: translateX(-28px);
}

[data-reveal-from="left"].is-visible:not(.is-revealed) {
  transform: translateX(0);
}

[data-reveal-from="right"]:not(.is-revealed) {
  transform: translateX(28px);
}

[data-reveal-from="right"].is-visible:not(.is-revealed) {
  transform: translateX(0);
}

/* ---------------------------------------------------------------
   Section ambient decoration
   --------------------------------------------------------------- */
.section-mission,
.section-programs,
.section-community,
.section-history,
.section-black-sheep,
.section-accreditations,
.section-testimonials {
  position: relative;
  isolation: isolate;
}

/* Sectional rhythm — distinct background tints per section
   ---------------------------------------------------------------
   Hero:         panel-tint canvas
   Our Story:    white canvas
   Programs:     soft BLUE band      (structured trust)
   Community:    soft PANEL band     (tertiary #4b9cd3 tints)
   Black Sheep:  dramatic DARK       (full-bleed, capped 90vh)
   Testimonials: soft panel wash     (cool closer → footer)
*/

.section-programs::before,
.section-history::before,
.section-community::before,
.section-testimonials::before,
.section-accreditations::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  border-radius: inherit;
}

.section-programs::before {
  background: linear-gradient(
    180deg,
    var(--white) 0%,
    var(--cream) 8%,
    var(--blue-soft) 28%,
    rgba(183, 215, 237, 0.55) 50%,
    var(--blue-soft) 72%,
    var(--cream) 100%
  );
}

.section-history::before {
  background: linear-gradient(
    180deg,
    var(--white) 0%,
    var(--blue-soft) 12%,
    rgba(75, 156, 211, 0.12) 28%,
    rgba(75, 156, 211, 0.1) 68%,
    var(--cream) 100%
  );
}

.section-history .section-heading {
  margin-bottom: var(--space-10);
}

#history {
  scroll-margin-top: 5rem;
}

.section-community::before {
  background: linear-gradient(
    180deg,
    var(--white) 0%,
    var(--cream) 8%,
    var(--blue-fountain) 30%,
    rgba(183, 215, 237, 0.65) 50%,
    var(--blue-fountain) 70%,
    var(--cream) 100%
  );
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] {
    opacity: 1;
    transform: none;
    filter: none;
  }
  .hero-image > img {
    animation: none !important;
  }
  .page-glow {
    display: none;
  }
}

/* ---------------------------------------------------------------
   Responsive
   --------------------------------------------------------------- */
@media (max-width: 1080px) {
  .page-glow {
    filter: blur(48px);
    opacity: 0.4;
  }

  .accreditations-panel {
    grid-template-columns: 1fr;
  }

  .hero-inner,
  .story-layout,
  .black-sheep-layout,
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .black-sheep-image {
    aspect-ratio: 16 / 9;
    height: auto;
  }

  .story-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .program-timeline {
    --timeline-axis: 1.5rem;
  }

  .program-timeline-item {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .program-timeline-item:nth-child(even) .program-timeline-media {
    order: 0;
  }

  .program-timeline-media {
    height: var(--program-media-height);
    min-height: var(--program-media-height);
  }

  .program-timeline-body {
    padding: var(--space-5) var(--space-6) var(--space-5) var(--space-10);
  }

  .program-timeline-marker {
    top: var(--program-media-height);
  }

  .testimonial-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .community-card,
  .community-card:nth-child(even) {
    grid-template-columns: 1fr;
  }

  .community-card:nth-child(even) .community-image {
    order: 0;
    border-left: 0;
  }

  .community-image {
    aspect-ratio: 16 / 9;
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .community-body {
    padding: var(--space-7);
  }

  /* When carousel is active on tablet, keep cards in their horizontal layout
     and shrink the carousel frame so the side cards still peek nicely */
  .community-grid[data-carousel="active"] {
    height: clamp(20rem, 38vw, 24rem);
  }
  .community-grid[data-carousel="active"] .community-card,
  .community-grid[data-carousel="active"]
    .community-card:nth-child(even) {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    width: clamp(18rem, 70vw, 32rem);
    height: clamp(18rem, 36vw, 22rem);
  }
  .community-grid[data-carousel="active"]
    .community-card:nth-child(even)
    .community-image {
    order: 2;
    border-right: 0;
    border-left: 1px solid var(--line);
  }
  .community-grid[data-carousel="active"] .community-image {
    aspect-ratio: auto;
    height: 100%;
    min-height: 0;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
  }

  .hero-inner {
    min-height: min(88vh, 48rem);
    padding-block: clamp(5.5rem, 12vh, 7rem) clamp(1.5rem, 4vh, 2.5rem);
  }

  .hero-stats {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .hero-stats li + li {
    border-left: 0;
    border-top: 0;
    padding-left: var(--space-5);
    padding-top: var(--space-4);
  }

}

/* Wide-but-tight desktop — tighten spacing before switching to drawer nav */
@media (max-width: 1400px) and (min-width: 1281px) {
  .brand-tagline {
    display: none;
  }

  .nav-phone span {
    display: none;
  }

  .nav-phone {
    padding: 0.5rem;
  }

  .brand-logo {
    height: 2.15rem;
  }

  .site-navigation {
    gap: 0;
    font-size: 0.84rem;
  }

  .site-navigation a:not(.button) {
    padding: 0.45rem 0.6rem;
  }

  .nav-donate,
  .nav-cta {
    padding: 0.5rem 0.85rem;
    font-size: 0.82rem;
  }

  .nav-actions {
    gap: 0.4rem;
  }
}

/* Drawer nav — too many items for a single row below this width */
@media (max-width: 1280px) {
  .site-header > .container {
    max-width: min(1640px, 100% - 1.5rem);
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
  }

  body.is-nav-open {
    overflow: hidden;
  }

  .nav-shell {
    --header-shell-fill: var(--white);
    flex-wrap: nowrap;
    gap: 0.5rem;
    padding: 0.55rem 0.55rem 0.55rem 0.85rem;
    border: 1px solid transparent;
    border-radius: var(--radius-xl);
    background:
      linear-gradient(var(--header-shell-fill), var(--header-shell-fill))
        padding-box,
      var(--header-shell-border) border-box;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset,
      0 6px 20px rgba(30, 42, 51, 0.05);
    position: relative;
    z-index: 46;
    transition: box-shadow 320ms var(--ease);
  }

  .site-header.is-scrolled .nav-shell {
    box-shadow: 0 10px 30px rgba(30, 42, 51, 0.12);
  }

  .brand,
  .nav-donate-compact,
  .nav-toggle {
    position: relative;
    z-index: 1;
  }

  .nav-donate-compact {
    display: inline-flex;
    margin-left: auto;
    padding: 0.5rem 0.85rem;
    font-size: 0.78rem;
  }

  .nav-donate-compact svg {
    width: 17px;
    height: 17px;
  }

  .nav-toggle {
    display: inline-block;
    flex-shrink: 0;
  }

  .brand {
    gap: 0.65rem;
    min-width: 0;
    flex: 1;
  }

  .brand-logo {
    height: 2.2rem;
  }

  .brand-tagline {
    display: none;
  }

  .mobile-nav-panel {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(22rem, calc(100vw - 1.5rem));
    height: 100vh;
    height: 100dvh;
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 5.25rem 1.15rem 1.5rem;
    background: rgba(255, 255, 255, 0.98);
    border-left: 1px solid var(--line);
    box-shadow: -12px 0 40px rgba(29, 26, 5, 0.14);
    transform: translateX(100%);
    transition: transform 320ms var(--ease), visibility 320ms var(--ease);
    z-index: 45;
    overflow-y: auto;
    overscroll-behavior: contain;
    visibility: hidden;
    pointer-events: none;
  }

  .site-header.is-nav-open .mobile-nav-panel {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(29, 26, 5, 0.42);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 44;
    opacity: 0;
    pointer-events: none;
    transition: opacity 320ms var(--ease);
  }

  .site-header.is-nav-open .nav-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .site-navigation {
    display: flex;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    margin: 0;
  }

  .site-navigation a:not(.button) {
    padding: 0.85rem 0.95rem;
    font-size: 1rem;
    border-radius: var(--radius-md);
    white-space: normal;
    flex-shrink: 1;
  }

  .site-navigation a:not(.button)::before {
    display: none;
  }

  .nav-actions {
    display: flex;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
  }

  .nav-actions .nav-donate {
    justify-content: center;
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
  }

  .nav-actions .nav-phone {
    justify-content: flex-start;
    padding: 0.75rem 0.95rem;
    border-radius: var(--radius-md);
    background: var(--cream-soft);
  }

  .nav-actions .nav-phone span {
    display: inline;
  }

  .nav-actions .nav-cta {
    justify-content: center;
    padding: 0.85rem 1rem;
  }
}

@media (max-width: 720px) {
  :root {
    --section-y: 3.5rem;
    --container-gutter: 1.15rem;
  }

  /* Disable carousel on mobile — show stacked cards instead */
  .community-grid[data-carousel="active"] {
    display: grid;
    height: auto;
    perspective: none;
  }
  .community-grid[data-carousel="active"] .community-card {
    position: static;
    width: auto;
    height: auto;
    transform: none !important;
    opacity: 1 !important;
    filter: none !important;
    pointer-events: auto;
    box-shadow: var(--shadow-sm);
  }
  .community-grid[data-carousel="active"] .carousel-arrow {
    display: none;
  }

  .brand-logo-light {
    height: 3rem;
    padding: 0.45rem 0.7rem;
  }

  .accreditations-panel {
    padding: var(--space-6);
  }

  .hero {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
  }

  .hero-inner {
    min-height: min(86vh, 44rem);
    padding-block: clamp(5rem, 14vh, 6.5rem) clamp(1.25rem, 3vh, 2rem);
  }

  .hero h1 {
    max-width: 100%;
  }

  .hero-stats {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .hero-stats li + li {
    padding-left: var(--space-5);
    padding-top: var(--space-4);
    border-left: 0;
    border-top: 0;
  }

  .hero-stats li {
    padding-right: var(--space-5);
  }

  .testimonial-grid,
  .community-grid,
  .footer-grid,
  .story-card-grid {
    grid-template-columns: 1fr;
  }

  .accreditation-grid {
    grid-template-columns: 1fr;
  }

  .story-card {
    grid-template-columns: 1fr;
  }

  .story-meta {
    padding: 0;
  }

  .community-body {
    padding: var(--space-6);
  }

  .black-sheep-feature-body {
    padding: var(--space-6);
  }

  .story-facts > div {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .story-badge {
    left: 0.75rem;
    bottom: -0.75rem;
    padding: 0.65rem 0.85rem;
  }

  .story-badge-year {
    font-size: 1.6rem;
  }

  .site-footer > .container {
    padding: 1.5rem;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .testimonial-card,
  .community-card {
    padding: 1.5rem;
  }

  .program-timeline-body {
    padding: var(--space-5) var(--space-5) var(--space-5) var(--space-9);
  }

  .program-timeline {
    --program-media-height: clamp(16rem, 48vw, 20rem);
  }

  .story-card {
    padding: 1.25rem 1.5rem;
  }
}

/* ---------------------------------------------------------------
   Apply Now modal
   --------------------------------------------------------------- */
.apply-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: clamp(0.75rem, 2vw, 1.5rem);
}

.apply-modal[hidden] {
  display: none;
}

.apply-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 24, 40, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.apply-modal-panel {
  position: relative;
  z-index: 1;
  width: min(42rem, 100%);
  max-height: min(92vh, 56rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(
    180deg,
    var(--white) 0%,
    var(--cream-soft) 100%
  );
  box-shadow: 0 28px 80px rgba(29, 26, 5, 0.22);
}

.apply-modal-scroll {
  overflow: auto;
  overscroll-behavior: contain;
  padding: clamp(1.25rem, 3vw, 2rem);
  padding-right: clamp(1.25rem, 3vw, 2rem);
  scrollbar-gutter: stable;
  margin: 0.5rem 0.5rem 0.5rem 0;
}

.apply-modal-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  color: var(--muted);
  cursor: pointer;
  transition:
    background 200ms var(--ease),
    color 200ms var(--ease),
    border-color 200ms var(--ease);
}

.apply-modal-close svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  fill: none;
}

.apply-modal-close:hover {
  background: var(--blue-soft);
  color: var(--heading);
  border-color: var(--blue-mid);
}

.apply-modal-header {
  display: grid;
  gap: var(--space-3);
  padding-right: 2.5rem;
  margin-bottom: var(--space-6);
}

.apply-modal-eyebrow {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.apply-modal-header h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  text-shadow: none;
}

.apply-modal-header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  max-width: 38ch;
}

.apply-form {
  display: grid;
  gap: var(--space-5);
}

.apply-section {
  margin: 0;
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-xs);
}

.apply-section > legend {
  padding: 0 var(--space-2);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--heading);
  letter-spacing: -0.01em;
}

.apply-subgroup {
  margin: 0 0 var(--space-4);
  padding: 0;
  border: 0;
}

.apply-subgroup:last-child {
  margin-bottom: 0;
}

.apply-subgroup > legend {
  padding: 0;
  margin-bottom: var(--space-3);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.apply-grid {
  display: grid;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.apply-grid:last-child {
  margin-bottom: 0;
}

.apply-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.apply-field {
  display: grid;
  gap: 0.45rem;
}

.apply-field label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.apply-field label span {
  color: var(--orange-deep);
}

.apply-field input,
.apply-field textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 0.95rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--text);
  font: inherit;
  line-height: 1.4;
  transition:
    border-color 200ms var(--ease),
    box-shadow 200ms var(--ease);
}

.apply-field textarea {
  min-height: 7rem;
  resize: vertical;
}

.apply-field input:focus,
.apply-field textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(75, 156, 211, 0.18);
}

.apply-field input.is-invalid,
.apply-field textarea.is-invalid {
  border-color: var(--orange-deep);
  box-shadow: 0 0 0 3px rgba(12, 26, 49, 0.15);
}

.apply-field-error {
  margin: 0;
  font-size: 0.78rem;
  color: var(--orange-deep);
  font-weight: 500;
}

.apply-field-conditional {
  margin-top: var(--space-3);
}

.apply-field-conditional[hidden] {
  display: none;
}

.apply-choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.apply-choice {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.55rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--white);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition:
    border-color 200ms var(--ease),
    background 200ms var(--ease);
}

.apply-choice:has(input:checked) {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--heading-deep);
}

.apply-choice input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--blue);
}

.apply-program-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.apply-program-option {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 3rem;
  padding: 0.75rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.35;
  transition:
    border-color 200ms var(--ease),
    background 200ms var(--ease),
    box-shadow 200ms var(--ease);
}

.apply-program-option:has(input:checked) {
  border-color: var(--panel);
  background: var(--panel-soft);
  box-shadow: inset 0 0 0 1px rgba(75, 156, 211, 0.35);
}

.apply-program-option input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--panel-deep);
}

.apply-reassurance {
  margin: 0;
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  background: linear-gradient(
    135deg,
    rgba(75, 156, 211, 0.08),
    rgba(75, 156, 211, 0.1)
  );
  border: 1px solid rgba(75, 156, 211, 0.15);
  color: var(--heading-deep);
  font-size: 0.95rem;
  line-height: 1.6;
  text-align: center;
}

.apply-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

/* The .button base sets display:inline-flex, which would override the
   [hidden] attribute. Restore it so step JS can show/hide buttons. */
.apply-actions .button[hidden] {
  display: none;
}

/* Step navigation (Back / Continue) — compact, distinct from final actions */
.apply-actions [data-apply-prev],
.apply-actions [data-apply-next] {
  flex: 0 0 auto;
  min-height: 2.5rem;
  padding-inline: 1.25rem;
  font-size: 0.92rem;
}

.apply-actions [data-apply-prev] {
  background: transparent;
  color: var(--blue-link);
  border: 1px solid rgba(75, 156, 211, 0.4);
}

.apply-actions [data-apply-prev]:hover {
  background: var(--blue-soft);
  border-color: var(--blue);
}

.apply-actions [data-apply-next] {
  font-weight: 600;
}

/* Final action — full-width emphasis */
.apply-actions .apply-submit {
  flex: 1 1 100%;
  min-height: 3rem;
}

.apply-form-status {
  margin: 0;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 600;
  text-align: center;
}

.apply-form-status.is-success {
  background: var(--panel-soft);
  color: var(--panel-deep);
  border: 1px solid rgba(75, 156, 211, 0.35);
}

.apply-form-status.is-error {
  background: rgba(233, 85, 80, 0.1);
  color: #b83d38;
  border: 1px solid rgba(233, 85, 80, 0.35);
}

/* ---------------------------------------------------------------
   Multi-step apply form: progress bar, steps, conditional sections
   --------------------------------------------------------------- */
.apply-progress {
  margin-bottom: var(--space-6);
}

.apply-progress-track {
  position: relative;
  height: 4px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.apply-progress-track span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--blue-mid));
  transition: width 320ms var(--ease);
}

.apply-progress-steps {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0.6rem 0 0;
  padding: 0;
  list-style: none;
}

.apply-progress-steps li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
  transition: color 220ms var(--ease);
}

.apply-progress-steps li span {
  display: inline-grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
  transition:
    background 220ms var(--ease),
    border-color 220ms var(--ease),
    color 220ms var(--ease);
}

.apply-progress-steps li.is-active {
  color: var(--heading);
}

.apply-progress-steps li.is-active span {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}

.apply-progress-steps li.is-done span {
  background: var(--blue-soft);
  border-color: var(--blue);
  color: var(--blue-mid);
}

@media (max-width: 720px) {
  .apply-progress-steps li {
    font-size: 0;
    gap: 0;
  }
  .apply-progress-steps li span {
    width: 1.75rem;
    height: 1.75rem;
  }
}

.apply-step {
  display: grid;
  gap: var(--space-5);
}

.apply-step[hidden] {
  display: none;
}

.apply-section-help {
  margin: 0 0 var(--space-3);
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.55;
}

.apply-section-help em {
  font-style: italic;
  color: var(--muted);
}

.apply-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.apply-choice-wrap .apply-choice {
  flex: 0 0 auto;
}

/* Program option with description */
.apply-program-option {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  text-align: left;
}

.apply-program-label {
  font-weight: 600;
  color: var(--heading);
}

.apply-program-label em {
  display: block;
  margin-top: 0.1rem;
  font-style: normal;
  font-weight: 500;
  font-size: 0.78rem;
  color: var(--muted);
}

.apply-program-desc {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}

.apply-program-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.apply-program-option:has(input:focus-visible) {
  box-shadow: 0 0 0 3px rgba(75, 156, 211, 0.3);
}

/* Conditional fieldset wrapper (used by prior-treatment / insurance detail) */
.apply-field-conditional[hidden] {
  display: none;
}

.apply-conditional[hidden] {
  display: none;
}

/* Consent checkboxes */
.apply-consent-list {
  display: grid;
  gap: 0.65rem;
}

.apply-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text);
  transition:
    border-color 200ms var(--ease),
    background 200ms var(--ease);
}

.apply-consent:has(input:checked) {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.apply-consent input {
  margin-top: 0.2rem;
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--blue);
  flex-shrink: 0;
}

/* File inputs */
.apply-field input[type="file"] {
  padding: 0.45rem 0.6rem;
  min-height: 2.75rem;
  font-size: 0.82rem;
  background: var(--white);
}

.apply-field input[type="file"]::file-selector-button {
  margin-right: 0.75rem;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--blue-soft);
  color: var(--blue-mid);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 200ms var(--ease),
    color 200ms var(--ease);
}

.apply-field input[type="file"]::file-selector-button:hover {
  background: var(--blue);
  color: var(--white);
}

/* Selects */
.apply-field select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  min-height: 2.75rem;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a8aa0' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
  transition:
    border-color 200ms var(--ease),
    box-shadow 200ms var(--ease);
}

.apply-field select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(75, 156, 211, 0.2);
}

.apply-field select.is-invalid {
  border-color: var(--danger, #c0392b);
}

/* Tables (medications, substance use, treatment history, symptom scale) */
.apply-table-wrap {
  overflow-x: auto;
  margin: 0.5rem 0 0.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
  -webkit-overflow-scrolling: touch;
}

.apply-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  min-width: 32rem;
}

.apply-table thead th {
  text-align: left;
  padding: 0.55rem 0.6rem;
  background: var(--blue-soft);
  color: var(--blue-mid);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.apply-table tbody td,
.apply-table tbody th {
  padding: 0.35rem 0.4rem;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  vertical-align: middle;
}

.apply-table tbody th {
  text-align: left;
  font-weight: 600;
  color: var(--heading);
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.015);
}

.apply-table tbody tr:last-child td,
.apply-table tbody tr:last-child th {
  border-bottom: none;
}

.apply-table input,
.apply-table select {
  width: 100%;
  min-width: 4.5rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm, 6px);
  background: var(--white);
  font: inherit;
  font-size: 0.82rem;
  min-height: 2.1rem;
}

.apply-table input:focus,
.apply-table select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(75, 156, 211, 0.25);
}

/* Symptom scale table (compact) */
.apply-scale-table {
  min-width: 18rem;
}

.apply-scale-table select {
  max-width: 6rem;
}

/* Submission information block */
.apply-submission {
  background: var(--blue-soft);
  border-color: var(--blue);
}

.apply-submission-block {
  margin: 0;
  padding: 0.25rem 0;
  line-height: 1.7;
  color: var(--text);
  font-size: 0.95rem;
}

.apply-submission-block strong {
  color: var(--heading);
  font-size: 1.05rem;
}

.apply-submission-block a {
  color: var(--blue-mid);
  text-decoration: none;
}

.apply-submission-block a:hover {
  text-decoration: underline;
}

body.is-apply-open {
  overflow: hidden;
}

@media (max-width: 720px) {
  .apply-modal-panel {
    max-height: 94vh;
    border-radius: var(--radius-lg);
  }

  .apply-grid-2,
  .apply-program-grid,
  .apply-grid-3 {
    grid-template-columns: 1fr;
  }

  .apply-actions {
    flex-direction: column;
  }

  .apply-actions .button {
    width: 100%;
    flex: none;
  }

  .apply-field input,
  .apply-field textarea {
    min-height: 3.25rem;
    font-size: 1rem;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .apply-modal:not([hidden]) .apply-modal-panel {
    animation: applyModalIn 320ms var(--ease) forwards;
  }

  @keyframes applyModalIn {
    from {
      opacity: 0;
      transform: translateY(12px) scale(0.98);
    }
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }
}

/* ---------------------------------------------------------------
   Staff page — editorial team grid
   --------------------------------------------------------------- */
.staff-page {
  background: var(--blue-deep);
  color: var(--white);
}

.staff-hero-section {
  position: relative;
  min-height: clamp(34rem, 70vh, 46rem);
  padding: 0;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  align-items: center;
  background: var(--blue-deep);
}

.staff-hero-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--blue-deep);
}

.staff-hero-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.staff-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(
      100deg,
      rgba(10, 20, 38, 0.92) 0%,
      rgba(10, 20, 38, 0.78) 38%,
      rgba(10, 20, 38, 0.42) 72%,
      rgba(10, 20, 38, 0.55) 100%
    );
}

.staff-hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  padding-top: clamp(7rem, 14vh, 9rem);
  padding-bottom: clamp(3rem, 8vh, 5rem);
}

.staff-hero-section .section-heading h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1.08;
  color: var(--white);
  max-width: 18ch;
}

.staff-hero-section .section-lede {
  margin-top: 1.25rem;
  max-width: 60ch;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.05rem;
}

@media (max-width: 640px) {
  .staff-hero-overlay {
    background:
      linear-gradient(
        180deg,
        rgba(10, 20, 38, 0.82) 0%,
        rgba(10, 20, 38, 0.72) 55%,
        rgba(10, 20, 38, 0.86) 100%
      );
  }
}

.staff-grid-section {
  padding-top: 1rem;
  padding-bottom: clamp(5rem, 10vh, 8rem);
}

.staff-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  gap: 1.5rem;
}

.staff-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 1.75rem 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition:
    transform 260ms var(--ease),
    border-color 260ms var(--ease),
    background 260ms var(--ease);
}

.staff-card:hover {
  transform: translateY(-4px);
  border-color: rgba(75, 156, 211, 0.55);
  background: rgba(75, 156, 211, 0.08);
}

.staff-avatar {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-mid) 100%);
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  box-shadow: 0 6px 18px rgba(19, 41, 75, 0.4);
}

.staff-photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 18%;
  display: block;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 10px 28px rgba(8, 18, 36, 0.45);
}

.staff-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.staff-title {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue);
}

.staff-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.15;
  color: var(--white);
}

.staff-bio {
  margin: 0.25rem 0 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.78);
}

@media (max-width: 640px) {
  .staff-card {
    padding: 1.4rem 1.25rem;
  }
  .staff-name {
    font-size: 1.3rem;
  }
}

/* ---------------------------------------------------------------
   Run for Recovery page
   Matches homepage rhythm: light sections, left headings,
   white cards, one dark CTA band (YouTube / black-sheep pattern).
   --------------------------------------------------------------- */
.r4r-page {
  background: var(--cream-soft);
  color: var(--text);
}

/* Hero — keep full-bleed photo (same as homepage hero) */
.r4r-hero {
  min-height: 100vh;
  min-height: 100dvh;
}

.r4r-hero-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transform: scale(1.02);
}

.r4r-hero .hero-overlay {
  background:
    radial-gradient(
      ellipse 80% 70% at 50% 42%,
      rgba(8, 16, 30, 0.58) 0%,
      rgba(8, 16, 30, 0.38) 48%,
      rgba(8, 16, 30, 0.52) 100%
    ),
    linear-gradient(
      180deg,
      rgba(8, 16, 30, 0.35) 0%,
      rgba(8, 16, 30, 0.15) 45%,
      rgba(8, 16, 30, 0.55) 100%
    );
}

/* Countdown — compact horizontal banner */
.r4r-countdown-banner {
  position: relative;
  z-index: 2;
  padding: 1.25rem 0;
  background: var(--blue-soft);
  border-block: 1px solid rgba(75, 156, 211, 0.18);
}

.r4r-countdown-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-5) var(--space-8);
}

.r4r-countdown-copy {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  flex: 0 1 auto;
}

.r4r-countdown-copy .eyebrow {
  margin: 0;
}

.r4r-countdown-copy h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.4vw, 1.65rem);
  font-weight: 600;
  line-height: 1.2;
  color: var(--heading);
  max-width: none;
}

.r4r-countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(3.5rem, 4.25rem));
  gap: 0.5rem;
  flex: 0 0 auto;
}

.r4r-countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.65rem 0.4rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  text-align: center;
}

.r4r-countdown-unit strong {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.2vw, 1.55rem);
  font-weight: 600;
  line-height: 1;
  color: var(--blue-deep);
  font-variant-numeric: tabular-nums;
}

.r4r-countdown-unit span {
  font-family: var(--font-sans);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.r4r-countdown-note {
  margin: 0;
  color: var(--blue-link);
  font-size: 0.9rem;
  font-weight: 600;
}

@media (max-width: 720px) {
  .r4r-countdown-inner {
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
  }
}

@media (max-width: 420px) {
  .r4r-countdown {
    grid-template-columns: repeat(2, minmax(3.5rem, 4.25rem));
  }
}

/* About — reuses section-mission; keep story-layout as-is */
.r4r-about .story-layout {
  margin-bottom: 0;
}

/* Event details — featured event listing (not icon info tiles) */
.r4r-details {
  position: relative;
  isolation: isolate;
  background: var(--white);
  color: var(--text);
}

.r4r-details::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    var(--cream) 0%,
    var(--blue-soft) 40%,
    var(--cream-soft) 100%
  );
}

.r4r-details .section-heading h2 {
  color: var(--heading);
}

.r4r-details .section-lede {
  color: var(--muted);
}

.r4r-event-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: var(--space-10);
  align-items: stretch;
  padding: clamp(1.75rem, 4vw, 2.75rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--white);
  box-shadow: var(--shadow-md);
}

.r4r-event-meta {
  display: flex;
  gap: var(--space-6);
  align-items: flex-start;
  padding-right: var(--space-6);
  border-right: 1px solid var(--line);
}

.r4r-event-date {
  flex-shrink: 0;
  display: grid;
  justify-items: center;
  gap: 0.15rem;
  min-width: 5.5rem;
  padding: 1rem 0.85rem;
  border-radius: var(--radius-md);
  background: var(--blue-deep);
  color: var(--white);
  text-align: center;
}

.r4r-event-month,
.r4r-event-year {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue-fountain);
}

.r4r-event-day {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1;
  color: var(--white);
}

.r4r-event-meta-copy {
  display: grid;
  gap: var(--space-3);
  align-content: start;
}

.r4r-event-when {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--heading);
  line-height: 1.25;
}

.r4r-event-where {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  color: var(--text);
  font-weight: 500;
}

.r4r-event-where svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: var(--blue);
  flex-shrink: 0;
}

.r4r-event-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.r4r-event-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.15rem;
  color: var(--blue-link);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  transition: color 200ms var(--ease), gap 200ms var(--ease);
}

.r4r-event-link:hover {
  color: var(--blue-deep);
  gap: 0.55rem;
}

.r4r-event-link svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.r4r-event-schedule {
  display: grid;
  gap: var(--space-5);
  align-content: start;
}

.r4r-event-schedule h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--heading);
  text-shadow: none;
}

.r4r-event-schedule ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-4);
}

.r4r-event-row {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--cream-soft);
}

.r4r-event-tag {
  display: inline-flex;
  align-self: start;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  background: rgba(75, 156, 211, 0.14);
  color: var(--blue-deep);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.r4r-event-row p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.98rem;
}

@media (max-width: 900px) {
  .r4r-event-panel {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .r4r-event-meta {
    padding-right: 0;
    padding-bottom: var(--space-6);
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 520px) {
  .r4r-event-meta {
    flex-direction: column;
  }
}

/* Register — full dark band like YouTube / black-sheep */
.r4r-register .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.r4r-register .section-heading {
  margin-bottom: var(--space-6);
  max-width: 40rem;
  margin-inline: auto;
  text-align: center;
}

.r4r-register .section-heading h2 {
  margin-inline: auto;
}

.r4r-register .section-heading .eyebrow {
  justify-content: center;
}

.r4r-register .section-lede,
.r4r-register .section-heading p {
  color: var(--white);
  max-width: 40rem;
  margin-inline: auto;
}

.r4r-register .hero-actions {
  justify-content: center;
}

.r4r-register .hero-actions .button svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 560px) {
  .r4r-register .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .r4r-register .hero-actions .button {
    width: 100%;
  }
}

/* ---------------------------------------------------------------
   Run for Recovery — gallery
   --------------------------------------------------------------- */
.r4r-gallery {
  padding-top: clamp(4rem, 8vh, 6rem);
  padding-bottom: clamp(5rem, 10vh, 8rem);
}

/* Two-column intro: heading on the left, video on the right */
.r4r-gallery-intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.r4r-gallery-copy {
  text-align: left;
}
.r4r-gallery-copy .eyebrow {
  justify-content: flex-start;
}

.r4r-gallery-video {
  margin: 0;
  max-width: 26rem;
  justify-self: end;
  width: 100%;
}
.r4r-gallery-video .r4r-video {
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 64vh;
  display: block;
  border-radius: 18px;
  background: #0b1626;
  box-shadow: 0 18px 44px rgba(8, 18, 36, 0.4);
  object-fit: cover;
}
.r4r-gallery-video figcaption {
  margin-top: 0.75rem;
  text-align: center;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (max-width: 860px) {
  .r4r-gallery-intro {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
  .r4r-gallery-copy {
    text-align: center;
  }
  .r4r-gallery-copy .eyebrow {
    justify-content: center;
  }
  .r4r-gallery-video {
    justify-self: center;
  }
}

.r4r-gallery-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
  gap: 1rem;
}
.r4r-gallery-grid li {
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: rgba(19, 41, 75, 0.06);
  box-shadow: 0 8px 22px rgba(8, 18, 36, 0.12);
}
.r4r-gallery-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 600ms var(--ease-cinematic);
}
.r4r-gallery-grid li:hover img {
  transform: scale(1.06);
}

@media (max-width: 640px) {
  .r4r-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr));
    gap: 0.75rem;
  }
}
