/* ————————————————————————————————————————————————
   The Literacy Circle — West Africa
   Book-page layout system · terracotta / indigo / aged paper / ink
   ———————————————————————————————————————————————— */

@font-face {
  font-family: 'Literata';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/literata.woff2') format('woff2');
}
@font-face {
  font-family: 'Literata';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/literata-italic.woff2') format('woff2');
}
/* Ŋ ŋ Ɔ Ɛ ɔ ɛ — West African orthography glyphs, subset separately
   (Google's latin slice omits them). Declared last so it wins the range. */
@font-face {
  font-family: 'Literata';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/literata-glyphs.woff2') format('woff2');
  unicode-range: U+14A-14B, U+186, U+190, U+254, U+25B;
}
@font-face {
  font-family: 'Public Sans';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('../fonts/publicsans.woff2') format('woff2');
}

:root {
  --paper: #F5EDDF;
  --paper-deep: #EDE1CB;
  --paper-dim: #E7D9BF;
  --ink: #221F1A;
  --ink-soft: #5A5348;
  --ink-faint: rgba(34, 31, 26, 0.16);
  --terra: #C4552A;
  --terra-deep: #9E3F1B;
  --indigo: #2A2F6B;
  --indigo-deep: #1F2350;
  --apricot: #F2B49A;
  --serif: 'Literata', 'Iowan Old Style', Georgia, serif;
  --sans: 'Public Sans', 'Helvetica Neue', Arial, sans-serif;
  --measure: 41rem;
  --wide: 72rem;
  --dur: 0.6s;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: 1.0625rem;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
/* aged-paper grain */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.13 0 0 0 0 0.11 0 0 0 0 0.08 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}
body > * { position: relative; z-index: 1; }

::selection { background: var(--terra); color: var(--paper); }
.on-indigo ::selection, footer ::selection { background: var(--apricot); color: var(--ink); }

:focus-visible {
  outline: 2.5px solid var(--terra-deep);
  outline-offset: 3px;
  border-radius: 2px;
}
.on-indigo :focus-visible, footer :focus-visible { outline-color: var(--apricot); }

@supports (scrollbar-color: red blue) {
  html { scrollbar-color: var(--terra) var(--paper-deep); scrollbar-width: thin; }
}

a { color: var(--indigo); text-decoration-color: rgba(42, 47, 107, 0.35); text-underline-offset: 0.2em; transition: color 0.2s, text-decoration-color 0.2s; }
a:hover { color: var(--terra-deep); text-decoration-color: var(--terra); }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--ink); color: var(--paper);
  font-family: var(--sans); font-size: 0.85rem; padding: 0.7em 1.2em;
  text-decoration: none; border-radius: 0 0 6px 6px;
  transition: top 0.2s;
}
.skip:focus { top: 0; color: var(--paper); }

/* ————— reading progress ————— */
.progress {
  position: fixed; top: 0; left: 0; z-index: 60;
  height: 3px; width: 100%; background: transparent;
  transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--terra), var(--terra-deep));
}

/* ————— header ————— */
.site-head {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.9rem clamp(1.1rem, 4vw, 2.6rem);
  transition: background 0.35s, box-shadow 0.35s, padding 0.35s;
}
.site-head.scrolled {
  background: rgba(245, 237, 223, 0.92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 var(--ink-faint);
  padding-top: 0.6rem; padding-bottom: 0.6rem;
}
.wordmark {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--serif); font-weight: 600; font-size: 1.02rem;
  letter-spacing: 0.01em; color: var(--ink); text-decoration: none;
  white-space: nowrap;
}
.wordmark:hover { color: var(--terra-deep); }
.wordmark svg { flex: none; }
.wordmark .ring-dot { transition: transform 0.4s var(--ease); transform-origin: 14px 14px; }
.wordmark:hover .ring-dot { transform: rotate(120deg); }

