/* ==========================================================================
   The Ambrose Initiative — theambroseinitiative.org.uk
   Design language: "warm light against the rain".
   Cold navy ground, warm amber light, cream paper. The arch motif is lifted
   from the logo (a sheltering doorway) and repeats as image masks.
   ========================================================================== */

/* ----------------------------------------------------------------- tokens */
:root {
  --navy:        #14213D;
  --navy-deep:   #0B1224;
  --navy-soft:   #22304F;
  --amber:       #F0A202;
  --amber-deep:  #C97F00;
  --amber-glow:  rgba(240, 162, 2, .16);
  --cream:       #F7F3EB;
  --cream-deep:  #EFE8DA;
  --paper:       #FFFDF9;
  --ink:         #161B27;
  --slate:       #59617A;
  --line:        rgba(20, 33, 61, .14);
  --line-dark:   rgba(247, 243, 235, .18);

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --step--1: clamp(.82rem, .79rem + .13vw, .89rem);
  --step-0:  clamp(1rem, .96rem + .2vw, 1.12rem);
  --step-1:  clamp(1.19rem, 1.12rem + .35vw, 1.45rem);
  --step-2:  clamp(1.45rem, 1.32rem + .62vw, 1.95rem);
  --step-3:  clamp(1.8rem, 1.55rem + 1.15vw, 2.85rem);
  --step-4:  clamp(2.2rem, 1.75rem + 2.1vw, 4.1rem);
  --step-5:  clamp(2.6rem, 1.85rem + 3.4vw, 5.6rem);

  --wrap: 1180px;
  --gutter: clamp(1.15rem, 4vw, 3.5rem);
  --radius: 14px;
  --arch: 50% 50% 0 0 / 22% 22% 0 0;   /* the doorway */

  --shadow-sm: 0 1px 2px rgba(11,18,36,.06), 0 4px 14px rgba(11,18,36,.06);
  --shadow-md: 0 2px 6px rgba(11,18,36,.07), 0 18px 45px rgba(11,18,36,.11);
}

/* ------------------------------------------------------------------ reset */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;   /* fallback for older Safari */
  overflow-x: clip;     /* preferred: contains the off-screen drawer, keeps sticky working */
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  overflow-x: clip;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -.018em;
  margin: 0 0 .5em;
  font-variation-settings: "SOFT" 18, "WONK" 0;
  text-wrap: balance;
}
h1 { font-size: var(--step-5); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); letter-spacing: -.01em; }
p  { margin: 0 0 1.15em; text-wrap: pretty; }
:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
  border-radius: 3px;
}

/* --------------------------------------------------------------- layout */
.wrap { width: min(100% - var(--gutter) * 2, var(--wrap)); margin-inline: auto; }
.wrap--narrow { width: min(100% - var(--gutter) * 2, 760px); margin-inline: auto; }
section { padding-block: clamp(3.5rem, 8vw, 7rem); }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--navy); color: var(--cream);
  padding: .8rem 1.2rem; border-radius: 0 0 var(--radius) 0; font-weight: 600;
}
.skip:focus { left: 0; }

/* --------------------------------------------------------------- eyebrow */
.eyebrow {
  display: inline-flex; align-items: center; gap: .6rem;
  font-size: var(--step--1); font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--amber-deep); margin-bottom: 1.1rem;
}
.eyebrow::before {
  content: ""; width: 28px; height: 2px;
  background: var(--amber); border-radius: 2px;
}
.on-dark .eyebrow { color: var(--amber); }

.lede { font-size: var(--step-1); line-height: 1.5; color: var(--slate); }
.on-dark .lede { color: rgba(247,243,235,.8); }

