/* 1. Fonts (self-hosted, variable) */
@font-face { font-family: "Bricolage Grotesque"; src: url("/assets/fonts/bricolage-grotesque-latin-standard-normal.woff2") format("woff2"); font-weight: 200 800; font-stretch: 75% 100%; font-display: swap; }
@font-face { font-family: "Geist"; src: url("/assets/fonts/geist-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist"; src: url("/assets/fonts/geist-latin-wght-italic.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }

/* 2. Tokens: the logo's charcoal, grey and red, plus the banner swallowtail */
:root {
  --ink: #232326;
  --text: #3c3d41;
  --grey: #939598;
  --muted: #6b6d72;
  --red: #ac1927;
  --red-dark: #861320;
  --red-tint: #fbeef0;
  --panel: #f4f4f5;
  --line: #e4e4e7;
  --paper: #ffffff;

  --display: "Bricolage Grotesque", "Arial Narrow", Arial, sans-serif;
  --sans: "Geist", "Segoe UI", Arial, sans-serif;

  --r-s: 10px; --r-m: 16px; --r-l: 28px; --pill: 999px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px; --s9: 112px;
  --wrap: 1240px;
  --column: 760px;
}

/* 3. Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }
body { margin: 0; background: var(--paper); color: var(--text); font: 400 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--red); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--red-dark); }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3, h4 { font-family: var(--display); color: var(--ink); font-weight: 700; line-height: 1.02; letter-spacing: -0.02em; margin: 0 0 var(--s4); }
h1 { font-size: clamp(40px, 6vw, 72px); font-weight: 800; letter-spacing: -0.035em; }
h2 { font-size: clamp(30px, 3.6vw, 44px); letter-spacing: -0.03em; }
h3 { font-size: 23px; font-weight: 650; letter-spacing: -0.015em; line-height: 1.15; }
h4 { font-size: 20px; font-weight: 650; }
p { margin: 0 0 var(--s4); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: var(--s6); padding-right: var(--s6); }
.column { max-width: var(--column); margin-left: auto; margin-right: auto; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff; padding: var(--s3) var(--s4); z-index: 20; }
.skip:focus { left: var(--s4); top: var(--s4); }

/* 4. Buttons and pills */
.btn { display: inline-flex; align-items: center; gap: var(--s2); font: 600 16px/1 var(--sans); padding: 15px 24px; border-radius: var(--pill); text-decoration: none; border: 1.5px solid var(--ink); color: var(--ink); background: transparent; }
.btn:hover { background: var(--ink); color: #fff; }
.btn-red { background: var(--red); border-color: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-dark); border-color: var(--red-dark); color: #fff; }
.pills { display: flex; flex-wrap: wrap; gap: var(--s2); list-style: none; margin: 0; padding: 0; }
.pill { display: inline-flex; align-items: center; gap: var(--s2); padding: 8px 14px; border-radius: var(--pill); background: var(--panel); color: var(--ink); font: 500 15px/1.2 var(--sans); text-decoration: none; border: 1px solid transparent; cursor: pointer; }
.pill:hover { border-color: var(--ink); color: var(--ink); }
.pill .n { color: var(--muted); font-variant-numeric: tabular-nums; }
.pill[aria-pressed="true"], .pill.on { background: var(--ink); color: #fff; }
.pill[aria-pressed="true"] .n, .pill.on .n { color: #c9c9cc; }

/* 5. Header */
.site-head { position: sticky; top: 0; z-index: 10; background: var(--paper); border-bottom: 3px solid var(--red); box-shadow: 0 2px 10px rgba(35, 35, 38, 0.08); }
.site-head .wrap { display: flex; align-items: center; gap: var(--s5); min-height: 76px; }
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-decoration: none; margin-right: auto; padding: 10px 0; }
.brand img { height: 38px; width: auto; }
.brand-years { font: 600 12px/1.2 var(--sans); color: var(--ink); letter-spacing: 0.01em; padding-left: 2px; white-space: nowrap; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; }
.nav a { display: block; padding: 9px 13px; border-radius: var(--pill); font: 600 15.5px/1.2 var(--sans); color: var(--ink); text-decoration: none; white-space: nowrap; }
.nav a:hover { background: #e9e9eb; color: var(--ink); }
.nav a[aria-current="page"] { background: var(--red); color: #fff; }
.head-cta { font: 600 14.5px/1 var(--sans); padding: 12px 18px; border-radius: var(--pill); background: var(--ink); color: #fff; text-decoration: none; white-space: nowrap; }
.head-cta:hover { background: var(--red); color: #fff; }
.nav-toggle { display: none; align-items: center; gap: 10px; font: 600 15px var(--sans); background: var(--ink); border: 0; color: #fff; padding: 11px 18px; border-radius: var(--pill); cursor: pointer; }
.nav-toggle .bars, .nav-toggle .bars::before, .nav-toggle .bars::after { display: block; width: 16px; height: 2px; background: currentColor; border-radius: 2px; position: relative; }
.nav-toggle .bars::before, .nav-toggle .bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle .bars::before { top: -5px; }
.nav-toggle .bars::after { top: 5px; }
.nav-toggle[aria-expanded="true"] { background: var(--red); }
.nav-toggle[aria-expanded="true"] .bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .bars::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bars::after { top: 0; transform: rotate(-45deg); }

/* 6. Home hero with the swallowtail banner */
.hero { padding: var(--s8) 0 var(--s7); }
.hero .wrap { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: var(--s8); align-items: center; }
.hero h1 { font-size: clamp(52px, 8.4vw, 116px); line-height: 0.9; font-stretch: 88%; margin-bottom: var(--s5); }
.hero h1 em { font-style: normal; color: var(--red); display: block; }
.hero p { font-size: 20px; line-height: 1.6; max-width: 32em; color: var(--text); margin-bottom: var(--s6); }
.hero .actions { display: flex; flex-wrap: wrap; gap: var(--s3); }
.portrait-wrap { position: relative; justify-self: end; width: min(100%, 440px); padding: 0 0 26px 26px; }
.portrait-wrap::before { content: ""; position: absolute; left: 0; bottom: 0; width: 78%; height: 86%; background: var(--red); border-radius: var(--r-l) var(--r-l) 0 0; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 88%, 0 100%); }
.portrait-wrap img { position: relative; border-radius: var(--r-l); width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.portrait-wrap figcaption { position: absolute; right: 14px; bottom: 40px; background: rgba(255, 255, 255, 0.92); color: var(--ink); font: 500 13px var(--sans); padding: 6px 12px; border-radius: var(--pill); }

/* 7. Career line (a real sequence, so it is numbered by year) */
.career { background: var(--panel); border-radius: var(--r-l); padding: var(--s6) var(--s6) var(--s5); }
.career h2 { font-size: 26px; margin-bottom: var(--s5); }
.career ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--s4); position: relative; }
.career ol::before { content: ""; position: absolute; left: 6px; right: 6px; top: 7px; height: 2px; background: var(--line); }
.career li { position: relative; padding-top: var(--s6); font-size: 15px; line-height: 1.45; color: var(--text); }
.career li::before { content: ""; position: absolute; top: 0; left: 0; width: 16px; height: 16px; border-radius: 50%; background: var(--paper); border: 3px solid var(--red); }
.career b { display: block; font: 700 22px/1.1 var(--display); color: var(--ink); letter-spacing: -0.02em; margin-bottom: var(--s1); }

/* 8. Sections */
.section { padding: var(--s8) 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: var(--s5); margin-bottom: var(--s6); }
.section-head h2 { margin: 0; }
.section-head p { margin: var(--s2) 0 0; color: var(--muted); }
.link-arrow { font: 600 16px var(--sans); color: var(--ink); text-decoration: none; border-bottom: 1.5px solid var(--red); padding-bottom: 2px; white-space: nowrap; }
.link-arrow:hover { color: var(--red); }

/* 9. Story cards and the news grid */
.bento { display: grid; grid-template-columns: 1.4fr 1fr 1fr; grid-template-rows: auto auto; gap: var(--s6) var(--s5); }
.bento .story:first-child { grid-row: span 2; }
.bento .story:first-child .story-img { aspect-ratio: 4 / 3.4; }
.bento .story:first-child h3 { font-size: clamp(26px, 2.6vw, 34px); }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s6) var(--s5); list-style: none; margin: 0; padding: 0; }
.story { display: flex; flex-direction: column; min-width: 0; }
.story-img { display: block; aspect-ratio: 16 / 10; border-radius: var(--r-m); overflow: hidden; background: var(--panel); margin-bottom: var(--s4); }
.story-img img { width: 100%; height: 100%; object-fit: cover; }
.story-img.empty { display: grid; place-items: center; background: var(--ink); color: #fff; font: 700 22px var(--display); letter-spacing: -0.01em; padding: var(--s4); text-align: center; }
.story-img.empty::after { content: ""; }
.story .meta { margin-bottom: var(--s2); }
.story h3 { margin: 0 0 var(--s2); }
.story h3 a { color: var(--ink); text-decoration: none; background-image: linear-gradient(var(--red), var(--red)); background-size: 0 1.5px; background-repeat: no-repeat; background-position: 0 100%; }
.story h3 a:hover { background-size: 100% 1.5px; }
.story p { margin: 0; font-size: 15.5px; color: var(--muted); }
.meta { font: 500 14px/1.4 var(--sans); color: var(--muted); }
.meta a { color: var(--muted); }
.tag { display: inline-block; background: var(--red-tint); color: var(--red); border-radius: var(--pill); padding: 2px 10px; font: 600 12.5px/1.6 var(--sans); margin-right: var(--s2); text-decoration: none; }
a.tag:hover { background: var(--red); color: #fff; }

/* 10. Place band and help panel */
.place { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s7); align-items: center; }
.place img { border-radius: var(--r-l); aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.place p { font-size: 18.5px; }
.place .pills { margin: var(--s5) 0 var(--s6); }
.help { background: var(--ink); color: #d9d9dc; border-radius: var(--r-l); padding: var(--s7); display: grid; grid-template-columns: 1fr 1fr; gap: var(--s6); align-items: center; }
.help h2 { color: #fff; }
.help p { font-size: 18px; }
.help .links { display: grid; gap: var(--s3); }
.help .links a { display: block; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.16); border-radius: var(--r-m); padding: var(--s4) var(--s5); color: #fff; text-decoration: none; font: 600 18px/1.3 var(--sans); }
.help .links a span { display: block; font: 400 15px/1.4 var(--sans); color: #b9b9bd; margin-top: 2px; }
.help .links a:hover { border-color: #fff; }

/* 11. Page head, article, prose */
.page-head { padding: var(--s7) 0 var(--s5); }
.crumbs { font: 500 14px var(--sans); color: var(--muted); margin-bottom: var(--s4); display: flex; flex-wrap: wrap; gap: var(--s2); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--red); text-decoration: underline; }
.crumbs span { color: var(--grey); }
.page-head h1 { font-stretch: 92%; }
.lead { font-size: 19px; line-height: 1.6; color: var(--muted); max-width: var(--column); }
.article-hero { max-width: 1040px; margin: var(--s5) auto var(--s7); }
.article-hero img { width: 100%; border-radius: var(--r-l); max-height: 620px; object-fit: cover; }
.prose { font-size: 18.5px; line-height: 1.75; color: var(--text); }
.prose > *:first-child { margin-top: 0; }
.prose h2 { font-size: 32px; margin-top: var(--s7); }
.prose h3 { font-size: 25px; margin-top: var(--s6); }
.prose h4 { font-size: 21px; margin-top: var(--s5); }
.prose strong { color: var(--ink); font-weight: 650; }
.prose ul, .prose ol { padding-left: 1.25em; margin: 0 0 var(--s5); }
.prose li { margin-bottom: var(--s2); }
.prose li::marker { color: var(--red); }
.prose blockquote { margin: var(--s6) 0; padding: var(--s2) 0 var(--s2) var(--s5); border-left: 3px solid var(--red); font: 500 22px/1.5 var(--display); letter-spacing: -0.01em; color: var(--ink); }
.prose blockquote strong, .prose blockquote em { font-weight: inherit; font-style: normal; }
.prose img { border-radius: var(--r-m); margin: var(--s6) 0; }
.prose video { width: 100%; border-radius: var(--r-m); background: #000; margin: var(--s6) 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: 15.5px; margin: var(--s5) 0; }
.prose td, .prose th { border-bottom: 1px solid var(--line); padding: var(--s2) var(--s3); text-align: left; vertical-align: top; }
.article-foot { border-top: 1px solid var(--line); margin-top: var(--s7); padding-top: var(--s5); }
.article-foot .pills { margin-top: var(--s3); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); margin-top: var(--s6); }
.pager a { display: block; background: var(--panel); border-radius: var(--r-m); padding: var(--s4) var(--s5); text-decoration: none; color: var(--ink); font: 600 16px/1.35 var(--sans); }
.pager a:hover { background: var(--red-tint); }
.pager span { display: block; font: 500 13px var(--sans); color: var(--muted); margin-bottom: 4px; }
.pager .older { text-align: right; grid-column: 2; }

/* 12. News: filters and lists */
.toolbar { position: sticky; top: 77px; z-index: 5; background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(8px); padding: var(--s4) 0; margin-bottom: var(--s5); border-bottom: 1px solid var(--line); }
.search { display: flex; align-items: center; gap: var(--s3); background: var(--panel); border-radius: var(--pill); padding: 4px 6px 4px 20px; max-width: 560px; margin-bottom: var(--s4); }
.search input { flex: 1; border: 0; background: transparent; font: 400 17px var(--sans); padding: 12px 0; color: var(--ink); min-width: 0; }
.search input:focus { outline: none; }
.search:focus-within { outline: 3px solid var(--red); outline-offset: 2px; }
.search .count-line { font: 500 14px var(--sans); color: var(--muted); padding-right: var(--s4); white-space: nowrap; }
.year { font-size: 26px; margin: var(--s7) 0 var(--s5); display: flex; align-items: center; gap: var(--s4); }
.year::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.empty-msg { font-size: 18px; color: var(--muted); }

/* 13. Gallery */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s3); margin-bottom: var(--s7); }
.gallery button { padding: 0; border: 0; background: var(--panel); cursor: zoom-in; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--r-m); }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery button:hover img { filter: brightness(1.06); }
.lightbox { border: 0; padding: 0; max-width: min(1100px, 94vw); background: var(--ink); color: #fff; border-radius: var(--r-m); overflow: hidden; }
.lightbox::backdrop { background: rgba(20, 20, 22, 0.9); }
.lightbox img { max-height: 78vh; width: auto; margin: 0 auto; }
.lightbox .bar { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); font: 500 15px var(--sans); }
.lightbox button { font: 600 14px var(--sans); background: rgba(255, 255, 255, 0.1); color: #fff; border: 0; padding: 8px 14px; border-radius: var(--pill); cursor: pointer; }
.lightbox button:hover { background: rgba(255, 255, 255, 0.22); }

/* 14. Page parts: notes, figures, accordion, side boxes */
.note { background: var(--red-tint); border-radius: var(--r-m); padding: var(--s5) var(--s6) var(--s3); margin: 0 0 var(--s6); }
.note p { font-size: 18px; line-height: 1.65; }
.note strong { color: var(--ink); }
.figs { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); margin: var(--s6) 0; }
.figs img { aspect-ratio: 1; object-fit: cover; width: 100%; border-radius: var(--r-m); }
.figure { margin: var(--s6) 0; }
.figure img { border-radius: var(--r-m); }
.caption { font: 400 14px/1.5 var(--sans); color: var(--muted); margin-top: var(--s2); }
.float-portrait { float: right; width: 260px; margin: 6px 0 var(--s5) var(--s6); }
.float-portrait img { border-radius: var(--r-l); }
.donations { clear: both; margin-top: var(--s7); }
.donations details { border-bottom: 1px solid var(--line); }
.donations summary { cursor: pointer; padding: var(--s4) 0; font: 650 22px var(--display); letter-spacing: -0.015em; color: var(--ink); list-style: none; display: flex; justify-content: space-between; align-items: center; }
.donations summary::-webkit-details-marker { display: none; }
.donations summary::after { content: "+"; font: 400 26px var(--sans); color: var(--red); }
.donations details[open] summary::after { content: "\2212"; }
.donations .prose { font-size: 16.5px; padding-bottom: var(--s4); }
.box { background: var(--panel); border-radius: var(--r-m); padding: var(--s5); margin-top: var(--s6); }
.box h2 { font-size: 24px; }
.more { margin-top: var(--s7); }
.more h2 { font-size: 28px; }

/* 15. Footer */
main { padding-bottom: var(--s8); }
.kind-home main, .kind-post main { padding-bottom: 0; }
.site-foot { background: var(--ink); color: #c8c8cc; padding: var(--s8) 0 var(--s5); }
.site-foot .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--s7); }
.site-foot h2 { font-size: 22px; color: #fff; letter-spacing: -0.015em; }
.site-foot a { color: #fff; text-decoration-color: rgba(255, 255, 255, 0.4); }
.site-foot a:hover { color: #fff; text-decoration-color: #fff; }
.site-foot ul { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: var(--s5); }
.site-foot li { margin-bottom: var(--s2); font-size: 15px; break-inside: avoid; }
.site-foot p { font-size: 15px; }
.site-foot .legal { border-top: 1px solid rgba(255, 255, 255, 0.12); margin-top: var(--s7); padding-top: var(--s4); font-size: 14px; color: #9a9aa0; }

/* 16. Responsive */
@media (max-width: 1300px) {
  .head-cta { display: none; }
}
@media (max-width: 1100px) {
  .nav a { padding: 9px 9px; font-size: 15px; }
  .career ol { grid-template-columns: repeat(3, 1fr); row-gap: var(--s5); }
  .career ol::before { display: none; }
}
@media (max-width: 980px) {
  .hero .wrap, .place, .help { grid-template-columns: 1fr; }
  .portrait-wrap { justify-self: start; width: min(100%, 360px); }
  .bento { grid-template-columns: 1fr 1fr; }
  .bento .story:first-child { grid-column: span 2; grid-row: auto; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: repeat(3, 1fr); }
  .site-foot .cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .nav { position: absolute; left: 0; right: 0; top: calc(100% + 3px); background: var(--ink); display: none; padding: var(--s3) var(--s4) var(--s5); box-shadow: 0 18px 30px rgba(0, 0, 0, 0.25); max-height: calc(100vh - 70px); overflow-y: auto; }
  .nav.open { display: block; }
  .nav ul { flex-direction: column; gap: 0; }
  .nav li + li { border-top: 1px solid rgba(255, 255, 255, 0.14); }
  .nav a { padding: 16px 14px; font-size: 19px; color: #fff; border-radius: var(--r-s); }
  .nav a:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
  .nav a[aria-current="page"] { background: var(--red); color: #fff; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { padding-left: var(--s4); padding-right: var(--s4); }
  .site-head .wrap { min-height: 64px; }
  .brand img { height: 30px; }
  .brand-years { font-size: 11px; }
  .portrait-wrap { width: calc(100% - 6px); max-width: 340px; }
  .hero { padding: var(--s6) 0 var(--s5); }
  .hero p { font-size: 18px; }
  .section { padding: var(--s7) 0; }
  .career { padding: var(--s5) var(--s4); border-radius: var(--r-m); }
  .career ol { grid-template-columns: 1fr 1fr; }
  .bento, .cards { grid-template-columns: 1fr; }
  .bento .story:first-child { grid-column: auto; }
  .section-head { flex-direction: column; align-items: start; }
  .help { padding: var(--s5); border-radius: var(--r-m); }
  .prose { font-size: 17.5px; }
  .gallery, .figs { grid-template-columns: repeat(2, 1fr); }
  .float-portrait { float: none; width: 200px; margin: 0 0 var(--s5); }
  .toolbar { top: 65px; }
  .site-foot .cols { grid-template-columns: 1fr; }
  .pager { grid-template-columns: 1fr; }
  .pager .older { grid-column: auto; text-align: left; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
@media print { .site-head, .site-foot, .toolbar { display: none; } }

/* 17. Helpers */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wide { max-width: var(--wrap); }
