/*! AFRITAL — tokens, base, layout and shared components (design width: 1440px) */

/* Self-hosted variable fonts (SIL OFL), latin subset */
@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-var.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Open Sans";
  src: url("../fonts/open-sans-var.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Colour system (Figma "Colour palette") */
  --c-bg: #F2ECDC;
  --c-navy: #09223B;
  --c-yellow: #FFC62B;
  --c-black: #1B2430;
  --c-grey: #4F626B;
  --c-surface: #EAF0F4;
  --c-border: #C9D2D9;
  --c-white: #FFFFFF;

  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-sans: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --container: 1240px;
  --gutter: clamp(20px, 6.944vw, 100px);
  --ease: cubic-bezier(.22, .61, .36, 1);

  --fs-h1: clamp(36px, 4.444vw, 64px);
  --fs-h2: clamp(30px, 3.333vw, 48px);
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-grey);
  font: 400 18px/1.5 var(--font-sans);
  letter-spacing: -0.02em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.menu-open { overflow: hidden; }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; letter-spacing: inherit; }

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.3;
  color: var(--c-navy);
  letter-spacing: -0.02em;
}
h2 { font-size: var(--fs-h2); }

:focus-visible { outline: 2px solid var(--c-navy); outline-offset: 3px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: 999px; background: var(--c-navy); color: #fff; font-size: 14px;
}
.skip-link:focus { top: 16px; }