.site-nav { display: flex; align-items: center; gap: clamp(0.9rem, 2vw, 1.6rem); }
.site-nav a {
  font-family: var(--sans); font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-soft); text-decoration: none;
  padding: 0.35em 0.1em; position: relative;
}
.site-nav a::after {
  content: ''; position: absolute; left: 0; right: 100%; bottom: 0;
  height: 2px; background: var(--terra); transition: right 0.28s var(--ease);
}
.site-nav a:hover { color: var(--ink); }
.site-nav a:hover::after { right: 0; }
.site-nav a.give-link {
  color: var(--paper); background: var(--terra-deep);
  padding: 0.6em 1.15em; border-radius: 999px;
  transition: background 0.2s, transform 0.2s;
}
.site-nav a.give-link::after { display: none; }
.site-nav a.give-link:hover { background: var(--ink); transform: translateY(-1px); }
@media (max-width: 860px) { .site-nav a.hide-m { display: none; } }

/* ————— shared section chrome ————— */
main { display: block; }
section { position: relative; }
.page { max-width: var(--measure); margin-inline: auto; padding-inline: clamp(1.2rem, 5vw, 2rem); }
.wide { max-width: var(--wide); margin-inline: auto; padding-inline: clamp(1.2rem, 5vw, 2.5rem); }

.chapter-head { text-align: center; margin-bottom: clamp(2.2rem, 5vw, 3.4rem); }
.kicker {
  font-family: var(--sans); font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.28em; text-transform: uppercase; color: var(--terra-deep);
  display: block; margin-bottom: 1.1rem;
}
.on-indigo .kicker { color: var(--apricot); }
.chapter-title {
  font-size: clamp(1.9rem, 4.4vw, 3rem);
  font-weight: 550; line-height: 1.14; letter-spacing: -0.012em;
  text-wrap: balance;
}
.ornament { display: block; margin: 1.5rem auto 0; width: 168px; height: 12px; color: var(--terra); }
.on-indigo .ornament { color: var(--apricot); }

.folio {
  display: flex; align-items: center; justify-content: center; gap: 1rem;
  font-family: var(--serif); font-style: italic; font-size: 0.95rem;
  color: var(--ink-soft); padding: clamp(2.6rem, 6vw, 4.2rem) 0;
}
.folio::before, .folio::after { content: ''; height: 1px; width: clamp(2rem, 8vw, 5rem); background: var(--ink-faint); }

.prose p { margin-bottom: 1.35em; }
.prose p:last-child { margin-bottom: 0; }
.lede { font-size: clamp(1.22rem, 2.1vw, 1.44rem); line-height: 1.62; letter-spacing: -0.004em; }

.dropcap::first-letter {
  font-family: var(--serif); font-weight: 650; color: var(--terra);
  float: left; font-size: 4.35em; line-height: 0.82;
  padding: 0.06em 0.12em 0 0;
}

/* scroll reveal */
.rv { opacity: 0; transform: translateY(22px); transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); }
.rv.in { opacity: 1; transform: none; }
.rv:nth-child(2) { transition-delay: 0.08s; }
.rv:nth-child(3) { transition-delay: 0.16s; }
.rv:nth-child(4) { transition-delay: 0.24s; }

/* ————— hero cover ————— */
.cover {
  min-height: 100svh;
  display: grid; place-items: center; text-align: center;
  padding: 7rem 1.2rem 4.5rem;
}
.cover-inner { max-width: 56rem; }
.cover .mark { margin-bottom: 2rem; color: var(--terra); }
.cover .mark svg { width: 64px; height: 64px; }
.cover-kicker {
  font-family: var(--sans); font-size: clamp(0.68rem, 1.4vw, 0.8rem); font-weight: 700;
  letter-spacing: 0.3em; text-transform: uppercase; color: var(--ink-soft);
  margin-bottom: 1.6rem;
}
h1.cover-title {
  font-size: clamp(2.9rem, 9.2vw, 6.6rem);
  font-weight: 500; line-height: 1.02; letter-spacing: -0.022em;
  text-wrap: balance;
}
h1 .accent { color: var(--terra); font-style: italic; font-weight: 450; }
.cover-sub {
  margin: 1.8rem auto 0; max-width: 34rem;
  font-size: clamp(1.05rem, 2vw, 1.28rem); line-height: 1.6; color: var(--ink-soft);
}
.cover-rule { margin: 2.4rem auto 0; }
.cover-cue {
  margin-top: 3.2rem; display: inline-flex; flex-direction: column; align-items: center; gap: 0.7rem;
  font-family: var(--sans); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--ink-soft); text-decoration: none;
}
.cover-cue:hover { color: var(--terra-deep); }
.cover-cue svg { animation: cue 2.4s var(--ease) infinite; }
@keyframes cue { 0%, 100% { transform: translateY(0); opacity: 0.7; } 50% { transform: translateY(7px); opacity: 1; } }

