/*
  Solomon Rise & Care — home page styles

  Colours: the "Sunrise" palette from BRAND-GUIDE.md. --sun-text is a
  slightly deeper orange for small text and links, because the guide's
  Sunrise Orange (#C75B1E) is 4.25:1 on white, just under WCAG AA (4.5:1).

  Type: Newsreader (serif) for headings, Montserrat for text.

  Motion: every animation is progressive. Elements start hidden only when
  the html element has the .js class (set in head.ejs), and everything is
  shown at once for people who ask for reduced motion.

  Layout is mobile first: base styles target a small Android phone, and
  min-width media queries scale up.
*/

:root {
  --navy: #14304f;
  --navy-deep: #0e2440;
  --sun: #c75b1e;
  --sun-text: #ad4e17;
  --sun-soft: #f4a261;
  --mist: #edf0f4;
  --paper: #ffffff;
  --text: #4a5565;
  --line: #d9dee5;

  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --gutter: 16px;
  --max: 1200px;
  --radius: 4px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  --interaction-duration: 160ms;
}

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

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--paper);
}
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--navy);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
}
h1 em, h2 em, h3 em { font-style: italic; }
p { margin: 0 0 1em; }
a { color: var(--sun-text); text-underline-offset: 0.18em; transition: text-decoration-color var(--interaction-duration); }
a:is(:hover, :focus-visible) { text-decoration-color: currentColor; }
img { max-width: 100%; height: auto; display: block; }
figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
  position: absolute; left: var(--gutter); top: -100px; z-index: 100;
  background: var(--navy); color: #fff; padding: 10px 16px;
}
.skip-link:focus { top: 8px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 700px) { :root { --gutter: 32px; } }

.section-title {
  font-size: clamp(2.1rem, 6vw, 3.6rem);
  max-width: 14em;
  margin-bottom: 0.7em;
}

figcaption {
  font-size: 0.85rem;
  color: var(--text);
  margin-top: 10px;
  padding-left: 12px;
  border-left: 2px solid var(--sun);
}

/* A brief crossfade between public pages in supporting browsers. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }

  ::view-transition-group(root) {
    animation-duration: var(--interaction-duration);
    animation-timing-function: ease-out;
  }
}

/* ---------- Buttons and links ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 50px; padding: 12px 26px;
  border-radius: var(--radius);
  font: 600 1rem/1 var(--sans);
  text-decoration: none;
  transition: transform var(--interaction-duration) var(--ease),
    background-color var(--interaction-duration), color var(--interaction-duration),
    border-color var(--interaction-duration);
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .btn:not(:disabled):hover { transform: translateY(-1px); }
}
@media (prefers-reduced-motion: no-preference) {
  .btn:not(:disabled):active { transform: scale(0.985); }
}
.btn-sun { background: var(--sun-text); color: #fff; }
.btn-sun:not(:disabled):is(:hover, :focus-visible) { background: #934110; }
.link-light {
  color: #fff; font-weight: 600; text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  padding-bottom: 2px;
}
.link-light:hover { border-bottom-color: #fff; }
.link-light span { display: inline-block; transition: transform 0.3s var(--ease); }
@media (prefers-reduced-motion: no-preference) {
  .link-light:is(:hover, :focus-visible) span { transform: translateY(2px); }
}

/* ---------- Header ---------- */

.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50;
  transition: background-color 0.35s, box-shadow 0.35s, opacity 0.6s;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 16px; }
.brand { display: block; position: relative; width: 150px; }
.logo { width: 100%; transition: opacity 0.35s; }
.over-hero:not(.is-solid) .brand { visibility: hidden; }
.logo-dark { position: absolute; inset: 0; opacity: 0; }
.is-solid .logo-light, .no-js .logo-light { opacity: 0; }
.is-solid .logo-dark, .no-js .logo-dark { opacity: 1; }

