/*
Theme Name: Upward & Onward Jacksonville
Theme URI: https://www.upwardonwardjax.org/
Author: U&OJAX web project
Description: Custom theme for Upward & Onward Jacksonville, Inc. Ink-blue and amber design system with a dedicated teal pathway for youth-facing pages. No plugin dependencies.
Version: 1.4.0
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: uojax
*/

/* ==========================================================================
   Upward & Onward Jacksonville — Design System v2 (with imagery)
   Tokens map 1:1 to theme.json. Change one, change both.
   ========================================================================== */

:root {
  /* Brand ------------------------------------------------------------------
     --u-lime #B8D561 is the client's brand colour. Its luminance is 0.586,
     which makes it a FILL colour, never a text colour: white on it measures
     1.65:1. Paired with --u-ink it reaches 9.22:1, so buttons use dark text
     on lime. For lime-coloured *text*, use --u-lime-deep. */
  --u-ink:        #152A1D;   /* deep forest — headings, header, footer */
  --u-ink-soft:   #2C4534;
  --u-body:       #333B36;   /* body copy, 11.1:1 on paper */
  --u-lime:       #B8D561;   /* BRAND. Actions only — never decorative */
  --u-lime-deep:  #556E12;   /* lime as text + button hover, 5.57:1 on paper */
  --u-paper:      #FAFBF6;   /* warm off-white with a green cast */
  --u-sand:       #EDF0E1;
  --u-line:       #D8DDC6;
  /* The "get help" pathway. Deliberately BLUE, not teal: teal sits beside
     lime on the wheel and the two would collide, and green-vs-blue stays
     distinguishable under red-green colour blindness where green-vs-orange
     does not. */
  --u-blue:       #0E5A54;
  --u-blue-deep:  #0A443F;

  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px; --sp-5: 24px;
  --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 96px; --sp-10: 128px;

  --container: 1180px;
  --prose: 720px;
  --gutter: 20px;

  --r-sm: 4px;
  --r-md: 10px;
  --r-lg: 14px;

  --shadow-header: 0 1px 3px rgba(21, 42, 29, .10);
  --shadow-card:   0 10px 30px -12px rgba(21, 42, 29, .22);
  --shadow-btn:    0 6px 16px -6px rgba(21, 42, 29, .45);

  --font-display: 'Archivo', system-ui, sans-serif;
  --font-body: 'Source Sans 3', system-ui, sans-serif;

  --fs-hero:  clamp(34px, 5.2vw, 58px);
  --fs-h2:    clamp(26px, 3.4vw, 38px);
  --fs-h3:    clamp(20px, 2.1vw, 24px);
  --fs-lead:  clamp(18px, 1.6vw, 21px);
  --fs-body:  clamp(17px, 1.1vw, 18px);
  --fs-small: 15px;
  --fs-eyebrow: 13px;
  --fs-stat:  clamp(40px, 6vw, 64px);

  --ease: cubic-bezier(.22, .61, .36, 1);
}

@media (min-width: 768px) { :root { --gutter: 32px; } }

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

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

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--u-body);
  background: var(--u-paper);
  -webkit-font-smoothing: antialiased;
}
@media (max-width: 1023px) { body { padding-bottom: 68px; } }

img, picture, svg, video { display: block; max-width: 100%; }
img { height: auto; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: var(--u-ink); text-underline-offset: 3px; text-decoration-thickness: 2px; }
a:hover { color: var(--u-lime-deep); }

:focus-visible { outline: 3px solid var(--u-blue); outline-offset: 2px; border-radius: 2px; }
.site-footer :focus-visible, .section--ink :focus-visible, .hero :focus-visible,
.cta-band :focus-visible, .drawer :focus-visible { outline-color: var(--u-lime); }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--u-ink); color: var(--u-paper);
  padding: var(--sp-3) var(--sp-5); font-weight: 600;
}
.skip:focus { left: var(--sp-4); top: var(--sp-4); color: var(--u-paper); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--u-ink);
  font-weight: 700;
  letter-spacing: -.015em;
  text-wrap: balance;
}
h1 { font-size: var(--fs-hero); line-height: 1.06; font-stretch: 112%; }
h2 { font-size: var(--fs-h2);   line-height: 1.15; font-stretch: 108%; }
h3 { font-size: var(--fs-h3);   line-height: 1.25; font-weight: 600; }

p { max-width: 62ch; }
p + p { margin-top: var(--sp-4); }

.lead { font-size: var(--fs-lead); line-height: 1.55; }
.small { font-size: var(--fs-small); }

.eyebrow {
  display: block;
  font-family: var(--font-display);
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--u-lime-deep);
  margin-bottom: var(--sp-3);
}
.eyebrow--teal { color: var(--u-blue-deep); }
.section--ink .eyebrow, .hero .eyebrow, .cta-band .eyebrow { color: var(--u-lime); }

