/* Muntech Foundation — shared styles
   Layout: formal institutional look; monochrome only (black, white, greys), serif headings, thin rules, square corners */
/* Fonts, served from fonts/ on this site (SIL Open Font License) */
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/source-sans-3-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/source-sans-3-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/source-sans-3-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Libre Caslon Text"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/libre-caslon-text-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Libre Caslon Text"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/libre-caslon-text-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Libre Caslon Text"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/libre-caslon-text-latin-700-normal.woff2") format("woff2"); }

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --sunk: #f5f5f4;
  --ink: #141414;
  --muted: #565656;
  --line: #d8d8d8;
  --primary: #141414;
  --board: #161616;
  --on-board: #f2f2f2;
  --on-board-muted: #b0b0b0;
  --accent: #141414;
  --accent-ink: #ffffff;
  --accent-text: #141414;
  --ph-bg: #f0f0f0;
  --ph-line: #9a9a9a;
  --ph-ink: #444444;
  --display: "Libre Caslon Text", Georgia, "Times New Roman", serif;
  --body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --radius: 2px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121212; --surface: #1a1a1a; --sunk: #171717; --ink: #ececec; --muted: #a6a6a6; --line: #333333;
    --primary: #ececec; --board: #0b0b0b; --on-board: #ececec; --on-board-muted: #a6a6a6;
    --accent: #ececec; --accent-ink: #111111; --accent-text: #ececec;
    --ph-bg: #242424; --ph-line: #6b6b6b; --ph-ink: #cfcfcf; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #121212; --surface: #1a1a1a; --sunk: #171717; --ink: #ececec; --muted: #a6a6a6; --line: #333333;
    --primary: #ececec; --board: #0b0b0b; --on-board: #ececec; --on-board-muted: #a6a6a6;
    --accent: #ececec; --accent-ink: #111111; --accent-text: #ececec;
    --ph-bg: #242424; --ph-line: #6b6b6b; --ph-ink: #cfcfcf; color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { animation: none !important; transition: none !important; } }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.6; }
img { max-width: 100%; display: block; }
.wrap { max-width: 1160px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: 0; line-height: 1.18; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2.4rem, 5.8vw, 4.4rem); }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
h3 { font-size: 1.35rem; }
p { margin: 0; max-width: 65ch; }
a { color: var(--primary); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.eyebrow { font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.lede { font-size: 1.18rem; color: var(--muted); }
.stack { display: grid; gap: 16px; align-content: start; min-width: 0; }

/* placeholders */
.ph { background: var(--ph-bg); color: var(--ph-ink); outline: 1px dashed var(--ph-line); outline-offset: -1px; padding: 0 .3em; border-radius: 2px; }
.draft-bar { background: var(--ph-bg); color: var(--ph-ink); border-bottom: 1px solid var(--ph-line); font-size: .88rem; }
.draft-bar .wrap { padding-block: 7px; }
.photo { background: var(--sunk); border: 1px dashed var(--ph-line); border-radius: var(--radius); display: grid; place-items: center; text-align: center; color: var(--ph-ink); font-size: .9rem; padding: 16px; aspect-ratio: 4 / 3; max-width: 100%; min-width: 0; }
.photo span { background: var(--ph-bg); padding: 4px 10px; border-radius: 3px; }

/* header */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--surface); }
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 12px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); min-width: 0; }
.logo { width: 48px; height: 48px; flex: none; }
.brand-name { font-family: var(--display); font-weight: 700; letter-spacing: 0; font-size: 1.15rem; line-height: 1; }
.brand-name small { display: block; font-family: var(--body); font-size: .72rem; color: var(--muted); letter-spacing: .04em; margin-top: 4px; }
.nav ul { list-style: none; display: flex; align-items: center; gap: 4px 22px; margin: 0; padding: 0; }
.nav a { text-decoration: none; color: var(--ink); font-weight: 600; font-size: .97rem; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--primary); }
.nav a[aria-current="page"] { border-bottom-color: var(--accent); }
.nav a.btn { padding: 8px 18px; border-bottom: 2px solid var(--accent); }
.menu-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); font: inherit; font-weight: 600; padding: 6px 12px; cursor: pointer; }
@media (max-width: 900px) {
  .menu-toggle { display: inline-block; }
  .nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--line); display: none; }
  .nav.open { display: block; }
  .nav ul { flex-direction: column; align-items: stretch; gap: 0; padding: 8px max(16px, env(safe-area-inset-right, 0px)) 16px max(16px, env(safe-area-inset-left, 0px)); }
  .nav li a { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .nav a[aria-current="page"] { color: var(--primary); border-bottom-color: var(--line); font-weight: 700; }
  .nav a.btn { margin-top: 12px; text-align: center; }
}