.site-nav { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.site-nav a { color: #fff; font-weight: 500; font-size: 0.95rem; text-decoration: none; transition: color 0.35s; }
.site-nav a:not(.nav-cta) { display: none; position: relative; }
.site-nav a:not(.nav-cta)::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: left;
  transition: transform 0.3s var(--ease);
}
.site-nav a:not(.nav-cta):is(:hover, :focus-visible)::after { transform: scaleX(1); }
.nav-cta {
  border-radius: 8px;
  padding: 9px 16px;
  transition: background-color 0.25s;
}
@media (min-width: 700px) {
  .brand { width: 190px; }
  .site-nav a:not(.nav-cta) { display: inline-block; }
}
.site-header.is-solid, .no-js .site-header {
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 1px 0 var(--line);
}
.is-solid .site-nav a, .no-js .site-nav a { color: var(--navy); }

.has-intro:not(.intro-landed) .site-header { opacity: 0; }

.scroll-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; }
.scroll-progress span {
  display: block; height: 100%; background: var(--sun);
  transform: scaleX(var(--progress, 0)); transform-origin: left;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  background: var(--navy-deep);
  overflow: hidden;
  color: #fff;
}
.hero-media { position: absolute; inset: 0; transform-origin: 50% 100%; will-change: transform; }
.hero-img { width: 100%; height: 100%; object-fit: cover; object-position: 68% 30%; }
.hero-media::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(0deg, rgba(14, 36, 64, 0.97) 0%, rgba(14, 36, 64, 0.77) 39%, rgba(14, 36, 64, 0) 74%),
    linear-gradient(180deg, rgba(14, 36, 64, 0.55) 0%, rgba(14, 36, 64, 0) 22%);
}
@media (min-width: 900px) {
  .hero-media::after {
    background:
      linear-gradient(90deg, rgba(14, 36, 64, 0.94) 0%, rgba(14, 36, 64, 0.73) 38%, rgba(14, 36, 64, 0) 72%),
      linear-gradient(180deg, rgba(14, 36, 64, 0.55) 0%, rgba(14, 36, 64, 0) 22%);
  }
}
.hero-dim { position: absolute; inset: 0; background: var(--navy-deep); opacity: 0; pointer-events: none; transition: opacity 1s var(--ease); }
.has-intro .hero-dim { opacity: 0.78; }
.has-intro.intro-landed .hero-dim { opacity: 0; }