.prose p, .prose ul { max-width: 62ch; }
.prose > * + * { margin-top: var(--sp-4); }
.prose h2 { margin-top: var(--sp-7); }
.prose ul li { position: relative; padding-left: var(--sp-5); }
.prose ul li + li { margin-top: var(--sp-3); }
.prose ul li::before {
  content: ""; position: absolute; left: 0; top: .62em;
  width: 10px; height: 3px; background: var(--u-lime);
}

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

.section { padding-block: var(--sp-8); }
@media (min-width: 768px)  { .section { padding-block: var(--sp-9); } }
@media (min-width: 1024px) { .section { padding-block: var(--sp-10); } }

.section--sand  { background: var(--u-sand); }
.section--ink   { background: var(--u-ink); color: #C3CFC2; }
.section--ink h2, .section--ink h3 { color: #fff; }
.section--tight { padding-block: var(--sp-7); }

.section__head { margin-bottom: var(--sp-7); }
.section__head p { max-width: 58ch; }
.section__head--row {
  display: flex; justify-content: space-between; align-items: flex-end;
  flex-wrap: wrap; gap: var(--sp-4);
}

.grid { display: grid; gap: var(--sp-5); }
.grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); gap: var(--sp-6); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
  .grid--2 { grid-template-columns: repeat(2, 1fr); gap: var(--sp-8); }
}

.rule-steps { display: flex; align-items: flex-end; gap: 4px; height: 14px; }
.rule-steps span { width: 22px; background: var(--u-line); }
.rule-steps span:nth-child(1) { height: 3px; }
.rule-steps span:nth-child(2) { height: 8px; }
.rule-steps span:nth-child(3) { height: 14px; }

/* --------------------------------------------------------------------------
   MEDIA — the image system
   Every photo sits in a .media wrapper. If an image fails to load, the sand
   background and alt text remain, so the layout never collapses.
   -------------------------------------------------------------------------- */
.media {
  position: relative; overflow: hidden;
  background: var(--u-sand);
  border-radius: var(--r-md);
  isolation: isolate;
}
.media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .6s var(--ease);
}
.media--16x10 { aspect-ratio: 16 / 10; }
.media--4x3   { aspect-ratio: 4 / 3; }
.media--3x2   { aspect-ratio: 3 / 2; }
.media--1x1   { aspect-ratio: 1 / 1; }
.media--portrait { aspect-ratio: 4 / 5; }
.media--wide  { aspect-ratio: 21 / 9; }
.media--flush { border-radius: 0; }

.media--tint::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(21,42,29,.08) 0%, rgba(21,42,29,.58) 100%);
  pointer-events: none;
}
.media--frame { box-shadow: var(--shadow-card); }

/* Amber corner tab — quiet brand mark on key photos */
.media--tab::before {
  content: ""; position: absolute; left: 0; bottom: 0; z-index: 2;
  width: 68px; height: 8px; background: var(--u-lime);
}

.media__caption {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: var(--sp-4);
  color: #fff; font-size: var(--fs-small); font-weight: 600;
  text-shadow: 0 1px 4px rgba(0,0,0,.6);
}

.media-duo { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.media-duo > *:last-child { margin-top: var(--sp-7); }

/* --------------------------------------------------------------------------
   Buttons — hover / focus / active on every variant
   -------------------------------------------------------------------------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: 50px; padding: 13px 28px;
  font-family: var(--font-body); font-size: 17px; font-weight: 600; line-height: 1.2;
  text-decoration: none; border-radius: var(--r-md);
  border: 2px solid transparent;
  cursor: pointer;
  transition:
    background-color .2s var(--ease),
    border-color .2s var(--ease),
    color .2s var(--ease),
    transform .2s var(--ease),
    box-shadow .2s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); box-shadow: none; transition-duration: .05s; }

.btn--primary { background: var(--u-lime); color: var(--u-ink); }
.btn--primary:hover { background: var(--u-lime-deep); color: #fff; box-shadow: var(--shadow-btn); }

.btn--help { background: var(--u-blue); color: #fff; }
.btn--help:hover { background: var(--u-blue-deep); color: #fff; box-shadow: var(--shadow-btn); }

.btn--secondary { border-color: var(--u-ink); color: var(--u-ink); background: transparent; }
.btn--secondary:hover { background: var(--u-ink); color: var(--u-paper); box-shadow: var(--shadow-btn); }

.btn--on-ink { border-color: rgba(250,251,246,.55); color: #fff; background: rgba(250,251,246,.07); }
.btn--on-ink:hover { background: var(--u-paper); color: var(--u-ink); border-color: var(--u-paper); box-shadow: 0 6px 20px -6px rgba(0,0,0,.55); }

.btn--lg { min-height: 58px; font-size: 19px; padding-inline: 34px; }
.btn--full { width: 100%; }

.btn-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); }

.link-arrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; text-decoration: none;
  border-bottom: 2px solid var(--u-lime); padding-bottom: 2px;
  transition: border-color .2s var(--ease), color .2s var(--ease), gap .2s var(--ease);
}
.link-arrow i { font-style: normal; transition: transform .2s var(--ease); }
.link-arrow:hover { border-color: var(--u-ink); gap: 12px; }
.link-arrow:hover i { transform: translateX(3px); }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250,251,246,.95);
  -webkit-backdrop-filter: saturate(150%) blur(8px);
  backdrop-filter: saturate(150%) blur(8px);
  border-bottom: 1px solid var(--u-line);
  transition: box-shadow .2s var(--ease);
}
.site-header.is-stuck { box-shadow: var(--shadow-header); }

/* Header height is FIXED and never changes on scroll.
   Shrinking a sticky header changes document height, which shifts scrollY,
   which re-fires the scroll handler — an oscillation loop that reads as the
   header "jumping" at random. Only the shadow changes. Don't reintroduce
   a height or logo-size transition here. */
.header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-4); height: 76px;
}
@media (min-width: 1024px) { .header__inner { height: 88px; } }

