/* ITPain v2 stylesheet.
   Identity: deep indigo ink + mint, cool paper. Serif headings (system stack), Manrope body (self-hosted, see fonts.css).
   Bright mint (--mint) is for graphics, rules and underlines ONLY; text in the accent uses --accent-text (WCAG AA).
   Family traits shared with the sibling project sites (sticky header, hero, stat strip, cards, dark footer);
   own treatment: hairline cards with a mint top rule, converging-lines hero. */

:root {
  --ink: #16204f;
  --ink-deep: #0e1636;
  --mint: #1a9d78;          /* graphics, rules, underlines only */
  --accent-text: #13795c;   /* accent as text */
  --paper: #f3f7f6;
  --white: #ffffff;
  --hairline: #d3e2de;
  --text: #1d2433;
  --muted: #4a5568;
  --footer-link: #d6f2e8;
  --footer-muted: #b4bedb;
  --ok-text: #0d5c43; --ok-bg: #e3f4ec;
  --err-text: #8a1f1f; --err-bg: #fbe9e9;
  --radius: 6px;
  --font-head: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--white); color: var(--text); font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.7; -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--mint); }
a:hover { color: var(--accent-text); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 3px; box-shadow: 0 0 0 6px var(--white); }
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--ink); line-height: 1.18; text-wrap: balance; margin: 0 0 .6em; font-weight: 700; }
h1 { font-size: clamp(2.1rem, 4.4vw, 3.3rem); letter-spacing: -.012em; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.05rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1.05em; }
ul, ol { padding-left: 1.3em; }
.wrap { width: min(1120px, 100% - 48px); margin-inline: auto; }
.reading { max-width: 72ch; }
.reading h2, .reading h3 { margin-top: 1.7em; }   /* space between a block of text and the next heading */
.reading h2:first-child, .reading h3:first-child { margin-top: 0; }
.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; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--white); padding: .6em 1em; border-radius: var(--radius); z-index: 100; font-weight: 700; }
.skip:focus { left: 8px; }
.eyebrow { display: flex; align-items: center; gap: 12px; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-text); margin: 0 0 1em; }
.eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--mint); }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.97); backdrop-filter: blur(8px); border-bottom: 1px solid var(--hairline); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 76px; }
.brand { display: inline-flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); }
.brand img { height: 48px; width: auto; }
.brand small { font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); max-width: 22ch; line-height: 1.3; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { text-decoration: none; color: var(--ink); font-weight: 600; font-size: .97rem; padding: .5em .35em; margin-left: 1.15rem; border-bottom: 3px solid transparent; }
.nav a:hover { border-bottom-color: var(--hairline); color: var(--ink); }
.nav a[aria-current="page"] { border-bottom-color: var(--mint); }
.nav-toggle { display: none; }  /* desktop: no invisible tab stop; phones restore it below */
.burger { display: none; cursor: pointer; padding: 12px 10px; border-radius: var(--radius); }
.burger span, .burger span::before, .burger span::after { display: block; width: 24px; height: 2px; background: var(--ink); position: relative; content: ""; border-radius: 2px; }
.burger span::before { position: absolute; top: -7px; }
.burger span::after { position: absolute; top: 7px; }
.nav-toggle:focus-visible + .burger { outline: 3px solid var(--ink); outline-offset: 2px; }

/* ---------- hero ---------- */
.hero { background: var(--paper); border-bottom: 1px solid var(--hairline); padding: clamp(40px, 7vw, 88px) 0; }
.hero .wrap { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(24px, 5vw, 64px); align-items: center; }
.hero .lead { font-size: 1.15rem; max-width: 52ch; color: var(--text); }
.hero-art svg { width: 100%; max-height: 380px; }
.btn { display: inline-block; background: var(--ink); color: var(--white); text-decoration: none; font-weight: 700; font-size: .95rem; padding: .8em 1.3em; border: 2px solid var(--ink); border-radius: var(--radius); cursor: pointer; font-family: var(--font-body); transition: background .15s, color .15s; }
.btn:hover { background: var(--ink-deep); color: var(--white); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--white); }
.btn[disabled] { opacity: .7; cursor: progress; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.4em; }
.page-head { background: var(--paper); border-bottom: 1px solid var(--hairline); padding: clamp(32px, 5vw, 56px) 0; }
.page-head h1 { margin: 0 0 .3em; }
.page-head p { margin: 0; max-width: 62ch; color: var(--muted); }

/* ---------- stats ---------- */
.stats { border-bottom: 1px solid var(--hairline); }
.stats .wrap { display: flex; flex-wrap: wrap; }
.stat { flex: 1 1 220px; padding: 24px 24px 22px 0; }
.stat + .stat { border-left: 1px solid var(--hairline); padding-left: 24px; }
.stat-n { display: block; font-family: var(--font-head); font-weight: 700; font-size: 2.4rem; line-height: 1; color: var(--ink); }
.stat-l { display: block; color: var(--muted); font-size: .92rem; margin-top: 6px; }