.hero-content { position: relative; z-index: 2; padding-top: 108px; padding-bottom: 62px; }
@media (min-width: 900px) { .hero-content { padding-bottom: 96px; } }
.hero-brand { margin: 0 0 22px; line-height: 0; }
.hero-logo { display: block; width: min(245px, 70vw); height: auto; overflow: visible; transform-origin: center; }
.hero h1 { color: #fff; font-size: clamp(2.5rem, 6vw, 5.1rem); max-width: 15ch; margin-bottom: 0.3em; text-wrap: balance; }
.hero-info { font-size: clamp(1rem, 2vw, 1.15rem); line-height: 1.55; max-width: 30em; color: #e3e9f0; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 28px; margin-top: 26px; }

/* Info text and buttons appear as the logo lands. */
.has-intro [data-after-intro] { opacity: 0; transform: translateY(16px); }
.has-intro.intro-landed [data-after-intro] {
  opacity: 1; transform: none;
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}
.has-intro.intro-landed .hero-actions { transition-delay: 0.1s; }

/* ---------- Results ---------- */

.results {
  padding: clamp(32px, 4.5vw, 56px) 0;
  background: var(--paper);
}
.results .section-title { margin-bottom: 0.55em; }
.stats { display: grid; }
.stat {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(12px, 2vw, 24px);
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.stat-feature { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 12px 0; }
.stat-value {
  display: block;
  margin-bottom: 4px;
  color: var(--navy);
  font: 400 clamp(1.9rem, 4vw, 2.5rem)/1 var(--serif);
  font-variant-numeric: tabular-nums lining-nums;
}
.stat-feature .stat-value { color: var(--sun-text); font-size: clamp(3rem, 7vw, 4.75rem); }
.stat-label { display: block; font-size: 0.9rem; line-height: 1.4; }
.stat-feature .stat-label { font-size: clamp(0.95rem, 1.6vw, 1.05rem); }
.marks { display: block; width: 100%; max-width: 180px; height: auto; overflow: visible; }
.stat-feature .marks { max-width: none; }
.marks use { fill: var(--navy); }
.marks-drop use, .marks-bowl use { fill: var(--sun-text); }
.stat.is-counting .marks use { opacity: 0.13; transition: opacity 0.35s ease; }
.stat.is-counting .marks use.on { opacity: 1; }

.results-notes {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 20px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  font-size: 0.82rem;
}
.results-notes p { margin: 0; }
@media (min-width: 760px) {
  .stats { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); column-gap: clamp(28px, 5vw, 72px); }
  .stat-feature { grid-row: span 3; align-content: start; }
}

.impact-map { padding: clamp(40px, 6vw, 72px) 0; background: var(--mist); }
.impact-map-inner { display: grid; align-items: center; gap: 22px; }
.impact-map .section-title { margin-bottom: 0.45em; }
.impact-map h3 { font-size: 1.5rem; }
.impact-map p { max-width: 34ch; margin: 0; }
.impact-map-image { width: 100%; height: auto; }

/* Live map (MapLibre). The drawn map inside shows until the live one loads. */
.map {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  overflow: hidden;
  background: #dce6ef;
  box-shadow: 0 1px 0 var(--line), 0 18px 40px -28px rgba(14, 36, 64, 0.45);
}
@media (max-width: 599px) { .map { aspect-ratio: 4 / 3; } }
.map .impact-map-image { position: absolute; inset: 0; height: 100%; object-fit: contain; transition: opacity 0.6s ease; }
.map.is-live .impact-map-image { opacity: 0; pointer-events: none; }
.map .maplibregl-canvas { outline: none; }
.map .maplibregl-ctrl-attrib { font-size: 0.68rem; }

/* The Honiara pin: a sun with rays that pulse out, like the logo. */
.map-pin { position: relative; width: 22px; height: 22px; }
.map-pin-sun {
  position: absolute; inset: 3px;
  border-radius: 50%;
  background: var(--sun);
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(14, 36, 64, 0.35);
}
.map-pin-ray {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 2px solid var(--sun-soft);
  opacity: 0;
}
.map-pin.is-dropped { animation: pin-drop 0.7s var(--ease) both; }
.map-pin.is-dropped .map-pin-ray { animation: pin-ray 2.4s ease-out infinite; }
.map-pin.is-dropped .map-pin-ray + .map-pin-ray { animation-delay: 1.2s; }
@keyframes pin-drop {
  from { transform: translateY(-26px) scale(0.6); opacity: 0; }
  60% { transform: translateY(2px) scale(1.05); opacity: 1; }
  to { transform: none; opacity: 1; }
}
@keyframes pin-ray {
  from { transform: scale(1); opacity: 0.9; }
  to { transform: scale(3.2); opacity: 0; }
}
.map-label {
  font: 600 0.8rem/1.3 var(--sans, inherit);
  color: var(--navy);
}
.map-label span { display: block; font-weight: 400; color: var(--text); }
.map .maplibregl-popup-content { padding: 8px 12px; border-radius: 10px; box-shadow: 0 6px 18px rgba(14, 36, 64, 0.18); }
@media (prefers-reduced-motion: reduce) {
  .map-pin.is-dropped, .map-pin.is-dropped .map-pin-ray { animation: none; }
}
@media (min-width: 760px) {
  .impact-map-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); gap: clamp(30px, 6vw, 72px); }
}

/* ---------- Three pillars ---------- */

