/* =========================================================
   Virtue Literacy Africa — Site Styles
   Palette: terracotta + deep green + cream
   Type: Fraunces (display/serif) + DM Sans (body)
   Motifs: paper grain, library stamps, dotted TOC leaders,
           bookmark ribbons, hand-drawn underlines
   ========================================================= */

:root {
  /* Brand colors taken from the VLA logo: blue + grass green on cream */
  --green-deep: #1f5a2d;        /* hero / dark sections — closer to logo halo */
  --green-darker: #133d1a;
  --green-soft: #5da130;         /* logo halo arc */
  --green-leaf: #7ac142;         /* logo Africa shape — bright accent */
  --terracotta: #2196d2;         /* repurposed: logo brand blue (kept name for fewer churn) */
  --terracotta-dark: #1979ab;    /* darker brand blue */
  --cream: #f5ede0;
  --cream-light: #faf6ee;
  --cream-deep: #ece1cd;
  --gold: #2196d2;                /* repurposed to brand blue per design direction */
  --ink: #1f1d1a;
  --ink-soft: #4a4742;
  --muted: #8a857e;
  --line: rgba(31, 29, 26, 0.12);
  --line-strong: rgba(31, 29, 26, 0.22);

  --font-serif: "Fraunces", "Newsreader", "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-sans: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --container: 1180px;
  --radius: 6px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(31, 29, 26, 0.06), 0 2px 8px rgba(31, 29, 26, 0.04);
  --shadow-md: 0 4px 12px rgba(31, 29, 26, 0.08), 0 12px 36px rgba(31, 29, 26, 0.06);

  --easing: cubic-bezier(0.22, 1, 0.36, 1);

  /* Paper-grain texture used as subtle body background.
     SVG noise → looks like cream paper under raking light. */
  --paper-grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.45  0 0 0 0 0.36  0 0 0 0 0.24  0 0 0 0.07 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");

  /* Hand-drawn wavy "scribble" underline (logo blue) */
  --scribble: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 16' preserveAspectRatio='none'><path d='M2 11 C 40 1, 80 17, 120 9 S 200 1, 240 11 S 290 17, 298 7' stroke='%232196d2' stroke-width='3.5' fill='none' stroke-linecap='round'/></svg>");
}

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

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--cream-light);
  background-image: var(--paper-grain);
  background-repeat: repeat;
  background-size: 220px 220px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "ss02";
}

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

a {
  color: var(--terracotta-dark);
  text-decoration: none;
  transition: color 160ms var(--easing);
}

a:hover {
  color: var(--terracotta);
}

button {
  font: inherit;
  cursor: pointer;
}

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

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
}

/* ----------- Typography ----------- */

h1,
h2,
h3,
h4 {
  font-family: var(--font-serif);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.015em;
  line-height: 1.1;
  margin: 0 0 0.6em;
  font-variation-settings: "SOFT" 30, "WONK" 0, "opsz" 144;
}