/* buttons */
.btn { display: inline-block; padding: 12px 24px; border-radius: 2px; font-weight: 600; letter-spacing: .02em; text-decoration: none; border: 2px solid var(--primary); color: var(--primary); background: transparent; font-family: var(--body); font-size: 1rem; cursor: pointer; transition: transform .15s ease; }
.btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.light { border-color: var(--ink); color: var(--ink); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.text-link { font-weight: 700; text-decoration: none; color: var(--primary); }
.text-link::after { content: " →"; }
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* page head (inner pages) */
.page-head { background: var(--surface); border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.page-head .wrap { padding-block: 56px 48px; display: grid; gap: 14px; position: relative; z-index: 1; }
.page-head h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); color: var(--primary); }
.crumbs { font-size: .88rem; color: var(--muted); }
.crumbs a { color: var(--muted); }

/* sections */
.section > .wrap { padding-block: 72px; display: grid; gap: 36px; }
.section + .section { border-top: 1px solid var(--line); }
.section.sunk { background: var(--sunk); }
.split { display: grid; grid-template-columns: 1fr 1.6fr; gap: 48px; }
.split > * { min-width: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.two > * { min-width: 0; }

/* hero (home) */
.hero { background: var(--sunk); color: var(--ink); border-bottom: 1px solid var(--line); }
.hero .wrap { padding-block: 88px 80px; display: grid; gap: 24px; }
.hero h1 { max-width: 18ch; color: var(--ink); }
.hero-grid { grid-template-columns: 1.5fr 1fr; align-items: center; column-gap: 56px; }
.hero-text { display: grid; gap: 24px; min-width: 0; }
.hero-logo { width: 100%; max-width: 400px; height: auto; justify-self: end; border: 1px solid var(--line); background: #fff; }
.hero h1 em { font-style: italic; }
.hero h1 { font-size: clamp(2.3rem, 5.4vw, 4.2rem); }
.hero .lede { color: var(--muted); max-width: 52ch; }
.hero .rule { width: 64px; height: 2px; background: var(--ink); }
.status-chip { font-size: .8rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 2px solid var(--ink); }
.stat { padding: 22px 20px 6px 0; display: grid; gap: 4px; min-width: 0; }
.stat + .stat { padding-left: 20px; border-left: 1px solid var(--line); }
.stat b { font-family: var(--display); font-weight: 400; letter-spacing: 0; font-size: 2.6rem; line-height: 1; color: var(--primary); font-variant-numeric: tabular-nums; }
.stat > span { color: var(--muted); font-size: .95rem; }

/* pillars */
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.pillar { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: grid; grid-template-rows: auto 1fr; min-width: 0; }
.pillar .photo { border-radius: 0; border-width: 0 0 1px 0; }
.pillar .body { padding: 24px; display: grid; gap: 10px; align-content: start; }
.tag { font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-text); }

/* program detail */
.program { display: grid; grid-template-columns: 1fr 1.3fr; gap: 48px; align-items: start; }
.program > * { min-width: 0; }
.program.flip > :first-child { order: 2; }
.facts-list { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; border-top: 1px solid var(--line); padding-top: 16px; }
.facts-list dt { color: var(--muted); font-size: .92rem; }
.facts-list dd { margin: 0; font-weight: 600; min-width: 0; }

/* quote */
.quote { border-left: 4px solid var(--accent); padding-left: 24px; display: grid; gap: 12px; }
.quote p { font-family: var(--display); font-style: italic; font-weight: 400; letter-spacing: 0; font-size: clamp(1.4rem, 2.6vw, 1.9rem); line-height: 1.3; max-width: 40ch; }
.quote cite { font-style: normal; color: var(--muted); }

/* values / steps */
.values { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 2px solid var(--ink); }
.value { padding: 20px 20px 0 0; display: grid; gap: 8px; align-content: start; min-width: 0; }
.value + .value { padding-left: 20px; border-left: 1px solid var(--line); }
.focus { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); border-top: 2px solid var(--ink); }
.focus li { padding: 20px 18px 0 0; display: grid; gap: 8px; align-content: start; min-width: 0; }
.focus li + li { padding-left: 18px; border-left: 1px solid var(--line); }
.focus h3 { font-size: 1.15rem; }
.focus p { color: var(--muted); font-size: .95rem; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; counter-reset: step; }
.step { counter-increment: step; display: grid; gap: 8px; align-content: start; min-width: 0; }
.step::before { content: counter(step) "."; font-family: var(--display); font-weight: 400; font-size: 2.2rem; color: var(--accent-text); line-height: 1; }

/* cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; display: grid; gap: 12px; align-content: start; min-width: 0; }
.card .btn { justify-self: start; margin-top: 6px; }
.cards.two { grid-template-columns: repeat(2, 1fr); }
.card-img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }
.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.gallery img { width: 100%; height: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid var(--line); }
.gallery img.wide { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.people { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.person { display: grid; gap: 8px; min-width: 0; }
.person .photo { aspect-ratio: 1; }
.person img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border: 1px solid var(--line); background: var(--sunk); }
.people.two-up { grid-template-columns: repeat(2, minmax(0, 340px)); }
.person small { color: var(--muted); }

/* band */
.band { background: var(--primary); color: var(--on-board); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .band { background: var(--surface); color: var(--ink); } }
:root[data-theme="dark"] .band { background: var(--surface); color: var(--ink); }
.band .wrap { padding-block: 64px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 24px; }
.band h2 { color: inherit; max-width: 22ch; }
.band p { opacity: .85; margin-top: 10px; }
.band .btn.primary { background: var(--on-board); border-color: var(--on-board); color: var(--board); }

/* notice, table */
.notice { background: var(--sunk); border: 1px solid var(--line); border-left: 3px solid var(--ink); padding: 18px 20px; border-radius: 2px; display: grid; gap: 6px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .97rem; }
.table th, .table td { text-align: left; padding: 12px 16px 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-weight: 600; color: var(--muted); width: 36%; }

/* donate amounts */
.amounts { display: flex; flex-wrap: wrap; gap: 10px; }
.amount { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 2px; padding: 10px 18px; font: inherit; font-weight: 700; cursor: pointer; font-variant-numeric: tabular-nums; }
.amount[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.impact { font-size: 1.05rem; min-height: 1.6em; }

/* forms */
.form { display: grid; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; min-width: 0; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form label { font-weight: 600; font-size: .92rem; display: grid; gap: 6px; min-width: 0; }
.form input, .form textarea, .form select { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); color: var(--ink); width: 100%; }
.form-status { font-size: .95rem; min-height: 1.4em; color: var(--muted); }
.form-status.ok { color: var(--primary); font-weight: 600; }
.hp { position: absolute; left: -9999px; }

/* faq */
details { border-bottom: 1px solid var(--line); padding: 16px 0; }
summary { cursor: pointer; font-weight: 700; font-size: 1.05rem; }
details p { margin-top: 10px; color: var(--muted); }

/* footer */
.site-footer { background: var(--board); color: var(--on-board-muted); font-size: .93rem; }
.site-footer .wrap { padding-block: 56px 32px; display: grid; gap: 40px; }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 32px; }
.foot-grid > * { min-width: 0; }
.site-footer h3 { font-family: var(--body); font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--on-board); margin-bottom: 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.site-footer a { color: var(--on-board-muted); text-decoration: none; }
.site-footer a:hover { color: var(--on-board); text-decoration: underline; }
.site-footer .brand-name { color: var(--on-board); }
.foot-legal { border-top: 1px solid var(--line); padding-top: 20px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: .85rem; }
.site-footer .ph { color: var(--ph-ink); }

