/* BookMode's past-program story: torn papyrus scraps with real photos taped on. */
:root {
  --desk: #27403b;
  --desk-2: #1f3531;
  --paper: #fbf6ea;
  --paper-edge: #eadcbc;
  --ink: #2a2118;
  --ink-soft: #57483a;
  --seal: #9e2f22;
  --gold: #8e5e12;
  --teal: #24646b;
  --wood: #a86d3c;
  --wood-dark: #6f4520;
  --rule: rgb(90 60 20 / .22);

  --serif: "Fraunces", Georgia, serif;
  --sans: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; color: var(--ink); font: 400 20px/1.62 var(--sans);
  background: radial-gradient(ellipse at 50% 0%, #2f4b45, var(--desk) 45%, var(--desk-2));
  background-attachment: fixed;
}
@media (max-width: 640px) { body { font-size: 18px; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
img { max-width: 100%; display: block; height: auto; }
a { color: var(--teal); text-underline-offset: .18em; text-decoration-thickness: 1.5px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 3px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.1; margin: 0 0 .45em; text-wrap: balance;
  font-variation-settings: "SOFT" 60, "WONK" 0; letter-spacing: -.01em; }
h1 { font-size: clamp(2.5rem, 5.6vw, 4.2rem); }
h2 { font-size: clamp(1.9rem, 3.8vw, 2.7rem); }
h3 { font-size: 1.4rem; }
p { margin: 0 0 1em; }
.lead { font-size: 1.2em; color: var(--ink-soft); }
.chapter { font: italic 500 1.15rem/1 var(--serif); color: var(--gold); margin: 0 0 14px; }
.wrap { width: min(1100px, 100% - 40px); margin-inline: auto; }

/* ---------- header ---------- */
.site-header .wrap { display: flex; align-items: center; gap: 20px; min-height: 88px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #f6ead0;
  font: 600 1.7rem/1 var(--serif); }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a { color: #f6ead0; text-decoration: none; font-weight: 700; font-size: 1rem; padding: 8px 12px; border-radius: 6px; }
.nav a:hover { background: rgb(255 255 255 / .1); }
.nav a.give { background: var(--seal); color: #fff; padding: 10px 18px; border-radius: 999px; margin-left: 6px; }
.nav a.give:hover { background: #f6ead0; color: var(--ink); }
.nav a.give { white-space: nowrap; }
@media (max-width: 860px) { .nav a:not(.give) { display: none; } }
@media (max-width: 420px) { .brand { font-size: 1.4rem; } .nav a.give { padding: 9px 14px; font-size: .95rem; } }

/* ---------- the scraps ---------- */
/* .scrap carries the shadow and the tilt; .paper inside carries the papyrus and the torn
   edge (a clip-path polygon drawn by scraps.js, so the shadow has to live on the parent). */
.scrap { --tilt: 0deg; position: relative; margin: 70px auto; max-width: 1000px;
  filter: drop-shadow(0 14px 16px rgb(0 0 0 / .38)) drop-shadow(0 2px 2px rgb(0 0 0 / .25));
  transform: rotate(var(--tilt)); }
.scrap.narrow { max-width: 840px; }
.scrap.left { margin-left: 0; }
.scrap.right { margin-right: 0; }
.paper { position: relative;
  background:
    radial-gradient(ellipse at 50% 45%, transparent 55%, rgb(120 72 18 / .22) 100%),
    linear-gradient(rgb(255 250 235 / .35), rgb(255 250 235 / .35)),
    url("/assets/papyrus.jpg") center / 900px;
  padding: clamp(40px, 6vw, 72px) clamp(30px, 6.5vw, 84px); }
@media (max-width: 760px) { .scrap { margin: 44px auto; transform: rotate(calc(var(--tilt) * .35)); } .scrap.left, .scrap.right { margin-inline: 0; } }

/* settle onto the desk: short, starts before the scrap is on screen, and anything
   already scrolled past just appears, so fast scrolling never shows empty space */
.js .scrap.pending { opacity: 0; transform: translateY(46px) rotate(calc(var(--tilt) * -3)); }
.js .scrap.shown { transition: opacity .45s ease-out, transform .6s cubic-bezier(.2, .9, .3, 1.15); }
@media (max-width: 760px) { .js .scrap.pending { transform: translateY(28px); } }
@media (prefers-reduced-motion: reduce) { .js .scrap.pending { opacity: 1; transform: rotate(var(--tilt)); } .js .scrap.shown { transition: none; } }

/* tape holding the photos on */
.taped { position: relative; }
.taped::before { content: ""; position: absolute; z-index: 2; top: -14px; left: 50%; width: 110px; height: 30px; margin-left: -55px;
  background: rgb(246 238 214 / .78); box-shadow: 0 1px 2px rgb(0 0 0 / .15); transform: rotate(-3deg);
  clip-path: polygon(0 8%, 4% 0, 9% 10%, 14% 0, 100% 4%, 97% 50%, 100% 96%, 0 100%, 3% 50%); }

/* ---------- buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 14px; }
.button { display: inline-block; font-weight: 700; font-size: 1.05rem; text-decoration: none; padding: 16px 26px;
  border-radius: 999px; background: var(--seal); color: #fff; max-width: 100%; text-align: center; }
.button:hover { background: var(--ink); color: #fff; }
.button.outline { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.button.outline:hover { background: var(--ink); color: #fff; }

/* ---------- 1. opening ---------- */
.opening { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.opening .lead { margin-bottom: 28px; }
.foundation-logo { display: block; width: 150px; margin-bottom: 26px; }
.program-note { border-left: 3px solid var(--gold); padding-left: 18px; font-size: 1rem; margin-bottom: 28px; }
.framed { border: 8px solid #fff; box-shadow: 0 10px 24px -10px rgb(0 0 0 / .35); }
.opening .framed { transform: rotate(1.5deg); aspect-ratio: 4 / 3.2; object-fit: cover; width: 100%; }
.caption { font: italic 400 .95rem/1.4 var(--serif); color: var(--ink-soft); margin-top: 12px; text-align: center; }
@media (max-width: 860px) { .opening { grid-template-columns: 1fr; } }

/* ---------- 2. proof ---------- */
.figures { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 34px 0 38px;
  border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule); }
.figures div { padding: 22px 18px 20px 0; }
.figures div + div { padding-left: 20px; border-left: 1px solid var(--rule); }
.figures b { display: block; font: 600 clamp(2.2rem, 4.4vw, 3.1rem)/1 var(--serif); color: var(--ink); margin-bottom: 8px; }
.figures span { font-size: 1rem; color: var(--ink-soft); line-height: 1.4; display: block; }
@media (max-width: 860px) { .figures { grid-template-columns: 1fr 1fr; }
  .figures div:nth-child(3) { border-left: 0; padding-left: 0; } .figures div:nth-child(n+3) { border-top: 1px solid var(--rule); } }
.photo-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 22px; }
.photo-row img { aspect-ratio: 1; object-fit: cover; width: 100%; }
.photo-row figure:nth-child(2) img { object-position: 50% 70%; }
.photo-row figure { margin: 0; }
.photo-row figure:nth-child(1) img { transform: rotate(-1.5deg); }
.photo-row figure:nth-child(3) img { transform: rotate(1.2deg); }
@media (max-width: 760px) { .photo-row { grid-template-columns: 1fr 1fr; } .photo-row figure:nth-child(3) { display: none; } }
blockquote { margin: 34px 0 0; padding: 0 0 0 24px; border-left: 3px solid var(--gold);
  font: italic 400 1.35rem/1.45 var(--serif); color: var(--ink); max-width: 46ch; }

/* ---------- 3. the problem ---------- */
.problem { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 48px; align-items: start; }
.reading-chart { grid-column: 1 / -1; margin: 18px 0 0; }
.problem .intro { grid-column: 1 / -1; }
.problem .chart { background: #fff; padding: 12px; }
.problem ul { padding-left: 1.1em; margin: 0; }
.problem li::marker { color: var(--gold); }
@media (max-width: 860px) { .problem { grid-template-columns: 1fr; } }

/* ---------- 4. how it worked ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 34px; margin-top: 30px; }
.steps h3 { margin-bottom: 8px; }
.steps .num { font: italic 600 2.4rem/1 var(--serif); color: var(--gold); display: block; margin-bottom: 10px; }
.steps p { font-size: 1.05rem; margin: 0; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; gap: 24px; } }

/* ---------- 5. what children received ---------- */
.gift { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.gift ul { list-style: none; padding: 0; margin: 0 0 26px; }
.gift li { padding: 12px 0 12px 36px; border-bottom: 1px solid var(--rule); position: relative; }
.gift li::before { content: ""; position: absolute; left: 4px; top: 21px; width: 16px; height: 9px;
  border-left: 3px solid var(--teal); border-bottom: 3px solid var(--teal); transform: rotate(-45deg); }
.gift .framed { transform: rotate(-1.5deg); aspect-ratio: 3 / 4; object-fit: cover; width: 100%; max-width: 420px; margin-left: auto; }
@media (max-width: 860px) { .gift { grid-template-columns: 1fr; } .gift .framed { margin: 0 auto; } }

/* ---------- 6. who's behind it ---------- */
.partners { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 26px; }
.partners a, .partners .partner { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 12px; min-height: 160px;
  background: rgb(255 255 255 / .55); border: 1px solid var(--rule); padding: 20px 14px 16px; text-decoration: none; color: var(--ink);
  font-weight: 700; font-size: .98rem; text-align: center; }
.partners a:hover { border-color: var(--ink); }
.partners img { max-height: 84px; width: auto; margin: auto 0; }
.partners img.dark { filter: brightness(0); height: 70px; }
@media (max-width: 700px) { .partners { grid-template-columns: 1fr; } }

/* ---------- 7. two ways to help ---------- */
.paths { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-top: 26px; }
.paths > div { padding: 6px 36px 6px 0; }
.paths > div + div { padding: 6px 0 6px 36px; border-left: 1px solid var(--rule); }
.paths p { margin-bottom: 22px; }
@media (max-width: 760px) { .paths { grid-template-columns: 1fr; }
  .paths > div + div { border-left: 0; border-top: 1px solid var(--rule); padding: 28px 0 0; margin-top: 28px; } }
.contact-line { margin: 32px 0 0; padding-top: 24px; border-top: 1px solid var(--rule); font-size: 1rem; }

/* footer */
.site-footer { padding: 30px 20px 70px; text-align: center; font-size: 1rem; color: #cdd8d2; }
.site-footer a { color: #f6ead0; }