/* ————— the rising letters ————— */
.rise { padding: clamp(3rem, 7vw, 5rem) 0 0; }
.rise-intro { text-align: center; max-width: 30rem; margin-inline: auto; }
.rise-intro .kicker { margin-bottom: 0.9rem; }
.rise-intro p { font-size: 1.12rem; font-style: italic; color: var(--ink-soft); }

.glyph-row {
  min-height: 108vh;
  display: grid; place-items: center;
  position: relative;
}
.glyph {
  position: relative;
  font-family: var(--serif);
  font-weight: 640;
  font-size: min(56vh, 62vw);
  line-height: 0.98;
  user-select: none;
}
.glyph .outline,
.glyph .fill { display: block; }
.glyph .outline {
  color: transparent;
  -webkit-text-stroke: 2px rgba(34, 31, 26, 0.34);
}
@supports not (-webkit-text-stroke: 2px red) {
  .glyph .outline { color: rgba(34, 31, 26, 0.1); }
}
.glyph .fill {
  position: absolute; inset: 0;
  color: var(--terra);
  /* polygon rather than inset(): calc()-driven inset() with negative side
     values misrenders in some Chromium compositors; the -6% overshoot keeps
     serifs and descender hooks from being shaved during the fill */
  clip-path: polygon(-6% calc((1 - var(--p, 0)) * 100%), 106% calc((1 - var(--p, 0)) * 100%), 106% 106%, -6% 106%);
  text-shadow: 0 1px 0 rgba(158, 63, 27, 0.25);
}
.glyph-cap {
  position: absolute; bottom: clamp(1.2rem, 6vh, 3.4rem); left: 50%; transform: translateX(-50%);
  width: max-content; max-width: 88vw; text-align: center;
  font-family: var(--sans); font-size: 0.78rem; font-weight: 500;
  letter-spacing: 0.06em; color: var(--ink-soft);
}
.glyph-cap b { color: var(--terra-deep); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.72rem; }
.glyph-cap .idx {
  display: block; margin-bottom: 0.5rem; font-family: var(--serif); font-style: italic;
  font-size: 0.85rem; color: var(--ink-soft); letter-spacing: 0.08em;
}
.rise-coda { text-align: center; padding: 1rem 1.2rem clamp(4rem, 9vw, 7rem); }
.rise-coda p { font-style: italic; font-size: 1.15rem; color: var(--ink-soft); max-width: 30rem; margin-inline: auto; }

/* ————— mission ————— */
.mission { padding: clamp(4rem, 9vw, 7rem) 0 0; }
.manifesto {
  font-size: clamp(1.3rem, 2.6vw, 1.62rem);
  line-height: 1.58; font-weight: 420; letter-spacing: -0.005em;
}
.mission-aside {
  margin-top: 2.6rem; padding-top: 2.2rem;
  border-top: 1px solid var(--ink-faint);
  font-size: 1rem; color: var(--ink-soft);
}
.mission-aside em { color: var(--ink); }

/* ————— map ————— */
.chapters { padding: clamp(4rem, 9vw, 7rem) 0 0; }
.map-frame {
  position: relative;
  border: 1px solid var(--ink-faint);
  outline: 1px solid var(--ink-faint);
  outline-offset: 5px;
  background:
    radial-gradient(120% 90% at 50% 8%, rgba(196, 85, 42, 0.05), transparent 55%),
    var(--paper);
  padding: clamp(0.8rem, 3vw, 2.2rem) clamp(0.4rem, 2vw, 1.6rem) 0.6rem;
  margin-top: 0.5rem;
}
.map-frame svg.wamap { display: block; width: 100%; height: auto; }

