/* ==========================================================================
   The Ties Foundation — styles.css
   Design tokens from the R5 brand identity. Mobile-first. WCAG 2.1 AA.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  /* palette */
  --pine: #004953;
  --pine-ink: #003a42;
  --pine-deep: #00363d;
  --pine-deeper: #002a30;
  --terracotta: #e2725b;
  --terracotta-deep: #b04c38;   /* AA on white (5.3:1) — buttons, small accent text on light */
  --terracotta-bright: #f49e86; /* AA on pine (4.9:1) — small accent text on dark */
  --slate: #8da9c4;
  --slate-light: #c6d4e2;
  --cream: #f2e8cf;
  --cream-page: #faf5e9;
  --cream-soft: #faf8f3;
  --charcoal: #3c3c3c;
  --paper: #ffffff;
  /* structure */
  --rule: rgba(0, 73, 83, 0.9);
  --hairline: rgba(60, 60, 60, 0.18);
  --pine-tint-border: rgba(0, 73, 83, 0.14);
  /* type */
  --display: 'Barlow', 'Inter', 'Work Sans', system-ui, sans-serif;
  --body: 'Inter', 'Barlow', 'Work Sans', system-ui, sans-serif;
  /* layout */
  --container: 1160px;
  --container-narrow: 780px;
  --gutter: clamp(20px, 5vw, 48px);
  --section-pad: clamp(64px, 10vw, 128px);
  --radius: 4px;
  --radius-lg: 8px;
  --shadow-card: 0 1px 2px rgba(0, 42, 48, 0.06), 0 8px 28px rgba(0, 42, 48, 0.07);
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: var(--body);
  font-size: clamp(16px, 1.05vw + 12px, 18px);
  line-height: 1.6;
  letter-spacing: 0.005em;
  color: var(--charcoal);
  background: var(--cream-page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, video { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; }

h1, h2, h3, h4 {
  font-family: var(--display);
  color: var(--pine);
  line-height: 1.08;
  text-wrap: balance;
}
h1 { font-size: clamp(40px, 6.4vw, 76px); font-weight: 300; letter-spacing: -0.025em; }
h2 { font-size: clamp(32px, 4.4vw, 52px); font-weight: 300; letter-spacing: -0.02em; }
h3 { font-size: clamp(22px, 2.2vw, 28px); font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
h4 { font-size: clamp(18px, 1.6vw, 21px); font-weight: 600; line-height: 1.3; }

h1 strong, h2 strong { font-weight: 600; }

p { max-width: 68ch; }
.lead { font-size: clamp(18px, 1.6vw, 22px); line-height: 1.55; color: var(--pine-ink); }

a { color: var(--pine); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #963f2e; } /* 5.5:1 on cream #F2E8CF */

:focus-visible {
  outline: 2px solid var(--pine);
  outline-offset: 3px;
  border-radius: 2px;
}
.on-dark :focus-visible, .site-footer :focus-visible { outline-color: var(--cream); }

::selection { background: var(--pine); color: var(--cream); }

/* Skip link */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--pine); color: #fff; padding: 12px 20px;
  font-family: var(--display); font-weight: 600; text-decoration: none;
}
.skip-link:focus { left: 0; color: #fff; }

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

.section { padding-block: var(--section-pad); }
.section-cream { background: var(--cream); }
.section-paper { background: var(--paper); }
.section-pine { background: var(--pine); color: #fff; }
.section-pine-deeper { background: var(--pine-deeper); color: #fff; }
.section-pine h2, .section-pine h3, .section-pine h4,
.section-pine-deeper h2, .section-pine-deeper h3, .section-pine-deeper h4 { color: #fff; }
.section-pine a, .section-pine-deeper a { color: var(--cream); }
.section-pine a:hover, .section-pine-deeper a:hover { color: #fff; }
.on-dark { color: #fff; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Kicker — signature tracked-uppercase label */
.kicker {
  display: block;
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--pine);
  margin-bottom: 18px;
}
.kicker--terracotta { color: var(--terracotta-deep); }
.section-pine .kicker, .section-pine-deeper .kicker { color: var(--slate-light); }
.section-pine .kicker--terracotta, .section-pine-deeper .kicker--terracotta { color: var(--terracotta-bright); }

.accent-rule {
  width: 64px; height: 3px; background: var(--terracotta);
  border: 0; margin: 22px 0 0;
}
.accent-rule--center { margin-inline: auto; }

.section-head { margin-bottom: clamp(36px, 5vw, 64px); }
.section-head--center { text-align: center; }
.section-head--center p { margin-inline: auto; }
.section-head .lead { margin-top: 20px; }
.section-pine .lead, .section-pine-deeper .lead { color: var(--slate-light); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 14px 30px;
  font-family: var(--display); font-weight: 600; font-size: 16px;
  letter-spacing: 0.04em; text-transform: uppercase; text-decoration: none;
  border-radius: var(--radius); border: 2px solid transparent;
  cursor: pointer; transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.btn:hover { transform: translateY(-1px); }
@media (prefers-reduced-motion: reduce) { .btn:hover { transform: none; } }

.btn-primary { background: var(--terracotta-deep); color: #fff; border-color: var(--terracotta-deep); }
.btn-primary:hover { background: #963f2e; border-color: #963f2e; color: #fff; }

.btn-secondary { background: transparent; color: var(--pine); border-color: var(--pine); }
.btn-secondary:hover { background: var(--pine); color: #fff; }

.on-dark .btn-secondary, .section-pine .btn-secondary, .section-pine-deeper .btn-secondary,
.hero .btn-secondary { color: #fff; border-color: #fff; background: rgba(255,255,255,0.04); }
.on-dark .btn-secondary:hover, .section-pine .btn-secondary:hover,
.section-pine-deeper .btn-secondary:hover, .hero .btn-secondary:hover { background: #fff; color: var(--pine); }

/* Apply + Donate always as an equal pair */
.cta-pair { display: flex; flex-wrap: wrap; gap: 16px; }
.cta-pair .btn { flex: 1 1 220px; }
.cta-pair--center { justify-content: center; }
.cta-pair--center .btn { flex: 0 1 260px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250, 245, 233, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--pine-tint-border);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; min-height: 76px;
  max-width: 1280px; margin-inline: auto; padding-inline: var(--gutter);
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { height: 48px; width: auto; }
.brand__word {
  font-family: var(--display); font-weight: 600; font-size: 15px;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--pine); white-space: nowrap;
}

.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border: 1px solid var(--pine-tint-border);
  border-radius: var(--radius); background: transparent; color: var(--pine); cursor: pointer;
}
.nav-toggle svg { width: 24px; height: 24px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

.site-nav {
  display: none;
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--cream-page);
  border-bottom: 1px solid var(--pine-tint-border);
  box-shadow: 0 24px 40px rgba(0, 42, 48, 0.12);
  padding: 20px var(--gutter) 28px;
}
.site-nav.is-open { display: block; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.site-nav a:not(.btn) {
  display: block; padding: 12px 8px;
  font-family: var(--display); font-weight: 500; font-size: 17px;
  color: var(--pine); text-decoration: none; border-radius: var(--radius);
}
.site-nav a:not(.btn):hover { background: var(--cream); }
.site-nav a[aria-current="page"]:not(.btn) { font-weight: 600; box-shadow: inset 3px 0 0 var(--terracotta); padding-left: 14px; }
.site-nav .nav-ctas { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.site-nav .nav-ctas .btn { width: 100%; }

@media (min-width: 981px) {
  .nav-toggle { display: none; }
  .site-nav {
    display: flex; position: static; background: transparent;
    border: 0; box-shadow: none; padding: 0; align-items: center; gap: 28px;
  }
  .site-nav ul { flex-direction: row; gap: 6px; align-items: center; }
  .site-nav a:not(.btn) { font-size: 15.5px; padding: 10px 12px; }
  .site-nav a[aria-current="page"]:not(.btn) { box-shadow: inset 0 -2px 0 var(--terracotta); padding-left: 12px; }
  .site-nav .nav-ctas { margin: 0; flex-direction: row; gap: 12px; }
  .site-nav .nav-ctas .btn { width: auto; min-height: 46px; padding: 10px 20px; font-size: 14px; }
}

/* Quiet "Grants" nav note - replaces Apply button */
.site-nav .nav-ctas .nav-grants-note {
  display: inline-block; padding: 8px 4px;
  font-family: var(--display); font-weight: 500; font-size: 13px;
  letter-spacing: 0.03em; color: rgba(0, 73, 83, 0.62);
  text-decoration: none; background: none !important;
  align-self: center; text-align: center; line-height: 1.25;
}
.site-nav .nav-ctas .nav-grants-note:hover { color: var(--pine); }
.site-nav .nav-ctas .nav-grants-note[aria-current="page"] { box-shadow: none; padding: 8px 4px; }

/* ---------- Our Approach block ---------- */
.approach-block { background: var(--paper); }
.approach-block__inner {
  display: flex; align-items: center;
  gap: clamp(40px, 8vw, 96px);
  max-width: 880px; margin: 0 auto;
}
.approach-block__icon-wrap { flex-shrink: 0; width: clamp(88px, 14vw, 128px); height: clamp(88px, 14vw, 128px); }
.approach-block__icon-wrap svg { width: 100%; height: 100%; }
.approach-block .kicker { color: var(--terracotta-deep); }
.approach-block__statement {
  margin-top: 14px;
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.55;
  color: var(--pine-ink);
}
@media (max-width: 680px) {
  .approach-block__inner { flex-direction: column; text-align: center; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: var(--pine-deeper); color: #fff;
  min-height: min(70vh, 640px);
  display: flex; align-items: center;
}
.hero__media { position: absolute; inset: 0; overflow: hidden; }
/* Video sized to the hero height and pushed LEFT, so the globe sits off to the
   left with roughly its left half beyond the edge; text overlays on the left. */
.hero__media video, .hero__media img {
  position: absolute; top: 50%; left: 0;
  width: auto; height: 122%; max-width: none;
  transform: translate(-33%, -50%);
  object-fit: cover;
  /* Feather the right edge so the globe melts into the pine ground — no hard
     rectangle, and it stays seamless at ANY viewport width (large screens too). */
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 62%, transparent 90%);
          mask-image: linear-gradient(90deg, #000 0%, #000 62%, transparent 90%);
}
.hero__media::after {
  content: ""; position: absolute; inset: 0;
  /* Left-weighted pine scrim: dark where the text sits so white text clears WCAG AA
     over the footage; lighter at right so the globe shows through and breathes. */
  background:
    linear-gradient(90deg, rgba(0,42,48,0.92) 0%, rgba(0,42,48,0.74) 42%, rgba(0,42,48,0.42) 100%),
    linear-gradient(180deg, rgba(0,42,48,0.45) 0%, rgba(0,42,48,0) 34%, rgba(0,42,48,0.55) 100%);
}
/* On narrow screens: recenter the globe full-bleed and use a stronger even scrim. */
@media (max-width: 700px) {
  .hero__media video, .hero__media img {
    inset: 0; top: 0; left: 0; width: 100%; height: 100%; transform: none; object-position: center;
    -webkit-mask-image: none; mask-image: none;
  }
  .hero__media::after {
    background: linear-gradient(180deg, rgba(0,42,48,0.80) 0%, rgba(0,42,48,0.72) 45%, rgba(0,42,48,0.88) 100%);
  }
}
.hero__content { position: relative; z-index: 1; padding-block: clamp(60px, 9vw, 110px); }
.hero h1 { color: #fff; max-width: 17ch; }
.hero .lead { color: var(--slate-light); margin-top: 26px; max-width: 52ch; }
.hero .kicker { color: var(--terracotta-bright); }
.hero .cta-pair { margin-top: 40px; max-width: 560px; }

.hero__video-toggle {
  position: absolute; z-index: 2; right: 20px; bottom: 20px;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.5);
  background: rgba(0,42,48,0.55); color: #fff; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.hero__video-toggle svg { width: 18px; height: 18px; }
.hero__video-toggle .icon-play { display: none; }
.hero__video-toggle[data-state="paused"] .icon-pause { display: none; }
.hero__video-toggle[data-state="paused"] .icon-play { display: block; }

.hero__scope {
  position: relative; z-index: 1;
  font-size: 14px; color: var(--slate-light); margin-top: 28px; max-width: 60ch;
}

/* Page heroes (interior) */
.page-hero { background: var(--pine); color: #fff; padding-block: clamp(72px, 9vw, 120px); }
.page-hero h1 { color: #fff; }
.page-hero .lead { color: var(--slate-light); margin-top: 22px; }
.page-hero .kicker { color: var(--terracotta-bright); }

/* ---------- Stats ---------- */
.stat { font-family: var(--display); }
.stat__number {
  font-weight: 600; color: var(--pine); line-height: 0.95; letter-spacing: -0.03em;
  font-size: clamp(56px, 9vw, 128px);
}
.stat__number--giant { font-size: clamp(72px, 14vw, 208px); }
.stat__unit { font-weight: 300; color: rgba(0, 73, 83, 0.55); }
.stat__label {
  font-weight: 600; font-size: 13px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--charcoal); margin-top: 14px;
}
.section-pine .stat__number, .section-pine-deeper .stat__number { color: #fff; }
.section-pine .stat__unit, .section-pine-deeper .stat__unit { color: var(--slate); }
.section-pine .stat__label, .section-pine-deeper .stat__label { color: var(--slate-light); }

.stat-row { display: grid; gap: clamp(32px, 5vw, 56px); }
@media (min-width: 720px) { .stat-row { grid-template-columns: repeat(3, 1fr); } }

/* Risk figures (evidence) */
.risk-grid { display: grid; gap: 2px; background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.12); }
@media (min-width: 620px) { .risk-grid { grid-template-columns: 1fr 1fr; } }
.risk-cell { background: var(--pine-deep); padding: clamp(24px, 3vw, 36px); }
.risk-cell__x {
  font-family: var(--display); font-weight: 600; letter-spacing: -0.02em;
  font-size: clamp(44px, 5.4vw, 68px); color: #fff; line-height: 1;
}
.risk-cell__x .x-unit { font-weight: 300; color: var(--terracotta); }
.risk-cell__label { margin-top: 10px; color: var(--slate-light); font-size: 15.5px; max-width: 30ch; }

/* Evidence split */
.evidence-split { display: grid; }
@media (min-width: 960px) { .evidence-split { grid-template-columns: 1fr 1fr; } }
.evidence-split__scale { background: var(--cream); padding: var(--section-pad) var(--gutter); }
.evidence-split__stakes { background: var(--pine); color: #fff; padding: var(--section-pad) var(--gutter); }
.evidence-split__stakes h3, .evidence-split__stakes h4 { color: #fff; }
.evidence-split__inner { max-width: 560px; margin-inline: auto; }
.evidence-source { font-size: 13.5px; color: rgba(60,60,60,0.72); margin-top: 20px; }
.evidence-split__stakes .evidence-source { color: var(--slate); }

/* World-dots visual for the 1.5M figure */
.world-scale { margin-top: 36px; }
.world-scale__dots { display: flex; flex-wrap: wrap; gap: 7px; max-width: 460px; }
.world-scale__dots span {
  width: 13px; height: 13px; border-radius: 50%;
  background: rgba(0, 73, 83, 0.22); flex: none;
}
.world-scale__dots span.is-served { background: var(--terracotta-deep); }
.world-scale__caption { font-size: 14px; color: rgba(60,60,60,0.8); margin-top: 14px; max-width: 46ch; }

/* ---------- Cards ---------- */
.card {
  background: var(--paper); border: 1px solid var(--pine-tint-border);
  border-radius: var(--radius); padding: clamp(28px, 3.4vw, 40px);
  box-shadow: var(--shadow-card);
}
.card-grid { display: grid; gap: 24px; }
@media (min-width: 860px) { .card-grid--3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 640px) and (max-width: 859px) { .card-grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 720px) { .card-grid--2 { grid-template-columns: repeat(2, 1fr); } }

.pillar-card { position: relative; display: flex; flex-direction: column; }
.pillar-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--terracotta); border-radius: var(--radius) var(--radius) 0 0;
}
.pillar-card__amount {
  font-family: var(--display); font-weight: 600; font-size: clamp(36px, 4vw, 48px);
  color: var(--pine); letter-spacing: -0.02em; line-height: 1;
}
.pillar-card__amount .stat__unit { font-size: 0.42em; letter-spacing: 0.08em; }
.pillar-card h3 { margin-top: 14px; }
.pillar-card p { margin-top: 12px; font-size: 16px; }
.pillar-card__meta { margin-top: auto; padding-top: 20px; }
.pillar-card__meta a { font-family: var(--display); font-weight: 600; font-size: 14px; letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none; }
.pillar-card__meta a::after { content: " →"; }

/* Quote cards (founding story) */
.quote-card { border-left: 3px solid var(--terracotta); }
.quote-card blockquote {
  font-family: var(--display); font-weight: 300; font-size: clamp(20px, 2vw, 25px);
  line-height: 1.35; color: var(--pine-ink);
}
.quote-card figcaption {
  margin-top: 16px; font-size: 13px; font-family: var(--display); font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--charcoal);
}

/* Scope clarifier */
.scope-grid { display: grid; gap: 24px; }
@media (min-width: 760px) { .scope-grid { grid-template-columns: 1fr 1fr; } }
.scope-list { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 14px; }
.scope-list li { display: flex; gap: 14px; align-items: flex-start; font-size: 16.5px; }
.scope-list .mark {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; margin-top: 2px;
  font-family: var(--display); font-weight: 700; font-size: 14px;
}
.scope-list--do .mark { background: var(--pine); color: #fff; }
.scope-list--dont .mark { background: var(--cream); color: var(--pine); border: 1px solid var(--pine-tint-border); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.brand-table { width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--pine-tint-border); font-size: 16px; }
.brand-table caption { text-align: left; padding-bottom: 14px; font-family: var(--display); font-weight: 600; color: var(--pine); }
.brand-table th, .brand-table td { padding: 16px 18px; text-align: left; border-bottom: 1px solid var(--hairline); }
.brand-table thead th {
  font-family: var(--display); font-weight: 600; font-size: 12.5px;
  letter-spacing: 0.16em; text-transform: uppercase;
  background: var(--pine); color: #fff; border-bottom: 0;
}
.brand-table tbody tr:last-child td { border-bottom: 0; }
.brand-table td.amount { font-family: var(--display); font-weight: 600; color: var(--pine); white-space: nowrap; }

/* ---------- Giving calculator ---------- */
.calculator { background: var(--paper); border: 1px solid var(--pine-tint-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); overflow: hidden; }
.calculator__controls { padding: clamp(28px, 4vw, 44px); }
.calculator__legend {
  font-family: var(--display); font-weight: 600; font-size: 13px;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--pine);
}
.amount-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.amount-chips button {
  min-height: 48px; padding: 10px 20px; border-radius: 999px;
  border: 1.5px solid var(--pine-tint-border); background: var(--cream-soft);
  font-family: var(--display); font-weight: 600; font-size: 16px; color: var(--pine); cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.amount-chips button:hover { border-color: var(--pine); }
.amount-chips button[aria-pressed="true"] { background: var(--pine); border-color: var(--pine); color: #fff; }

.calculator__custom { margin-top: 18px; display: flex; align-items: center; gap: 10px; max-width: 320px; }
.calculator__custom label { font-size: 14px; font-weight: 500; color: var(--charcoal); flex: none; }
.calculator__custom .field-prefix { position: relative; flex: 1; }
.calculator__custom .field-prefix::before {
  content: "$"; position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--pine); font-family: var(--display); font-weight: 600;
}
.calculator__custom input {
  width: 100%; min-height: 48px; padding: 10px 14px 10px 30px;
  border: 1.5px solid var(--pine-tint-border); border-radius: var(--radius);
  background: #fff; color: var(--charcoal);
}
.calculator__custom input:focus { border-color: var(--pine); outline: none; box-shadow: 0 0 0 2px rgba(0,73,83,0.18); }

.calculator__result {
  background: var(--pine); color: #fff; padding: clamp(28px, 4vw, 44px);
}
.calculator__result .kicker { color: var(--slate-light); margin-bottom: 10px; }
.calculator__headline {
  font-family: var(--display); font-weight: 300; font-size: clamp(24px, 3vw, 34px);
  line-height: 1.25; letter-spacing: -0.01em; max-width: 26ch;
}
.calculator__headline strong { font-weight: 600; color: var(--terracotta-bright); }
.calculator__breakdown { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 8px; font-size: 15.5px; color: var(--slate-light); }
.calculator__breakdown li::before { content: "· "; color: var(--terracotta); font-weight: 700; }
.calculator__result .btn { margin-top: 26px; }

/* ---------- Embeds (Jotform / Monkeypod) ---------- */
.embed-shell { background: var(--paper); border: 1px solid var(--pine-tint-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); overflow: hidden; }
.embed-shell__bar {
  display: flex; align-items: center; gap: 12px;
  background: var(--pine); color: #fff; padding: 16px 22px;
  font-family: var(--display); font-weight: 600; font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase;
}
.embed-shell__bar::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--terracotta); }
.embed-shell__body { padding: 0; min-height: 640px; position: relative; }
.embed-shell__body iframe { display: block; width: 100%; min-height: 640px; border: 0; }
.embed-shell__note { padding: 14px 22px; font-size: 13.5px; color: rgba(60,60,60,0.75); border-top: 1px solid var(--hairline); background: var(--cream-soft); }

/* ---------- Forms ---------- */
.form-grid { display: grid; gap: 22px; }
@media (min-width: 640px) { .form-grid--2 { grid-template-columns: 1fr 1fr; } .form-grid .span-2 { grid-column: 1 / -1; } }
.field label { display: block; font-family: var(--display); font-weight: 600; font-size: 14.5px; color: var(--pine); margin-bottom: 8px; }
.field .hint { display: block; font-weight: 400; font-family: var(--body); font-size: 13.5px; color: rgba(60,60,60,0.75); margin-top: 3px; }
.field input, .field textarea, .field select {
  width: 100%; min-height: 50px; padding: 12px 14px;
  border: 1.5px solid var(--pine-tint-border); border-radius: var(--radius);
  background: #fff; color: var(--charcoal);
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--pine); outline: none; box-shadow: 0 0 0 2px rgba(0,73,83,0.18);
}
.field--optional label::after { content: " · optional"; font-weight: 400; color: rgba(60,60,60,0.6); text-transform: none; letter-spacing: 0; }
fieldset { border: 0; padding: 0; margin: 0; }
fieldset legend { font-family: var(--display); font-weight: 600; font-size: 14.5px; color: var(--pine); margin-bottom: 10px; padding: 0; }
.choice-row { display: flex; flex-wrap: wrap; gap: 12px; }
.choice { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border: 1.5px solid var(--pine-tint-border); border-radius: var(--radius); background: #fff; cursor: pointer; font-size: 15.5px; }
.choice:has(:checked) { border-color: var(--pine); background: rgba(0,73,83,0.05); }
.choice input { width: 18px; height: 18px; accent-color: var(--pine); }

/* ---------- Steps ---------- */
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 24px; }
@media (min-width: 860px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li { counter-increment: step; background: var(--paper); border: 1px solid var(--pine-tint-border); border-radius: var(--radius); padding: 28px; }
.steps li::before {
  content: counter(step, decimal-leading-zero);
  display: block; font-family: var(--display); font-weight: 300; font-size: 44px;
  color: var(--terracotta-deep); line-height: 1; margin-bottom: 14px;
}
.steps h3 { font-size: 19px; }
.steps p { font-size: 15.5px; margin-top: 8px; }

/* ---------- Stories ---------- */
.story-card { display: flex; flex-direction: column; gap: 0; }
.story-card__origin {
  font-family: var(--display); font-weight: 600; font-size: 12.5px;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--terracotta-deep);
}
.story-card h3 { margin-top: 12px; font-weight: 300; font-size: clamp(21px, 2vw, 25px); }
.story-card h3 strong { font-weight: 600; }
.story-card p { margin-top: 14px; font-size: 16px; }
.story-card__byline { margin-top: auto; padding-top: 22px; font-size: 14px; color: rgba(60,60,60,0.8); }
.consent-note {
  border: 1px solid var(--pine-tint-border); border-left: 3px solid var(--terracotta);
  background: var(--paper); border-radius: var(--radius); padding: 22px 26px; font-size: 15.5px;
}

/* ---------- Timeline (About) ---------- */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { position: relative; padding: 0 0 36px 34px; border-left: 1.5px solid var(--pine-tint-border); margin-left: 8px; }
.timeline li:last-child { padding-bottom: 0; border-left-color: transparent; }
.timeline li::before {
  content: ""; position: absolute; left: -8px; top: 4px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--terracotta); border: 3px solid var(--cream-page);
}
.timeline__year { font-family: var(--display); font-weight: 600; font-size: 14px; letter-spacing: 0.18em; color: var(--pine); }
.timeline h3 { margin-top: 6px; }
.timeline p { margin-top: 8px; font-size: 16px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--pine-deeper); color: var(--slate-light); font-size: 15px; }
.site-footer__main { display: grid; gap: 40px; padding-block: clamp(56px, 7vw, 88px); }
.site-footer img { height: 96px; width: auto; }
.site-footer h4 {
  color: #fff; font-size: 13px; letter-spacing: 0.2em; text-transform: uppercase; margin-bottom: 18px;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.site-footer a { color: var(--slate-light); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer__mission { margin-top: 24px; max-width: 40ch; }
.site-footer__scope { margin-top: 16px; font-size: 13.5px; color: var(--slate); max-width: 46ch; }
.site-footer__legal {
  border-top: 1px solid rgba(255,255,255,0.14);
  padding-block: 26px; display: flex; flex-wrap: wrap; gap: 10px 28px;
  font-size: 13px; color: var(--slate);
}
.site-footer__crisis { font-size: 13.5px; color: var(--slate-light); padding-bottom: 8px; max-width: 72ch; }

/* ---------- Reveal animation (progressive enhancement) ---------- */
.reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
  .js .reveal.is-visible { opacity: 1; transform: none; transform: none; }
}

/* ---------- Footer: expanded crisis block + legal links (Prompt 1) ---------- */
.site-footer__crisis h4 { color: #fff; margin-bottom: 12px; }
.site-footer__crisis p { max-width: 74ch; margin-top: 10px; }
.site-footer__crisis .crisis-lines { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 7px; }
.site-footer__crisis .crisis-lines strong { color: #fff; }
.site-footer__disclaimer { font-size: 12.5px; color: var(--slate); margin-top: 16px; max-width: 74ch; }
.site-footer__legal-links a { color: var(--slate); text-decoration: none; }
.site-footer__legal-links a:hover { color: #fff; text-decoration: underline; }

/* ---------- Evidence citations (home) ---------- */
.evidence-refs { margin: 18px 0 0; padding-left: 1.4em; font-size: 12px; line-height: 1.5; color: var(--slate-light); max-width: 54ch; }
.evidence-refs li { margin-top: 6px; }
.risk-cell__label sup { font-size: 0.62em; color: var(--terracotta-bright); }

/* ---------- Prose pages (guide, legal, FAQ, 404) ---------- */
.prose { max-width: 74ch; }
.prose h2 { font-size: clamp(24px, 3vw, 34px); margin-top: clamp(36px, 4.5vw, 56px); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 34px; }
.prose h4 { margin-top: 26px; color: var(--pine); }
.prose p { margin-top: 14px; }
.prose ul, .prose ol { margin-top: 14px; padding-left: 1.3em; display: grid; gap: 8px; }
.prose li { max-width: 72ch; }
.prose .meta { font-size: 14px; color: rgba(60,60,60,0.72); }
.prose .lead + h2 { margin-top: clamp(28px, 3vw, 40px); }
.faq-q { margin-top: 30px; }
.faq-q h3 { margin-top: 0; font-size: clamp(19px, 2vw, 22px); }

/* ---------- Team & Board photos (About) ---------- */
.team-card__head { display: flex; align-items: center; gap: 18px; margin-bottom: 4px; }
.team-card__photo { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; object-position: center top; flex: none; border: 2px solid var(--cream); box-shadow: var(--shadow-card); background: var(--cream-soft); }
@media (min-width: 640px) { .team-card__photo { width: 104px; height: 104px; } }
.team-card__head h3 { line-height: 1.15; }

.board-grid { display: grid; gap: 24px; grid-template-columns: repeat(2, 1fr); margin-top: 8px; }
@media (min-width: 900px) { .board-grid { grid-template-columns: repeat(4, 1fr); } }
.board-card { margin: 0; }
.board-card__photo { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center top; border-radius: var(--radius); border: 1px solid var(--pine-tint-border); box-shadow: var(--shadow-card); background: var(--cream-soft); }
.board-card__name { font-family: var(--display); font-weight: 600; font-size: 18px; color: var(--pine); margin-top: 16px; }
.board-card__role { font-family: var(--display); font-weight: 600; font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--terracotta-deep); margin-top: 4px; }

/* ---------- Footer newsletter (Prompt 17) ---------- */
.site-footer__signup-note { margin: 0 0 14px; font-size: 13.5px; color: var(--slate-light); max-width: 34ch; }
.footer-newsletter__row { display: flex; gap: 8px; flex-wrap: wrap; }
.footer-newsletter input { flex: 1 1 160px; min-height: 46px; padding: 10px 12px; border: 1px solid rgba(255,255,255,0.4); border-radius: var(--radius); background: rgba(255,255,255,0.08); color: #fff; }
.footer-newsletter input::placeholder { color: var(--slate-light); }
.footer-newsletter input:focus { outline: 2px solid var(--cream); outline-offset: 1px; border-color: var(--cream); }
.footer-newsletter .btn { flex: 0 0 auto; min-height: 46px; padding: 10px 22px; }
.footer-newsletter .form-status { margin: 0 0 8px; font-size: 13.5px; color: var(--cream); }

/* ---------- Accessible form validation (Prompt 15) ---------- */
.field-error { display: block; margin-top: 6px; font-size: 13.5px; color: var(--terracotta-deep); font-weight: 500; }
.site-footer .field-error { color: var(--terracotta-bright); }
[aria-invalid="true"] { border-color: var(--terracotta-deep) !important; }
.site-footer [aria-invalid="true"] { border-color: var(--terracotta-bright) !important; }
.form-status { font-size: 15px; }
.form-status:empty { margin: 0; padding: 0; }
.form-status--error { color: var(--terracotta-deep); font-weight: 600; }
.site-footer .form-status--error { color: var(--terracotta-bright); }
.form-status--ok { color: var(--pine); font-weight: 600; }
.site-footer .form-status--ok { color: var(--cream); }

/* ---------- Apply page: timing callout + newsletter embed (Prompt 16) ---------- */
.apply-callout { margin-top: 26px; max-width: 62ch; background: rgba(255,255,255,0.08); border-left: 3px solid var(--terracotta); border-radius: var(--radius); padding: 16px 20px; }
.apply-callout p { margin: 0; color: var(--slate-light); font-size: 15.5px; }
.apply-callout strong { color: #fff; }
.apply-callout a { color: var(--cream); }
.embed-shell__body--form { min-height: 0; padding: clamp(24px, 4vw, 40px); }

/* ---------- Language switcher ---------- */
.lang-switch { margin-left: auto; display: flex; align-items: center; }
@media (min-width: 981px) { .lang-switch { margin-right: 6px; } }
/* Google Translate widget */
.goog-te-gadget { font-family: var(--display) !important; font-size: 13px !important; color: var(--pine) !important; margin: 0 !important; background: transparent !important; }
.goog-te-gadget-simple {
  display: inline-flex !important; align-items: center !important;
  background: transparent !important;
  border: 1px solid var(--pine-tint-border) !important;
  border-radius: var(--radius) !important;
  padding: 7px 12px !important;
  font-size: 12px !important; font-family: var(--display) !important;
  text-decoration: none !important; white-space: nowrap !important;
  cursor: pointer !important;
}
/* Globe icon */
.goog-te-gadget-simple::before {
  content: '';
  display: inline-block; width: 14px; height: 14px; flex-shrink: 0; margin-right: 6px;
  background-color: var(--pine);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z'/%3E%3C/svg%3E");
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}
.goog-te-gadget-simple:hover { background: var(--cream) !important; }
.goog-te-gadget-simple .goog-te-menu-value span:first-child { color: var(--pine) !important; font-weight: 600 !important; letter-spacing: 0.06em !important; }
.goog-te-gadget-simple .goog-te-menu-value span[style] { color: var(--pine) !important; }
.goog-te-gadget-simple img { display: none !important; }
.goog-logo-link, .goog-te-gadget > span { display: none !important; }
body { top: 0 !important; }
.goog-te-banner-frame { display: none !important; }
/* Language menu popup on mobile: Google renders the language list as a very wide
   multi-column table (~2600px). On a phone only the first column (A-C) is visible and
   the rest overflow off-screen with no way to scroll to them. Below the desktop nav
   breakpoint, pin the popup iframe to the viewport; main.js reflows its contents into a
   single scrollable column (parent CSS can't reach inside the cross-frame document). */
@media (max-width: 980px) {
  iframe.VIpgJd-ZVi9od-xl07Ob-OEVmcd,
  iframe.goog-te-menu-frame {
    width: 100vw !important;
    max-width: 100vw !important;
    left: 0 !important;
    height: 70vh !important;
    max-height: 70vh !important;
    border-radius: 0 !important;
  }
}

/* Machine-translation notice (shown only when a non-English language is active — see docs) */
.translate-note { background: var(--cream); border-bottom: 1px solid var(--pine-tint-border); color: var(--charcoal); font-size: 13.5px; }
.translate-note__inner { display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap; max-width: var(--container); margin-inline: auto; padding: 10px var(--gutter); }
.translate-note a { color: var(--pine); }
.translate-note__dismiss { background: transparent; border: 0; color: var(--pine); font-weight: 600; cursor: pointer; text-decoration: underline; padding: 0; }
/* duplicate suppression rules merged into the block above */

/* ---------- Concise footer refresh ---------- */
@media (min-width: 860px) { .site-footer__main { grid-template-columns: 1.7fr 1fr 1.5fr; } }
.site-footer__main { padding-block: clamp(32px, 3.5vw, 44px); }
.site-footer__tagline { margin-top: 20px; max-width: 32ch; font-family: var(--display); font-weight: 300; font-size: 18px; line-height: 1.35; color: #fff; }
.site-footer__scope { margin-top: 12px; font-size: 12.5px; color: var(--slate); max-width: 42ch; }
.site-footer__signup .footer-newsletter { margin-top: 16px; }
.site-footer__crisis { max-width: none; padding: 0 0 12px; font-size: 13.5px; color: var(--slate-light); border-top: 1px solid rgba(255,255,255,0.10); padding-top: 16px; }
.site-footer__crisis a { color: var(--cream); }

/* ---------- Footer social icons ---------- */
.site-footer__social { display: flex; gap: 16px; margin-top: 20px; }
.site-footer__social a { color: var(--slate); display: flex; align-items: center; transition: color 0.15s; }
.site-footer__social a:hover { color: #fff; text-decoration: none; }

/* ---------- Embedded Stripe giving (Give page) ---------- */
.give-form__freq { border: 0; padding: 0; margin: 0 0 4px; }
.give-fallback { margin-top: 16px; font-size: 14px; color: rgba(60,60,60,0.8); }
#checkout { min-height: 320px; }
#give-status:empty { display: none; }
.give-hint { margin-top: 12px; font-size: 14px; color: rgba(60,60,60,0.8); }
