/* nonprofitglee.org: "a reading room, not a landing page."
   Tokens from the Claude Design style foundation (tokens.css). */
:root {
  --paper: #F7F4EE;  --paper-sunk: #EFEAE1;  --rule: #D9D2C6;
  --ink: #1F1C19;    --ink-2: #5A534B;
  --accent: #2F6A62; /* links + one mark detail only; never emphasis */
  --night: #1B1A18;  --night-ink: #EDE8DF;  --night-ink-2: #BDB5A8;  --accent-night: #86BFB4;

  --serif: 'Newsreader', Georgia, serif;
  --sans: 'Public Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --t-meta: 14px; --t-ui: 16px; --t-body: 20px; --t-lead: 22px;
  --t-h3: 24px; --t-h2: 30px; --t-h1: clamp(36px, 5vw, 52px); --t-display: clamp(40px, 6vw, 64px);
  --lh-body: 1.65; --measure: 680px;

  --radius: 3px; --radius-card: 4px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: var(--t-ui)/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
::selection { background: #CFE3DE; }
p { margin: 0; }
.wrap { max-width: 1440px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 56px); }
.read { max-width: var(--measure); }
.label { font: 400 13px/1.4 var(--mono); color: var(--ink-2); }

/* Header */
header.site { border-bottom: 1px solid var(--rule); }
header.site .wrap { padding-top: 20px; padding-bottom: 20px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px 32px; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); }
.brand svg { width: 21px; height: 21px; flex: none; }
.word { font: 400 21px/1 var(--serif); letter-spacing: -0.012em; white-space: nowrap; }
.word b { font-weight: 700; }
.word .org { color: var(--accent); }
nav.main { display: flex; flex-wrap: wrap; gap: 4px 22px; font-size: 15px; }
nav.main a { color: var(--ink); text-decoration: none; }
nav.main a:hover { text-decoration: underline; text-underline-offset: 6px; }
nav.main a[aria-current="page"] { font-weight: 600; text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1.5px; }

/* Page blocks */
main { padding: 88px 0 96px; }
.stack { display: flex; flex-direction: column; gap: 80px; }
.filter { font: 400 24px/1.5 var(--serif); text-wrap: pretty; max-width: 760px; }
h1 { margin: 0; font: 600 var(--t-h1)/1.08 var(--serif); letter-spacing: -0.02em; text-wrap: balance; }
h1.display { font-size: var(--t-display); line-height: 1.04; letter-spacing: -0.022em; }
.who-line { font-size: 16px; line-height: 1.6; color: var(--ink-2); max-width: 58ch; }
.intro { display: flex; flex-direction: column; gap: 28px; max-width: 760px; }
.dek { font: 400 21px/1.55 var(--serif); text-wrap: pretty; }
h2.sec { margin: 0; font: 600 var(--t-h2)/1.2 var(--serif); letter-spacing: -0.01em; }
h2.group { margin: 0; font: 600 28px/1.2 var(--serif); }
.group-note { font-size: 15px; line-height: 1.5; color: var(--ink-2); margin: 4px 0 14px; }
.body { font: 400 var(--t-body)/var(--lh-body) var(--serif); display: flex; flex-direction: column; gap: 22px; }
.pivot { font-weight: 700; }