.work { padding: clamp(54px, 8vw, 104px) 0; background: var(--mist); }
.work .section-title { text-align: center; max-width: none; margin-bottom: 12px; }
.work-intro { margin: 0 auto 32px; max-width: 58ch; text-align: center; }
.pillars { display: grid; gap: 40px; }
@media (min-width: 760px) {
  .pillars { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
}
.pillar { text-align: center; }
.pillar-art-wrap {
  position: relative;
  display: grid;
  place-items: center;
  height: clamp(160px, 23vw, 220px);
  margin-bottom: 22px;
  color: var(--navy);
}
.pillar-art {
  display: block;
  width: 90%;
  max-width: 275px;
  height: 100%;
  transition: transform 240ms var(--ease);
}
@media (prefers-reduced-motion: no-preference) {
  .pillar:focus-within .pillar-art { transform: translateY(-3px); }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .pillar:hover .pillar-art { transform: translateY(-3px); }
}
.pillar-copy { max-width: 24em; margin-inline: auto; }
.pillar-name { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-bottom: 12px; }
.pillar-name a { color: inherit; text-decoration-color: var(--sun-text); }
.pillar-summary { margin-bottom: 0; }
.work-action { margin-top: clamp(28px, 5vw, 48px); text-align: center; }

/* ---------- Pillar drawings: small animations, like the logo intro ----------
   Moving shapes are marked by scripts/build-illustrations.py. Each motion
   plays while the program is hovered or a control within it is focused. */

.ill-pop { transform-box: fill-box; transform-origin: 0% 100%; }
.ill-drip { transform-box: fill-box; transform-origin: 50% 0%; }
.ill-page { transform-box: fill-box; transform-origin: 0% 100%; } /* hinge at the spine */
.ill-jolt { transform-box: fill-box; }
.ill-swing, .ill-nod, .ill-lean { transform-box: view-box; } /* turn around a point set on each shape */

.pillar:focus-within .ill-pop { animation: ill-pop 1.6s var(--ease) infinite; animation-delay: calc(var(--i) * 90ms + 0.35s); }
.pillar:focus-within .ill-swing { animation: ill-swing 1.6s cubic-bezier(0.5, 0, 0.3, 1) infinite; }
.pillar:focus-within .ill-nod { animation: ill-nod 1.6s var(--ease) infinite; }
.pillar:focus-within .ill-drip { animation: ill-drip 0.9s linear infinite; }
.pillar:focus-within .ill-lean { animation: ill-lean 1.8s ease-in-out infinite; }
.pillar:focus-within .ill-page { animation: ill-page 1.8s ease-in-out infinite; animation-delay: 0.3s; }
.pillar:focus-within .ill-jolt { animation: ill-jolt 1.6s linear infinite; }
@media (hover: hover) {
  .pillar:hover .ill-pop { animation: ill-pop 1.6s var(--ease) infinite; animation-delay: calc(var(--i) * 90ms + 0.35s); }
  .pillar:hover .ill-swing { animation: ill-swing 1.6s cubic-bezier(0.5, 0, 0.3, 1) infinite; }
  .pillar:hover .ill-nod { animation: ill-nod 1.6s var(--ease) infinite; }
  .pillar:hover .ill-drip { animation: ill-drip 0.9s linear infinite; }
  .pillar:hover .ill-lean { animation: ill-lean 1.8s ease-in-out infinite; }
  .pillar:hover .ill-page { animation: ill-page 1.8s ease-in-out infinite; animation-delay: 0.3s; }
  .pillar:hover .ill-jolt { animation: ill-jolt 1.6s linear infinite; }
}

/* Pilot drawings loop on their own while on screen (site.js adds
   .is-playing), each with a rest between plays and the three columns
   offset so they take turns. Still for reduced motion. */
.ill-flutter { transform-box: fill-box; transform-origin: 50% 0%; }
.ill-wag { transform-box: fill-box; transform-origin: 100% 100%; }
.ill-drift { transform-box: fill-box; }
.ill-wave { transform-box: fill-box; transform-origin: 50% 50%; }
.ill-bob { transform-box: fill-box; transform-origin: 50% 100%; }
.pilot-list li:nth-child(2) { --col: 1.1s; }
.pilot-list li:nth-child(3) { --col: 2.2s; }
.pilot-list .is-playing .ill-pop { animation: pilot-pop 3.3s var(--ease) infinite both; animation-delay: calc(var(--col, 0s) + var(--i) * 90ms); }
.pilot-list .is-playing .ill-nod { animation: pilot-nod 3.3s var(--ease) infinite; animation-delay: var(--col, 0s); }
.pilot-list .is-playing .ill-flutter { animation: pilot-flutter 3.3s ease-in-out infinite; animation-delay: calc(var(--col, 0s) + var(--i) * 120ms); }
.pilot-list .is-playing .ill-drift { animation: pilot-drift 3.3s ease-in-out infinite; animation-delay: calc(var(--col, 0s) + var(--i) * 160ms); }
.pilot-list .is-playing .ill-wave { animation: pilot-wave 3.3s ease-in-out infinite; animation-delay: calc(var(--col, 0s) + var(--i) * 200ms); }
.pilot-list .is-playing .ill-bob { animation: pilot-bob 3.3s ease-in-out infinite; animation-delay: calc(var(--col, 0s) + 0.1s); }
.pilot-list .is-playing .ill-wag { animation: pilot-wag 3.3s ease-in-out infinite; animation-delay: calc(var(--col, 0s) + 0.15s); }
@media (prefers-reduced-motion: reduce) {
  .pilot-list .ill-pop, .pilot-list .ill-nod, .pilot-list .ill-flutter, .pilot-list .ill-wag, .pilot-list .ill-drift, .pilot-list .ill-wave, .pilot-list .ill-bob { animation: none !important; }
}
@keyframes pilot-flutter { /* ripple, then rest */
  0%, 50%, 100% { transform: rotate(0deg); }
  14% { transform: rotate(-7deg); }
  28% { transform: rotate(4deg); }
  40% { transform: rotate(-2deg); }
}
@keyframes pilot-wag {
  0%, 50%, 100% { transform: rotate(0deg); }
  12% { transform: rotate(-9deg); }
  26% { transform: rotate(4deg); }
  38% { transform: rotate(-3deg); }
}
@keyframes pilot-nod {
  0%, 45%, 100% { transform: rotate(0deg); }
  15% { transform: rotate(-6deg); }
  30% { transform: rotate(3deg); }
}
@keyframes pilot-drift { /* float up and fade, come back in, rest */
  0%, 55%, 100% { opacity: 1; transform: none; }
  28% { opacity: 0.25; transform: translate(6px, -14px); }
  30% { opacity: 0; transform: translate(0, 8px); }
}
@keyframes pilot-wave { /* roll side to side, then rest */
  0%, 60%, 100% { transform: none; }
  20% { transform: translate(-8px, 2px) rotate(-1.5deg); }
  40% { transform: translate(6px, -2px) rotate(1deg); }
}
@keyframes pilot-bob { /* rise and dip with the waves, then rest */
  0%, 60%, 100% { transform: none; }
  20% { transform: translateY(-5px) rotate(-1.5deg); }
  40% { transform: translateY(3px) rotate(1deg); }
}
@keyframes pilot-pop { /* pop out, hold, fade before the next play */
  0%, 6% { opacity: 0; transform: scale(0.3); }
  18% { opacity: 1; transform: scale(1.08); }
  26%, 82% { opacity: 1; transform: none; }
  96%, 100% { opacity: 0; transform: scale(0.9); }
}
@keyframes ill-pop {
  0%, 15% { opacity: 0; transform: scale(0.3); }
  35% { opacity: 1; transform: scale(1.08); }
  50%, 100% { opacity: 1; transform: none; }
}
@keyframes ill-swing { /* lift a little, strike down, settle */
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-6deg); }
  45% { transform: rotate(7deg); }
  60% { transform: rotate(5deg); }
}
@keyframes ill-page { /* lift the page like it's being turned */
  0%, 70%, 100% { transform: rotate(0deg); }
  30% { transform: rotate(-7deg); }
  45% { transform: rotate(-5deg); }
}
@keyframes ill-jolt { /* dip when the hammer lands (the swing strikes at ~45%) */
  0%, 40%, 58%, 100% { transform: none; }
  46% { transform: translateY(5px); }
  51% { transform: translateY(-1px); }
}
@keyframes ill-nod {
  0%, 100% { transform: rotate(0deg); }
  30% { transform: rotate(-6deg); }
  55% { transform: rotate(3deg); }
}
@keyframes ill-drip {
  0% { transform: translateY(-18%) scaleY(0.6); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translateY(22%) scaleY(1); opacity: 0; }
}
@keyframes ill-lean {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(3deg); }
}

