/* =========================================================
   Foundation for Education and Humanitarian Care
   Design tokens
   ========================================================= */
:root {
  /* Colour — drawn directly from the supplied logo mark */
  --ivory:        #F9F6EF;   /* base background, matches logo field   */
  --ivory-deep:   #F1ECDE;   /* alternating section background        */
  --navy:         #24487E;   /* compass star — primary                */
  --navy-deep:    #17335C;   /* deep navy — footer, hover states      */
  --green:        #6E8F52;   /* leaf — secondary accent               */
  --gold:         #AB8F63;   /* book edge — decorative rules, dots    */
  --gold-text:    #846A3E;   /* deeper gold — meets contrast for text */
  --gold-soft:    #D9C9A8;   /* faint gold, hairlines on dark ground  */
  --charcoal:     #292722;   /* primary text                          */
  --charcoal-soft:#5B564C;   /* secondary / muted text                */
  --line:         #E1D9C4;   /* hairline rule colour on ivory         */
  --line-soft:    #EAE3D2;

  /* Type */
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", serif;
  --font-body: "Public Sans", "Segoe UI", -apple-system, sans-serif;

  /* Scale (fluid) */
  --step--1: clamp(0.86rem, 0.83rem + 0.15vw, 0.95rem);
  --step-0:  clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --step-1:  clamp(1.2rem, 1.1rem + 0.4vw, 1.4rem);
  --step-2:  clamp(1.5rem, 1.3rem + 0.8vw, 1.9rem);
  --step-3:  clamp(1.9rem, 1.6rem + 1.4vw, 2.6rem);
  --step-4:  clamp(2.4rem, 1.9rem + 2.2vw, 3.6rem);
  --step-5:  clamp(3rem, 2.2rem + 3.6vw, 5rem);

  /* Layout */
  --content-max: 76rem;
  --text-max: 42rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --section-space: clamp(4rem, 8vw, 7.5rem);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* =========================================================
   Reset
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol {
  margin: 0;
}
ul, ol { padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; }

html, body { height: 100%; }
body {
  background: var(--ivory);
  color: var(--charcoal);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main { display: block; }

/* Focus visibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--navy);
  color: var(--ivory);
  padding: 0.6rem 1rem;
  border-radius: 3px;
  z-index: 200;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 1rem; }

/* =========================================================
   Typography
   ========================================================= */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--charcoal);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
h1 { font-size: var(--step-5); font-weight: 400; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); font-family: var(--font-body); font-weight: 600; }

p { max-width: var(--text-max); }
p + p { margin-top: 1.1em; }

.lede {
  font-size: var(--step-1);
  color: var(--charcoal-soft);
  font-weight: 400;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-body);
  font-size: var(--step--1);
  color: var(--gold-text);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.eyebrow::before {
  content: "";
  width: 1.6rem;
  height: 1px;
  background: var(--gold);
  display: inline-block;
}

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

/* =========================================================
   Layout helpers
   ========================================================= */
.wrap {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-space);
}
.section--alt { background: var(--ivory-deep); }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }

.section-head {
  max-width: 38rem;
  margin-bottom: clamp(2rem, 4vw, 3.25rem);
}
.section-head--center { margin-inline: auto; text-align: center; }

/* Hairline divider with centred gold mark */
.divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--gold);
}
.divider::before,
.divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}
.divider__mark {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
}

.rule {
  border: none;
  border-top: 1px solid var(--line);
}