.icon {
  width: 1em; height: 1em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

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

/* Eyebrow: yellow rule + label */
.eyebrow {
  display: flex; align-items: center; gap: 14px;
  margin: 0 0 var(--eyebrow-gap, 18px);
  font: 500 16px/24px var(--font-sans);
  color: var(--c-navy);
}
.eyebrow::before {
  content: ""; width: 56px; height: 3px; border-radius: 2px; background: var(--c-yellow); flex: none;
}

/* Section header: title left, paragraph right-aligned */
.section-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 40px;
}
.section-head__title { max-width: 520px; }
.section-head__title h2 .muted { color: var(--c-grey); }
.section-head__text {
  width: 100%; max-width: 616px; margin-top: var(--head-offset, 8px);
  text-align: right; color: var(--c-grey);
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 44px;
  border: 1px solid transparent; border-radius: 999px;
  font: 500 14px/1 var(--font-sans); letter-spacing: -0.02em; white-space: nowrap;
  cursor: pointer;
  transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.btn--primary { background: var(--c-navy); color: #fff; }
.btn--primary:hover { background: #12365a; }
.btn--light { background: #fff; color: var(--c-navy); }
.btn--light:hover { background: var(--c-surface); }
.btn--bordered { padding: 0 30px; border-color: var(--c-border); }
.btn--form { height: 50px; padding: 0 28px; font-size: 16px; }
.btn--sm { height: 40px; padding: 0 28px; }
.btn--lg { height: 46px; padding: 0 30px; font-size: 16px; }
.btn .icon { font-size: 16px; }

.icon--fill { fill: currentColor; stroke: none; }
.section-head--left .section-head__text { text-align: left; }

/* Stats row (Home: 4 columns left-aligned; About: 3 columns centred) */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 73px; }
.stat { padding-left: 40px; border-right: 1px solid var(--c-border); }
.stat:last-child { border-right: 0; }
.stat__value { font: 400 42px/1.3 var(--font-serif); color: var(--c-navy); }
.stat__label { margin-top: 4px; font-size: 14px; line-height: 21px; color: var(--c-grey); }
.stats--3 { grid-template-columns: repeat(3, 1fr); }
.stats--3 .stat { padding: 0 24px; text-align: center; }

/* Header / navigation */
.site-header { position: relative; z-index: 20; padding: 56px 3vw 0; }

.nav {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  max-width: 1354px; height: 90px; margin: 0 auto; padding: 0 27px 0 35px;
  background: #FBFAF6; border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .55);
}
.nav__logo { width: 70px; height: auto; }
.nav__links { display: flex; gap: 52px; margin-right: 22px; }
.nav__links a { font: 400 14px/1.5 var(--font-sans); color: var(--c-navy); }
.nav__links a:hover { opacity: .65; }
.nav__actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.nav__toggle {
  display: none; width: 40px; height: 40px; padding: 0; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: transparent; color: var(--c-navy); font-size: 24px; cursor: pointer;
}

.mobile-menu {
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; justify-content: center;
  padding: 24px var(--gutter); background: var(--c-bg);
  visibility: hidden; opacity: 0; transform: translateY(-12px);
  transition: opacity .3s var(--ease), transform .3s var(--ease), visibility 0s .3s;
}
.mobile-menu.is-open { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
.mobile-menu__close {
  position: absolute; top: 20px; right: 20px; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border: 0; background: transparent; color: var(--c-navy); font-size: 26px; cursor: pointer;
}
.mobile-menu__links { display: grid; gap: 8px; text-align: center; }
.mobile-menu__links a { display: block; padding: 10px; font: 500 32px/1.3 var(--font-serif); color: var(--c-navy); }

/* Shared "Get involved" band */
.cta { background: var(--c-navy); color: #fff; padding: 40px 0; }
.cta__grid {
  display: grid; grid-template-columns: 1fr auto;
  grid-template-areas: "eyebrow ." "body actions";
  column-gap: 40px;
}
.cta__eyebrow {
  grid-area: eyebrow; position: relative; justify-self: start;
  padding-bottom: 8px; margin-bottom: 28px;
  font: 400 16px/24px var(--font-sans); color: #fff;
}
.cta__eyebrow span { color: var(--c-yellow); }
.cta__eyebrow::before, .cta__eyebrow::after { content: ""; position: absolute; bottom: 0; height: 1px; }
.cta__eyebrow::before { left: 0; width: 150px; background: var(--c-yellow); }
.cta__eyebrow::after { left: 165px; width: 50px; background: rgba(255, 255, 255, .7); }
.cta__body { grid-area: body; max-width: 722px; }
.cta__title { font-size: clamp(28px, 2.778vw, 40px); color: #fff; }
.cta__text { margin-top: 20px; color: var(--c-border); }
.cta__actions { grid-area: actions; align-self: center; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.cta__link { font-size: 16px; color: #fff; }
.cta__link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Footer */
.footer { padding: 50px 0 32px; }
.footer__top { display: flex; justify-content: space-between; gap: 40px; }
.footer__brand { max-width: 390px; }
.footer__logo { width: 70px; height: auto; }
.footer__brand p { margin-top: 21px; font-size: 16px; line-height: 1.55; color: var(--c-grey); }
.footer__nav { display: flex; gap: 72px; }
.footer__title { margin-top: 3px; font: 400 12px/18px var(--font-sans); letter-spacing: 0; text-transform: uppercase; color: var(--c-grey); }
.footer__col ul { margin-top: 10px; display: grid; gap: 9px; }
.footer__col a { font-size: 16px; line-height: 24px; color: var(--c-navy); }
.footer__col a:hover { text-decoration: underline; text-underline-offset: 4px; }
.footer__bottom {
  display: flex; justify-content: space-between; gap: 24px;
  margin-top: 35px; padding-top: 35px; border-top: 1px solid var(--c-border);
  font-size: 14px; line-height: 21px; color: var(--c-grey);
}

/* Stub / error pages */
.stub { padding: 120px var(--gutter) 160px; text-align: center; }
.stub__code { font: 500 18px/1 var(--font-sans); color: var(--c-grey); margin-bottom: 16px; }
.stub__title { font-size: var(--fs-h1); font-weight: 600; }
.stub__text { margin: 20px 0 36px; }

/* Scroll reveal: only hidden once JS has run, so no-JS visitors see everything */
html.js [data-reveal] {
  opacity: 0; transform: translateY(28px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
html.js [data-reveal="fade"] { transform: none; }
html.js [data-reveal="left"] { transform: translateX(-32px); }
html.js [data-reveal="right"] { transform: translateX(32px); }
html.js [data-reveal].is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* ---------- Responsive (assumed: the Figma file is desktop only) ---------- */
@media (max-width: 1100px) {
  .nav__links { gap: 32px; }
}

@media (max-width: 900px) {
  .site-header { padding-top: 16px; }
  .nav { height: 72px; padding: 0 16px 0 22px; grid-template-columns: auto 1fr; }
  .nav__links { display: none; }
  .nav__toggle { display: inline-flex; }
}

@media (max-width: 800px) {
  .stats { grid-template-columns: repeat(2, 1fr); row-gap: 32px; margin-top: 48px; }
  .stats--3 { grid-template-columns: 1fr; }
  .stat:nth-child(2n) { border-right: 0; }
  .stats--3 .stat { border-right: 0; }
  .stat { padding-left: 24px; }
  .stat__value { font-size: 34px; }
  .section-head { flex-direction: column; gap: 20px; --head-offset: 0px; }
  .section-head__title { max-width: none; }
  .section-head__text { text-align: left; }
  .cta__grid { grid-template-columns: 1fr; grid-template-areas: "eyebrow" "body" "actions"; }
  .cta__actions { align-items: flex-start; margin-top: 28px; }
  .footer__top { flex-direction: column; }
  .footer__nav { gap: 48px; }
  .footer__bottom { flex-direction: column; gap: 8px; }
}