/* Primary CTA: one per page */
.cta { display: inline-block; background: var(--ink); color: var(--paper); text-decoration: none; font-weight: 700; font-size: 16px; padding: 14px 22px; border-radius: var(--radius); }
.cta:hover { color: var(--paper); background: #000; }

/* "Start here" rows */
.start { display: flex; flex-direction: column; }
.start a { text-decoration: none; color: var(--ink); border-top: 1px solid var(--rule); padding: 28px 0; display: grid; grid-template-columns: minmax(160px, 220px) minmax(0, 1fr); gap: 8px 40px; }
.start a:first-of-type { border-top-color: var(--ink); }
.start a:last-of-type { border-bottom: 1px solid var(--rule); }
.start .t { display: block; font: 600 30px/1.15 var(--serif); letter-spacing: -0.01em; }
.start .d { display: block; margin-top: 8px; font: 400 19px/1.5 var(--serif); color: var(--ink-2); }
.start a:hover .t { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 5px; }
.start .label { padding-top: 8px; }

/* Archive rows */
.archive { display: flex; flex-direction: column; border-bottom: 1px solid var(--rule); }
.archive a { text-decoration: none; color: var(--ink); border-top: 1px solid var(--rule); padding: 16px 0; display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
.archive .t { font: 400 20px/1.35 var(--serif); }
.archive .s { display: block; font: 400 16px/1.45 var(--serif); color: var(--ink-2); margin-top: 4px; }
.archive .label { font-size: 12px; white-space: nowrap; text-align: right; }
.archive a:hover .t { text-decoration: underline; text-underline-offset: 4px; }
.groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 56px 64px; }

/* Paired-article module */
.pair { background: var(--paper-sunk); border-radius: var(--radius-card); padding: 28px; display: flex; flex-direction: column; gap: 18px; }
.pair-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.pair-grid > * { border-radius: var(--radius-card); padding: 22px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 8px; }
.pair-grid .a { background: var(--paper); border: 1px solid var(--rule); }
.pair-grid .b { background: var(--paper); border: 1.5px solid var(--ink); }
.pair-grid .t { font: 600 22px/1.2 var(--serif); }
.pair-grid .d { font: 400 17px/1.5 var(--serif); color: var(--ink-2); }

/* 90-10 figure */
.balance { display: grid; gap: 10px; margin: 6px 0; font-family: var(--sans); }
.bal-row { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 14px; }
.bal-bar { display: flex; height: 34px; border-radius: var(--radius); overflow: hidden; font: 500 12px/1 var(--mono); }
.bal-bar span { display: flex; align-items: center; padding: 0 10px; white-space: nowrap; }
.bal-bar .tech { background: var(--paper-sunk); color: var(--ink-2); border: 1px solid var(--rule); }
.bal-bar .ppl { background: var(--ink); color: var(--paper); justify-content: flex-end; }

/* Article */
article.post { max-width: var(--measure); margin: 0 auto; padding: 0 24px; }
article.post header { display: flex; flex-direction: column; gap: 16px; margin-bottom: 40px; }
article.post .lede { font: 400 var(--t-lead)/1.5 var(--serif); color: var(--ink-2); text-wrap: pretty; }
article.post .byline { font-size: 14px; color: var(--ink-2); }
.prose { font: 400 var(--t-body)/var(--lh-body) var(--serif); }
.prose > * + * { margin-top: 24px; }
.prose p { text-wrap: pretty; }
.prose h2 { margin-top: 48px; font: 600 var(--t-h2)/1.2 var(--serif); letter-spacing: -0.01em; }
.prose h3 { margin-top: 36px; font: 600 var(--t-h3)/1.25 var(--serif); }
.prose ul, .prose ol { padding-left: 1.1em; }
.prose li { padding-left: 6px; }
.prose li + li { margin-top: 10px; }
.prose blockquote { margin: 40px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 28px 0; font-size: 28px; line-height: 1.3; font-weight: 500; letter-spacing: -0.01em; }
.prose figure { margin: 32px 0; }
.prose img, .prose iframe { max-width: 100%; height: auto; display: block; border: 1px solid var(--rule); }
.prose figcaption { font: 400 14px/1.5 var(--sans); color: var(--ink-2); margin-top: 12px; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 40px 0; }
.source { margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--ink); display: flex; flex-direction: column; gap: 6px; font-size: 15px; color: var(--ink-2); }
.source strong { color: var(--ink); font-weight: 600; }

/* About */
.about { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; max-width: var(--measure); }

/* Contact */
.contact { position: relative; border: 1px solid var(--rule); border-radius: var(--radius-card); background: var(--paper); overflow: hidden; max-width: 760px; }
.contact .grid-bg { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 170px; pointer-events: none; }
.contact .inner { position: relative; padding: 40px 32px 96px; display: flex; flex-direction: column; gap: 18px; }
.contact .mark-lg { width: 56px; height: 56px; }
.headshot { display: block; margin: -12px -12px -8px; }
.headshot img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 0.98; object-fit: cover; object-position: 50% 0%;
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 55%, transparent 100%); mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 55%, transparent 100%); }
.contact .role { font: 400 19px/1.55 var(--serif); color: var(--ink-2); }
.creds { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font: 400 19px/1.4 var(--serif); color: var(--ink-2); }
.creds li { display: flex; align-items: baseline; gap: 12px; }
.creds li::before { content: ""; flex: none; width: 7px; height: 7px; background: var(--accent); transform: rotate(45deg) translateY(-3px); }
.contact .actions { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; margin-top: 8px; }
.contact .actions a:not(.cta) { font: 400 18px/1 var(--serif); }
.contact .seam-note { font: 400 12px/1.4 var(--mono); color: var(--ink-2); position: absolute; left: 32px; bottom: 16px; }

