/* ==========================================================================
   SEMPER FOUNDATION — Design System
   Brand idea: the North Star (always in the same place) inside an open door.
   "Semper" = Latin for "always". Everything here should feel steady, warm,
   and specific — never pitying.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Core palette */
  --ink:        #101b2d;   /* midnight — the night sky */
  --ink-2:      #1b2c45;
  --ink-3:      #2c4160;
  --ink-soft:   #55647c;

  --star:       #f2b33d;   /* the north star — primary warm accent */
  --star-deep:  #cf8f22;
  --star-glow:  #ffd784;

  --ember:      #c4553a;   /* urgency, secondary CTA */
  --sage:       #3e7c74;   /* growth, stability */

  --cream:      #fbf7f1;
  --cream-2:    #f4ece0;
  --cream-3:    #e8dcca;
  --paper:      #ffffff;

  /* Semantic */
  --bg:         var(--cream);
  --fg:         var(--ink);
  --muted:      var(--ink-soft);
  --rule:       #e2d7c6;

  /* Type */
  --font-display: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Palatino,
                  Georgia, 'Songti SC', serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                  'Helvetica Neue', Arial, 'PingFang SC', 'Hiragino Sans GB',
                  'Microsoft YaHei', sans-serif;
  --font-mono:    ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

  /* Fluid type scale */
  --t-xs:   0.75rem;
  --t-sm:   0.875rem;
  --t-base: 1rem;
  --t-lg:   clamp(1.06rem, 0.99rem + 0.35vw, 1.2rem);
  --t-xl:   clamp(1.25rem, 1.1rem + 0.7vw, 1.55rem);
  --t-2xl:  clamp(1.6rem, 1.32rem + 1.3vw, 2.3rem);
  --t-3xl:  clamp(2.05rem, 1.55rem + 2.3vw, 3.3rem);
  --t-4xl:  clamp(2.6rem, 1.7rem + 4vw, 5rem);
  --t-5xl:  clamp(3.2rem, 1.7rem + 6.4vw, 7rem);

  /* Space */
  --gap:   1.5rem;
  --pad-x: clamp(1.25rem, 4vw, 3rem);
  --sect:  clamp(4.5rem, 9vw, 8.5rem);

  /* Shape */
  --r-sm: 6px;
  --r:    12px;
  --r-lg: 20px;
  --r-xl: 32px;
  --arch: 260px 260px var(--r) var(--r);

  /* Elevation */
  --sh-1: 0 1px 2px rgba(16, 27, 45, .06), 0 2px 8px rgba(16, 27, 45, .04);
  --sh-2: 0 2px 4px rgba(16, 27, 45, .06), 0 12px 28px rgba(16, 27, 45, .08);
  --sh-3: 0 4px 8px rgba(16, 27, 45, .08), 0 24px 56px rgba(16, 27, 45, .14);

  --ease: cubic-bezier(.22, .61, .36, 1);
  --maxw: 1220px;
  --maxw-text: 68ch;
}

/* Chinese headings: Fraunces has no CJK glyphs, so give zh a cleaner stack. */
html[lang='zh'] .display,
html[lang='zh'] h1,
html[lang='zh'] h2,
html[lang='zh'] h3,
html[lang='zh'] .stat__num {
  font-family: 'Fraunces', 'Source Han Serif SC', 'Noto Serif SC', 'Songti SC',
               'Microsoft YaHei', serif;
  letter-spacing: 0.01em;
}
html[lang='zh'] body { letter-spacing: 0.01em; }

/* --------------------------------------------------------------------------
   2. Reset
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 var(--t-base)/1.68 var(--font-body);
  font-feature-settings: 'kern' 1, 'liga' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; height: auto; }
img { background: var(--cream-2); }

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
p { margin: 0 0 1.1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }

button { font: inherit; color: inherit; }

ul, ol { margin: 0 0 1.1em; padding-left: 1.15rem; }
li { margin-bottom: .45em; }

hr { border: 0; border-top: 1px solid var(--rule); margin: var(--gap) 0; }

::selection { background: var(--star-glow); color: var(--ink); }

:focus-visible {
  outline: 3px solid var(--star-deep);
  outline-offset: 3px;
  border-radius: 3px;
}

/* --------------------------------------------------------------------------
   3. Layout
   -------------------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}
.wrap--narrow { max-width: 880px; }

.section { padding-block: var(--sect); position: relative; }
.section--tight { padding-block: clamp(3rem, 6vw, 5rem); }
.section--ink   { background: var(--ink); color: var(--cream); }
.section--ink-2 { background: var(--ink-2); color: var(--cream); }
.section--paper { background: var(--paper); }
.section--cream2{ background: var(--cream-2); }

.section--ink a, .section--ink-2 a { color: var(--star-glow); }
.section--ink .muted, .section--ink-2 .muted { color: #9fb0c8; }

.grid { display: grid; gap: clamp(1.5rem, 3vw, 2.75rem); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

.stack > * + * { margin-top: var(--flow, 1.1rem); }

.center { text-align: center; margin-inline: auto; }

/* Grain overlay for warmth on light sections */
.grain::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .24;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.36'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}
.section--ink.grain::after, .section--ink-2.grain::after { mix-blend-mode: screen; opacity: .1; }