h1 {
  font-size: clamp(2.3rem, 5.8vw, 4.3rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  font-variation-settings: "SOFT" 40, "WONK" 1, "opsz" 144;
}

h2 {
  font-size: clamp(1.9rem, 3.8vw, 2.8rem);
}

h3 {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 500;
}

p {
  margin: 0 0 1em;
}

.lede {
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  line-height: 1.6;
  color: var(--ink-soft);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: 1.2rem;
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 1.5px;
  background: var(--terracotta);
}

.eyebrow.on-dark {
  color: var(--gold);
}

.eyebrow.on-dark::before {
  background: var(--gold);
}

em.accent {
  color: var(--terracotta);
  font-style: italic;
  font-family: var(--font-serif);
  font-variation-settings: "SOFT" 80, "WONK" 1, "opsz" 144;
}

/* Hand-drawn squiggle underline under any inline element */
.scribble {
  position: relative;
  display: inline-block;
  font-style: italic;
  color: var(--terracotta);
  font-family: var(--font-serif);
  font-variation-settings: "SOFT" 90, "WONK" 1, "opsz" 144;
  white-space: nowrap;
}

.scribble::after {
  content: "";
  position: absolute;
  left: -4%;
  right: -4%;
  bottom: -0.32em;
  height: 0.5em;
  background-image: var(--scribble);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  pointer-events: none;
}

.scribble.on-dark {
  color: var(--gold);
}

.scribble.on-dark::after {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 16' preserveAspectRatio='none'><path d='M2 11 C 40 1, 80 17, 120 9 S 200 1, 240 11 S 290 17, 298 7' stroke='%232196d2' stroke-width='3.5' fill='none' stroke-linecap='round'/></svg>");
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.9rem 1.6rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: 999px;
  border: 1.5px solid transparent;
  transition: transform 180ms var(--easing), background-color 180ms var(--easing),
    color 180ms var(--easing), border-color 180ms var(--easing);
  white-space: nowrap;
}

.btn-primary {
  background: var(--terracotta);
  color: #fff;
}

.btn-primary:hover {
  background: var(--terracotta-dark);
  color: #fff;
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}

.btn-ghost:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.btn-ghost.on-dark {
  color: var(--cream);
  border-color: rgba(245, 237, 224, 0.4);
}

.btn-ghost.on-dark:hover {
  background: rgba(245, 237, 224, 0.08);
  border-color: var(--cream);
  color: var(--cream);
}

.btn .arrow {
  transition: transform 180ms var(--easing);
}

.btn:hover .arrow {
  transform: translateX(3px);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 246, 238, 0.92);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem 24px;
  max-width: var(--container);
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
}

.brand:hover {
  color: var(--ink);
}

.brand-logo {
  display: block;
  width: 132px;
  height: auto;
}

@media (max-width: 600px) {
  .brand-logo {
    width: 108px;
  }
}

/* Footer logo sits on a printed-label-style cream card so the
   green parts of the logo stay legible against the dark footer */
.brand--card {
  display: inline-flex;
  align-items: center;
  background: var(--cream-light);
  padding: 0.55rem 0.95rem;
  border-radius: 10px;
  border: 1px dashed rgba(31, 29, 26, 0.18);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.brand-logo--footer {
  width: 150px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--green-deep);
  color: var(--cream);
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 600;
  font-size: 1.1rem;
  border-radius: 50%;
  letter-spacing: 0.02em;
  font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144;
  position: relative;
}

.brand-mark::after {
  /* tiny ring like a library card eyelet */
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px dashed rgba(245, 237, 224, 0.4);
  border-radius: 50%;
}

.brand-name {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.15rem;
  line-height: 1.1;
  letter-spacing: -0.01em;
  font-variation-settings: "SOFT" 40, "opsz" 144;
}

.brand-name em {
  display: block;
  font-style: italic;
  color: var(--terracotta);
  font-size: 1rem;
  font-variation-settings: "SOFT" 80, "WONK" 1, "opsz" 144;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.primary-nav a {
  position: relative;
  font-family: var(--font-sans);
  font-size: 0.94rem;
  font-weight: 400;
  color: var(--ink-soft);
  padding: 0.35rem 0;
}

.primary-nav a:hover,
.primary-nav a.is-active {
  color: var(--ink);
}

.primary-nav a.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 8px;
  background-image: var(--scribble);
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.nav-cta {
  margin-left: 0.5rem;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.nav-toggle .bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
  margin: 3px 0;
  transition: transform 200ms var(--easing), opacity 200ms var(--easing);
}

.nav-toggle[aria-expanded="true"] .bar:nth-child(2) {
  transform: translateY(5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .bar:nth-child(3) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .bar:nth-child(4) {
  transform: translateY(-5px) rotate(-45deg);
}

@media (max-width: 920px) {
  .nav-toggle {
    display: inline-flex;
  }
  .primary-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--cream-light);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem 24px 1.25rem;
    transform: translateY(-10px);
    opacity: 0;
    pointer-events: none;
    transition: transform 220ms var(--easing), opacity 220ms var(--easing);
  }
  .primary-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .primary-nav a {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--line);
    font-size: 1rem;
  }
  .primary-nav .nav-cta {
    margin: 0.85rem 0 0;
    align-self: flex-start;
  }
}

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

