/* ==========================================================================
   PATCH — Programme Assistance Technique des Chrétiens Haïtiens
   Design system. One stylesheet, five pages.

   Palette is the Haitian flag on cool ledger paper — a nod to the literacy
   and numeracy training that sits at the centre of the programme.
   The plait (assets/img/plait.svg) is the signature device: two strands,
   weak alone, strong woven. L'union fait la force.
   ========================================================================== */

:root {
  --ink:        #111A2E;  /* deep navy-black — text, footer ground           */
  --ink-soft:   #46506A;  /* secondary text                                  */
  --paper:      #EEF1F4;  /* pale cool ledger paper — page ground            */
  --paper-lift: #F7F9FB;  /* raised panels                                   */
  --drapo-blue: #00209F;  /* Haitian flag blue                               */
  --drapo-red:  #D21034;  /* Haitian flag red                                */
  --straw:      #A8761C;  /* Artibonite straw — figures only                 */
  --rule:       #C8D0DA;  /* ledger rule                                     */

  --display: "Jost", "Futura", "Century Gothic", system-ui, sans-serif;
  --body: "Source Serif 4", Georgia, "Times New Roman", serif;

  --measure: 66ch;
  --shell: 1180px;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --section-y: clamp(4rem, 9vw, 8rem);
}

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

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

/* clear the sticky masthead when jumping to an anchor */
[id] { scroll-margin-top: 6.5rem; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }

/* --------------------------------------------------------------- type ---- */

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: clamp(2.6rem, 7vw, 5.25rem); font-weight: 700; line-height: 0.96; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.75rem); }
.h1--sub { font-size: clamp(2.1rem, 5vw, 3.5rem); letter-spacing: -0.025em; }
h3 { font-size: clamp(1.1rem, 1.6vw, 1.3rem); letter-spacing: -0.005em; }

p { margin: 0 0 1.15em; max-width: var(--measure); }
p:last-child { margin-bottom: 0; }

a { color: var(--drapo-blue); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--drapo-red); }

strong { font-weight: 600; }

.eyebrow {
  display: block;
  font-family: var(--display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--straw);
  margin: 0 0 1.25rem;
}

.lead {
  font-size: clamp(1.1rem, 1.9vw, 1.375rem);
  line-height: 1.55;
  color: var(--ink);
}

.fine { font-size: 0.875rem; line-height: 1.6; color: var(--ink-soft); }

/* ------------------------------------------------------------ skeleton --- */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.band { padding-block: var(--section-y); }
.band--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }
.band--lift { background: var(--paper-lift); border-block: 1px solid var(--rule); }

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

/* ---------------------------------------------- the plait: the signature -- */

.plait {
  height: 24px;
  background-image: url("../img/plait.svg");
  background-repeat: repeat-x;
  background-position: left center;
  background-size: auto 24px;
}
.plait--hero { height: 46px; background-size: auto 46px; }
.plait--rule { height: 22px; background-size: auto 22px; }

/* Weaving reveal: the braid draws itself left to right on load. */
.plait--hero { clip-path: inset(0 100% 0 0); animation: weave 1.5s cubic-bezier(.22,.61,.36,1) .35s forwards; }
@keyframes weave { to { clip-path: inset(0 0 0 0); } }

/* ------------------------------------------------------------- header ---- */

.masthead {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

.masthead__inner {
  display: flex; align-items: center; gap: 1.5rem;
  min-height: 5rem;
}

.lockup { display: flex; align-items: center; gap: 0.875rem; text-decoration: none; color: inherit; margin-right: auto; }
.lockup img { width: 38px; height: auto; display: block; }
.lockup__name {
  display: block;
  font-family: var(--display); font-weight: 700;
  font-size: 1.3rem; letter-spacing: 0.1em; line-height: 1;
}
.lockup__full {
  display: block;
  font-family: var(--display); font-weight: 400;
  font-size: 0.6rem; letter-spacing: 0.085em; text-transform: uppercase;
  color: var(--ink-soft); margin-top: 0.3rem;
}

.nav { display: flex; align-items: center; gap: clamp(1rem, 2.2vw, 2rem); }
.nav a {
  position: relative;
  font-family: var(--display); font-weight: 500; font-size: 0.9rem;
  letter-spacing: 0.02em; color: var(--ink); text-decoration: none;
  padding-block: 0.65rem;
}
.nav a:hover { color: var(--drapo-blue); }
/* Active page marker: the flag split, blue into red. The plait was tried
   here first but is illegible below about 16px — it stays in the hero and
   the section rules where its weave can actually be read. */
.nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(to right, var(--drapo-blue) 50%, var(--drapo-red) 50%);
}