.wamap .land { fill: var(--paper-deep); }
.wamap .coast { fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: 0.82; }
.wamap .inland { fill: none; stroke: var(--ink-soft); stroke-width: 1; stroke-dasharray: 2 6; stroke-linecap: round; opacity: 0.75; }
.wamap .river { fill: none; stroke: var(--indigo); stroke-width: 1.4; opacity: 0.4; stroke-linecap: round; }
.wamap .sea-label { font-family: var(--sans); font-size: 13px; font-weight: 600; letter-spacing: 5px; fill: var(--ink-soft); opacity: 0.62; }
.wamap .sea-label.it { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: 2.5px; font-size: 15px; }
.wamap .river-label { font-family: var(--serif); font-style: italic; font-size: 12.5px; fill: var(--indigo); opacity: 0.6; letter-spacing: 1px; }

.wamap .node-g { cursor: pointer; }
.wamap .node { fill: var(--terra); stroke: var(--paper); stroke-width: 1.4; transition: opacity 0.25s, fill 0.25s; }
.wamap .halo {
  fill: none; stroke: var(--terra); stroke-width: 1.3; opacity: 0;
  transform-box: fill-box; transform-origin: center;
}
.live .halo { animation: pulse 3.6s ease-out infinite; animation-delay: var(--d, 0s); }
@keyframes pulse {
  0% { transform: scale(0.35); opacity: 0; }
  12% { opacity: 0.75; }
  55% { transform: scale(2.6); opacity: 0; }
  100% { transform: scale(2.6); opacity: 0; }
}
.wamap .node-g:hover .node,
.wamap .node-g:focus-visible .node { fill: var(--indigo); }
.wamap.filtering .node-g:not(.hit) .node { opacity: 0.16; }
.wamap.filtering .node-g:not(.hit) .halo { opacity: 0 !important; animation: none; }

.map-caption {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 1.5rem;
  border-top: 1px solid var(--ink-faint); margin-top: 0.8rem;
  padding: 0.85rem 0.4rem 0.7rem;
  font-family: var(--sans); font-size: 0.8rem; color: var(--ink-soft);
}
.map-caption .readout { font-family: var(--serif); font-style: italic; font-size: 0.95rem; color: var(--ink); min-height: 1.5em; }
.map-caption .readout b { color: var(--terra-deep); font-style: normal; }
.map-caption .plate-no { letter-spacing: 0.18em; text-transform: uppercase; font-size: 0.68rem; font-weight: 600; }

.legend {
  margin-top: 1.7rem; display: flex; flex-wrap: wrap; gap: 0.55rem; justify-content: center;
}
.legend button {
  font-family: var(--sans); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em;
  color: var(--ink-soft); background: transparent;
  border: 1px solid var(--ink-faint); border-radius: 999px;
  padding: 0.42em 0.95em; cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.legend button .n { color: var(--terra-deep); font-weight: 700; margin-left: 0.35em; }
.legend button:hover, .legend button[aria-pressed="true"] {
  border-color: var(--terra); color: var(--ink); background: rgba(196, 85, 42, 0.07);
}
.legend-note { margin-top: 1rem; text-align: center; font-family: var(--sans); font-size: 0.74rem; color: var(--ink-soft); }

/* ————— programs ————— */
.programs { padding: clamp(4rem, 9vw, 7rem) 0 0; }
.plates { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1rem, 2.4vw, 1.8rem); margin-top: 0.5rem; }
@media (max-width: 900px) { .plates { grid-template-columns: 1fr; max-width: 32rem; margin-inline: auto; } }
.plate {
  border: 1px solid var(--ink-faint);
  outline: 1px solid var(--ink-faint); outline-offset: 4px;
  background: var(--paper);
  padding: clamp(1.6rem, 3vw, 2.2rem) clamp(1.3rem, 2.6vw, 1.9rem) 1.7rem;
  display: flex; flex-direction: column; gap: 1.05rem;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
@media (hover: hover) {
  .plate:hover { transform: translateY(-5px); box-shadow: 0 18px 34px -22px rgba(34, 31, 26, 0.45); }
  .plate:hover .plate-art { color: var(--terra-deep); }
}
.plate-no-tag {
  font-family: var(--serif); font-style: italic; font-size: 0.9rem; color: var(--ink-soft);
  display: flex; align-items: center; gap: 0.8rem;
}
.plate-no-tag::after { content: ''; flex: 1; height: 1px; background: var(--ink-faint); }
.plate-art { color: var(--terra); margin: 0.4rem auto 0.2rem; transition: color 0.3s; }
.plate h3 { font-size: 1.42rem; font-weight: 600; letter-spacing: -0.01em; text-align: center; }
.plate p { font-size: 0.98rem; line-height: 1.66; color: var(--ink-soft); }
.plate p strong { color: var(--ink); font-weight: 600; }
.plate .plate-foot {
  margin-top: auto; padding-top: 0.9rem; border-top: 1px solid var(--ink-faint);
  font-family: var(--sans); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--terra-deep); text-align: center;
}