/* =========================================================
   Buttons / links
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--step--1);
  padding: 0.85rem 1.7rem;
  border-radius: 2px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
  text-decoration: none;
}
.btn--primary {
  background: var(--navy);
  color: var(--ivory);
  border-color: var(--navy);
}
.btn--primary:hover { background: var(--navy-deep); border-color: var(--navy-deep); }

.btn--ghost {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}
.btn--ghost:hover { background: var(--navy); color: var(--ivory); }

.btn--on-dark {
  background: transparent;
  color: var(--ivory);
  border-color: rgba(249, 246, 239, 0.45);
}
.btn--on-dark:hover { background: var(--ivory); color: var(--navy-deep); border-color: var(--ivory); }

.link-underline {
  color: var(--navy);
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
  transition: text-decoration-color 0.2s var(--ease);
}
.link-underline:hover { text-decoration-color: var(--navy); }

/* =========================================================
   Header
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(249, 246, 239, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.site-header.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 6px 18px -14px rgba(23, 51, 92, 0.35);
}

.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}
.brand img {
  height: 56px;
  width: auto;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 3vw, 2.5rem);
}
.nav__list {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 3vw, 2.5rem);
}
.nav__link {
  text-decoration: none;
  font-weight: 600;
  font-size: var(--step--1);
  color: var(--charcoal);
  position: relative;
  padding-bottom: 0.3rem;
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: 0;
  height: 1px;
  background: var(--gold);
  transition: right 0.25s var(--ease);
}
.nav__link:hover::after,
.nav__link[aria-current="page"]::after { right: 0; }
.nav__link[aria-current="page"] { color: var(--navy); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 3px;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--charcoal);
  position: relative;
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}
.nav-toggle__bars::before,
.nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .nav { position: static; }
  .nav__list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    background: var(--ivory);
    padding: 1.5rem var(--gutter) 2rem;
    gap: 1.4rem;
    border-bottom: 1px solid var(--line);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
  }
  .nav__list.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav__link { font-size: var(--step-0); }
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(3.5rem, 9vw, 6.5rem) clamp(3rem, 7vw, 5rem);
  text-align: center;
}

.hero__ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(64rem, 150vw);
  aspect-ratio: 1;
  transform: translate(-50%, -46%);
  color: var(--navy);
  opacity: 0.06;
  pointer-events: none;
}

.hero__inner {
  position: relative;
  max-width: 44rem;
  margin-inline: auto;
}

.hero__logo {
  width: min(220px, 46vw);
  margin-inline: auto;
  margin-bottom: 1.75rem;
}

.hero__tagline {
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--gold-text);
  margin-bottom: 0.9rem;
}

.hero h1 {
  font-size: var(--step-4);
  max-width: 20ch;
  margin-inline: auto;
}

.hero__lede {
  margin-top: 1.4rem;
  margin-inline: auto;
  font-size: var(--step-1);
  color: var(--charcoal-soft);
  max-width: 34rem;
}

.hero__actions {
  margin-top: 2.2rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Reveal-on-load for hero only (single choreographed moment) */
.reveal-in {
  opacity: 0;
  transform: translateY(10px);
  animation: reveal 0.7s var(--ease) forwards;
}
.reveal-in--1 { animation-delay: 0.05s; }
.reveal-in--2 { animation-delay: 0.18s; }
.reveal-in--3 { animation-delay: 0.3s; }
.reveal-in--4 { animation-delay: 0.42s; }
@keyframes reveal {
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .reveal-in { opacity: 1; transform: none; animation: none; }
}

/* On-scroll reveal, used sparingly on section headers only */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal-on-scroll { opacity: 1; transform: none; transition: none; }
}

/* =========================================================
   Two-column editorial block ("Who we are")
   ========================================================= */
.editorial {
  display: grid;
  grid-template-columns: minmax(0, 20rem) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}
.editorial__label { padding-top: 0.3rem; }
.editorial__body p { color: var(--charcoal-soft); }
.editorial__body p:first-child { color: var(--charcoal); }

@media (max-width: 760px) {
  .editorial { grid-template-columns: 1fr; gap: 1.25rem; }
}

/* =========================================================
   Areas of work — flat blocks divided by hairlines
   ========================================================= */