/* --------------------------------------------------------------------------
   4. Typographic components
   -------------------------------------------------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  margin: 0 0 1.1rem;
  font: 600 var(--t-xs)/1 var(--font-body);
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--star-deep);
}
.eyebrow::before {
  content: '';
  width: 26px; height: 1px;
  background: currentColor;
  flex: none;
}
.section--ink .eyebrow, .section--ink-2 .eyebrow { color: var(--star); }
html[lang='zh'] .eyebrow { letter-spacing: .1em; }

.display   { font-family: var(--font-display); font-weight: 600; line-height: 1.05; letter-spacing: -.025em; }
.display--hero { font-size: var(--t-5xl); }
.h1 { font-size: var(--t-4xl); }
.h2 { font-size: var(--t-3xl); }
.h3 { font-size: var(--t-2xl); }
.h4 { font-size: var(--t-xl); }

.lead {
  font-size: var(--t-lg);
  line-height: 1.62;
  color: var(--muted);
  max-width: 62ch;
}
.section--ink .lead, .section--ink-2 .lead { color: #c3d0e2; }

.prose { max-width: var(--maxw-text); }
.prose h3 { margin: 2.4em 0 .6em; font-size: var(--t-xl); }
.prose h3:first-child { margin-top: 0; }
.prose > p, .prose > ul, .prose > ol { color: var(--ink-2); }

.small { font-size: var(--t-sm); }
.muted { color: var(--muted); }

.italic-serif { font-family: var(--font-display); font-style: italic; }

/* Highlighted phrase — gold swipe behind the words.
   Uses a background gradient rather than a z-index:-1 pseudo-element, which
   would otherwise slip behind the section background. */
.mark {
  padding-inline: .07em;
  background-image: linear-gradient(
    to top,
    rgba(242, 179, 61, .45) 0,
    rgba(242, 179, 61, .45) .34em,
    transparent .34em
  );
}

/* --------------------------------------------------------------------------
   5. Buttons
   -------------------------------------------------------------------------- */
.btn {
  --btn-bg: var(--ink);
  --btn-fg: var(--cream);
  --btn-bd: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: .92rem 1.6rem;
  border: 1.5px solid var(--btn-bd);
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: 600 var(--t-sm)/1 var(--font-body);
  letter-spacing: .01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease),
              background-color .2s var(--ease), color .2s var(--ease);
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.btn:active { transform: translateY(0); }

.btn--star  { --btn-bg: var(--star); --btn-fg: var(--ink); --btn-bd: var(--star); }
.btn--star:hover { --btn-bg: var(--star-glow); --btn-bd: var(--star-glow); }
.btn--ember { --btn-bg: var(--ember); --btn-fg: #fff; --btn-bd: var(--ember); }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--ink); --btn-bd: var(--ink); }
.btn--ghost:hover { --btn-bg: var(--ink); --btn-fg: var(--cream); }
.btn--ghost-light { --btn-bg: transparent; --btn-fg: var(--cream); --btn-bd: rgba(251,247,241,.45); }
.btn--ghost-light:hover { --btn-bg: var(--cream); --btn-fg: var(--ink); --btn-bd: var(--cream); }
.btn--lg { padding: 1.08rem 2rem; font-size: var(--t-base); }
.btn--block { width: 100%; }

.btn__arrow { transition: transform .2s var(--ease); }
.btn:hover .btn__arrow { transform: translateX(3px); }

.btn-row { display: flex; flex-wrap: wrap; gap: .85rem; }

/* Quiet text link with arrow */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-weight: 600;
  font-size: var(--t-sm);
  text-decoration: none;
  border-bottom: 1.5px solid currentColor;
  padding-bottom: 2px;
  transition: gap .2s var(--ease);
}
.link-arrow:hover { gap: .8rem; }

/* --------------------------------------------------------------------------
   6. Logo
   -------------------------------------------------------------------------- */
