/* Layout concept: an illuminated-manuscript palette (ultramarine, vermilion, gold leaf)
   on cool paper. Big display type, staggered image plates with catalogue captions,
   dark ink-blue bands for rhythm. */
:root {
  --bg: #F2F3F7;
  --surface: #FFFFFF;
  --ink: #14182B;
  --muted: #4A5169;
  --rule: #D3D7E4;
  --blue: #2432A8;
  --red: #B8341C;
  --gold: #C4912A;
  --band: #151B45;
  --band-ink: #F2F3F7;
  --band-muted: #B7BEDD;
  --plate: #F6F0DC;
  --tbc-bg: #FBF0CF;
  --tbc-ink: #5C4510;
  --display: "Gloock", "Iowan Old Style", Georgia, serif;
  --body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1226; --surface: #171D3A; --ink: #ECEEF8; --muted: #A9B0CC; --rule: #2A3158;
    --blue: #93A0FF; --red: #FF8266; --gold: #E3B04B; --band: #070A18; --band-ink: #ECEEF8; --band-muted: #A9B0CC;
    --plate: #E9E1C6; --tbc-bg: #3A3115; --tbc-ink: #F0D98C; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E1226; --surface: #171D3A; --ink: #ECEEF8; --muted: #A9B0CC; --rule: #2A3158;
  --blue: #93A0FF; --red: #FF8266; --gold: #E3B04B; --band: #070A18; --band-ink: #ECEEF8; --band-muted: #A9B0CC;
  --plate: #E9E1C6; --tbc-bg: #3A3115; --tbc-ink: #F0D98C; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 1.0625rem; line-height: 1.65; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 2px; }
.wrap { max-width: 76rem; margin-inline: auto; padding-left: max(1rem, env(safe-area-inset-left, 0px), 4vw); padding-right: max(1rem, env(safe-area-inset-right, 0px), 4vw); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--surface); padding: .5rem 1rem; z-index: 20; }

.draft { background: var(--tbc-bg); color: var(--tbc-ink); font-size: .85rem; padding: .45rem 0; }
.tbc { background: var(--tbc-bg); color: var(--tbc-ink); padding: 0 .3em; border-radius: 3px; font-size: .92em; }

/* Header */
.site-header { background: var(--bg); border-bottom: 1px solid var(--rule); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 2rem; padding-block: 1rem; }
.wordmark { font-family: var(--display); font-size: 1.3rem; line-height: 1.15; color: var(--ink); text-decoration: none; }
.wordmark small { display: block; font-family: var(--mono); font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: .2rem; }
nav ul { display: flex; flex-wrap: wrap; gap: .25rem 1.4rem; list-style: none; margin: 0; padding: 0; align-items: center; }
nav a { color: var(--ink); text-decoration: none; font-size: .95rem; padding: .35rem 0; border-bottom: 3px solid transparent; }
nav a:hover, nav a[aria-current="page"] { border-bottom-color: var(--red); }
nav a.give { color: #fff; background: var(--red); padding: .45rem 1rem; border-radius: 2px; border-bottom: 0; font-weight: 500; }

/* Type */
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.08; text-wrap: balance; margin: 0 0 .5em; }
h1 { font-size: clamp(2.6rem, 7vw, 5.2rem); letter-spacing: -.015em; }
h2 { font-size: clamp(1.9rem, 4vw, 3rem); }
h3 { font-size: 1.5rem; }
p { margin: 0 0 1em; max-width: 65ch; }
.lede { font-size: 1.25rem; color: var(--muted); max-width: 48ch; }
.label { font-family: var(--mono); font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--red); margin: 0 0 .9rem; }
em.hl { font-style: italic; color: var(--blue); }

section { padding-block: clamp(2.5rem, 7vw, 5rem); }
.hero { padding-block: clamp(2rem, 6vw, 4.5rem) clamp(2.5rem, 6vw, 4rem); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }

/* Image plates with catalogue captions */
.plate { margin: 0; background: var(--surface); border: 1px solid var(--rule); padding: .55rem .55rem 0; box-shadow: 0 10px 24px -14px rgba(10,14,50,.45); }
.plate img { width: 100%; height: 100%; object-fit: cover; }
.plate figcaption { font-family: var(--mono); font-size: .7rem; letter-spacing: .04em; color: var(--muted); padding: .55rem .15rem .6rem; line-height: 1.4; }
.collage { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1.4rem .9rem; align-items: start; }
.collage .plate:nth-child(1) { grid-column: 1 / 5; }
.collage .plate:nth-child(2) { grid-column: 5 / 7; margin-top: 2.5rem; }
.collage .plate:nth-child(3) { grid-column: 1 / 3; }
.collage .plate:nth-child(4) { grid-column: 3 / 7; }
.collage .plate { animation: rise .8s ease backwards; }
.collage .plate:nth-child(2) { animation-delay: .1s; } .collage .plate:nth-child(3) { animation-delay: .2s; } .collage .plate:nth-child(4) { animation-delay: .3s; }
@keyframes rise { from { transform: translateY(18px); } }
.collage .plate img { aspect-ratio: 4/3; }
.collage .plate:nth-child(2) img, .collage .plate:nth-child(3) img { aspect-ratio: 3/4; }

/* Bands */
.band { background: var(--band); color: var(--band-ink); }
.band .label { color: var(--gold); }
.band p, .band .muted { color: var(--band-muted); }
.band a { color: var(--gold); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 2rem 3rem; }
.stat b { display: block; font-family: var(--display); font-weight: 400; font-size: clamp(2.6rem, 6vw, 4rem); line-height: 1; color: var(--gold); }
.stat span { display: block; margin-top: .5rem; color: var(--band-muted); font-size: .95rem; max-width: 22ch; }
.ornament { background: var(--plate); padding: 1rem 0; border-block: 1px solid var(--rule); }
.ornament img { margin-inline: auto; width: min(100%, 60rem); mix-blend-mode: multiply; }