.areas {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.areas--three { grid-template-columns: repeat(3, 1fr); }
.area {
  padding: clamp(1.5rem, 3vw, 2.25rem) clamp(1.25rem, 2.5vw, 1.75rem);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.area__icon {
  width: 34px;
  height: 34px;
  color: var(--navy);
  margin-bottom: 1.1rem;
}
.area h4 { margin-bottom: 0.5rem; }
.area p { font-size: var(--step--1); color: var(--charcoal-soft); }

@media (max-width: 900px) {
  .areas { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .areas { grid-template-columns: 1fr; }
}

/* =========================================================
   Credibility band
   ========================================================= */
.credibility {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding-block: clamp(2rem, 4vw, 2.75rem);
}
.credibility__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.credibility__id {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.credibility__id-icon {
  width: 40px;
  height: 40px;
  color: var(--navy);
  flex-shrink: 0;
}
.credibility__id h4 { margin-bottom: 0.15rem; }
.credibility__id p { font-size: var(--step--1); color: var(--charcoal-soft); margin: 0; }

/* =========================================================
   Closing CTA band
   ========================================================= */
.cta-band {
  background: var(--navy);
  color: var(--ivory);
}
.cta-band .wrap {
  padding-block: clamp(3rem, 6vw, 4.5rem);
  text-align: center;
}
.cta-band h2 { color: var(--ivory); }
.cta-band p { color: rgba(249, 246, 239, 0.78); margin-inline: auto; }
.cta-band .btn--primary { background: var(--ivory); color: var(--navy-deep); border-color: var(--ivory); margin-top: 1.75rem; }
.cta-band .btn--primary:hover { background: var(--gold-soft); border-color: var(--gold-soft); }

/* =========================================================
   Page hero (About / Contact — shorter, left-aligned)
   ========================================================= */
.page-hero {
  padding-block: clamp(3rem, 7vw, 4.5rem) clamp(2rem, 5vw, 3rem);
  border-bottom: 1px solid var(--line);
}
.page-hero__eyebrow { margin-bottom: 1rem; }
.page-hero h1 { font-size: var(--step-4); max-width: 16ch; }
.page-hero .lede { margin-top: 1rem; max-width: 34rem; }

/* =========================================================
   Objects list (About page)
   ========================================================= */
.objects {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}
.objects__item {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 1.5rem;
  padding-block: 1.5rem;
  border-bottom: 1px solid var(--line);
}
.objects__item dt {
  font-family: var(--font-display);
  color: var(--gold-text);
  font-style: italic;
  font-size: var(--step-0);
}
.objects__item dd { margin: 0; color: var(--charcoal-soft); }
@media (max-width: 640px) {
  .objects__item { grid-template-columns: 1fr; gap: 0.4rem; }
}

/* =========================================================
   Contact page
   ========================================================= */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 26rem);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}
@media (max-width: 860px) {
  .contact-grid { grid-template-columns: 1fr; }
}

.info-card {
  border: 1px solid var(--line);
  padding: clamp(1.75rem, 3vw, 2.25rem);
}
.info-card h3 { margin-bottom: 1.25rem; }
.info-list { display: grid; gap: 1.1rem; }
.info-list__item { display: flex; gap: 0.9rem; align-items: flex-start; }
.info-list__icon { width: 22px; height: 22px; color: var(--navy); flex-shrink: 0; margin-top: 0.15rem; }
.info-list__item p { margin: 0; color: var(--charcoal-soft); }
.info-list__item strong { display: block; color: var(--charcoal); font-weight: 600; margin-bottom: 0.1rem; }

.field {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}
.field label {
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--charcoal);
}
.field input,
.field textarea {
  border: 1px solid var(--line);
  background: var(--ivory);
  padding: 0.75rem 0.9rem;
  border-radius: 2px;
  font-family: var(--font-body);
  font-size: var(--step--1);
  color: var(--charcoal);
}
.field input:focus,
.field textarea:focus { border-color: var(--navy); }
.field textarea { resize: vertical; min-height: 8.5rem; }
.field-note { font-size: var(--step--1); color: var(--charcoal-soft); margin-top: -0.4rem; margin-bottom: 1.25rem; }

.form-status {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  background: var(--ivory-deep);
  font-size: var(--step--1);
  display: none;
}
.form-status.is-visible { display: block; }

.map-note {
  margin-top: 1.5rem;
  font-size: var(--step--1);
  color: var(--charcoal-soft);
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  background: var(--navy-deep);
  color: var(--ivory);
}
.site-footer__top {
  padding-block: clamp(3rem, 6vw, 4rem);
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: clamp(2rem, 5vw, 3rem);
}
@media (max-width: 760px) {
  .site-footer__top { grid-template-columns: 1fr; gap: 2rem; }
}
.site-footer h5 {
  font-family: var(--font-body);
  font-size: var(--step--1);
  color: var(--gold-soft);
  font-weight: 600;
  margin-bottom: 1rem;
}
.site-footer p, .site-footer address { font-style: normal; color: rgba(249, 246, 239, 0.78); font-size: var(--step--1); }
.site-footer__brand-name {
  font-family: var(--font-display);
  font-size: var(--step-1);
  color: var(--ivory);
  margin-bottom: 0.75rem;
  max-width: 18ch;
}
.footer-links { display: grid; gap: 0.65rem; }
.footer-links a {
  color: rgba(249, 246, 239, 0.85);
  text-decoration: none;
  font-size: var(--step--1);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.footer-links a:hover { color: var(--ivory); border-color: var(--gold-soft); }

.site-footer__bottom {
  border-top: 1px solid rgba(249, 246, 239, 0.14);
  padding-block: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  font-size: var(--step--1);
  color: rgba(249, 246, 239, 0.6);
}

/* =========================================================
   Visually hidden utility
   ========================================================= */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