.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo img { height: 52px; width: auto; border-radius: var(--r-sm); }
.logo__text {
  font-family: var(--font-display); font-weight: 700; font-size: 16px;
  line-height: 1.1; color: var(--u-ink); font-stretch: 105%;
}
.logo__text em { display: block; font-style: normal; font-weight: 400; font-size: 13px; color: var(--u-ink-soft); letter-spacing: .04em; }
@media (max-width: 460px) { .site-header .logo__text { display: none; } }

.nav { display: none; }
.nav__list { display: flex; align-items: center; gap: var(--sp-5); }
.nav__list > li { position: relative; }
.nav__list a, .nav__toggle {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  height: 40px; /* fixed — keeps hover/active states from nudging the row */
  font-weight: 600; font-size: 17px; text-decoration: none; color: var(--u-ink);
  transition: color .2s var(--ease);
}
.nav__list > li > a::after, .nav__toggle::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 3px; background: var(--u-lime);
  transform: scaleX(0); transform-origin: left;
  transition: transform .22s var(--ease);
}
.nav__list > li > a:hover::after, .nav__toggle:hover::after,
.nav__toggle[aria-expanded="true"]::after,
.nav__list a[aria-current="page"]::after { transform: scaleX(1); }
.nav__list a:hover, .nav__toggle:hover { color: var(--u-ink); }
.nav__toggle svg { transition: transform .18s var(--ease); }
.nav__toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

.submenu {
  position: absolute; top: calc(100% + 6px); left: -16px; min-width: 282px;
  background: #fff; border: 1px solid var(--u-line); border-radius: var(--r-md);
  box-shadow: 0 14px 34px -10px rgba(21,42,29,.28);
  padding: var(--sp-2); display: none;
}
.submenu[data-open] { display: block; animation: dropIn .18s var(--ease); }
@keyframes dropIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.submenu a { display: block; padding: 11px var(--sp-3); border-radius: var(--r-sm); font-weight: 600; }
.submenu a::after { display: none; }
.submenu a span { display: block; font-weight: 400; font-size: 14px; color: var(--u-ink-soft); }
.submenu a:hover { background: var(--u-sand); color: var(--u-ink); }

.header__actions { display: none; align-items: center; gap: var(--sp-4); }
/* Buttons inside the fixed-height header must not lift — the transform is
   fine, but pairing it with a height-constrained flex row invites jitter. */
.header__actions .btn { min-height: 46px; }
.header__actions .btn:hover { transform: none; }
.header__tel { font-weight: 600; text-decoration: none; white-space: nowrap; transition: color .2s var(--ease); }
.header__tel:hover { color: var(--u-lime-deep); }