/* --------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  font-family: var(--font-body); font-weight: 600; font-size: var(--step-0);
  padding: .88em 1.6em; border-radius: 999px; border: 2px solid transparent;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .18s ease, background-color .18s ease,
              color .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--amber); color: var(--navy-deep); box-shadow: 0 6px 20px var(--amber-glow); }
.btn--primary:hover { background: #FFB01A; box-shadow: 0 10px 28px rgba(240,162,2,.34); }
.btn--dark { background: var(--navy); color: var(--cream); }
.btn--dark:hover { background: var(--navy-soft); }
.btn--ghost { border-color: currentColor; color: var(--navy); }
.btn--ghost:hover { background: var(--navy); color: var(--cream); border-color: var(--navy); }
.on-dark .btn--ghost, .hero .btn--ghost, .callout .btn--ghost { color: var(--cream); }
.on-dark .btn--ghost:hover, .hero .btn--ghost:hover, .callout .btn--ghost:hover {
  background: var(--cream); color: var(--navy); border-color: var(--cream); }
.btn-row { display: flex; flex-wrap: wrap; gap: .85rem; }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,253,249,.86);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; padding-block: .7rem;
}
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; flex-shrink: 0; }
.brand img { width: auto; height: 46px; }
.brand__name {
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.05rem; line-height: 1.1; color: var(--navy);
  letter-spacing: -.015em;
}
.brand__sub {
  display: block; font-family: var(--font-body); font-size: .64rem;
  font-weight: 600; letter-spacing: .17em; text-transform: uppercase;
  color: var(--amber-deep); margin-top: .18rem;
}

.nav { display: flex; align-items: center; gap: clamp(.9rem, 1.8vw, 1.7rem); }
.nav a {
  text-decoration: none; font-weight: 500; font-size: .95rem;
  color: var(--navy); padding: .35rem 0; position: relative;
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 2px; background: var(--amber); border-radius: 2px;
  transform: scaleX(0); transform-origin: left; transition: transform .2s ease;
}
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav a[aria-current="page"] { font-weight: 600; }

.nav-toggle {
  display: none; background: none; border: 0; cursor: pointer;
  padding: .5rem; color: var(--navy);
}
.nav-toggle svg { width: 26px; height: 26px; }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav {
    position: fixed; inset: 0 0 0 auto; width: min(84vw, 340px);
    background: var(--navy); flex-direction: column; align-items: stretch;
    justify-content: flex-start; gap: 0; padding: 5.5rem 1.75rem 2rem;
    transform: translateX(100%); visibility: hidden;
    transition: transform .3s cubic-bezier(.4,0,.2,1), visibility .3s linear;
    box-shadow: -20px 0 60px rgba(11,18,36,.3); overflow-y: auto;
  }
  .nav[data-open="true"] { transform: translateX(0); visibility: visible; }
  .nav a { color: var(--cream); font-size: 1.1rem; padding: .95rem 0;
           border-bottom: 1px solid var(--line-dark); }
  .nav a::after { display: none; }
  .nav a[aria-current="page"] { color: var(--amber); }
  .nav .btn { margin-top: 1.4rem; border-bottom: 0; }
  .nav-close {
    position: absolute; top: 1.2rem; right: 1.3rem;
    background: none; border: 0; color: var(--cream); cursor: pointer; padding: .5rem;
  }
  .nav-close svg { width: 26px; height: 26px; }
}
@media (min-width: 901px) { .nav-close { display: none; } }

.scrim {
  position: fixed; inset: 0; background: rgba(11,18,36,.5);
  opacity: 0; pointer-events: none; transition: opacity .3s ease; z-index: 99;
}
.scrim[data-open="true"] { opacity: 1; pointer-events: auto; }
body[data-nav-open="true"] { overflow: hidden; }

/* ------------------------------------------------------------------ hero */
.hero { position: relative; background: var(--navy-deep); color: var(--cream);
        isolation: isolate; padding-block: 0; }