.logo {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  text-decoration: none;
  color: inherit;
  flex: none;
}
.logo__mark { width: 34px; height: 38px; flex: none; overflow: visible; }
.logo__arch { fill: none; stroke: currentColor; stroke-width: 2.4; }
.logo__star { fill: var(--star); }
.logo__text { display: flex; flex-direction: column; line-height: 1; }
.logo__name {
  font: 700 .95rem/1 var(--font-body);
  letter-spacing: .15em;
  text-transform: uppercase;
}
.logo__sub {
  margin-top: .3rem;
  font: 500 .58rem/1 var(--font-body);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--star-deep);
}
.site-header--over .logo__sub { color: var(--star); }

/* --------------------------------------------------------------------------
   7. Header / nav
   -------------------------------------------------------------------------- */
.skip {
  position: absolute;
  left: 1rem; top: -100px;
  z-index: 200;
  padding: .8rem 1.2rem;
  background: var(--ink);
  color: var(--cream);
  border-radius: var(--r-sm);
  text-decoration: none;
  font-weight: 600;
  transition: top .2s var(--ease);
}
.skip:focus { top: 1rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--cream);
  border-bottom: 1px solid var(--rule);
  transition: background-color .35s var(--ease), border-color .35s var(--ease),
              color .35s var(--ease);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 72px;
  padding-block: .7rem;
}

/* Transparent state while over a dark hero */
.site-header--over {
  position: fixed;
  left: 0; right: 0;
  background: transparent;
  border-color: transparent;
  color: var(--cream);
}
.site-header--over .btn--ghost { --btn-fg: var(--cream); --btn-bd: rgba(251,247,241,.5); }
.site-header--over .btn--ghost:hover { --btn-bg: var(--cream); --btn-fg: var(--ink); }
.site-header--stuck {
  background: rgba(251, 247, 241, .93);
  backdrop-filter: saturate(150%) blur(14px);
  border-color: var(--rule);
  color: var(--ink);
}

.nav {
  display: flex;
  align-items: center;
  gap: .35rem;
  margin-left: auto;
}
.nav__link {
  padding: .55rem .8rem;
  border-radius: 999px;
  font: 500 var(--t-sm)/1 var(--font-body);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .18s var(--ease), opacity .18s var(--ease);
}
.nav__link:hover { background: rgba(16, 27, 45, .07); }
.site-header--over:not(.site-header--stuck) .nav__link:hover { background: rgba(251, 247, 241, .16); }
.nav__link[aria-current='page'] { font-weight: 700; }
.nav__link[aria-current='page']::after {
  content: '';
  display: block;
  height: 2px;
  margin-top: 3px;
  border-radius: 2px;
  background: var(--star);
}

.header__actions { display: flex; align-items: center; gap: .5rem; margin-left: .5rem; }

/* The in-drawer Donate button only exists for the mobile layout. */
.nav__cta { display: none; }

/* Language toggle */
.lang {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  overflow: hidden;
  opacity: .82;
}
.lang__btn {
  padding: .42rem .68rem;
  border: 0;
  background: transparent;
  font: 700 .72rem/1 var(--font-body);
  letter-spacing: .06em;
  cursor: pointer;
  transition: background-color .18s var(--ease), color .18s var(--ease);
}
.lang__btn[aria-pressed='true'] { background: currentColor; }
.lang__btn[aria-pressed='true'] span { color: var(--cream); mix-blend-mode: normal; }
.site-header--over:not(.site-header--stuck) .lang__btn[aria-pressed='true'] span { color: var(--ink); }

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  margin-left: auto;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  place-items: center;
}
.nav-toggle svg { width: 20px; height: 20px; }
.nav-toggle__close { display: none; }
body.nav-open .nav-toggle__open { display: none; }
body.nav-open .nav-toggle__close { display: block; }

@media (max-width: 1000px) {
  .nav-toggle { display: grid; }
  .nav {
    position: fixed;
    inset: 72px 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 1rem var(--pad-x) 2rem;
    background: var(--cream);
    border-bottom: 1px solid var(--rule);
    box-shadow: var(--sh-3);
    transform: translateY(-130%);
    transition: transform .38s var(--ease);
    max-height: calc(100vh - 72px);
    overflow-y: auto;
  }
  body.nav-open .nav { transform: translateY(0); }
  .nav__link {
    padding: .95rem .25rem;
    border-radius: 0;
    border-bottom: 1px solid var(--rule);
    font-size: var(--t-lg);
    color: var(--ink);
  }
  .nav__link[aria-current='page']::after { display: none; }
  .nav__cta { display: inline-flex; }
  .nav .btn { margin-top: 1.1rem; --btn-fg: var(--cream); --btn-bd: var(--ink); }
  .nav .btn--star { --btn-fg: var(--ink); }
  .header__actions { margin-left: 0; order: -1; }
  .header__actions .btn { display: none; }
}