.nav__give {
  font-family: var(--display); font-weight: 600; font-size: 0.85rem;
  letter-spacing: 0.06em; text-transform: uppercase;
  background: var(--drapo-red); color: var(--paper-lift);
  padding: 0.7rem 1.15rem; border-radius: 2px; text-decoration: none;
}
.nav__give:hover { background: var(--ink); color: var(--paper-lift); }

.burger {
  display: none; background: none; border: 1px solid var(--rule);
  border-radius: 2px; padding: 0.55rem 0.7rem; cursor: pointer; color: var(--ink);
}
.burger span { display: block; width: 20px; height: 2px; background: currentColor; }
.burger span + span { margin-top: 4px; }

@media (max-width: 860px) {
  .lockup__full { display: none; }
  .burger { display: block; }
  .nav {
    position: fixed; inset: 5rem 0 auto;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper-lift);
    border-bottom: 1px solid var(--rule);
    padding: 0.5rem var(--gutter) 1.5rem;
  }
  .nav[hidden] { display: none; }
  .nav a { padding-block: 0.95rem; border-bottom: 1px solid var(--rule); font-size: 1.0625rem; }
  .nav a[aria-current="page"]::after { height: 3px; }
  .nav__give { text-align: center; margin-top: 1rem; border: 0; }
}

/* --------------------------------------------------------------- hero ---- */

/* Bottom padding is 0: the band that follows supplies the gap, so the two
   do not stack into a dead stripe. */
.hero { padding-block: clamp(3.5rem, 8vw, 7rem) 0; }
.hero__motto { max-width: 18ch; }
.hero__motto em { font-style: normal; color: var(--drapo-blue); }
.hero__translate {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(0.95rem, 1.5vw, 1.1rem); letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-soft);
  margin: 1.5rem 0 0;
}
.hero__weave { margin: clamp(2rem, 4vw, 3rem) 0; }
.hero__body { max-width: 56ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: center; margin-top: 2.25rem; }

/* ------------------------------------------------------------ buttons ---- */

.btn {
  display: inline-block;
  font-family: var(--display); font-weight: 600; font-size: 0.9rem;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 1rem 1.6rem; border-radius: 2px; text-decoration: none;
  border: 1.5px solid transparent; cursor: pointer;
}
.btn--solid { background: var(--drapo-red); color: var(--paper-lift); }
.btn--solid:hover { background: var(--ink); color: var(--paper-lift); }
.btn--line { border-color: var(--ink); color: var(--ink); background: none; }
.btn--line:hover { background: var(--ink); color: var(--paper-lift); }

.textlink {
  font-family: var(--display); font-weight: 600; font-size: 0.9rem;
  letter-spacing: 0.04em; text-decoration: none; color: var(--drapo-blue);
  border-bottom: 1.5px solid currentColor; padding-bottom: 2px;
}
.textlink:hover { color: var(--drapo-red); }

/* --------------------------------------------------------------- grids --- */

.strands { display: grid; gap: 0; margin-top: clamp(2.5rem, 5vw, 4rem); }
@media (min-width: 820px) { .strands { grid-template-columns: repeat(3, 1fr); } }

.strand { padding: 2rem 0; border-top: 1px solid var(--rule); }
@media (min-width: 820px) {
  .strand { padding: 0 2.25rem; border-top: 0; border-left: 1px solid var(--rule); }
  .strand:first-child { padding-left: 0; border-left: 0; }
  .strand:last-child { padding-right: 0; }
}
.strand h3 { margin-bottom: 0.75rem; }
.strand p { max-width: none; }

/* figures sit in a ledger row, not a hero stat block */
.ledger { border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule); margin-top: 2.5rem; }
.ledger__row { display: grid; gap: 0.25rem 2rem; padding: 1.5rem 0; border-bottom: 1px solid var(--rule); }
.ledger__row:last-child { border-bottom: 0; }
@media (min-width: 720px) {
  .ledger__row { grid-template-columns: 9rem 1fr; align-items: baseline; }
}
.ledger__figure {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(2rem, 4.5vw, 2.9rem); line-height: 1;
  letter-spacing: -0.02em; color: var(--straw);
  font-variant-numeric: tabular-nums;
}
.ledger__note { max-width: 52ch; }
.ledger__note strong { font-family: var(--display); font-weight: 600; letter-spacing: -0.01em; }

/* two places, set as type — no invented map */
.places { display: grid; gap: clamp(2rem, 4vw, 3.5rem); margin-top: clamp(2.5rem, 5vw, 3.5rem); }
@media (min-width: 760px) { .places { grid-template-columns: 1fr 1fr; } }
.place { border-left: 3px solid var(--drapo-blue); padding-left: 1.5rem; }
.place:last-child { border-left-color: var(--drapo-red); }
.place__dept {
  font-family: var(--display); font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft);
  display: block; margin-bottom: 0.4rem;
}
.place h3 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); margin-bottom: 0.75rem; }