.hero__media { position: absolute; inset: 0; z-index: -2; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; object-position: center 58%; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(to right, rgba(11,18,36,.94) 0%, rgba(11,18,36,.82) 42%, rgba(11,18,36,.42) 78%, rgba(11,18,36,.34) 100%),
    linear-gradient(to top, rgba(11,18,36,.8) 0%, transparent 45%);
}
.hero__inner { padding-block: clamp(5rem, 12vw, 8.5rem); max-width: 46rem; }
.hero h1 { color: var(--cream); margin-bottom: .42em; }
.hero h1 em {
  font-style: normal; color: var(--amber);
  display: block;
}
.hero__lede {
  font-size: var(--step-1); line-height: 1.55;
  color: rgba(247,243,235,.86); max-width: 34rem; margin-bottom: 2rem;
}
.hero .btn-row { margin-bottom: 2.5rem; }
.hero__meta {
  display: flex; flex-wrap: wrap; gap: .6rem 1.5rem; align-items: center;
  font-size: var(--step--1); color: rgba(247,243,235,.62);
  padding-top: 1.5rem; border-top: 1px solid var(--line-dark);
}
.hero__meta strong { color: var(--cream); font-weight: 600; }

/* page hero (interior pages) */
.page-hero { background: var(--navy); color: var(--cream); position: relative;
             overflow: hidden; padding-block: 0; }
.page-hero::before {
  content: ""; position: absolute; width: 620px; height: 620px;
  right: -180px; top: -280px; border-radius: 50%;
  background: radial-gradient(circle, rgba(240,162,2,.2), transparent 66%);
  pointer-events: none;
}
.page-hero__inner { padding-block: clamp(3.25rem, 7vw, 5rem); position: relative; max-width: 44rem; }
.page-hero h1 { color: var(--cream); font-size: var(--step-4); }
.page-hero p { color: rgba(247,243,235,.8); font-size: var(--step-1); margin-bottom: 0; }

.crumbs { font-size: var(--step--1); color: rgba(247,243,235,.6); margin-bottom: 1.1rem; }
.crumbs a { color: rgba(247,243,235,.85); text-decoration: none; }
.crumbs a:hover { color: var(--amber); text-decoration: underline; }
.crumbs span { margin-inline: .45rem; opacity: .5; }

/* ---------------------------------------------------------------- bands */
.band--cream { background: var(--cream); }
.band--navy  { background: var(--navy); color: var(--cream); }
.band--navy h2, .band--navy h3 { color: var(--cream); }
.on-dark a { color: var(--amber); }

/* --------------------------------------------------------- pillars (home) */
.pillars { display: grid; gap: clamp(1.6rem, 3vw, 2.6rem); grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.pillar { position: relative; }
.pillar__num {
  font-family: var(--font-display); font-size: 2.6rem; line-height: 1;
  color: var(--amber); opacity: .95; margin-bottom: .5rem; font-weight: 600;
}
.pillar h3 { margin-bottom: .45em; }
.pillar p { color: var(--slate); font-size: .97rem; margin-bottom: 0; }
.band--navy .pillar p { color: rgba(247,243,235,.76); }

/* ------------------------------------------------------------ split rows */
.split {
  display: grid; gap: clamp(2rem, 5vw, 4.5rem);
  grid-template-columns: 1fr; align-items: center;
}
@media (min-width: 860px) {
  .split { grid-template-columns: 1fr 1fr; }
  .split--flip .split__media { order: 2; }
}
.split__media img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: var(--arch); box-shadow: var(--shadow-md);
}
.split__body h2 { margin-bottom: .5em; }
.split__body p { color: var(--slate); }
.band--navy .split__body p { color: rgba(247,243,235,.78); }

/* --------------------------------------------------------------- cards */
.cards { display: grid; gap: clamp(1.3rem, 2.5vw, 2rem); grid-template-columns: repeat(auto-fit, minmax(265px, 1fr)); }
.card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .22s ease, box-shadow .22s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.card__body { padding: 1.5rem 1.5rem 1.7rem; flex: 1; display: flex; flex-direction: column; }
.card__body h3 { margin-bottom: .45em; }
.card__body p { color: var(--slate); font-size: .96rem; margin-bottom: 1.1rem; }
.card__body .link { margin-top: auto; }
.band--navy .card { background: var(--navy-soft); border-color: var(--line-dark); }
.band--navy .card__body p { color: rgba(247,243,235,.76); }