/* --------------------------------------------------------------------------
   8. Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  display: grid;
  align-items: end;
  min-height: min(94vh, 900px);
  padding-block: 12rem 3.5rem;
  background: var(--ink);
  color: var(--cream);
  overflow: hidden;
  isolation: isolate;
}
.hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.hero__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 32%;
  opacity: .5;
  filter: saturate(.82) contrast(1.02);
}
.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 85% at 12% 88%, rgba(16,27,45,.94) 0%, rgba(16,27,45,.55) 46%, rgba(16,27,45,.2) 72%),
    linear-gradient(180deg, rgba(16,27,45,.86) 0%, rgba(16,27,45,.28) 34%, rgba(16,27,45,.72) 100%);
}
/* Star field */
.hero__stars {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .55;
  background-image:
    radial-gradient(1.6px 1.6px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 27% 9%,  #fff 50%, transparent 51%),
    radial-gradient(1.8px 1.8px at 41% 24%, var(--star-glow) 50%, transparent 51%),
    radial-gradient(1.1px 1.1px at 58% 12%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 72% 21%, #fff 50%, transparent 51%),
    radial-gradient(1.3px 1.3px at 86% 8%,  var(--star-glow) 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 94% 27%, #fff 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 6% 34%,  #fff 50%, transparent 51%),
    radial-gradient(1.1px 1.1px at 34% 38%, #fff 50%, transparent 51%),
    radial-gradient(1.6px 1.6px at 65% 34%, #fff 50%, transparent 51%);
}

.hero__inner { position: relative; }
.hero__title { font-size: var(--t-5xl); max-width: 20ch; }
.hero__title em { font-style: italic; color: var(--star); }
.hero__lead {
  margin-top: 1.7rem;
  max-width: 56ch;
  font-size: var(--t-lg);
  line-height: 1.62;
  color: #d6dfec;
}
.hero .btn-row { margin-top: 2.2rem; }

/* Trust strip below hero copy */
.hero__trust {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem 2.6rem;
  margin-top: 3.2rem;
  padding-top: 1.6rem;
  border-top: 1px solid rgba(251, 247, 241, .2);
}
.hero__trust-item { display: flex; align-items: baseline; gap: .6rem; }
.hero__trust-num {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--star);
  line-height: 1;
}
.hero__trust-label {
  font-size: var(--t-xs);
  line-height: 1.35;
  max-width: 17ch;
  color: #b9c6d8;
}

/* Compact hero for sub-pages */
.page-hero {
  position: relative;
  padding-block: 11rem 4rem;
  background: var(--ink);
  color: var(--cream);
  overflow: hidden;
  isolation: isolate;
}
.page-hero__media { position: absolute; inset: 0; z-index: -2; }
.page-hero__media img { width: 100%; height: 100%; object-fit: cover; opacity: .34; }
.page-hero__scrim {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(16,27,45,.9) 0%, rgba(16,27,45,.6) 55%, rgba(16,27,45,.9) 100%);
}
.page-hero__title { font-size: var(--t-4xl); max-width: 24ch; }
.page-hero__lead { margin-top: 1.3rem; max-width: 60ch; font-size: var(--t-lg); color: #cdd8e6; }

.crumbs {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.1rem;
  font-size: var(--t-xs);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--star);
}
.crumbs a { text-decoration: none; opacity: .75; }
.crumbs a:hover { opacity: 1; }

/* --------------------------------------------------------------------------
   9. Stats
   -------------------------------------------------------------------------- */
.stat { position: relative; padding-top: 1.35rem; border-top: 2px solid var(--star); }
.stat__num {
  display: block;
  font-family: var(--font-display);
  font-size: var(--t-3xl);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.stat__label { margin-top: .7rem; font-size: var(--t-sm); line-height: 1.5; }
.stat__src {
  display: block;
  margin-top: .7rem;
  font-size: .69rem;
  letter-spacing: .04em;
  color: var(--muted);
  text-transform: uppercase;
}
.section--ink .stat__src, .section--ink-2 .stat__src { color: #7f90a8; }
.stat__src a { color: inherit; }

/* Big single figure, editorial */
.figure-block { display: grid; gap: clamp(1.5rem, 4vw, 3.5rem); grid-template-columns: 1fr; }
@media (min-width: 900px) { .figure-block { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; } }
.figure-block__num {
  font-family: var(--font-display);
  font-size: var(--t-5xl);
  font-weight: 600;
  line-height: .88;
  letter-spacing: -.045em;
  color: var(--star-deep);
  font-variant-numeric: tabular-nums;
}
.section--ink .figure-block__num { color: var(--star); }

/* --------------------------------------------------------------------------
   10. Cards
   -------------------------------------------------------------------------- */
.card {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease),
              border-color .3s var(--ease);
}
.card--link:hover { transform: translateY(-5px); box-shadow: var(--sh-3); border-color: var(--cream-3); }
.card__media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--cream-2); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.card--link:hover .card__media img { transform: scale(1.045); }
.card__body { display: flex; flex-direction: column; flex: 1; padding: clamp(1.4rem, 2.4vw, 1.9rem); }
.card__kicker {
  margin-bottom: .7rem;
  font: 600 var(--t-xs)/1 var(--font-body);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--sage);
}
.card__title { font-size: var(--t-xl); margin-bottom: .65rem; }
.card__text { color: var(--muted); font-size: var(--t-sm); line-height: 1.62; }
.card__foot { margin-top: auto; padding-top: 1.3rem; }

/* Price tag on program cards */
.tag {
  display: inline-flex;
  align-items: baseline;
  gap: .35rem;
  padding: .38rem .75rem;
  border-radius: 999px;
  background: var(--cream-2);
  border: 1px solid var(--cream-3);
  font-size: var(--t-xs);
  font-weight: 600;
  color: var(--ink-2);
}
.tag strong { font-family: var(--font-display); font-size: .95rem; }

/* Arch-shaped image — the "open door" motif */
.arch {
  border-radius: var(--arch);
  overflow: hidden;
  background: var(--cream-2);
}
.arch img { width: 100%; height: 100%; object-fit: cover; }
.arch--tall { aspect-ratio: 3 / 4; }
.arch--sq { aspect-ratio: 1 / 1; }

/* Numbered step list */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li {
  position: relative;
  padding-left: 3.6rem;
  margin-bottom: 2rem;
  counter-increment: step;
}
.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0; top: -.12em;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--star-deep);
  font-variant-numeric: tabular-nums;
}
.steps h3 { font-size: var(--t-lg); margin-bottom: .35rem; }
.steps p { font-size: var(--t-sm); color: var(--muted); margin: 0; }
.section--ink .steps li::before, .section--ink-2 .steps li::before { color: var(--star); }