.header__mobile { display: flex; align-items: center; gap: var(--sp-2); }
.icon-btn {
  display: grid; place-items: center; width: 48px; height: 48px;
  border-radius: var(--r-md); color: var(--u-ink);
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.icon-btn:hover { background: var(--u-sand); }

@media (min-width: 1024px) {
  .nav { display: block; }
  .header__actions { display: flex; }
  .header__mobile { display: none; }
}

/* Mobile drawer */
.drawer {
  position: fixed; inset: 0; z-index: 200;
  background: var(--u-ink); color: var(--u-paper);
  padding: var(--sp-4) var(--gutter) var(--sp-8);
  overflow-y: auto;
  transform: translateY(-100%); visibility: hidden;
  transition: transform .3s var(--ease), visibility .3s;
}
.drawer[data-open] { transform: translateY(0); visibility: visible; }
.drawer__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sp-6); }
.drawer__top .icon-btn { color: var(--u-paper); }
.drawer__top .icon-btn:hover { background: var(--u-ink-soft); }
.drawer .logo img { background: #fff; padding: 4px; }
.drawer .logo__text { color: #fff; }
.drawer .logo__text em { color: #9EAE9D; }
.drawer__nav a {
  display: block; padding: var(--sp-4) 0; font-family: var(--font-display);
  font-size: 22px; font-weight: 600; color: #fff; text-decoration: none;
  border-bottom: 1px solid var(--u-ink-soft);
  transition: color .2s var(--ease), padding-left .2s var(--ease);
}
.drawer__nav a:hover { color: var(--u-lime); padding-left: 6px; }
.drawer__nav .sub a { font-size: 17px; font-family: var(--font-body); padding-left: var(--sp-4); color: #C0CCBF; }
.drawer__cta { display: grid; gap: var(--sp-3); margin-bottom: var(--sp-6); }
@media (min-width: 1024px) { .drawer { display: none; } }


/* Mobile drawer: WordPress's default walker emits <ul class="sub-menu"> for
   nested items. Style that too, not just the hand-written .sub wrapper. */
.drawer__nav ul { margin: 0; padding: 0; list-style: none; }
.drawer__nav .sub-menu a,
.drawer__nav .sub a {
  font-family: var(--font-body); font-size: 17px;
  padding-left: var(--sp-4); color: #C0CCBF;
}
.drawer__nav .sub-menu a::before { content: "— "; opacity: .6; }

/* Sticky mobile conversion bar */
.mobile-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 150;
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  background: rgba(250,251,246,.97);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-top: 1px solid var(--u-line);
  box-shadow: 0 -2px 12px rgba(21,42,29,.10);
}
.mobile-cta .btn { min-height: 46px; font-size: 16px; padding-inline: 10px; }
.mobile-cta .btn:hover { transform: none; }
@media (min-width: 1024px) { .mobile-cta { display: none; } }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero { position: relative; background: var(--u-ink); color: var(--u-paper); overflow: hidden; }
.hero__bg { position: absolute; inset: 0; z-index: 0; }
.hero__bg img { width: 100%; height: 100%; object-fit: cover; object-position: center 32%; }
.hero__bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(100deg, rgba(21,42,29,.96) 0%, rgba(21,42,29,.87) 46%, rgba(21,42,29,.55) 100%),
    linear-gradient(0deg, rgba(21,42,29,.7) 0%, rgba(21,42,29,0) 55%);
}
.hero__inner { position: relative; z-index: 1; padding-block: var(--sp-9); max-width: 760px; }
@media (min-width: 1024px) { .hero__inner { padding-block: 132px 118px; } }
.hero h1 { color: #fff; }
.hero .lead { color: #DDE6DA; margin-top: var(--sp-5); max-width: 56ch; }
.hero .btn-row { margin-top: var(--sp-7); }

.hero--compact .hero__inner { padding-block: var(--sp-8); }
@media (min-width: 1024px) { .hero--compact .hero__inner { padding-block: var(--sp-9) var(--sp-8); } }

.trustbar { position: relative; z-index: 1; background: rgba(21,42,29,.55); border-top: 1px solid rgba(255,255,255,.14); }
.trustbar__inner {
  display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-6);
  padding-block: var(--sp-4);
  font-family: var(--font-display); font-size: 13px; font-weight: 600;
  letter-spacing: .07em; text-transform: uppercase; color: rgba(223,231,238,.92);
}
.trustbar__inner span { display: inline-flex; align-items: center; gap: 8px; }
.trustbar__inner span::before { content: ""; width: 7px; height: 7px; background: var(--u-lime); flex: none; }

/* Page header (interior) */
.page-head { position: relative; background: var(--u-sand); border-bottom: 1px solid var(--u-line); overflow: hidden; }
.page-head__inner { padding-block: var(--sp-8); position: relative; z-index: 1; }
@media (min-width: 768px) { .page-head__inner { padding-block: var(--sp-9); } }
.page-head .lead { margin-top: var(--sp-4); }
.page-head .btn-row { margin-top: var(--sp-6); }
.page-head--help { background: #E9F1EF; }

.crumb { position: relative; z-index: 1; font-size: var(--fs-small); padding-top: var(--sp-5); color: var(--u-ink-soft); }
.crumb a { text-decoration: none; font-weight: 600; }
.crumb a:hover { text-decoration: underline; }
.crumb span { opacity: .55; padding-inline: 6px; }

/* --------------------------------------------------------------------------
   SIGNATURE — continuum band
   -------------------------------------------------------------------------- */
.continuum { margin-top: var(--sp-7); }
.continuum__track { display: grid; gap: var(--sp-6); }

.continuum__step { position: relative; padding-top: var(--sp-5); }
.continuum__step::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--u-lime);
}
.continuum__media { margin-bottom: var(--sp-4); }
.continuum__stage {
  font-family: var(--font-display); font-size: var(--fs-eyebrow); font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--u-lime);
}
.continuum__name { font-family: var(--font-display); font-size: 21px; font-weight: 700; color: #fff; margin-top: 6px; }
.continuum__desc { font-size: var(--fs-small); margin-top: var(--sp-2); max-width: 34ch; color: #BCC9BB; }

@media (min-width: 860px) {
  .continuum__track { grid-template-columns: repeat(3, 1fr); align-items: end; }
  .continuum__step:nth-child(1) { margin-bottom: 0; }
  .continuum__step:nth-child(2) { margin-bottom: 34px; }
  .continuum__step:nth-child(3) { margin-bottom: 68px; }
  .continuum__step:nth-child(1)::after,
  .continuum__step:nth-child(2)::after {
    content: ""; position: absolute; top: -34px; right: -32px;
    width: 4px; height: 38px; background: var(--u-lime);
  }
}

/* Scroll reveal — the only motion on the site */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .55s var(--ease), transform .55s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .09s; }
.reveal[data-delay="2"] { transition-delay: .18s; }
.reveal[data-delay="3"] { transition-delay: .27s; }

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.card {
  position: relative;
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--u-line); border-radius: var(--r-lg);
  overflow: hidden; height: 100%;
  transition: border-color .28s var(--ease), transform .28s var(--ease), box-shadow .28s var(--ease);
}
/* Accent bar wipes across the top on hover */
.card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; z-index: 3;
  background: var(--u-lime);
  transform: scaleX(0); transform-origin: left;
  transition: transform .32s var(--ease);
}
.card:hover::before, .card:focus-within::before { transform: scaleX(1); }