.link {
  display: inline-flex; align-items: center; gap: .4rem;
  font-weight: 600; font-size: .95rem; color: var(--navy);
  text-decoration: none; border-bottom: 2px solid var(--amber);
  padding-bottom: 1px; width: fit-content;
}
.link:hover { color: var(--amber-deep); gap: .65rem; }
.link { transition: gap .18s ease, color .18s ease; }
.on-dark .link, .band--navy .link { color: var(--cream); }
.on-dark .link:hover, .band--navy .link:hover { color: var(--amber); }

/* ---------------------------------------------------------- ways to help */
.ways { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.way {
  padding: 1.6rem; border-radius: var(--radius);
  background: var(--paper); border: 1px solid var(--line);
}
.way__icon {
  width: 44px; height: 44px; border-radius: 11px; margin-bottom: 1rem;
  background: var(--amber-glow); color: var(--amber-deep);
  display: grid; place-items: center;
}
.way__icon svg { width: 23px; height: 23px; }
.way h3 { font-size: 1.08rem; margin-bottom: .4em; }
.way p { color: var(--slate); font-size: .94rem; margin-bottom: 0; }

/* ------------------------------------------------------------- callout */
.callout {
  background: var(--navy); color: var(--cream);
  border-radius: var(--radius); padding: clamp(1.8rem, 4vw, 3.2rem);
  position: relative; overflow: hidden;
}
.callout::before {
  content: ""; position: absolute; right: -110px; bottom: -170px;
  width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(240,162,2,.22), transparent 68%);
}
.callout > * { position: relative; }
.callout h2 { color: var(--cream); }
.callout p { color: rgba(247,243,235,.82); }