/* Feature row: alternating image + copy */
.feature { display: grid; gap: clamp(1.75rem, 4vw, 4rem); align-items: center; }
@media (min-width: 880px) {
  .feature { grid-template-columns: 1fr 1fr; }
  .feature--flip .feature__media { order: 2; }
}
.feature + .feature { margin-top: clamp(3.5rem, 7vw, 6.5rem); }
.feature__media { position: relative; }
.feature__media .arch { box-shadow: var(--sh-2); }

/* Small floating badge over an image */
.badge-float {
  position: absolute;
  right: -.6rem; bottom: 1.4rem;
  max-width: 15rem;
  padding: 1rem 1.15rem;
  background: var(--star);
  color: var(--ink);
  border-radius: var(--r);
  box-shadow: var(--sh-3);
  font-size: var(--t-xs);
  line-height: 1.45;
  font-weight: 600;
}
.badge-float strong { display: block; font-family: var(--font-display); font-size: 1.5rem; line-height: 1; margin-bottom: .3rem; }

/* --------------------------------------------------------------------------
   11. Quote / story
   -------------------------------------------------------------------------- */
.quote { position: relative; }
.quote__text {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--t-2xl);
  font-weight: 500;
  font-style: italic;
  line-height: 1.34;
  letter-spacing: -.015em;
}
.quote__text::before { content: '\201C'; }
.quote__text::after  { content: '\201D'; }
.quote__cite {
  display: block;
  margin-top: 1.4rem;
  font-size: var(--t-sm);
  font-style: normal;
  color: var(--muted);
}
.quote__cite strong { color: var(--fg); font-weight: 600; }
.section--ink .quote__cite strong, .section--ink-2 .quote__cite strong { color: var(--cream); }

.pull {
  border-left: 3px solid var(--star);
  padding: .2rem 0 .2rem 1.4rem;
  font-family: var(--font-display);
  font-size: var(--t-xl);
  font-style: italic;
  line-height: 1.42;
}

/* --------------------------------------------------------------------------
   12. Donation UI
   -------------------------------------------------------------------------- */
.give {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-xl);
  padding: clamp(1.5rem, 3.5vw, 2.6rem);
  box-shadow: var(--sh-2);
}

.freq {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .35rem;
  padding: .35rem;
  background: var(--cream-2);
  border-radius: 999px;
  margin-bottom: 1.6rem;
}
.freq__btn {
  padding: .78rem 1rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font: 600 var(--t-sm)/1 var(--font-body);
  cursor: pointer;
  transition: background-color .22s var(--ease), box-shadow .22s var(--ease);
}
.freq__btn[aria-pressed='true'] { background: var(--paper); box-shadow: var(--sh-1); }