/* ---------- sections, cards ---------- */
.section { padding: clamp(40px, 6vw, 72px) 0; }
.section--paper { background: var(--paper); border-block: 1px solid var(--hairline); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin: 1.6em 0; }
.card { background: var(--white); border: 1px solid var(--hairline); border-top: 3px solid var(--mint); border-radius: var(--radius); padding: 22px 22px 8px; min-width: 0; }
.card h3 { font-size: 1.1rem; }
.objectives { counter-reset: obj; list-style: none; padding: 0; display: grid; gap: 14px; max-width: 80ch; }
.objectives li { counter-increment: obj; display: grid; grid-template-columns: 2.2rem 1fr; gap: 14px; }
.objectives li::before { content: counter(obj); font-family: var(--font-head); font-weight: 700; color: var(--accent-text); font-size: 1.5rem; line-height: 1.3; }
.figure { margin: 1.6em 0; background: var(--white); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 18px; }
.figure img { margin-inline: auto; }
.figure figcaption { color: var(--muted); font-size: .92rem; margin-top: 10px; }
.callout { border: 1px solid var(--hairline); border-left: 4px solid var(--mint); background: var(--white); border-radius: var(--radius); padding: 22px 26px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.callout h2 { margin: 0 0 .2em; font-size: 1.4rem; }
.callout p { margin: 0; color: var(--muted); }

/* ---------- people ---------- */
.avatars { display: flex; flex-wrap: wrap; gap: 10px; margin: 1.2em 0; padding: 0; list-style: none; }
.avatar { flex: none; width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--paper); border: 2px solid var(--white); box-shadow: 0 0 0 1px var(--hairline); }
.avatar--initials { flex: none; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: var(--ink); background: var(--paper); font-size: 1rem; width: 56px; height: 56px; border-radius: 50%; box-shadow: 0 0 0 1px var(--hairline); }
.partners-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; list-style: none; padding: 0; margin: 1.6em 0; }
.partner { display: flex; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--hairline); border-radius: var(--radius); text-decoration: none; color: var(--ink); background: var(--white); }
.partner:hover { border-color: var(--mint); }
.partner strong { display: block; line-height: 1.3; }
.partner div span { color: var(--muted); font-size: .9rem; line-height: 1.4; display: block; }
.member { padding: 32px 0; border-top: 1px solid var(--hairline); scroll-margin-top: 96px; }
.member header { display: flex; gap: 20px; align-items: center; margin-bottom: 14px; }
.member header .avatar, .member header .avatar--initials { width: 84px; height: 84px; }
.member h2 { margin: 0; font-size: 1.5rem; }
.member .role { color: var(--muted); margin: 0; }
.member .tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 1em; }
.member .tags li { font-size: .82rem; border: 1px solid var(--hairline); border-radius: 999px; padding: .1em .8em; color: var(--muted); }
.pub { padding: 20px 0; border-top: 1px solid var(--hairline); }
.pub h3 { margin-bottom: .4em; }
.pub p { margin-bottom: .4em; color: var(--muted); }
.pub-note { border-top: 1px solid var(--hairline); padding-top: 20px; color: var(--muted); }

/* ---------- funding slot (renders only when content/funding.md has text) ---------- */
.funding { border: 1px solid var(--hairline); background: var(--paper); border-radius: var(--radius); padding: 22px 26px; margin: 0; }
.funding h2 { font-size: 1.15rem; margin-bottom: .4em; }
.funding p:last-child { margin-bottom: 0; }

/* ---------- contact form ---------- */
.contact-form { display: grid; gap: 18px; max-width: 640px; }
.form-group label { display: block; font-weight: 700; margin-bottom: 6px; color: var(--ink); }
.contact-form input[type="text"], .contact-form input[type="email"], .contact-form textarea { width: 100%; font: inherit; color: var(--text); background: var(--white); border: 1.5px solid var(--muted); border-radius: var(--radius); padding: .7em .85em; }
.contact-form textarea { min-height: 9em; resize: vertical; }
.form-message { padding: .8em 1em; border-radius: var(--radius); margin-bottom: 1em; font-weight: 600; max-width: 640px; }
.form-message.success { background: var(--ok-bg); color: var(--ok-text); border: 1px solid var(--ok-text); }
.form-message.error { background: var(--err-bg); color: var(--err-text); border: 1px solid var(--err-text); }
.obf-mail::after { content: ""; }
address { font-style: normal; margin: 0 0 1.6em; }
.contact-info { margin-top: 2.6em; }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: var(--footer-muted); padding: 48px 0 32px; margin-top: 0; }
.site-footer a { color: var(--footer-link); text-decoration-color: var(--mint); }
.site-footer a:hover { color: var(--white); }
.site-footer h2 { color: var(--white); font-size: 1rem; font-family: var(--font-body); letter-spacing: .08em; text-transform: uppercase; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: .4em; }
.logo-plate { display: inline-block; background: var(--white); padding: 10px 14px; border-radius: var(--radius); }
.logo-plate img { height: 44px; width: auto; }
.footer-funding { margin-top: 24px; font-size: .92rem; }
.footer-legal { margin-top: 32px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.2); font-size: .88rem; }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-width: 360px; }
  .nav-toggle { display: block; position: absolute; opacity: 0; pointer-events: none; }
  .burger { display: block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; background: var(--white); border-bottom: 1px solid var(--hairline); padding: 8px 24px 16px; }
  .nav a { margin: 0; padding: .8em 0; border-bottom: 1px solid var(--hairline); }
  .nav-toggle:checked ~ .nav { display: flex; }
  .site-header .wrap { position: relative; }
  .stat + .stat { border-left: 0; padding-left: 0; }
  .footer-grid { grid-template-columns: 1fr; }
  .brand small { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