/* ---------- Pillar pages (placeholders) ---------- */

.pillar-page { padding: 120px 0 96px; }
.pillar-page-inner { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .pillar-page-inner { grid-template-columns: 6fr 5fr; gap: 72px; } }
.pillar-back { display: inline-block; margin-bottom: 18px; text-decoration: none; font-weight: 500; }
.pillar-page-title { font-size: clamp(2.4rem, 6vw, 4rem); }
.pillar-page-stat strong { font-family: var(--serif); font-weight: 400; font-size: 3rem; color: var(--sun-text); margin-right: 8px; vertical-align: -0.1em; }
.pillar-page-stat { color: var(--navy); }
.pillar-page-lede { font-family: var(--serif); font-size: 1.35rem; line-height: 1.4; color: var(--navy); }
.pillar-page-points li { position: relative; padding: 11px 0 11px 26px; border-top: 1px solid var(--line); }
.pillar-page-points li::before { content: ''; position: absolute; left: 0; top: 1.3em; width: 13px; height: 1.5px; background: var(--sun); }
.pillar-page-note { margin-top: 18px; font-size: 0.9rem; }
.pillar-page-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 24px; }
.pillar-page-img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 10px; }

/* ---------- Our model ---------- */

.story { padding: clamp(54px, 8vw, 104px) 0; }
.story-inner { display: grid; gap: 24px; }
.story-heading .section-title { margin-bottom: 0; max-width: 19ch; }
.story-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: center 42%; }
.model-steps { counter-reset: model-step; }
.model-steps li { position: relative; padding: 0 0 20px 32px; counter-increment: model-step; }
.model-steps li::before {
  content: counter(model-step);
  position: absolute;
  z-index: 1;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--sun-text);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
}
.model-steps li:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 12px;
  bottom: -10px;
  left: 10px;
  border-left: 1px solid var(--sun);
}
@media (prefers-reduced-motion: no-preference) {
  .model-steps.steps-motion li:not(:last-child)::after {
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.32s var(--ease);
  }
  .model-steps.steps-motion.is-visible li:not(:last-child)::after { transform: scaleY(1); }
  .model-steps.steps-motion li:nth-child(2)::after { transition-delay: 0.30s; }
}
.model-steps h3, .story-pilots h3 { margin-bottom: 5px; font-size: 1.5rem; }
.model-steps p, .pilot-list p { margin: 0; }
.story-pilots h3 { margin-bottom: 14px; }
.pilot-list { display: grid; gap: 12px 24px; }
.pilot-list li { padding-top: 12px; border-top: 1px solid var(--line); font-size: 0.95rem; }
.pilot-list strong { color: var(--navy); }
.pilot-status { display: block; color: var(--sun-text); font-size: 0.82rem; }
@media (min-width: 760px) {
  .pilot-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  .story-inner { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); column-gap: clamp(36px, 6vw, 72px); }
  .story-heading, .story-pilots { grid-column: 1 / -1; }
  .story-img { aspect-ratio: 5 / 4; }
  .model-steps { align-self: center; }
}