/* ————— goals (indigo plate) ————— */
.goals {
  margin-top: clamp(4.5rem, 10vw, 7.5rem);
  background:
    radial-gradient(90% 70% at 50% 0%, rgba(242, 180, 154, 0.09), transparent 60%),
    var(--indigo);
  color: var(--paper);
  padding: clamp(4rem, 8vw, 6.5rem) 0 clamp(3.4rem, 7vw, 5.5rem);
}
.goals .chapter-title { color: var(--paper); }
.goals-note {
  max-width: 36rem; margin: 0 auto; text-align: center;
  font-size: 1.08rem; line-height: 1.7; color: rgba(245, 237, 223, 0.82);
}
.goals-note em { color: var(--apricot); }
.goal-grid {
  margin-top: clamp(2.6rem, 6vw, 4rem);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem clamp(1.2rem, 3vw, 2.6rem);
}
@media (max-width: 980px) { .goal-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .goal-grid { grid-template-columns: 1fr; max-width: 22rem; margin-inline: auto; } }
.goal { text-align: center; padding-top: 1.4rem; border-top: 1px solid rgba(245, 237, 223, 0.22); }
.goal .num {
  font-family: var(--serif); font-weight: 560; font-size: clamp(2.7rem, 5vw, 3.9rem);
  line-height: 1; color: var(--apricot); letter-spacing: -0.02em;
  font-variant-numeric: oldstyle-nums;
}
.goal .num sup { font-size: 0.45em; font-style: italic; font-weight: 450; }
.goal p { margin-top: 0.85rem; font-size: 0.95rem; line-height: 1.6; color: rgba(245, 237, 223, 0.85); }
.goals-foot {
  margin-top: clamp(2.6rem, 6vw, 3.8rem); text-align: center;
  font-family: var(--sans); font-size: 0.74rem; font-weight: 600; letter-spacing: 0.18em;
  text-transform: uppercase; color: rgba(245, 237, 223, 0.55);
}

/* ————— give ————— */
.give { padding: clamp(4.5rem, 10vw, 7.5rem) 0 0; }
.give-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(2rem, 5vw, 4.5rem); align-items: start;
}
@media (max-width: 900px) { .give-grid { grid-template-columns: 1fr; } }
.give-copy .chapter-head { text-align: left; margin-bottom: 1.6rem; }
.give-copy .ornament { margin-left: 0; }
.give-copy p { color: var(--ink-soft); margin-bottom: 1.2em; }
.give-copy p strong { color: var(--ink); }
.give-list { list-style: none; margin: 1.6rem 0 0; }
.give-list li {
  display: flex; gap: 0.85rem; align-items: baseline;
  padding: 0.75rem 0; border-top: 1px solid var(--ink-faint);
  font-size: 0.98rem; color: var(--ink-soft);
}
.give-list li:last-child { border-bottom: 1px solid var(--ink-faint); }
.give-list b { color: var(--ink); font-weight: 600; white-space: nowrap; }
.give-list .tick { color: var(--terra); font-family: var(--serif); flex: none; }