.hero {
  position: relative;
  background: var(--green-deep);
  color: var(--cream);
  overflow: hidden;
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
      ellipse at top right,
      rgba(33, 150, 210, 0.22),
      transparent 55%
    ),
    radial-gradient(ellipse at bottom left, rgba(33, 150, 210, 0.32), transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* Decorative open-book SVG anchored top-right of hero */
.hero-decoration {
  position: absolute;
  pointer-events: none;
  z-index: 0;
  opacity: 0.16;
}

.hero-decoration--book {
  top: -30px;
  right: -40px;
  width: 320px;
  color: var(--gold);
}

.hero-decoration--paper-plane {
  bottom: 30px;
  right: 6%;
  width: 110px;
  color: var(--cream);
  opacity: 0.22;
  transform: rotate(-12deg);
}

.hero-inner {
  position: relative;
  z-index: 1;
  padding: clamp(4rem, 9vw, 7.5rem) 0 clamp(4rem, 9vw, 7.5rem);
  max-width: 900px;
}

.hero h1 {
  color: var(--cream);
}

.hero p {
  font-size: clamp(1.1rem, 1.7vw, 1.35rem);
  line-height: 1.55;
  color: rgba(245, 237, 224, 0.88);
  max-width: 60ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2rem;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.4rem;
  padding: 0.45rem 0.95rem 0.45rem 0.7rem;
  background: rgba(33, 150, 210, 0.12);
  border-radius: 999px;
  border: 1px dashed rgba(33, 150, 210, 0.4);
}

.hero-tag .dot {
  width: 6px;
  height: 6px;
  background: var(--gold);
  border-radius: 50%;
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

.hero-compact {
  padding-bottom: 0;
}

.hero-compact .hero-inner {
  padding: clamp(3rem, 7vw, 5rem) 0 clamp(3rem, 7vw, 5rem);
}

.hero-compact h1 {
  font-size: clamp(2rem, 4.4vw, 3.4rem);
}

/* ----------- Section primitives ----------- */

section {
  padding: clamp(4rem, 8vw, 7rem) 0;
  position: relative;
  overflow: hidden;
}

.section-head {
  max-width: 760px;
  margin-bottom: 3.5rem;
}

.section-head.center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.bg-cream { background: var(--cream); }
.bg-cream-light { background: var(--cream-light); }
.bg-cream-deep { background: var(--cream-deep); }

.bg-green {
  background: var(--green-deep);
  color: var(--cream);
  isolation: isolate;
}

.bg-green::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--paper-grain);
  opacity: 0.4;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.bg-green h2,
.bg-green h3 {
  color: var(--cream);
}

.bg-green .lede,
.bg-green p {
  color: rgba(245, 237, 224, 0.88);
}

/* Section divider that looks like an open book spread */
.divider-book {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2.5rem 0 0;
  color: var(--terracotta);
  opacity: 0.6;
}

.divider-book::before,
.divider-book::after {
  content: "";
  flex: 0 1 140px;
  height: 1px;
  background: var(--line-strong);
}

/* ----------- Story / pull quote ----------- */

.story-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.story-grid p {
  font-size: 1.075rem;
  color: var(--ink-soft);
}

.pull-quote {
  position: relative;
  margin: clamp(2.5rem, 5vw, 4rem) 0;
  padding: 2.5rem clamp(1.5rem, 3vw, 3rem) 2rem;
  background: var(--cream);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--terracotta);
}

.pull-quote::before {
  content: "“";
  position: absolute;
  top: -0.15rem;
  left: 1.5rem;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 5.5rem;
  line-height: 1;
  color: var(--terracotta);
  opacity: 0.3;
  font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144;
}

.pull-quote blockquote {
  margin: 0 0 1rem;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  line-height: 1.45;
  color: var(--ink);
  font-variation-settings: "SOFT" 50, "WONK" 1, "opsz" 144;
}

.pull-quote cite {
  display: block;
  font-style: normal;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  color: var(--ink-soft);
  font-weight: 500;
}

.pull-quote cite span {
  color: var(--muted);
  font-weight: 400;
}

@media (max-width: 760px) {
  .story-grid {
    grid-template-columns: 1fr;
  }
}

/* ----------- Feature row (photo + text) ----------- */

.feature-row {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.feature-row.reverse {
  grid-template-columns: 1fr 1.05fr;
}

.feature-row.reverse .feature-visual {
  order: 2;
}

.feature-visual {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--green-deep);
  box-shadow: var(--shadow-md);
  isolation: isolate;
}