.amounts { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: .6rem; }
.amount {
  position: relative;
  padding: 1.05rem .5rem;
  border: 1.5px solid var(--rule);
  border-radius: var(--r);
  background: var(--paper);
  cursor: pointer;
  text-align: center;
  transition: border-color .18s var(--ease), background-color .18s var(--ease),
              transform .18s var(--ease);
}
.amount:hover { border-color: var(--star); transform: translateY(-2px); }
.amount[aria-pressed='true'] { border-color: var(--star); background: #fdf6e6; border-width: 2px; }
.amount__val { display: block; font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; line-height: 1; }
.amount__note { display: block; margin-top: .35rem; font-size: .68rem; line-height: 1.3; color: var(--muted); }

.amount-custom { margin-top: .6rem; position: relative; }
.amount-custom__sym {
  position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
  font-weight: 600; color: var(--muted); pointer-events: none;
}

.impact-line {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  margin-top: 1.5rem;
  padding: 1.05rem 1.2rem;
  background: var(--cream-2);
  border-radius: var(--r);
  font-size: var(--t-sm);
  line-height: 1.5;
}
.impact-line svg { flex: none; width: 20px; height: 20px; color: var(--star-deep); margin-top: .1rem; }

/* Allocation bar — "where the money goes" */
.alloc { margin-top: 1.2rem; }
.alloc__bar {
  display: flex;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--cream-2);
}
.alloc__seg { height: 100%; }
.alloc__key { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; margin-top: .95rem; font-size: var(--t-xs); }
.alloc__key li { display: flex; align-items: center; gap: .45rem; margin: 0; }
.alloc__dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }

/* --------------------------------------------------------------------------
   13. Forms
   -------------------------------------------------------------------------- */
.field { display: block; margin-bottom: 1.15rem; }
.field__label {
  display: block;
  margin-bottom: .45rem;
  font: 600 var(--t-sm)/1.3 var(--font-body);
}
.field__hint { display: block; margin-top: .4rem; font-size: var(--t-xs); color: var(--muted); }
.field__req { color: var(--ember); }

.input, .select, .textarea {
  width: 100%;
  padding: .88rem 1rem;
  border: 1.5px solid var(--rule);
  border-radius: var(--r);
  background: var(--paper);
  color: var(--fg);
  font: 400 var(--t-base)/1.4 var(--font-body);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--star-deep);
  box-shadow: 0 0 0 4px rgba(242, 179, 61, .22);
}
.textarea { min-height: 8.5rem; resize: vertical; }
.select { appearance: none; padding-right: 2.6rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' stroke='%2355647c' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 1rem center; }

.field-row { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.check { display: flex; gap: .7rem; align-items: flex-start; margin-bottom: .85rem; font-size: var(--t-sm); line-height: 1.5; }
.check input { margin-top: .22rem; width: 18px; height: 18px; accent-color: var(--star-deep); flex: none; }

.form-note {
  margin-top: 1.2rem;
  padding: 1rem 1.15rem;
  border-left: 3px solid var(--star);
  background: var(--cream-2);
  border-radius: 0 var(--r) var(--r) 0;
  font-size: var(--t-sm);
  line-height: 1.55;
}

/* --------------------------------------------------------------------------
   14. Accordion (FAQ)
   -------------------------------------------------------------------------- */
.acc { border-top: 1px solid var(--rule); }
.acc__item { border-bottom: 1px solid var(--rule); }
.acc__btn {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  width: 100%;
  padding: 1.4rem 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  font: 600 var(--t-lg)/1.42 var(--font-body);
}
.acc__btn:hover { color: var(--star-deep); }
.acc__icon { flex: none; width: 22px; height: 22px; margin-top: .18rem; transition: transform .3s var(--ease); }
.acc__btn[aria-expanded='true'] .acc__icon { transform: rotate(45deg); }
.acc__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .34s var(--ease);
}
.acc__panel[data-open='true'] { grid-template-rows: 1fr; }
.acc__panel > div { overflow: hidden; }
.acc__panel p { padding-bottom: 1.5rem; color: var(--muted); max-width: 68ch; font-size: var(--t-sm); line-height: 1.68; }
.acc__panel p:first-child { padding-top: .1rem; }

/* --------------------------------------------------------------------------
   15. Ribbon / callouts
   -------------------------------------------------------------------------- */
.ribbon {
  background: var(--star);
  color: var(--ink);
  padding: .7rem 0;
  font-size: var(--t-sm);
  font-weight: 600;
  text-align: center;
}
.ribbon a { color: inherit; }

.cta-band {
  position: relative;
  background: var(--ink-2);
  color: var(--cream);
  border-radius: var(--r-xl);
  padding: clamp(2.2rem, 5vw, 4rem);
  overflow: hidden;
  isolation: isolate;
}
.cta-band__glow {
  position: absolute;
  z-index: -1;
  width: 34rem; height: 34rem;
  right: -8rem; top: -14rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(242,179,61,.28) 0%, transparent 62%);
  pointer-events: none;
}