/* Home: full-width bands */
main:has(> .hero) { padding: 0; }
.hero { padding-top: clamp(48px, 7vw, 96px); }
.hero-text { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 28px clamp(32px, 5vw, 80px); align-items: end; }
.hero-text .filter { max-width: 640px; }
.hero-art { margin: clamp(24px, 4vw, 48px) 0 0; }
.hero-art { overflow: hidden; }
.hero-art svg { display: block; width: 100%; height: clamp(300px, 38vw, 640px); }
.band { padding: clamp(56px, 8vw, 112px) 0; }
.band + .band { border-top: 1px solid var(--rule); }
.band.sunk { background: var(--paper-sunk); border-top: 0; }
.split { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 48px clamp(40px, 6vw, 112px); align-items: center; }
.split > .body { max-width: var(--measure); }
.balance-card { gap: 28px; }
.balance-pict { display: flex; flex-direction: column; gap: 22px; padding: 24px 22px 18px; border-radius: var(--radius-card); background: linear-gradient(180deg, #F7F4EE 0%, #F5E6D0 60%, #F1D1AE 100%); }
.pict-row { display: flex; flex-direction: column; gap: 8px; }
.pict-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; font: 600 18px/1.3 var(--serif); }
.pict { display: block; width: 100%; height: auto; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 16px; }
.cards li { border-top: 2px solid var(--ink); background: var(--paper-sunk); padding: 22px 24px 28px; display: flex; flex-direction: column; gap: 12px; }
.cards p { font: 400 19px/1.5 var(--serif); text-wrap: pretty; }
.actions-col { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.follow { font: 400 18px/1.55 var(--serif); }

/* Presence */
.strip { margin: clamp(24px, 4vw, 48px) 0 0; overflow: hidden; }
.strip svg { display: block; width: 100%; height: clamp(110px, 13vw, 200px); }
.pair { background: linear-gradient(180deg, #F7F4EE 0%, #F5E6D0 60%, #F1D1AE 100%); padding: clamp(24px, 3vw, 40px); }
.groups { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 20px; }
.group-card { border-top: 2px solid var(--ink); background: var(--paper-sunk); padding: 24px 26px 18px; display: flex; flex-direction: column; }
.group-card .archive { border-bottom: 0; margin-top: auto; }
.archive a { transition: padding .25s ease, background-color .25s ease; }
.archive a:hover { padding-left: 8px; }

/* About + contact */
.about-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 48px clamp(40px, 6vw, 112px); align-items: start; }
.about-grid .about { max-width: var(--measure); }
.about-grid .contact { position: sticky; top: 32px; max-width: none; scroll-margin-top: 32px; }
.contact h2.sec { font-size: var(--t-h1); }

/* Footer */
footer.site { background: var(--night); color: var(--night-ink); }
footer.site .top { padding-top: 48px; padding-bottom: 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 48px; }
.foot-brand { color: var(--night-ink); }
.foot-brand svg rect:first-child { fill: var(--night-ink); }
.foot-brand .org { color: var(--accent-night); }
footer.site .wm { font: italic 400 21px/1.5 var(--serif); max-width: 44ch; text-wrap: pretty; }
footer.site .colo { font-size: 14px; line-height: 1.6; color: var(--night-ink-2); margin-top: 14px; }
footer.site nav { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 15px; }
footer.site nav a { color: var(--night-ink); }
footer.site nav a:hover { color: var(--accent-night); }
footer.site .base { padding-bottom: 32px; font: 400 12px/1 var(--mono); color: var(--night-ink-2); }

@media (max-width: 860px) {
  .hero-text, .split, .about-grid { grid-template-columns: 1fr; }
  .about-grid .contact { position: relative; top: 0; }
}
@media (max-width: 640px) {
  .hero-art svg { height: 300px; }
  main { padding: 56px 0 72px; }
  .stack { gap: 56px; }
  .filter { font-size: 21px; }
  .start a { grid-template-columns: 1fr; gap: 6px; padding: 22px 0; }
  .start .t { font-size: 25px; }
  .start .label { padding-top: 0; }
  .archive a { flex-direction: column; gap: 4px; }
  .archive .label { text-align: left; }
  .contact .inner { padding: 28px 22px 130px; }
  .prose blockquote { font-size: 24px; }
}

/* ---------- Motion ----------
   Scroll-linked where the browser supports scroll timelines (no JS);
   site.js adds a reveal-on-enter fallback elsewhere. Off for reduced motion. */
.pict .cell, .hero-art svg g, .strip svg g { transform-box: fill-box; }
.pict .cell { transform-origin: 50% 100%; }

@media (prefers-reduced-motion: no-preference) {
  /* Ambient life in the hero */
  .l-fog { animation: fog-drift 18s ease-in-out infinite alternate; }
  .kite { transform-origin: 0% 100%; animation: kite-bob 5s ease-in-out infinite alternate; }
  .bulb { animation: twinkle 3.2s ease-in-out infinite; animation-delay: calc(var(--i) * -0.37s); }
  @keyframes fog-drift { to { transform: translateX(-90px); } }
  @keyframes kite-bob { from { transform: rotate(-2.5deg); } to { transform: rotate(2deg) translateY(-6px); } }
  @keyframes twinkle { 50% { opacity: .45; } }
  .lantern { transform-origin: 50% 0%; animation: sway 4s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -0.31s); }
  @keyframes sway { from { transform: rotate(-3deg); } to { transform: rotate(3deg); } }

  @supports (animation-timeline: scroll()) {
    /* Parallax: far layers lag, the sun rises, the headline melts back into the scene */
    .l-sun, .l-birds, .l-far, .l-city, .l-houses, .hero-text {
      animation-timing-function: linear; animation-fill-mode: both;
      animation-timeline: scroll(root); animation-range: 0 90vh;
    }
    .bus, .wheel { animation-timing-function: linear; animation-fill-mode: both; animation-timeline: scroll(root); animation-range: 0 90vh; }
    .bus { animation-name: bus-drive; }
    .wheel { transform-origin: 50% 50%; animation-name: wheel-roll; }
    @keyframes bus-drive { to { transform: translateX(420px); } }
    @keyframes wheel-roll { to { transform: rotate(1080deg); } }
    .l-sun { animation-name: sun-rise; }
    .l-birds { animation-name: birds-fly; }
    .l-far { animation-name: drift-60; }
    .l-city { animation-name: drift-40; }
    .l-houses { animation-name: drift-20; }
    .hero-text { animation-name: text-recede; animation-range: 0 55vh; }
    @keyframes sun-rise { to { transform: translateY(-150px) scale(1.12); } }
    @keyframes birds-fly { to { transform: translate(140px, -40px); } }
    @keyframes drift-60 { to { transform: translateY(70px); } }
    @keyframes drift-40 { to { transform: translateY(45px); } }
    @keyframes drift-20 { to { transform: translateY(20px); } }
    @keyframes text-recede { to { opacity: .15; transform: translateY(-40px) scale(.97); } }
  }

  @supports (animation-timeline: view()) {
    .reveal {
      animation: rise linear both; animation-timeline: view();
      animation-range: entry calc(var(--i, 0) * 8%) entry calc(70% + var(--i, 0) * 8%);
    }
    @keyframes rise { from { opacity: 0; transform: translateY(36px); filter: blur(4px); } }

    /* --o is the build order from build.py: 0 stands from the start, the odd one out comes last */
    .pict { view-timeline: --row block; }
    .pict .cell:not(.static) {
      animation: grow linear both; animation-timeline: --row;
      animation-range: cover calc(4% + var(--o) * 3.6%) cover calc(11% + var(--o) * 3.6%);
    }
    @keyframes grow { from { transform: scaleY(0); } }

    /* Bands blend into each other instead of hard-cutting */
    .band.sunk { animation: sink-in linear both; animation-timeline: view(); animation-range: entry 0% entry 60%; }
    @keyframes sink-in { from { background-color: var(--paper); } }
  }

  /* Fallback (set by site.js when scroll timelines are missing) */
  .io .reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); transition-delay: calc(var(--i, 0) * 90ms); }
  .io .reveal.in { opacity: 1; transform: none; }
  .io .pict .cell { transition: transform .6s cubic-bezier(.2,.7,.2,1); transition-delay: calc(200ms + var(--o) * 80ms); }
  .io .reveal:not(.in) .pict .cell:not(.static) { transform: scaleY(0); }
}