/* Pilots: three centred columns of drawing, name and description. The
   drawings share one height so the names line up; HER Project (the only
   one with a status line) sits in the middle so the outer two stay even. */
.story-pilots > h3 { text-align: center; margin-bottom: 18px; }
.pilot-list li { display: grid; justify-items: center; align-content: start; padding: 28px 8px 0; text-align: center; }
.pilot-art-wrap { grid-row: 1; display: flex; align-items: flex-end; justify-content: center; height: 140px; margin-bottom: 16px; color: var(--navy); }
.pilot-art { display: block; width: auto; max-width: 100%; height: 100%; overflow: visible; }
.pilot-list strong { grid-row: 2; display: block; font: 500 1.35rem/1.25 var(--serif); }
.pilot-list .pilot-status { grid-row: 3; margin-top: 4px; font: italic 400 0.98rem/1.4 var(--serif); }
.pilot-list p { grid-row: 4; max-width: 30ch; margin: 10px 0 0; font-size: 0.95rem; line-height: 1.6; }

/* ---------- Intro: the hero logo draws itself as a sunrise ----------
   Plays only when the html element has .has-intro (first visit in a
   session, from the top of the home page). The drawing overlaps the
   unchanged 1.4 s hand wave, then the logo glides while the copy fades in. */

/* The waving arm is left out: its rotation uses its own shoulder pivot. */
.intro-wave, .intro-land, .intro-sun, .intro-ray, .intro-word { transform-box: fill-box; transform-origin: center; }
.has-intro .intro-wave { opacity: 0; animation: intro-wave 0.5s var(--ease) forwards; animation-delay: calc(var(--i) * 40ms); }
.has-intro .intro-land { opacity: 0; animation: intro-rise 0.45s var(--ease) 0.05s forwards; }
.has-intro .intro-sun { transform: translateY(70%); animation: intro-sun 0.65s var(--ease) 0.2s forwards; }
.has-intro .intro-ray { opacity: 0; transform: scale(0.2); animation: intro-ray 0.45s var(--ease) forwards; animation-delay: calc(650ms + var(--i) * 40ms); }
.has-intro .intro-divider { transform-box: fill-box; transform-origin: 50% 0%; transform: scaleY(0); animation: intro-sun 0.4s var(--ease) 0.65s forwards; }
.has-intro .intro-word { opacity: 0; transform: translateY(30%); animation: intro-rise 0.55s var(--ease) forwards; animation-delay: calc(770ms + var(--i) * 55ms); }

@keyframes intro-wave { from { opacity: 0; transform: translateX(-14%); } to { opacity: 1; transform: none; } }
@keyframes intro-rise { from { opacity: 0; transform: translateY(30%); } to { opacity: 1; transform: none; } }
@keyframes intro-sun { to { transform: none; } }
@keyframes intro-ray { to { opacity: 1; transform: none; } }

/* ---------- Team ---------- */