/* ------------------------------------------------------- urgent / notice */
.notice {
  border-left: 4px solid var(--amber);
  background: var(--cream); border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.3rem 1.5rem; margin-block: 1.8rem;
}
.notice p:last-child { margin-bottom: 0; }
.notice strong { color: var(--navy); }
.notice--alert { border-left-color: #C0392B; background: #FDF1EF; }

/* ------------------------------------------------------------- prose */
.prose { max-width: 68ch; }
.prose h2 { font-size: var(--step-2); margin-top: 2.4em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: var(--step-1); margin-top: 1.9em; }
.prose ul, .prose ol { margin: 0 0 1.3em; padding-left: 1.35em; }
.prose li { margin-bottom: .5em; }
.prose li::marker { color: var(--amber-deep); }
.prose a { color: var(--navy); text-decoration: underline; text-decoration-color: var(--amber); text-underline-offset: 3px; text-decoration-thickness: 2px; }
.prose a:hover { color: var(--amber-deep); }
.prose table { width: 100%; border-collapse: collapse; margin-bottom: 1.6em; font-size: .95rem; }
.prose th, .prose td { text-align: left; padding: .75rem .9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { background: var(--cream); font-weight: 600; color: var(--navy); }
.prose dl { margin: 0 0 1.4em; }
.prose dt { font-weight: 600; color: var(--navy); margin-top: 1em; }
.prose dd { margin: .25em 0 0; color: var(--slate); }
.table-scroll { overflow-x: auto; }

.toc {
  background: var(--cream); border-radius: var(--radius);
  padding: 1.4rem 1.6rem; margin-bottom: 2.5rem;
}
.toc h2 { font-size: 1rem !important; margin: 0 0 .7em !important;
          text-transform: uppercase; letter-spacing: .1em;
          font-family: var(--font-body); color: var(--slate); }
.toc ol { margin: 0; padding-left: 1.2em; columns: 2; column-gap: 2rem; }
@media (max-width: 640px) { .toc ol { columns: 1; } }
.toc li { margin-bottom: .4em; break-inside: avoid; }
.toc a { color: var(--navy); text-decoration: none; font-size: .95rem; }
.toc a:hover { text-decoration: underline; text-decoration-color: var(--amber); }

.doc-meta {
  font-size: var(--step--1); color: var(--slate);
  padding-bottom: 1.5rem; margin-bottom: 2.5rem; border-bottom: 1px solid var(--line);
}

/* --------------------------------------------------------------- forms */
.form { display: grid; gap: 1.15rem; }
.field { display: grid; gap: .4rem; }
.field label { font-weight: 600; font-size: .92rem; color: var(--navy); }
.field .hint { font-size: .84rem; color: var(--slate); font-weight: 400; }
.field input, .field textarea, .field select {
  font-family: inherit; font-size: 1rem; color: var(--ink);
  padding: .8rem .95rem; border: 1px solid var(--line); border-radius: 9px;
  background: var(--paper); width: 100%;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px var(--amber-glow);
}
.field textarea { min-height: 150px; resize: vertical; }
.checkbox { display: flex; gap: .7rem; align-items: flex-start; font-size: .93rem; color: var(--slate); }
.checkbox input { width: 19px; height: 19px; flex-shrink: 0; margin-top: .16rem; accent-color: var(--amber); }

/* ------------------------------------------------------------ contact */
.contact-grid { display: grid; gap: clamp(2rem, 5vw, 4rem); grid-template-columns: 1fr; }
@media (min-width: 880px) { .contact-grid { grid-template-columns: 1.1fr .9fr; } }
.contact-card {
  background: var(--cream); border-radius: var(--radius); padding: 1.8rem;
}
.contact-card h3 { font-size: 1.05rem; margin-bottom: .5em; }
.contact-card + .contact-card { margin-top: 1.1rem; }
.contact-card p { font-size: .96rem; color: var(--slate); margin-bottom: .5em; }
.contact-card a { color: var(--navy); font-weight: 600; }

/* -------------------------------------------------------------- footer */
.site-footer { background: var(--navy-deep); color: rgba(247,243,235,.72); padding-block: clamp(3rem, 6vw, 4.5rem) 2rem; }
.footer-grid {
  display: grid; gap: 2.5rem;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  padding-bottom: 2.5rem; border-bottom: 1px solid var(--line-dark);
}
.footer-brand { max-width: 22rem; }
.footer-brand img { height: 52px; width: auto; margin-bottom: 1rem; }
.footer-brand p { font-size: .92rem; line-height: 1.6; margin-bottom: 1rem; }
.site-footer h4 {
  font-family: var(--font-body); font-size: .76rem; font-weight: 700;
  letter-spacing: .15em; text-transform: uppercase;
  color: var(--amber); margin-bottom: 1.1rem;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .6rem; }
.site-footer a { color: rgba(247,243,235,.76); text-decoration: none; font-size: .93rem; }
.site-footer a:hover { color: var(--amber); text-decoration: underline; }
.footer-note {
  padding-top: 1.8rem; font-size: .84rem; line-height: 1.65;
  color: rgba(247,243,235,.5);
  display: flex; flex-wrap: wrap; gap: .6rem 1.6rem; justify-content: space-between;
}
.footer-note p { margin: 0; max-width: 58ch; }
address { font-style: normal; }

/* --------------------------------------------------------------- misc */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.stack-sm > * + * { margin-top: .75rem; }
.mt-2 { margin-top: 2rem; }
.center { text-align: center; margin-inline: auto; }
.max-52 { max-width: 52rem; }

/* reveal on scroll — opt-in, and disabled when motion is reduced */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
  .reveal.is-visible { opacity: 1; transform: none; }
}

@media print {
  .site-header, .site-footer, .nav, .scrim, .btn { display: none !important; }
  body { background: #fff; color: #000; }
  .page-hero { background: #fff; color: #000; }
  .page-hero h1 { color: #000; }
}