/* Photo variant — uses a real <img> + caption overlay */
.feature-visual.photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  transition: transform 1.2s var(--easing);
}

.feature-visual.photo:hover img {
  transform: scale(1.04);
}

.feature-visual.photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(22, 55, 41, 0) 30%,
    rgba(22, 55, 41, 0.85) 100%
  );
  z-index: 1;
}

.feature-visual .feature-mark {
  position: absolute;
  z-index: 2;
  left: 1.5rem;
  right: 1.5rem;
  bottom: 1.5rem;
  color: var(--cream);
  text-align: left;
}

.feature-visual .feature-mark .label {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.6rem;
  padding: 0.3rem 0.7rem;
  background: rgba(22, 55, 41, 0.6);
  border-radius: 999px;
  border: 1px dashed rgba(33, 150, 210, 0.55);
}

.feature-visual .feature-mark .title {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
  line-height: 1.3;
  color: var(--cream);
  font-variation-settings: "SOFT" 80, "WONK" 1, "opsz" 144;
}

/* Library stamp circle in top-right of photo */
.feature-visual .stamp {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  width: 78px;
  height: 78px;
  border: 1.5px solid var(--cream-light);
  color: var(--cream-light);
  background: rgba(22, 55, 41, 0.35);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.05;
  transform: rotate(-8deg);
  font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144;
}

.feature-visual .stamp strong {
  display: block;
  font-style: normal;
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: 0.15rem;
}

/* Fallback when img fails to load */
.feature-visual.photo.img-failed img { display: none; }
.feature-visual.photo.img-failed {
  background: linear-gradient(140deg, var(--green-deep), var(--green-darker));
}
.feature-visual.photo.img-failed::after { opacity: 0.4; }

/* Illustration variant — kept as fallback / decorative-only */
.feature-visual.illustration {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(140deg, var(--green-deep), var(--green-darker));
  color: var(--cream);
}

.feature-visual.illustration .deco {
  position: absolute;
  inset: 0;
  background: radial-gradient(
      circle at 30% 20%,
      rgba(33, 150, 210, 0.22),
      transparent 50%
    ),
    radial-gradient(circle at 80% 80%, rgba(33, 150, 210, 0.3), transparent 55%);
}

.feature-visual.illustration .feature-mark {
  position: relative;
  text-align: center;
  padding: 2rem;
  bottom: auto;
  left: auto;
  right: auto;
}

@media (max-width: 820px) {
  .feature-row,
  .feature-row.reverse {
    grid-template-columns: 1fr;
  }
  .feature-row.reverse .feature-visual {
    order: 0;
  }
  .feature-visual {
    aspect-ratio: 16 / 11;
  }
}

/* ----------- Stat strip ----------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2rem;
  padding: 2.5rem 0;
  border-top: 1.5px dashed var(--line-strong);
  border-bottom: 1.5px dashed var(--line-strong);
}

.stat {
  text-align: left;
}

.stat .num {
  display: block;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(2.2rem, 3.8vw, 3rem);
  color: var(--terracotta);
  line-height: 1;
  margin-bottom: 0.5rem;
  font-variation-settings: "SOFT" 80, "WONK" 1, "opsz" 144;
}

.stat .lbl {
  display: block;
  font-size: 0.92rem;
  color: var(--ink-soft);
  line-height: 1.45;
}

/* ----------- Table of Contents (Get Involved) ----------- */

.toc-intro {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1rem;
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--terracotta);
  font-size: 0.95rem;
  font-variation-settings: "SOFT" 80, "WONK" 1, "opsz" 144;
}

.toc-intro::before,
.toc-intro::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-strong);
}

.toc {
  display: flex;
  flex-direction: column;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  background-image: var(--paper-grain);
  background-size: 220px 220px;
}

.toc-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  padding: 1.75rem 1rem;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  transition: padding 240ms var(--easing), background-color 240ms var(--easing),
    color 240ms var(--easing);
  position: relative;
}

.toc-item:last-child {
  border-bottom: 0;
}

.toc-item:hover {
  background: rgba(33, 150, 210, 0.06);
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  color: var(--ink);
}

