/* ==========================================================================
   Africa Autism Alliance — core
   Tokens → base → layout → type → buttons. Loaded on every page, first.
   Colours and fonts are defined only in :root. Everything else references them.
   Each later stylesheet adds its own Calm mode / reduced-motion overrides.
   ========================================================================== */

:root {
  /* Brand — extracted from africaautismalliance.org stylesheets (Oct 2026).
     Live site: #3dbabe ×37 (headings), #2c8085 ×22 (buttons), #132e3a ×5 (footer).
     #3dbabe is only 2.3:1 against white, so the button colour leads. */
  --brand-primary:   #2C8085;
  --brand-secondary: #3DBABE;
  --brand-accent:    #132E3A;
  --primary-tint:    color-mix(in srgb, var(--brand-primary) 10%, white);
  --secondary-tint:  color-mix(in srgb, var(--brand-secondary) 12%, white);

  /* Derived brand values (no new hues) */
  --primary-ink:   color-mix(in srgb, var(--brand-primary) 85%, black); /* primary as text on --bg / tints: 5.3–6:1 */
  --primary-hover: color-mix(in srgb, var(--brand-primary) 92%, black); /* buttons darken 8% */
  --on-brand:      #FFFFFF;                                              /* text on primary fills: 4.6:1 */
  --cta-blob:      color-mix(in srgb, var(--brand-accent) 30%, var(--brand-primary));
  --rule-on-tint:  color-mix(in srgb, var(--brand-primary) 30%, transparent);

  /* Logo — exact colours from the supplied mark; used only by the logo */
  --logo-orange: #F5AB46;
  --logo-teal:   #40BABE;

  /* Neutrals */
  --bg:       #FAF7F2;
  --surface:  #FFFFFF;
  --ink:      #1C1B1A;
  --ink-soft: #5E5A55;
  --line:     #E8E2D9;
  --line-strong: color-mix(in srgb, var(--ink-soft) 70%, white); /* form control borders: 3.3:1 on white */
  --frost:      color-mix(in srgb, var(--bg) 80%, transparent);
  --hover-wash: color-mix(in srgb, var(--ink) 6%, transparent);
  --light-hover: color-mix(in srgb, var(--surface) 92%, black);
  --light-wash:  color-mix(in srgb, var(--surface) 14%, transparent);

  /* Feedback — form errors only (6.5:1 on white) */
  --error:      #B42318;
  --error-tint: color-mix(in srgb, var(--error) 8%, white);

  /* Type — Poppins (sans) for everything; weight carries the contrast */
  --font-display: "Poppins", system-ui, sans-serif;
  --font-body:    "Poppins", system-ui, sans-serif;
  --fs-display: clamp(2.75rem, 6vw, 5.5rem);
  --fs-h2:      clamp(2rem, 4vw, 3.25rem);
  --fs-h3:      1.375rem;
  --fs-body:    1.0625rem;
  --fs-small:   0.875rem;
  --fs-page-title: clamp(2.5rem, 5vw, 4.25rem); /* inner-page h1: a step below --fs-display */

  /* Space (8px base) */
  --space-1: 0.5rem;  --space-2: 1rem;  --space-3: 1.5rem;
  --space-4: 2rem;    --space-6: 3rem;  --space-8: 4rem;
  --section-y: clamp(5rem, 10vw, 9rem);
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --max-w: 1240px;
  --nav-h: 72px;
  --topbar-h: 40px;

  /* Shape */
  --radius-sm: 12px;  --radius-md: 20px;  --radius-lg: 32px;  --radius-pill: 999px;
  --shadow-soft: 0 1px 2px rgb(0 0 0 / .04), 0 8px 24px rgb(0 0 0 / .06);
  --shadow-lift: 0 2px 4px rgb(0 0 0 / .05), 0 16px 40px rgb(0 0 0 / .10);

  /* Motion */
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --dur: 300ms;
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + var(--space-2));
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  color: var(--ink);
  text-wrap: balance;
}

p { margin: 0; max-width: 65ch; text-wrap: pretty; }

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; }

::selection { background: var(--secondary-tint); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 3px;
}
.on-brand :focus-visible { outline-color: var(--on-brand); }

main:focus { outline: none; }

/* All 24×24 line icons share one stroke style */
svg[viewBox="0 0 24 24"] {
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.no-js .js-only { display: none !important; }
.js .no-js-only { display: none !important; }

.skip-link {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 200;
  padding: .75rem 1.25rem;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-soft);
  translate: 0 -200%;
}
.skip-link:focus { translate: none; }

/* ---------- Layout ---------- */

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

.section { padding-block: var(--section-y); }

.section-head {
  display: grid;
  gap: var(--space-3);
  max-width: 46rem;
  margin-bottom: clamp(var(--space-6), 6vw, var(--space-8));
}

/* ---------- Type helpers ---------- */

.display {
  font-size: var(--fs-display);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.h2 {
  font-size: var(--fs-h2);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h1 em, h2 em {
  white-space: nowrap;
  font-style: italic;
  font-weight: 300;
  color: var(--brand-accent);
}
.on-brand em { color: inherit; }

.lead {
  font-size: clamp(var(--fs-body), 1.4vw, 1.1875rem);
  color: var(--ink-soft);
}

.label,
.eyebrow {
  font-family: var(--font-body);
  font-size: var(--fs-small);
  font-weight: 600;
  letter-spacing: .14em;
  line-height: 1.4;
  text-transform: uppercase;
}
.label { color: var(--primary-ink); }
.eyebrow { color: var(--ink-soft); font-weight: 400; }

/* Text links: underline draws left → right */
.link {
  color: var(--primary-ink);
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  background-origin: content-box;
  background-clip: content-box;
  transition: background-size var(--dur) var(--ease-out);
}
.link:hover,
.link:focus-visible { background-size: 100% 1px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 48px;
  padding: .75rem 1.5rem;
  border: 1.5px solid transparent;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color var(--dur) var(--ease-out),
    border-color var(--dur) var(--ease-out),
    color var(--dur) var(--ease-out),
    translate var(--dur) var(--ease-out);
}
.btn:hover { translate: 0 -2px; }

.btn--primary { background-color: var(--brand-primary); color: var(--on-brand); }
.btn--primary:hover { background-color: var(--primary-hover); }

.btn--outline { border-color: var(--brand-primary); color: var(--primary-ink); }
.btn--outline:hover { border-color: var(--primary-hover); background-color: var(--primary-tint); }

.btn--light { background-color: var(--surface); color: var(--primary-ink); }
.btn--light:hover { background-color: var(--light-hover); }

.btn--outline-light { border-color: var(--on-brand); color: var(--on-brand); }
.btn--outline-light:hover { background-color: var(--light-wash); }

.btn--block { width: 100%; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* ==========================================================================
   Small screens
   ========================================================================== */

@media (max-width: 599.98px) {
  .btn-row > .btn { flex: 1 1 100%; }
}

/* ==========================================================================
   Motion preferences — Calm mode and prefers-reduced-motion
   Nothing transitions, nothing lifts.
   ========================================================================== */

.calm *,
.calm *::before,
.calm *::after {
  transition: none !important;
  animation: none !important;
}
.calm .btn:hover { translate: none; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
  .btn:hover { translate: none; }
}