.card .media { border-radius: 0; }
.card .media::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(21,42,29,.32) 0%, rgba(21,42,29,0) 45%);
  pointer-events: none;
}
.card:hover { border-color: var(--u-ink); transform: translateY(-6px); box-shadow: var(--shadow-card); }
.card:hover .media img, .card:focus-within .media img { transform: scale(1.06); }
.card:focus-within { border-color: var(--u-ink); box-shadow: var(--shadow-card); }

/* Category chip sits on the photo, freeing the body for real content */
.card__chip {
  position: absolute; top: var(--sp-4); left: var(--sp-4); z-index: 2;
  display: inline-block; padding: 6px 12px;
  background: rgba(251,249,246,.94);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  border-radius: 999px;
  font-family: var(--font-display); font-size: 12px; font-weight: 600;
  letter-spacing: .07em; text-transform: uppercase; color: var(--u-ink);
}

.card__body { padding: var(--sp-5); display: flex; flex-direction: column; flex: 1; }
.card__body h3 { margin-bottom: var(--sp-3); }
.card__body p { flex: 1; font-size: 16.5px; }

/* Whole card is the click target; the arrow is the visible affordance */
.card__link {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  margin-top: var(--sp-5); padding-top: var(--sp-4);
  border-top: 1px solid var(--u-line);
  font-weight: 600; text-decoration: none; color: var(--u-ink);
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.card__link::after { content: ""; position: absolute; inset: 0; z-index: 4; }
.card__link i {
  flex: none; display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 50%;
  border: 2px solid var(--u-line); font-style: normal; font-size: 17px;
  transition: background-color .25s var(--ease), border-color .25s var(--ease),
              color .25s var(--ease), transform .25s var(--ease);
}
.card:hover .card__link { border-color: var(--u-ink); }
.card:hover .card__link i {
  background: var(--u-lime); border-color: var(--u-lime);
  color: var(--u-ink); transform: translateX(4px);
}
.card__body .btn { margin-top: var(--sp-5); align-self: flex-start; position: relative; z-index: 5; }

/* Board/person card — no link, so no arrow row */
.card--static::before { display: none; }
.card--static:hover { transform: none; border-color: var(--u-line); box-shadow: none; }

/* ---- Role cards ---- */
.role {
  position: relative; overflow: hidden;
  border: 1px solid var(--u-line); border-radius: var(--r-lg);
  padding: var(--sp-6) var(--sp-5) var(--sp-5); background: #fff;
  display: flex; flex-direction: column; height: 100%;
  transition: transform .28s var(--ease), box-shadow .28s var(--ease), border-color .28s var(--ease);
}
.role::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--u-ink);
  transition: height .28s var(--ease), background-color .28s var(--ease);
}
.role:hover { transform: translateY(-6px); box-shadow: var(--shadow-card); border-color: var(--u-ink); }
.role:hover::before { height: 7px; background: var(--u-lime); }
.role--help::before { background: var(--u-blue); }
.role--help:hover::before { background: var(--u-blue); }
.role h3 { margin-bottom: var(--sp-3); }
.role p { flex: 1; font-size: 16.5px; }
.role .btn { margin-top: var(--sp-5); }

/* --------------------------------------------------------------------------
   Stats
   -------------------------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-6) var(--sp-5); }
@media (min-width: 1024px) { .stats { grid-template-columns: repeat(4, 1fr); gap: var(--sp-7); } }
.stat__num {
  font-family: var(--font-display); font-size: var(--fs-stat); font-weight: 700;
  line-height: 1; color: var(--u-ink); font-stretch: 112%;
  padding-bottom: var(--sp-3); border-bottom: 4px solid var(--u-lime); display: inline-block;
}
.stat__label { margin-top: var(--sp-3); font-size: 16px; line-height: 1.45; max-width: 22ch; }
.section--ink .stat__num { color: #fff; }
.section--ink .stat__label { color: #C3CFC2; }

/* --------------------------------------------------------------------------
   Quote / split
   -------------------------------------------------------------------------- */