.toc-num {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.65rem, 3vw, 2.1rem);
  color: var(--terracotta);
  font-variation-settings: "SOFT" 80, "WONK" 1, "opsz" 144;
  min-width: 2.5rem;
  line-height: 1;
  padding-top: 0.15em;
}

.toc-content {
  min-width: 0;
}

.toc-line {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  margin-bottom: 0.4rem;
}

.toc-content h3 {
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  margin: 0;
  font-family: var(--font-serif);
  font-variation-settings: "SOFT" 40, "WONK" 1, "opsz" 144;
  transition: color 240ms var(--easing);
  flex: 0 0 auto;
}

.toc-item:hover .toc-content h3 {
  color: var(--terracotta-dark);
}

.toc-content p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

.toc-leader {
  flex: 1;
  min-width: 30px;
  height: 0;
  border-bottom: 2px dotted var(--line-strong);
  align-self: end;
  margin-bottom: 0.55em;
  transition: border-color 240ms var(--easing);
}

.toc-item:hover .toc-leader {
  border-bottom-color: var(--terracotta);
}

.toc-arrow {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ink-soft);
  transition: transform 240ms var(--easing), color 240ms var(--easing);
  white-space: nowrap;
  flex: 0 0 auto;
}

.toc-item:hover .toc-arrow {
  transform: translateX(6px);
  color: var(--terracotta);
}

@media (max-width: 600px) {
  .toc-line {
    flex-wrap: wrap;
  }
  .toc-leader {
    display: none;
  }
  .toc-arrow {
    font-size: 0.95rem;
  }
}

/* ----------- CTA band ----------- */

.cta-band {
  background: var(--terracotta);
  background-image: var(--paper-grain);
  background-size: 220px 220px;
  color: #fff;
  border-radius: var(--radius-lg);
  padding: clamp(2.5rem, 5vw, 4rem);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2rem;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.cta-band::before {
  /* tiny dashed bookmark detail in top-right */
  content: "";
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 60px;
  height: 60px;
  border: 1.5px dashed rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.cta-band > * {
  position: relative;
  z-index: 1;
}

.cta-band h2 {
  color: #fff;
  margin: 0 0 0.5rem;
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
}

.cta-band p {
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
  max-width: 52ch;
}

.cta-band .btn {
  background: var(--cream-light);
  color: var(--terracotta-dark);
}

.cta-band .btn:hover {
  background: #fff;
  color: var(--terracotta-dark);
}

@media (max-width: 720px) {
  .cta-band {
    grid-template-columns: 1fr;
    text-align: left;
  }
}

/* ----------- Library Card (contact info) ----------- */

/* Replaces generic contact-card — styled like an old library
   checkout card with stamped lines and a barcode at the bottom. */
.library-card {
  position: relative;
  background: var(--cream);
  background-image: var(--paper-grain);
  background-size: 220px 220px;
  border-radius: 4px;
  border: 1px solid var(--line-strong);
  padding: 1.75rem 1.75rem 1.5rem;
  box-shadow: 0 12px 24px rgba(31, 29, 26, 0.06);
}

.library-card::before {
  /* paper-clip eyelet on the top edge */
  content: "";
  position: absolute;
  top: 0.85rem;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 6px;
  background: var(--ink);
  opacity: 0.18;
  border-radius: 999px;
}

.library-card .lc-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 0.75rem;
  margin-bottom: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
}

.library-card .lc-head em {
  font-family: var(--font-serif);
  font-style: italic;
  text-transform: none;
  letter-spacing: -0.01em;
  font-size: 1rem;
  color: var(--terracotta);
  font-variation-settings: "SOFT" 80, "WONK" 1, "opsz" 144;
}

.library-card .lc-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: baseline;
  padding: 0.85rem 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.95rem;
}

.library-card .lc-row:last-of-type {
  border-bottom: 0;
}