.team { padding: clamp(40px, 6vw, 80px) 0; background: var(--mist); }
.team-inner { display: grid; gap: 24px; align-items: center; }
.team-text { max-width: 42ch; }
.team-text .section-title { margin-bottom: 0.35em; text-wrap: balance; }
.team-img { width: 100%; height: auto; border-radius: 8px; }
.team-figure figcaption { padding-left: 0; border-left: 0; }
@media (min-width: 850px) {
  .team-inner { grid-template-columns: minmax(0, 1.14fr) minmax(0, 0.86fr); gap: clamp(32px, 6vw, 80px); }
  .team-text { grid-area: 1 / 2; }
  .team-figure { grid-area: 1 / 1; }
}

/* ---------- Get involved: "I'm a..." picker ---------- */

.involved { padding: clamp(54px, 8vw, 104px) 0; background: var(--navy); color: #d5deea; }
.section-title-light { color: #fff; }
.path-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 36px; }
.path-lead { font-family: var(--serif); font-size: 1.5rem; color: #fff; margin-right: 6px; }
.path-chip {
  padding: 10px 20px; border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  background: transparent; color: #fff;
  font: 500 1rem var(--sans); cursor: pointer;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s, transform 0.3s var(--ease);
}
.path-chip:hover { border-color: #fff; transform: translateY(-2px); }
.path-chip[aria-selected='true'] { background: var(--sun-soft); border-color: var(--sun-soft); color: var(--navy-deep); }
.no-js .path-chips { display: none; }

.path-panels { display: grid; max-width: 760px; }
.path-panel { padding-top: 28px; border-top: 1px solid rgba(255, 255, 255, 0.18); }
.no-js .path-panel + .path-panel { margin-top: 36px; }
.js .path-panel {
  grid-area: 1 / 1;
  opacity: 0; visibility: hidden; transform: translateY(14px);
  transition: opacity 0.35s, transform 0.5s var(--ease), visibility 0s linear 0.35s;
}
.js .path-panel.is-active {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity 0.5s var(--ease) 0.1s, transform 0.6s var(--ease) 0.1s;
}
.path-who { font-size: 0.9rem; color: var(--sun-soft); margin-bottom: 6px; }
.path-title { color: #fff; font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 0.3em; }
.path-text { font-size: 1.1rem; max-width: 34em; }
.path-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 22px; }

.btn-ghost { border: 1.5px solid rgba(255, 255, 255, 0.7); color: #fff; }
.btn-ghost:is(:hover, :focus-visible) { background: #fff; color: var(--navy); }
.btn-outline { border: 1.5px solid var(--navy); color: var(--navy); }
.btn-outline:is(:hover, :focus-visible) { background: var(--navy); color: #fff; }
button.btn { cursor: pointer; border: 0; }
button.btn.btn-ghost, button.btn.btn-outline { border: 1.5px solid; }

/* ---------- Donate tab and panel ---------- */

.donate-tab {
  position: fixed; z-index: 60; right: 16px; bottom: 16px;
  padding: 13px 22px; border: 0; border-radius: 999px;
  background: var(--sun-text); color: #fff;
  font: 600 1rem var(--sans); cursor: pointer;
  box-shadow: 0 8px 24px rgba(14, 36, 64, 0.3);
  transition: transform 0.35s var(--ease), background-color 0.3s, opacity 0.4s;
}
.donate-tab:is(:hover, :focus-visible) { background: #934110; }
.no-js .donate-tab { display: none; }
@media (min-width: 700px) {
  /* On larger screens: a tab on the right edge, written sideways. */
  .donate-tab {
    right: 0; bottom: auto; top: 50%;
    padding: 18px 12px; border-radius: 8px 0 0 8px;
    writing-mode: vertical-rl;
    transform: translate(4px, -50%);
    letter-spacing: 0.04em;
  }
  .donate-tab:hover { transform: translate(0, -50%); }
}
.has-intro:not(.intro-landed) .donate-tab, .donate-open .donate-tab { opacity: 0; pointer-events: none; }

.donate-backdrop {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(14, 36, 64, 0.55);
  opacity: 0; transition: opacity 0.4s;
}
.donate-panel {
  position: fixed; z-index: 80; top: 0; right: 0; bottom: 0;
  width: min(420px, 100%);
  overflow-y: auto;
  padding: 56px 32px 32px;
  background: var(--paper);
  box-shadow: -12px 0 40px rgba(14, 36, 64, 0.25);
  transform: translateX(100%);
  transition: transform 0.5s var(--ease);
}
.donate-open .donate-backdrop { opacity: 1; }
.donate-open .donate-panel { transform: none; }
.donate-close {
  position: absolute; top: 14px; right: 14px;
  width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: var(--mist); color: var(--navy);
  font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.donate-mark { width: 84px; margin-bottom: 18px; }
.donate-panel h2 { font-size: 2rem; }
.donate-text { margin-bottom: 22px; }
.donate-amounts { border: 0; margin: 0 0 20px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.donate-amount input { position: absolute; opacity: 0; }
.donate-amount span {
  display: block; padding: 14px; text-align: center;
  border: 1.5px solid var(--line); border-radius: 8px;
  font-family: var(--serif); font-size: 1.4rem; color: var(--navy);
  cursor: pointer; transition: background-color 0.25s, border-color 0.25s, color 0.25s;
}
.donate-amount input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.donate-amount input:focus-visible + span { outline: 3px solid var(--sun); outline-offset: 2px; }
.donate-go { width: 100%; }
.donate-go:disabled { background: var(--mist); color: var(--text); cursor: default; transform: none; }
.donate-note { font-size: 0.8rem; margin-top: 12px; }

/* ---------- Footer ---------- */

.site-footer { background: var(--navy-deep); color: #b9c5d4; padding: 56px 0 40px; font-size: 0.92rem; }
.site-footer a { color: #fff; }
.footer-mission { font-family: var(--serif); }

/* ---------- 404 ---------- */

.not-found { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 24px; text-align: center; }

/* ---------- Motion ---------- */

/* Sections fade up as they scroll into view (site.js adds .is-visible). */
.js [data-reveal] {
  opacity: 0; transform: translateY(12px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
  transition-delay: var(--delay, 0ms);
}
.js [data-reveal].is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
  .ill-pop { opacity: 1 !important; }
}


/* ---------- Public contact panel ---------- */

.contact-panel {
  position: fixed;
  z-index: 55;
  left: 16px;
  bottom: 16px;
  width: max-content;
  max-width: calc(100vw - 32px);
  color: #fff;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(14, 36, 64, 0.25);
  font-size: 0.9rem;
}

.contact-panel summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  min-height: 48px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  background: var(--navy);
  border-radius: 999px;
  transition: background-color 0.2s;
}
.contact-panel summary:is(:hover, :focus-visible) { background: var(--navy-deep); }

.contact-panel summary::-webkit-details-marker {
  display: none;
}

.contact-toggle {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  margin-left: auto;
  background: rgb(255 255 255 / 0.16);
  border-radius: 50%;
  line-height: 1;
}

.contact-toggle::before {
  content: '+';
  font-size: 1.2rem;
}

.contact-panel[open] .contact-toggle::before {
  content: '−';
}

.contact-panel[open] {
  border-radius: 14px;
}

.contact-panel-body {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  box-sizing: border-box;
  width: min(320px, calc(100vw - 24px));
  padding: 16px;
  background: var(--paper);
  color: var(--navy);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(14, 36, 64, 0.18);
  overflow-y: auto;
  overflow-wrap: anywhere;
  max-height: min(480px, calc(100vh - 110px));
  max-height: min(480px, calc(100dvh - 110px));
}

.contact-panel-body dl {
  margin: 0;
}

.contact-panel-body dl > div {
  margin-bottom: 12px;
}

.contact-panel-body dt {
  font-weight: 700;
}

.contact-panel-body dd {
  margin: 3px 0 0;
}

.contact-inquiry {
  display: block;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  font-weight: 600;
}

@media (prefers-reduced-motion: no-preference) {
  .contact-toggle { transition: transform 0.2s var(--ease); }
  .contact-panel summary:is(:hover, :focus-visible) .contact-toggle { transform: scale(1.12); }
  .contact-panel[open] .contact-panel-body { animation: contact-in 0.22s var(--ease) both; }
  @keyframes contact-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: none; }
  }
}

/* Hide the contact panel during the intro
   and when the donation panel is open. */

.has-intro:not(.intro-landed) .contact-panel,
.donate-open .contact-panel {
  visibility: hidden;
}

/* Mobile contact panel */

@media (max-width: 699px) {
  .contact-panel {
    left: 12px;
    bottom: 16px;
    max-width: calc(100vw - 24px);
  }

  .contact-panel-body {
    max-height: min(480px, calc(100vh - 110px));
    max-height: min(480px, calc(100dvh - 110px));
  }
}