.quote { border-left: 4px solid var(--u-lime); padding-left: var(--sp-5); }
.quote p {
  font-family: var(--font-display); font-size: var(--fs-lead); font-weight: 600;
  line-height: 1.4; color: var(--u-ink); font-stretch: 104%;
}
.quote cite { display: block; margin-top: var(--sp-4); font-style: normal; font-size: var(--fs-small); color: var(--u-ink-soft); }
.section--ink .quote p { color: #fff; }
.section--ink .quote cite { color: #A7B5A6; }

.split { display: grid; gap: var(--sp-6); align-items: center; }
@media (min-width: 900px) {
  .split { grid-template-columns: 5fr 7fr; gap: var(--sp-8); }
  .split--reverse > *:first-child { order: 2; }
  .split--even { grid-template-columns: 1fr 1fr; }
  .split--top { align-items: start; }
}

/* --------------------------------------------------------------------------
   Notice / steps / features
   -------------------------------------------------------------------------- */
.notice {
  border-left: 4px solid var(--u-blue);
  background: var(--u-sand); border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: var(--sp-5);
}
.section--sand .notice, .page-head .notice { background: #fff; }
.notice h3 { font-size: 19px; margin-bottom: var(--sp-3); }
.notice p { font-size: 16.5px; }

.steps { counter-reset: s; display: grid; gap: var(--sp-5); }
.steps li { position: relative; padding-left: 62px; }
.steps li::before {
  counter-increment: s; content: counter(s, decimal-leading-zero);
  position: absolute; left: 0; top: -2px;
  font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--u-lime-deep);
  width: 46px; padding-bottom: 6px; border-bottom: 3px solid var(--u-lime);
}
.steps h3 { font-size: 19px; margin-bottom: 4px; }
.steps p { font-size: 16.5px; }

.features { display: grid; gap: var(--sp-5); }
@media (min-width: 768px) { .features--2 { grid-template-columns: repeat(2, 1fr); gap: var(--sp-6); } }
.features li { border-top: 3px solid var(--u-line); padding-top: var(--sp-4); transition: border-color .25s var(--ease); }
.features li:hover { border-top-color: var(--u-lime); }
.features h3 { font-size: 19px; margin-bottom: var(--sp-2); }
.features p { font-size: 16.5px; }

/* --------------------------------------------------------------------------
   Gallery
   -------------------------------------------------------------------------- */
.gallery-strip {
  display: grid; grid-auto-flow: column; grid-auto-columns: 62%;
  gap: var(--sp-3); overflow-x: auto; scroll-snap-type: x mandatory;
  padding-bottom: var(--sp-3);
}
.gallery-strip > * { scroll-snap-align: start; }
@media (min-width: 768px) { .gallery-strip { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); overflow: visible; } }
@media (min-width: 1024px) { .gallery-strip { grid-template-columns: repeat(6, 1fr); } }

.gallery-grid { display: grid; gap: var(--sp-4); grid-template-columns: repeat(2, 1fr); }
@media (min-width: 768px)  { .gallery-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .gallery-grid { grid-template-columns: repeat(4, 1fr); } }
.gallery-grid .media, .gallery-strip .media { transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.gallery-grid .media:hover, .gallery-strip .media:hover { transform: translateY(-4px); box-shadow: var(--shadow-card); }
.gallery-grid .media:hover img, .gallery-strip .media:hover img { transform: scale(1.06); }

/* --------------------------------------------------------------------------
   CTA band
   -------------------------------------------------------------------------- */
.cta-band { position: relative; background: var(--u-ink); color: #C3CFC2; text-align: center; overflow: hidden; }
.cta-band__bg { position: absolute; inset: 0; z-index: 0; }
.cta-band__bg img { width: 100%; height: 100%; object-fit: cover; }
.cta-band__bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(21,42,29,.94), rgba(21,42,29,.84)); }
.cta-band__inner { position: relative; z-index: 1; padding-block: var(--sp-8); }
@media (min-width: 768px) { .cta-band__inner { padding-block: var(--sp-9); } }
.cta-band h2 { color: #fff; }
.cta-band p { margin: var(--sp-4) auto 0; max-width: 52ch; }
.cta-band .btn-row { justify-content: center; margin-top: var(--sp-7); }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.field { margin-bottom: var(--sp-5); }
.field label { display: block; font-weight: 600; color: var(--u-ink); margin-bottom: var(--sp-2); }
.field .hint { display: block; font-size: 14px; font-weight: 400; color: var(--u-ink-soft); margin-top: 2px; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 50px; padding: 13px var(--sp-4);
  font: inherit; font-size: 17px; color: var(--u-body);
  background: #fff; border: 1px solid var(--u-line); border-radius: var(--r-sm);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--u-ink-soft); }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--u-blue); outline: 3px solid rgba(14,90,84,.26); outline-offset: 0;
}
.form-card { background: #fff; border: 1px solid var(--u-line); border-radius: var(--r-lg); padding: var(--sp-5); }
@media (min-width: 768px) { .form-card { padding: var(--sp-7); } }

.signup { display: flex; flex-wrap: wrap; gap: var(--sp-3); max-width: 520px; margin-inline: auto; }
.signup input {
  flex: 1 1 240px; min-height: 54px; padding: 13px var(--sp-4);
  font: inherit; font-size: 17px; border: 1px solid transparent; border-radius: var(--r-sm);
}
.form-status { margin-top: var(--sp-4); font-weight: 600; color: var(--u-blue-deep); }

.tiers { display: grid; gap: var(--sp-4); }
@media (min-width: 768px) { .tiers { grid-template-columns: repeat(3, 1fr); } }
.tier {
  border: 1px solid var(--u-line); border-top: 4px solid var(--u-lime);
  border-radius: var(--r-lg); padding: var(--sp-5); background: #fff;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.tier:hover { transform: translateY(-5px); box-shadow: var(--shadow-card); }
.tier__amount { font-family: var(--font-display); font-size: 32px; font-weight: 700; color: var(--u-ink); }
.tier p { margin-top: var(--sp-3); font-size: 16.5px; }

.embed-slot {
  border: 2px dashed var(--u-line); border-radius: var(--r-lg);
  background: #fff; padding: var(--sp-7) var(--sp-5); text-align: center;
}
.embed-slot .eyebrow { color: var(--u-ink-soft); }
.embed-slot p { margin-inline: auto; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer { background: var(--u-ink); color: #BCC9BB; padding-block: var(--sp-8) var(--sp-5); }
.footer__grid { display: grid; gap: var(--sp-7); }
@media (min-width: 700px)  { .footer__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .footer__grid { grid-template-columns: 2fr 1fr 1fr 1.4fr; gap: var(--sp-6); } }
.footer__logo { background: #fff; padding: var(--sp-3); border-radius: var(--r-md); display: inline-block; }
.footer__logo img { height: 64px; width: auto; }
.site-footer h2 {
  font-size: var(--fs-eyebrow); letter-spacing: .08em; text-transform: uppercase;
  color: #fff; margin-bottom: var(--sp-4);
}
.site-footer a { color: #C6D2C5; text-decoration: none; transition: color .2s var(--ease); }
.site-footer a:hover { color: var(--u-lime); text-decoration: underline; }
.footer__list li + li { margin-top: var(--sp-3); }
.footer__mission { margin-top: var(--sp-4); font-size: 16px; max-width: 34ch; }
.footer__social { display: flex; gap: var(--sp-3); margin-top: var(--sp-5); }
.footer__social a {
  display: grid; place-items: center; width: 46px; height: 46px;
  border: 1px solid var(--u-ink-soft); border-radius: var(--r-sm);
  transition: background-color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease), color .2s var(--ease);
}
.footer__social a:hover { background: var(--u-lime); border-color: var(--u-lime); color: var(--u-ink); transform: translateY(-2px); }
.footer__legal {
  margin-top: var(--sp-8); padding-top: var(--sp-5);
  border-top: 1px solid var(--u-ink-soft); font-size: var(--fs-small);
  display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4);
}

/* --------------------------------------------------------------------------
   Dev annotations — remove before launch
   -------------------------------------------------------------------------- */
.devnote {
  font-family: var(--font-body); font-size: 14px; line-height: 1.5;
  background: #FFF6E5; border-left: 4px solid var(--u-lime);
  color: #5A4212; padding: var(--sp-3) var(--sp-4); border-radius: 0 var(--r-sm) var(--r-sm) 0;
  margin-top: var(--sp-5); max-width: 62ch;
}
.devnote strong { color: #3E2D0B; }
body.hide-devnotes .devnote { display: none; }

.devbar {
  position: fixed; right: 14px; bottom: 82px; z-index: 300;
  background: var(--u-ink); color: #fff; border-radius: 999px;
  padding: 10px 18px; font-size: 14px; font-weight: 600;
  box-shadow: 0 6px 20px rgba(21,42,29,.3);
  transition: background-color .2s var(--ease), transform .2s var(--ease);
}
.devbar:hover { background: var(--u-ink-soft); color: #fff; transform: translateY(-2px); }
@media (min-width: 1024px) { .devbar { bottom: 14px; } }

/* ==========================================================================
   MOBILE REFINEMENTS
   Most visitors arrive on a phone. These rules are not afterthoughts —
   several fix real bugs that only manifest on small screens.
   ========================================================================== */

/* --- Anchor jumps must clear the sticky header ---------------------------
   Without this, tapping "Register" or "Apply" scrolls the heading directly
   underneath the fixed header and the user lands mid-paragraph. */
[id] { scroll-margin-top: 92px; }
@media (min-width: 1024px) { [id] { scroll-margin-top: 104px; } }

/* --- Horizontal overflow guard ------------------------------------------
   `clip` rather than `hidden`: overflow:hidden on a scroll ancestor silently
   breaks position:sticky, which would kill the header. */
body { overflow-x: clip; overflow-wrap: break-word; }

/* --- iPhone safe areas (home indicator / notch) -------------------------- */
@media (max-width: 1023px) {
  body { padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px)); }
}
.mobile-cta {
  padding-bottom: calc(var(--sp-2) + env(safe-area-inset-bottom, 0px));
  padding-left: calc(var(--sp-3) + env(safe-area-inset-left, 0px));
  padding-right: calc(var(--sp-3) + env(safe-area-inset-right, 0px));
}
.drawer {
  padding-top: calc(var(--sp-4) + env(safe-area-inset-top, 0px));
  padding-bottom: calc(var(--sp-8) + env(safe-area-inset-bottom, 0px));
}

/* --- Header auto-hide on phones -----------------------------------------
   Reclaims 76px of a small screen. Uses transform only — never height —
   so it cannot re-trigger the scroll handler the way a height change would. */
@media (max-width: 1023px) {
  .site-header { transition: transform .28s var(--ease), box-shadow .2s var(--ease); }
  .site-header.is-hidden { transform: translateY(-100%); }
}

/* --- Hero ---------------------------------------------------------------- */
@media (max-width: 767px) {
  .hero__inner { padding-block: var(--sp-8) var(--sp-7); }
  /* Portrait crops: bias toward the upper-middle so faces survive the crop */
  .hero__bg img { object-position: center 28%; }
  .trustbar__inner { gap: var(--sp-2) var(--sp-5); font-size: 12px; }
}

/* --- Full-width primary actions on small screens -------------------------
   Two side-by-side buttons wrap into a ragged two-line block under ~520px.
   Stacked full-width buttons are both tidier and easier to hit. */
@media (max-width: 519px) {
  .hero .btn-row, .page-head .btn-row, .cta-band .btn-row { display: grid; gap: var(--sp-3); }
  .hero .btn-row .btn, .page-head .btn-row .btn, .cta-band .btn-row .btn { width: 100%; }
  .btn--lg { min-height: 54px; font-size: 18px; }
  .signup { display: grid; }
  .signup input, .signup .btn { width: 100%; }
}

/* --- Stats: two 40px numbers don't fit a 320px viewport ------------------ */
@media (max-width: 400px) {
  .stats { grid-template-columns: 1fr; gap: var(--sp-6); }
  .stat__label { max-width: none; }
}

/* --- Continuum: give the stacked mobile version its connecting thread ---- */
@media (max-width: 859px) {
  .continuum__track { position: relative; gap: var(--sp-7); }
  .continuum__step { padding-left: var(--sp-5); padding-top: var(--sp-4); }
  .continuum__step::before { left: var(--sp-5); height: 3px; }
  /* vertical riser linking each step down to the next */
  .continuum__step:not(:last-child)::after {
    content: ""; position: absolute; left: 0; top: 0; bottom: calc(var(--sp-7) * -1);
    width: 3px; background: rgba(184, 213, 97, .45);
  }
  .continuum__step:last-child::after {
    content: ""; position: absolute; left: 0; top: 0; height: 40px;
    width: 3px; background: var(--u-lime);
  }
  .continuum__desc { max-width: none; }
}

/* --- Cards: hover states are meaningless on touch ------------------------
   On a touch device :hover sticks after a tap, leaving a card stuck in its
   raised state. Neutralise transform-based hover where hover isn't real. */
@media (hover: none) {
  .card:hover, .role:hover, .tier:hover, .btn:hover,
  .gallery-grid .media:hover, .gallery-strip .media:hover { transform: none; }
  .card:hover .media img { transform: none; }
  .card:active { transform: scale(.99); transition-duration: .08s; }
  .btn:active { transform: scale(.98); }
}

/* --- Touch targets ------------------------------------------------------- */
@media (max-width: 1023px) {
  .crumb { line-height: 2.2; }
  .footer__list a, .card__link { display: inline-flex; min-height: 44px; align-items: center; }
  .card__link { display: flex; }
}

/* --- Gallery strip: make the horizontal scroll obviously scrollable ------ */
@media (max-width: 767px) {
  .gallery-strip { scroll-padding-left: var(--gutter); grid-auto-columns: 58%; }
}

/* --- Long headings shouldn't break awkwardly on narrow screens ----------- */
@media (max-width: 480px) {
  h1 { font-size: clamp(30px, 8.5vw, 38px); }
  .lead { font-size: 17.5px; }
}


@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .btn:hover, .card:hover, .role:hover, .tier:hover,
  .gallery-grid .media:hover, .gallery-strip .media:hover { transform: none; }
}