.pledge-card {
  border: 1px solid var(--ink-faint);
  outline: 1px solid var(--ink-faint); outline-offset: 5px;
  background: var(--paper);
  padding: clamp(1.7rem, 3.6vw, 2.6rem);
}
.pledge-card h3 { font-size: 1.3rem; font-weight: 600; margin-bottom: 0.4rem; }
.pledge-card .form-note { font-family: var(--sans); font-size: 0.78rem; color: var(--ink-soft); margin-bottom: 1.7rem; line-height: 1.55; }
.field { margin-bottom: 1.35rem; }
.field label {
  display: block; font-family: var(--sans); font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft);
  margin-bottom: 0.45rem;
}
.field input, .field select, .field textarea {
  width: 100%; font-family: var(--serif); font-size: 1.02rem; color: var(--ink);
  background: transparent; border: none; border-bottom: 1.5px solid rgba(34, 31, 26, 0.32);
  padding: 0.45em 0.1em; border-radius: 0;
  transition: border-color 0.2s;
}
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%239E3F1B' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.3em center; cursor: pointer; }
.field textarea { resize: vertical; min-height: 5.2em; line-height: 1.55; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-bottom-color: var(--terra); }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: none; }
.field ::placeholder { color: rgba(90, 83, 72, 0.55); font-style: italic; }

.btn {
  display: inline-flex; align-items: center; gap: 0.7em;
  font-family: var(--sans); font-size: 0.8rem; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--paper); background: var(--terra-deep);
  border: none; border-radius: 999px; padding: 1em 1.9em; cursor: pointer;
  transition: background 0.2s, transform 0.2s var(--ease), box-shadow 0.2s;
}
.btn:hover { background: var(--ink); transform: translateY(-2px); box-shadow: 0 12px 22px -12px rgba(34, 31, 26, 0.55); }
.btn svg { transition: transform 0.25s var(--ease); }
.btn:hover svg { transform: translateX(4px); }

.form-success {
  border-top: 2px solid var(--terra);
  padding-top: 1.6rem; margin-top: 0.4rem;
}
.form-success h4 { font-size: 1.45rem; font-weight: 600; margin-bottom: 0.7rem; }
.form-success p { color: var(--ink-soft); font-size: 1rem; }
[hidden] { display: none !important; }

/* ————— colophon (process + guide) ————— */
.colophon {
  margin-top: clamp(5rem, 11vw, 8rem);
  border-top: 1px solid var(--ink-faint);
  background: linear-gradient(var(--paper-deep), var(--paper) 26rem);
  padding-top: clamp(4rem, 8vw, 6rem);
}
.colophon-band { text-align: center; margin-bottom: clamp(3rem, 6vw, 4.5rem); }
.colophon-band .band-title { font-style: italic; font-weight: 450; font-size: clamp(1.6rem, 3vw, 2.1rem); color: var(--ink); }

.doc { padding-bottom: clamp(2rem, 5vw, 3rem); }
.doc + .doc { border-top: 1px solid var(--ink-faint); padding-top: clamp(3.4rem, 7vw, 5rem); }
.doc-grid {
  display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  gap: clamp(1.6rem, 4vw, 4rem);
}
@media (max-width: 820px) { .doc-grid { grid-template-columns: 1fr; } }
.doc-side { position: sticky; top: 5.5rem; align-self: start; }
@media (max-width: 820px) { .doc-side { position: static; } }
.doc-side .kicker { margin-bottom: 0.7rem; }
.doc-side h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 550; line-height: 1.15; letter-spacing: -0.01em; }
.doc-side .doc-sub { margin-top: 0.9rem; font-style: italic; color: var(--ink-soft); font-size: 0.98rem; }
.doc-body h3 {
  font-size: 1.22rem; font-weight: 650; margin: 2.3rem 0 0.75rem;
  display: flex; align-items: baseline; gap: 0.7rem;
}
.doc-body h3:first-child { margin-top: 0.3rem; }
.doc-body h3 .no { font-family: var(--sans); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em; color: var(--terra-deep); }
.doc-body p { font-size: 1rem; color: var(--ink-soft); margin-bottom: 1.05em; max-width: 38rem; }
.doc-body p strong, .doc-body li strong { color: var(--ink); font-weight: 600; }
.doc-body ul { margin: 0 0 1.2em; padding-left: 1.1em; max-width: 38rem; }
.doc-body li { font-size: 1rem; color: var(--ink-soft); margin-bottom: 0.55em; }
.doc-body li::marker { color: var(--terra); }