.note-box {
  padding: 1.3rem 1.5rem;
  border: 1.5px dashed var(--cream-3);
  border-radius: var(--r);
  background: var(--paper);
  font-size: var(--t-sm);
  line-height: 1.6;
}
.note-box__title { display: block; margin-bottom: .4rem; font-weight: 700; }

/* Source list */
.sources { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 2.5rem; }
.sources li { break-inside: avoid; margin-bottom: .9rem; font-size: var(--t-xs); line-height: 1.55; color: var(--muted); }
.sources a { color: var(--ink-2); }
@media (max-width: 700px) { .sources { columns: 1; } }

/* --------------------------------------------------------------------------
   16. Footer
   -------------------------------------------------------------------------- */
.site-footer { background: var(--ink); color: #c3d0e2; padding-block: clamp(3rem, 6vw, 5rem) 2rem; }
.site-footer a { color: #c3d0e2; text-decoration: none; }
.site-footer a:hover { color: var(--star); }
.footer__top {
  display: grid;
  gap: clamp(2rem, 4vw, 3.5rem);
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  padding-bottom: 2.75rem;
  border-bottom: 1px solid rgba(251,247,241,.15);
}
.footer__brand { grid-column: 1 / -1; max-width: 30rem; }
@media (min-width: 980px) { .footer__brand { grid-column: span 2; } }
.footer__brand .logo { color: var(--cream); margin-bottom: 1.1rem; }
.footer__tagline { font-size: var(--t-sm); line-height: 1.65; }
.footer__col h3 {
  margin-bottom: 1rem;
  font: 700 var(--t-xs)/1 var(--font-body);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--cream);
}
.footer__col ul { list-style: none; padding: 0; margin: 0; }
.footer__col li { margin-bottom: .6rem; font-size: var(--t-sm); }
/* The one quiet way in to volunteering — a small underlined line at the very
   end of the footer, deliberately not a nav item or a section. */
.footer__quiet {
  margin: 1.6rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(251, 247, 241, .12);
  font-size: var(--t-xs);
  line-height: 1.6;
}
.footer__quiet a {
  color: #9fb0c8;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color .2s var(--ease);
}
.footer__quiet a:hover { color: var(--star); }

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.75rem;
  font-size: var(--t-xs);
  color: #8b9bb3;
}
.footer__legal { display: flex; flex-wrap: wrap; gap: .4rem 1.3rem; }