@media (max-width: 900px) {
  .split, .two, .program, .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .hero-logo { justify-self: start; max-width: 280px; order: -1; }
  .program.flip > :first-child { order: 0; }
  .pillars, .cards, .people, .steps { grid-template-columns: 1fr 1fr; }
  .stats, .values { grid-template-columns: 1fr 1fr; }
  .focus { grid-template-columns: 1fr 1fr; row-gap: 20px; }
  .focus li + li { padding-left: 0; border-left: 0; }
  .stat:nth-child(3), .value:nth-child(3) { padding-left: 0; border-left: 0; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .pillars, .cards, .cards.two, .people, .people.two-up, .steps, .form .row, .gallery { grid-template-columns: 1fr; }
  .stats, .values, .focus { grid-template-columns: 1fr; }
  .stat + .stat, .value + .value { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .foot-grid { grid-template-columns: 1fr; }
  .hero .wrap { padding-block: 64px 56px; }
  .section > .wrap { padding-block: 52px; }
  .facts-list { grid-template-columns: 1fr; gap: 2px; }
  .facts-list dd { margin-bottom: 10px; }
}
.table td small { display: block; color: var(--muted); font-size: .88rem; margin-top: 2px; }
.table td.num { font-variant-numeric: tabular-nums; letter-spacing: .04em; font-weight: 600; }
/* legal pages */
.prose { max-width: 72ch; display: grid; gap: 14px; }
.prose h2 { font-size: clamp(1.35rem, 2.4vw, 1.7rem); margin-top: 22px; }
.prose h3 { font-family: var(--body); font-weight: 700; font-size: 1.02rem; margin-top: 6px; }
.prose ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; max-width: 65ch; }
.form-note { font-size: .88rem; color: var(--muted); }

/* ---- Motion. Calm and brief: content rises in once as it scrolls into view, the hero settles in on load,
   photos fade in when they have loaded, cards lift under the pointer, pages cross-fade.
   Only active when the head script sets .motion (JS on, no reduced-motion preference). ---- */
:root { --ease: cubic-bezier(0.2, 0.7, 0.2, 1); }

@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.motion .hero-text > *, .motion .hero-logo, .motion .page-head .wrap > * { animation: rise .8s var(--ease) both; }
.motion .hero-text > :nth-child(2), .motion .page-head .wrap > :nth-child(2) { animation-delay: .08s; }
.motion .hero-text > :nth-child(3), .motion .page-head .wrap > :nth-child(3) { animation-delay: .16s; }
.motion .hero-text > :nth-child(4), .motion .page-head .wrap > :nth-child(4) { animation-delay: .24s; }
.motion .hero-text > :nth-child(5) { animation-delay: .32s; }
.motion .hero-logo { animation-delay: .2s; animation-duration: 1s; }

.motion .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.motion .reveal.is-in { opacity: 1; transform: none; }

.motion main img.img-fade:not(.is-loaded) { opacity: 0; }
.motion main img.img-fade { transition: opacity .6s var(--ease); }

.site-header { transition: box-shadow .3s var(--ease); }
.site-header.scrolled { box-shadow: 0 1px 14px rgb(0 0 0 / .07); }

.card, .person img, .gallery img { transition: transform .5s var(--ease), box-shadow .5s var(--ease); }
@media (hover: hover) {
  .card:hover { transform: translateY(-4px); box-shadow: 0 18px 36px -20px rgb(0 0 0 / .3); }
  .gallery img:hover, .person img:hover { transform: translateY(-3px); box-shadow: 0 16px 30px -20px rgb(0 0 0 / .35); }
}
.btn:active { transform: scale(.98); }

@keyframes drop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.motion .nav.open { animation: drop .25s var(--ease) both; }

/* Page changes cross-fade in Chrome and Edge; the header stays in place. */
@view-transition { navigation: auto; }
.site-header { view-transition-name: site-header; }
::view-transition-old(root) { animation: vt-out .15s ease-out both; }
::view-transition-new(root) { animation: vt-in .3s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