.library-card .lc-row strong {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.library-card .lc-row a {
  color: var(--ink);
}

.library-card .lc-row a:hover {
  color: var(--terracotta);
}

.library-card .lc-barcode {
  display: flex;
  gap: 2px;
  height: 28px;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.library-card .lc-barcode span {
  background: var(--ink);
  height: 100%;
  flex-shrink: 0;
}

.library-card .lc-barcode i {
  display: block;
  font-style: normal;
  margin-top: 0.4rem;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  color: var(--muted);
}

/* ----------- Contact ----------- */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

form.contact-form {
  display: grid;
  gap: 1rem;
}

.contact-form label {
  display: grid;
  gap: 0.4rem;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 500;
}

.contact-form input,
.contact-form textarea,
.contact-form select {
  font: inherit;
  font-family: var(--font-sans);
  letter-spacing: 0;
  text-transform: none;
  font-size: 1rem;
  font-weight: 400;
  color: var(--ink);
  width: 100%;
  padding: 0.85rem 0;
  background: transparent;
  border: 0;
  border-bottom: 1.5px solid var(--line-strong);
  border-radius: 0;
  transition: border-color 160ms var(--easing);
}

.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus {
  outline: none;
  border-bottom-color: var(--terracotta);
}

.contact-form textarea {
  min-height: 140px;
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 760px) {
  .contact-grid,
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* ----------- Doodle decorations -----------
   Children's-drawing style marginalia: suns, houses, flowers,
   stars, kites, birds, trees, clouds, smileys. Inline SVGs use
   currentColor so a single utility class controls color/opacity.
   Position via inline style (top/right/--rot). */

.doodle {
  position: absolute;
  pointer-events: none;
  z-index: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.22;
  color: var(--terracotta);
  transform: rotate(var(--rot, 0deg));
}

.doodle--ink { color: var(--ink-soft); opacity: 0.18; }
.doodle--green { color: var(--green-soft); opacity: 0.3; }
.doodle--gold { color: var(--gold); opacity: 0.6; }
.doodle--cream { color: var(--cream); opacity: 0.32; }

.doodle.sm { width: 44px; height: 44px; }
.doodle.md { width: 70px; height: 70px; }
.doodle.lg { width: 105px; height: 105px; }
.doodle.xl { width: 150px; height: 150px; }
.doodle.wide { width: 130px; height: auto; }
.doodle.tall { width: 70px; height: 90px; }

/* Hero needs doodles above the radial-gradient ::before */
.hero .doodle { z-index: 1; }

@keyframes sway {
  0%, 100% { transform: rotate(var(--rot, 0deg)) translateY(0); }
  50% { transform: rotate(calc(var(--rot, 0deg) + 3deg)) translateY(-4px); }
}

.doodle--sway {
  animation: sway 6s ease-in-out infinite;
  transform-origin: center;
}

@keyframes drift {
  0%, 100% { transform: rotate(var(--rot, 0deg)) translate(0, 0); }
  50% { transform: rotate(calc(var(--rot, 0deg) - 2deg)) translate(10px, -6px); }
}

.doodle--drift {
  animation: drift 14s ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: var(--twinkle-base, 0.5); transform: rotate(var(--rot, 0deg)) scale(1); }
  50% { opacity: calc(var(--twinkle-base, 0.5) + 0.25); transform: rotate(var(--rot, 0deg)) scale(1.12); }
}

.doodle--twinkle {
  animation: twinkle 3.5s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .doodle--sway,
  .doodle--drift,
  .doodle--twinkle {
    animation: none;
  }
}

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

.site-footer {
  background: var(--green-darker);
  background-image: var(--paper-grain);
  background-size: 220px 220px;
  background-blend-mode: overlay;
  color: rgba(245, 237, 224, 0.85);
  padding: 4rem 0 1.75rem;
  position: relative;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 3rem;
}

.footer-grid h4 {
  color: var(--cream);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.footer-grid p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(245, 237, 224, 0.7);
}

.footer-grid ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}

.footer-grid ul a {
  color: rgba(245, 237, 224, 0.75);
  font-size: 0.95rem;
}

.footer-grid ul a:hover {
  color: var(--cream);
}

.footer-brand .brand-name {
  color: var(--cream);
}

.footer-brand .brand-name em {
  color: var(--gold);
}

.footer-brand .brand-mark {
  background: var(--terracotta);
  color: var(--cream-light);
}

.footer-bottom {
  padding-top: 1.75rem;
  border-top: 1px dashed rgba(245, 237, 224, 0.25);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: rgba(245, 237, 224, 0.55);
}

@media (max-width: 820px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* ----------- Reveal animations ----------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 600ms var(--easing), transform 600ms var(--easing);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
  html {
    scroll-behavior: auto;
  }
}