.social { display: flex; gap: .55rem; margin-top: 1.4rem; }
.social a {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border: 1px solid rgba(251,247,241,.22);
  border-radius: 999px;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.social a:hover { background: var(--star); border-color: var(--star); color: var(--ink); }
.social svg { width: 17px; height: 17px; }

.newsletter { display: flex; gap: .5rem; margin-top: 1.1rem; flex-wrap: wrap; }
.newsletter .input {
  flex: 1 1 12rem;
  background: rgba(251,247,241,.07);
  border-color: rgba(251,247,241,.24);
  color: var(--cream);
  padding: .78rem .95rem;
  font-size: var(--t-sm);
}
.newsletter .input::placeholder { color: #8b9bb3; }

/* --------------------------------------------------------------------------
   17. Modal
   -------------------------------------------------------------------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(16, 27, 45, .62);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .28s var(--ease), visibility .28s var(--ease);
}
.modal[data-open='true'] { opacity: 1; visibility: visible; }
.modal__box {
  width: min(34rem, 100%);
  max-height: 88vh;
  overflow-y: auto;
  padding: clamp(1.6rem, 4vw, 2.4rem);
  background: var(--cream);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-3);
  transform: translateY(14px) scale(.985);
  transition: transform .3s var(--ease);
}
.modal[data-open='true'] .modal__box { transform: none; }
.modal__close {
  float: right;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper);
  cursor: pointer;
}
.modal__title { font-size: var(--t-2xl); margin-bottom: .8rem; }

/* Error variant — used when the donation service cannot be reached. */
.modal--error { border-top: 4px solid var(--ember); }
.modal__icon {
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  margin-bottom: 1.1rem;
  border-radius: 50%;
  background: rgba(196, 85, 58, .12);
  color: var(--ember);
}
.modal__icon svg { width: 28px; height: 28px; }
.modal--error .modal__title { color: var(--ember); }
.modal__ref {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  margin: 1.1rem 0 0;
  padding: .65rem .9rem;
  background: var(--cream-2);
  border: 1px dashed var(--cream-3);
  border-radius: var(--r-sm);
  font-size: var(--t-xs);
  color: var(--muted);
}
.modal__ref code {
  font: 600 .82rem/1 var(--font-mono);
  letter-spacing: .06em;
  color: var(--ink);
  background: none;
  padding: 0;
}
.modal [data-error-retry][disabled] { opacity: .6; cursor: progress; }
.modal ul { font-size: var(--t-sm); color: var(--muted); }
.modal code {
  font: 500 .82em/1 var(--font-mono);
  background: var(--cream-2);
  padding: .18em .4em;
  border-radius: 4px;
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   17b. Error toast
   -------------------------------------------------------------------------- */
.toast-error {
  position: fixed;
  top: 1.2rem;
  left: 50%;
  translate: -50% 0;
  z-index: 400;
  width: min(400px, calc(100% - 2rem));
  padding: .9rem 1.4rem;
  background: var(--ember);
  color: #fff;
  font: 600 var(--t-base)/1.4 var(--font-body);
  text-align: center;
  border-radius: var(--r-md);
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-1rem);
  transition: opacity .3s var(--ease), transform .3s var(--ease), visibility .3s var(--ease);
  pointer-events: none;
}
.toast-error.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   18. Motion
   -------------------------------------------------------------------------- */
/* The hidden start state is scoped to html.js, which an inline script in each
   <head> sets. If JavaScript never runs — error, blocked script, ancient
   browser — the content simply renders visible instead of an empty page. */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .72s var(--ease), transform .72s var(--ease);
  transition-delay: var(--delay, 0ms);
}
html.js [data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  html.js [data-reveal] { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   19. Audit mode — append #audit to any URL to highlight every placeholder
   -------------------------------------------------------------------------- */
body.audit [data-placeholder] {
  outline: 2px dashed var(--ember);
  outline-offset: 3px;
  position: relative;
  background: rgba(196, 85, 58, .09);
}
body.audit [data-placeholder]::after {
  content: 'PLACEHOLDER';
  position: absolute;
  top: -.72rem; left: 0;
  padding: 1px 5px;
  background: var(--ember);
  color: #fff;
  font: 700 .55rem/1.5 var(--font-mono);
  letter-spacing: .08em;
  border-radius: 3px;
  z-index: 5;
  pointer-events: none;
}
.audit-flag { display: none; }
body.audit .audit-flag {
  display: block;
  position: fixed;
  left: 1rem; bottom: 1rem;
  z-index: 250;
  padding: .7rem 1rem;
  background: var(--ember);
  color: #fff;
  border-radius: var(--r);
  font: 600 var(--t-xs)/1.4 var(--font-body);
  box-shadow: var(--sh-3);
  max-width: 17rem;
}

/* --------------------------------------------------------------------------
   20. Misc utilities
   -------------------------------------------------------------------------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mb-0 { margin-bottom: 0 !important; }

.divider-star {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-block: clamp(2.5rem, 5vw, 4rem);
  color: var(--star-deep);
}
.divider-star::before, .divider-star::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
}
.divider-star svg { width: 18px; height: 18px; flex: none; }

.sect-head { max-width: 62ch; margin-bottom: clamp(2.2rem, 4.5vw, 3.5rem); }
.sect-head--center { margin-inline: auto; text-align: center; }

.chip-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  padding: .4rem .85rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper);
  font-size: var(--t-xs);
  font-weight: 500;
}
.section--ink .chip, .section--ink-2 .chip {
  background: rgba(251,247,241,.08);
  border-color: rgba(251,247,241,.2);
  color: var(--cream);
}

.table-plain { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.table-plain th, .table-plain td { padding: .9rem .4rem; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: top; }
.table-plain th { font-weight: 700; font-size: var(--t-xs); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.table-plain td:last-child, .table-plain th:last-child { text-align: right; }

/* --------------------------------------------------------------------------
   21. Touch targets
   Kept last in the file so these win over the base component rules on equal
   specificity. On a coarse pointer every control clears 44px.
   -------------------------------------------------------------------------- */
@media (pointer: coarse), (max-width: 1000px) {
  .lang__btn    { padding: 1rem .95rem; font-size: .8rem; }
  .modal__close { width: 44px; height: 44px; }
  .social a     { width: 44px; height: 44px; }
}