.disclaimer {
  border: 1px solid rgba(158, 63, 27, 0.4);
  border-left: 4px solid var(--terra);
  background: rgba(196, 85, 42, 0.06);
  padding: 1.2rem 1.4rem; margin: 1.8rem 0; max-width: 38rem;
}
.disclaimer p { font-family: var(--sans); font-size: 0.88rem; line-height: 1.6; color: var(--ink); margin: 0; }

pre.code {
  background: var(--ink); color: #EFE7D6;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.78rem; line-height: 1.65;
  padding: 1.2rem 1.4rem; margin: 1.3rem 0 1.6rem;
  overflow-x: auto; border-radius: 6px; max-width: 38rem;
  tab-size: 2;
}
pre.code .c { color: #9A917F; } /* comment */
pre.code .k { color: var(--apricot); } /* keyword-ish */

.pass-log { list-style: none; padding: 0; max-width: 38rem; }
.pass-log > li { margin-bottom: 1.5rem; padding-left: 0; }
.pass-log .pass-name {
  font-family: var(--sans); font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--terra-deep);
  display: block; margin-bottom: 0.5rem;
}
.pass-log ul { padding-left: 1.1em; margin: 0; }

/* ————— footer ————— */
footer {
  margin-top: clamp(4rem, 9vw, 6rem);
  background: var(--ink); color: rgba(245, 237, 223, 0.78);
  padding: clamp(3rem, 6vw, 4.5rem) 0 2.2rem;
}
.foot-grid {
  display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
  gap: 2.5rem clamp(1.5rem, 4vw, 4rem);
}
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr; } }
.foot-brand .wordmark { color: var(--paper); font-size: 1.15rem; }
.foot-brand .wordmark:hover { color: var(--apricot); }
.foot-brand p { margin-top: 1rem; font-size: 0.95rem; font-style: italic; max-width: 24rem; line-height: 1.65; }
footer h4 {
  font-family: var(--sans); font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.22em; text-transform: uppercase; color: rgba(245, 237, 223, 0.5);
  margin-bottom: 1.1rem;
}
footer ul { list-style: none; }
footer li { margin-bottom: 0.55rem; }
footer a { color: rgba(245, 237, 223, 0.85); text-decoration: none; font-size: 0.95rem; }
footer a:hover { color: var(--apricot); }
.foot-credit {
  margin-top: clamp(2.5rem, 5vw, 3.5rem); padding-top: 1.6rem;
  border-top: 1px solid rgba(245, 237, 223, 0.14);
  display: flex; flex-wrap: wrap; gap: 0.8rem 2rem; justify-content: space-between;
  font-family: var(--sans); font-size: 0.78rem; color: rgba(245, 237, 223, 0.55);
}
.foot-credit a { font-size: inherit; color: rgba(245, 237, 223, 0.85); text-decoration: underline; text-decoration-color: rgba(245, 237, 223, 0.3); text-underline-offset: 0.2em; }
.foot-credit a:hover { color: var(--apricot); }

/* below-fold rendering hint (lifted for headless QA captures, which render
   beyond the viewport and would otherwise skip these sections) */
.programs, .goals, .give, .colophon, footer { content-visibility: auto; contain-intrinsic-size: auto 800px; }
.robot .programs, .robot .goals, .robot .give, .robot .colophon, .robot footer { content-visibility: visible; }

/* ————— finishing details ————— */
[id] { scroll-margin-top: 5rem; }
.doc-grid > * { min-width: 0; }
pre.code { max-width: min(38rem, 100%); }
.give-grid { max-width: 62rem; margin-inline: auto; }
.wamap text { pointer-events: none; user-select: none; }
.wamap .node-g:focus { outline: none; }
.wamap .node-g:focus-visible { outline: 2.5px solid var(--terra-deep); outline-offset: 3px; }
code {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.86em; background: rgba(34, 31, 26, 0.07);
  padding: 0.1em 0.35em; border-radius: 3px;
}

/* ————— reduced motion ————— */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.1s !important;
  }
  .glyph .fill { clip-path: none; }
  .rv { opacity: 1; transform: none; }
  .live .halo { animation: none; opacity: 0.28; transform: scale(1.9); }
  .cover-cue svg { animation: none; }
  .glyph-row { min-height: 88vh; }
  .glyph { font-size: min(48vh, 58vw); }
}