.photo-band { position: relative; color: #fff; padding-block: clamp(3rem, 9vw, 7rem); isolation: isolate; background: var(--band); }
.photo-band > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.photo-band::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(10,14,50,.88), rgba(10,14,50,.45)); }
.photo-band .label { color: #F2C768; }
.photo-band p { color: #E8EAF6; }

/* Category rail on home */
.cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1rem; }
.cat { display: flex; flex-direction: column; gap: .4rem; background: var(--surface); border: 1px solid var(--rule); padding: 1.2rem 1.2rem 1.3rem; text-decoration: none; color: var(--ink); border-top: 5px solid var(--blue); }
.cat:nth-child(2) { border-top-color: var(--red); } .cat:nth-child(3) { border-top-color: var(--gold); } .cat:nth-child(4) { border-top-color: var(--ink); } .cat:nth-child(5) { border-top-color: var(--muted); }
.cat strong { font-family: var(--display); font-weight: 400; font-size: 1.4rem; line-height: 1.15; }
.cat span { color: var(--muted); font-size: .92rem; line-height: 1.5; }
.cat:hover { transform: translateY(-3px); }
.cat { transition: transform .15s ease; }

/* Items */
.item { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; padding-block: 2.5rem; border-top: 1px solid var(--rule); }
.item:nth-of-type(even) { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.item:nth-of-type(even) .plate { order: 2; }
.item .plate img { aspect-ratio: auto; max-height: 30rem; margin-inline: auto; object-fit: contain; background: var(--plate); width: 100%; }
.shelf { font-family: var(--mono); font-size: .8rem; letter-spacing: .06em; color: var(--red); margin: 0 0 .5rem; }
.facts { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: 1rem 0 0; }
.facts li { font-family: var(--mono); font-size: .75rem; border: 1px solid var(--rule); background: var(--surface); padding: .25rem .6rem; border-radius: 99px; }
blockquote { margin: 1.2rem 0; padding: .2rem 0 .2rem 1.2rem; border-left: 4px solid var(--gold); font-family: var(--display); font-size: 1.25rem; line-height: 1.35; max-width: 40ch; }
blockquote cite { display: block; font: normal .8rem var(--mono); color: var(--muted); margin-top: .5rem; }
.slim { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; margin-top: 1rem; }
.slim div { background: var(--surface); border: 1px solid var(--rule); padding: 1rem 1.2rem; }
.slim h3 { font-size: 1.2rem; margin-bottom: .3em; }
.slim p { font-size: .95rem; color: var(--muted); margin: 0; }

/* Timeline */
.timeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0; border-top: 3px solid var(--gold); margin-top: 1.5rem; }
.timeline li { list-style: none; padding: 1rem 1rem 0 0; position: relative; }
.timeline li::before { content: ""; position: absolute; top: -9px; left: 0; width: 15px; height: 15px; border-radius: 50%; background: var(--red); border: 3px solid var(--bg); }
.timeline b { font-family: var(--display); font-weight: 400; font-size: 1.6rem; display: block; }
.timeline span { font-size: .9rem; color: var(--muted); display: block; line-height: 1.4; }
ol.timeline { padding: 0; margin-bottom: 0; }

/* Buttons */
.btn { display: inline-block; font: 500 1rem var(--body); text-decoration: none; padding: .8rem 1.5rem; border-radius: 2px; border: 2px solid var(--red); }
.btn.primary { background: var(--red); color: #fff; }
.btn.secondary { color: inherit; background: transparent; border-color: currentColor; }
.btn:hover { filter: brightness(1.1); }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

.cols-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); gap: 2.5rem; }
.entries { list-style: none; margin: 0; padding: 0; }
.entries li { display: grid; grid-template-columns: 10rem minmax(0, 1fr); gap: .5rem 1.5rem; padding-block: 1.3rem; border-top: 1px solid var(--rule); }
.entries li:last-child { border-bottom: 1px solid var(--rule); }
.entries .meta { font-family: var(--mono); font-size: .8rem; color: var(--muted); }
.entries h3 { font-size: 1.35rem; margin-bottom: .3em; }
.entries p { margin-bottom: 0; color: var(--muted); }
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1.2rem; }
.tier { background: var(--surface); border: 1px solid var(--rule); border-top: 5px solid var(--red); padding: 1.5rem; display: flex; flex-direction: column; gap: .5rem; }
.tier h3 { margin: 0; } .tier p { color: var(--muted); flex: 1; }
.panel { background: var(--surface); border: 1px solid var(--rule); padding: 1.5rem; }
address { font-style: normal; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-family: var(--mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.table-wrap { overflow-x: auto; }

.site-footer { background: var(--band); color: var(--band-muted); padding-block: 3rem; font-size: .92rem; }
.site-footer .wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1.5rem 3rem; }
.site-footer p { margin-bottom: .4rem; } .site-footer strong { color: var(--band-ink); }
.site-footer a { color: var(--gold); }

@media (max-width: 800px) {
  .hero-grid, .item, .item:nth-of-type(even) { grid-template-columns: minmax(0, 1fr); }
  .item:nth-of-type(even) .plate { order: 0; }
  .entries li { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .collage .plate { animation: none; } .cat { transition: none; } }

/* Grants */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.chip { font: 500 .9rem var(--body); color: var(--ink); background: var(--surface); border: 1px solid var(--rule); border-radius: 99px; padding: .4rem 1rem; cursor: pointer; }
.chip.on { background: var(--blue); color: var(--bg); border-color: var(--blue); }
.muted { color: var(--muted); font-size: .88rem; }
tr[hidden] { display: none; }

/* Grants lists */
.gbar { display: grid; gap: .8rem; margin-bottom: 2.5rem; max-width: 52rem; }
.gbar input { font: 1.05rem var(--body); padding: .8rem 1rem; border: 2px solid var(--rule); background: var(--surface); color: var(--ink); border-radius: 2px; width: 100%; }
.gbar input:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px var(--gold); }
.gyear { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: .5rem 2rem; padding-block: 1.4rem; border-top: 1px solid var(--rule); }
.gyear h3 { font-size: 2rem; margin: 0; color: var(--blue); }
.glist { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.glist li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .2rem 1rem; align-items: baseline; }
.glist li[hidden], .gyear[hidden] { display: none; }
.g-tag { font-family: var(--mono); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.g-title { max-width: 62ch; }
@media (max-width: 700px) { .gyear { grid-template-columns: minmax(0, 1fr); } }

/* decorative marbled papers */
.cat { position: relative; overflow: hidden; padding-top: 6.5rem; }
.cat::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5rem; background: var(--sw) center/cover; border-bottom: 1px solid var(--rule); }
.marble-strip { height: clamp(3rem, 8vw, 5.5rem); background: var(--sw) center/cover; border-block: 1px solid var(--rule); }
.photo-band > img { opacity: .9; }
.photo-band::before { background: linear-gradient(90deg, rgba(10,14,50,.92), rgba(10,14,50,.6)); }
.site-footer { background-image: linear-gradient(rgba(21,27,69,.93), rgba(21,27,69,.93)), url(img/paper-diamond.jpg); background-size: auto, 260px; }
.ornament img { max-height: 9rem; width: auto; max-width: 100%; }
.stats.three { grid-template-columns: repeat(3, 1fr); } @media (max-width: 760px) { .stats.three { grid-template-columns: 1fr; } }
.stats.three .stat b { font-size: clamp(2rem, 4.2vw, 3.2rem); white-space: nowrap; }
.prose { max-width: 40rem; } .prose p { margin-bottom: 1.1rem; line-height: 1.7; }
.facts a { color: var(--blue); text-decoration: none; } .facts a:hover { text-decoration: underline; }
.prose h2 { margin-top: 2.5rem; font-size: clamp(1.5rem, 3vw, 2rem); } .prose h2 + .label { margin-top: -.4rem; margin-bottom: 1.2rem; }

/* Year-by-year grant totals (grants page band) */
.yearbars { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .55rem; max-width: 46rem; }
.yearbars li { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); align-items: center; gap: 1rem; }
.yearbars .yr { font-family: var(--mono); font-size: .85rem; color: var(--band-muted); }
.yearbars .track { display: flex; align-items: center; gap: .75rem; height: 1.1rem; }
.yearbars .bar { display: block; flex: none; width: calc(var(--w) * (100% - 6.5rem)); height: 100%; background: var(--gold); border-radius: 0 4px 4px 0; }
.yearbars .amt { font-family: var(--mono); font-size: .9rem; color: var(--band-ink); white-space: nowrap; }
@media (max-width: 480px) { .yearbars li { grid-template-columns: 3rem minmax(0, 1fr); gap: .6rem; } }
@media (forced-colors: active) { .yearbars .bar { background: CanvasText; } }
@media (max-width: 700px) { .gyear .gnote { grid-column: 1 !important; } }


/* News page with an embedded video */
.news-split { display: grid; grid-template-columns: minmax(0, 40rem) minmax(0, 22rem); gap: 3.5rem; align-items: start; justify-content: space-between; }
.reel h2 { margin-top: 0; font-size: clamp(1.5rem, 3vw, 2rem); }
.reel .instagram-media { margin: 1rem 0 !important; width: 100% !important; min-width: 0 !important; max-width: 100% !important; }
.reel iframe { min-width: 0 !important; max-width: 100% !important; }
@media (max-width: 58rem) { .news-split { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; } }

/* Home page statement */
.statement { max-width: 40rem; margin-top: 1.25rem; }
.statement p { margin: 0 0 1rem; line-height: 1.65; }
.statement + .actions { margin-top: 1.5rem; }
.hero-grid:has(.statement) { align-items: start; }