/* board */
.roster { list-style: none; margin: clamp(2.5rem,5vw,3.5rem) 0 0; padding: 0; display: grid; gap: 0; }
@media (min-width: 680px) { .roster { grid-template-columns: 1fr 1fr; column-gap: clamp(2rem,5vw,4rem); } }
.roster li { padding: 1.35rem 0; border-top: 1px solid var(--rule); }
.roster__name { font-family: var(--display); font-weight: 600; font-size: 1.1rem; display: block; }
.roster__role {
  font-family: var(--display); font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft);
  display: block; margin-top: 0.25rem;
}

/* prose column for long copy */
.prose { max-width: var(--measure); }
.prose h3 { margin-top: 2.5rem; margin-bottom: 0.75rem; }
.prose h3:first-child { margin-top: 0; }

.callout {
  background: var(--paper-lift); border: 1px solid var(--rule);
  border-left: 3px solid var(--straw);
  padding: clamp(1.5rem, 3vw, 2rem); border-radius: 2px;
  margin-top: 2.5rem;
}
.callout p { max-width: 58ch; }

/* ------------------------------------------------------- contact / give -- */

.pair { display: grid; gap: clamp(2.5rem, 5vw, 4rem); align-items: start; }
@media (min-width: 900px) { .pair { grid-template-columns: 1fr 1fr; } }

.dl { margin: 0; }
.dl div { padding: 1.15rem 0; border-top: 1px solid var(--rule); }
.dl dt {
  font-family: var(--display); font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft);
  margin-bottom: 0.35rem;
}
.dl dd { margin: 0; font-size: 1.0625rem; }
.dl dd a { font-family: var(--display); font-weight: 500; }

.field { display: block; margin-bottom: 1.25rem; }
.field > span {
  display: block;
  font-family: var(--display); font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft);
  margin-bottom: 0.45rem;
}
.field input, .field textarea, .field select {
  width: 100%; font-family: var(--body); font-size: 1rem; color: var(--ink);
  background: var(--paper-lift); border: 1px solid var(--rule); border-radius: 2px;
  padding: 0.8rem 0.9rem;
}
.field textarea { min-height: 9rem; resize: vertical; }
.field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible {
  outline: 2px solid var(--drapo-blue); outline-offset: 1px; border-color: var(--drapo-blue);
}

/* ------------------------------------------------------------- footer ---- */

.foot { background: var(--ink); color: #CBD3E0; padding-block: clamp(3rem, 6vw, 4.5rem) 2rem; }
.foot a { color: #FFF; }
.foot a:hover { color: #F0A0AE; }
.foot__grid { display: grid; gap: clamp(2rem, 4vw, 3rem); }
@media (min-width: 820px) { .foot__grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.foot h2 {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.16em;
  text-transform: uppercase; color: #7C8AA8; margin-bottom: 1rem;
}
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin-bottom: 0.6rem; }
.foot li a { font-family: var(--display); font-weight: 500; font-size: 0.95rem; text-decoration: none; }
.foot li a:hover { text-decoration: underline; }
.foot__lockup { display: flex; align-items: center; gap: 0.875rem; margin-bottom: 1.25rem; }
.foot__lockup img { width: 34px; }
.foot__lockup b {
  font-family: var(--display); font-weight: 700; font-size: 1.3rem;
  letter-spacing: 0.1em; color: #FFF;
}
.foot p { font-size: 0.9rem; line-height: 1.65; max-width: 42ch; }
.foot__legal {
  margin-top: clamp(2.5rem, 5vw, 3.5rem); padding-top: 1.5rem;
  border-top: 1px solid #28334F; font-size: 0.8rem; color: #7C8AA8;
}
.foot__legal p { max-width: 80ch; margin-bottom: 0.6rem; }

/* ------------------------------------------------------ interaction ------ */

:focus-visible { outline: 2px solid var(--drapo-blue); outline-offset: 2px; }

.skip {
  position: absolute; left: 50%; translate: -50% -150%;
  z-index: 100; background: var(--ink); color: #FFF;
  padding: 0.75rem 1.25rem; border-radius: 0 0 2px 2px; text-decoration: none;
  font-family: var(--display); font-size: 0.85rem;
}
.skip:focus { translate: -50% 0; color: #FFF; }

/* Scroll reveal is opt-in: the hidden state only exists once site.js has
   added .reveals-armed to <html>. Without JavaScript, or if the observer
   never fires, every .reveal block is simply visible. Content is never
   hidden behind a script. */
.reveals-armed .reveal {
  opacity: 0; translate: 0 18px;
  transition: opacity .7s ease, translate .7s cubic-bezier(.22,.61,.36,1);
}
.reveals-armed .reveal.is-in { opacity: 1; translate: 0 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .plait--hero { animation: none; clip-path: none; }
  .reveals-armed .reveal,
  .reveals-armed .reveal.is-in { opacity: 1; translate: 0 0; transition: none; }
}
