/* ==========================================================================
   MAXimizing Mental Health, Inc. — site stylesheet
   Design system: colors from the logo (summit blue, MAX green, ray blue),
   Alegreya for the family's words, Atkinson Hyperlegible for everything else.
   ========================================================================== */

/* ---------- Fonts (self-hosted, latin subset) ---------- */
@font-face { font-family: "Alegreya"; src: url("../fonts/alegreya-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Alegreya"; src: url("../fonts/alegreya-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Alegreya"; src: url("../fonts/alegreya-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Alegreya"; src: url("../fonts/alegreya-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("../fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("../fonts/atkinson-hyperlegible-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("../fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

/* ---------- Design tokens ---------- */
:root {
  /* Color — sampled from the logo */
  --summit: #21469b;        /* logo blue: headings, links, header */
  --summit-deep: #13285f;   /* dark bands, footer */
  --ray: #8fd3f4;           /* logo sun rays: decoration + focus on dark */
  --max-green: #009949;     /* logo "MAX" green: decoration only */
  --green-ink: #00733a;     /* accessible green for buttons (white text 5.9:1) */
  --green-ink-hover: #005c2e;
  --sky: #f3f8fc;           /* page background */
  --paper: #ffffff;
  --ink: #172033;           /* body text */
  --muted: #4a576b;         /* secondary text (6.9:1 on sky) */
  --line: #d3e0ec;
  --on-dark: #ffffff;
  --on-dark-muted: #c6d6ee;
  --error: #b3261e;
  --focus: #1d5fd6;

  /* Type */
  --serif: "Alegreya", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --step--1: clamp(0.9rem, 0.87rem + 0.12vw, 0.97rem);
  --step-0: clamp(1.0625rem, 1.02rem + 0.2vw, 1.1875rem);
  --step-1: clamp(1.25rem, 1.16rem + 0.4vw, 1.5rem);
  --step-2: clamp(1.55rem, 1.36rem + 0.85vw, 2.05rem);
  --step-3: clamp(1.95rem, 1.6rem + 1.6vw, 2.9rem);
  --step-4: clamp(2.35rem, 1.8rem + 2.6vw, 3.85rem);

  /* Space (8px base) */
  --s-1: 0.25rem; --s-2: 0.5rem; --s-3: 0.75rem; --s-4: 1rem; --s-5: 1.5rem;
  --s-6: 2rem; --s-7: 3rem; --s-8: 4rem; --s-9: 6rem;
  --section: clamp(4rem, 3rem + 5vw, 7.5rem);

  /* Shape, depth, motion */
  --radius-sm: 6px;
  --radius-pill: 999px;
  --arch: 999px 999px 14px 14px;   /* photo frames echo the logo badge */
  --shadow-paper: 0 1px 0 var(--line), 0 30px 60px -34px rgba(19, 40, 95, 0.4);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --t-fast: 160ms;
  --t-med: 260ms;

  --container: 1200px;
  --header-h: 72px;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--ink);
  background: var(--sky);
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body.is-locked { overflow: hidden; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.12; color: var(--summit); margin: 0 0 var(--s-4); letter-spacing: -0.005em; text-wrap: balance; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); line-height: 1.25; }
p { margin: 0 0 var(--s-4); }
a { color: var(--summit); text-decoration-thickness: 1px; text-underline-offset: 0.18em; transition: color var(--t-fast) var(--ease), text-decoration-color var(--t-fast) var(--ease); }
a:hover { color: var(--summit-deep); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.on-dark :focus-visible { --focus: var(--ray); }
::selection { background: var(--ray); color: var(--summit-deep); }

.container { width: min(100% - 2.5rem, var(--container)); margin-inline: auto; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 1rem; top: -100px; z-index: 200; background: var(--paper); color: var(--summit); padding: 0.75rem 1rem; border-radius: var(--radius-sm); font-weight: 700; }
.skip-link:focus { top: 1rem; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--green-ink); --btn-fg: #fff; --btn-border: var(--green-ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  min-height: 48px; padding: 0.7rem 1.4rem;
  font: 700 var(--step-0)/1.2 var(--sans);
  color: var(--btn-fg); background: var(--btn-bg);
  border: 2px solid var(--btn-border); border-radius: var(--radius-pill);
  text-decoration: none; cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.btn:hover { --btn-bg: var(--green-ink-hover); --btn-border: var(--green-ink-hover); color: var(--btn-fg); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--outline { --btn-bg: var(--paper); --btn-fg: var(--summit); --btn-border: var(--summit); }
.btn--outline:hover { --btn-bg: var(--summit); --btn-fg: #fff; --btn-border: var(--summit); }
.btn--light { --btn-bg: #fff; --btn-fg: var(--summit-deep); --btn-border: #fff; }
.btn--light:hover { --btn-bg: var(--ray); --btn-fg: var(--summit-deep); --btn-border: var(--ray); }
.btn--ghost-light { --btn-bg: transparent; --btn-fg: #fff; --btn-border: rgba(255,255,255,0.55); }
.btn--ghost-light:hover { --btn-bg: #fff; --btn-fg: var(--summit-deep); --btn-border: #fff; }
.btn--small { min-height: 44px; padding: 0.5rem 1.05rem; font-size: var(--step--1); }
.btn svg { width: 1.1em; height: 1.1em; flex: none; }

/* ---------- Crisis bar ---------- */
.crisis-bar { background: var(--summit-deep); color: var(--on-dark); font-size: var(--step--1); }
.crisis-bar .container { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; align-items: center; justify-content: center; padding-block: 0.55rem; text-align: center; }
.crisis-bar a { color: #fff; font-weight: 700; }
.crisis-bar a:hover { color: var(--ray); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(243, 248, 252, 0.92);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease);
}
.site-header.is-scrolled { border-color: var(--line); box-shadow: 0 10px 30px -24px rgba(19,40,95,0.45); }
.site-header__inner { display: flex; align-items: center; gap: var(--s-4); min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--summit); margin-right: auto; }
.brand:hover { text-decoration: none; color: var(--summit-deep); }
.brand img { width: 48px; height: 48px; transition: transform var(--t-med) var(--ease); }
.site-header.is-scrolled .brand img { transform: scale(0.88); }
.brand__name { font-family: var(--serif); font-weight: 700; font-size: 1.2rem; line-height: 1.05; }
.brand__name small { display: block; font-family: var(--sans); font-weight: 400; font-size: 0.8rem; color: var(--muted); letter-spacing: 0.01em; }

.nav { display: none; }
.nav ul { list-style: none; display: flex; gap: 0.25rem; margin: 0; padding: 0; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.8rem; border-radius: var(--radius-pill); text-decoration: none; color: var(--ink); font-weight: 700; font-size: var(--step--1); }
.nav a:hover { background: #e2edf7; color: var(--summit-deep); }
.nav a[aria-current="page"] { color: var(--summit); box-shadow: inset 0 -2px 0 var(--max-green); border-radius: 0; }

.header-help, .header-donate { white-space: nowrap; }
.header-help { display: inline-flex; }
.header-donate { display: none; }
.hide-sm { display: inline; }
@media (max-width: 520px) { .hide-sm { display: none; } }
.menu-toggle {
  display: inline-grid; place-items: center; width: 48px; height: 48px;
  border: 2px solid var(--line); border-radius: 50%; background: var(--paper); color: var(--summit); cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.menu-toggle:hover { border-color: var(--summit); }
.menu-toggle svg { width: 22px; height: 22px; }

@media (max-width: 420px) {
  .brand__name small { display: none; }
  .brand__name { font-size: 1.05rem; }
  .brand img { width: 42px; height: 42px; }
  .header-help { padding-inline: 0.8rem; }
}
@media (min-width: 1100px) {
  .nav { display: block; }
  .menu-toggle { display: none; }
  .header-donate { display: inline-flex; }
}

/* ---------- Mobile menu ---------- */
.mobile-menu { position: fixed; inset: 0; z-index: 150; visibility: hidden; pointer-events: none; }
.mobile-menu__backdrop { position: absolute; inset: 0; background: rgba(19, 40, 95, 0.45); opacity: 0; transition: opacity var(--t-med) var(--ease); }
.mobile-menu__panel {
  position: absolute; top: 0; right: 0; height: 100%; width: min(88vw, 380px);
  background: var(--paper); padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-5);
  transform: translateX(100%); transition: transform var(--t-med) var(--ease); overflow-y: auto;
}
.mobile-menu.is-open { visibility: visible; pointer-events: auto; }
.mobile-menu.is-open .mobile-menu__backdrop { opacity: 1; }
.mobile-menu.is-open .mobile-menu__panel { transform: none; }
.mobile-menu__top { display: flex; justify-content: space-between; align-items: center; }
.mobile-menu ul { list-style: none; margin: 0; padding: 0; }
.mobile-menu li + li { border-top: 1px solid var(--line); }
.mobile-menu nav a { display: flex; align-items: center; min-height: 56px; font-family: var(--serif); font-size: var(--step-2); font-weight: 600; text-decoration: none; color: var(--summit); }
.mobile-menu nav a:hover { color: var(--green-ink); }
.mobile-menu__help { margin-top: auto; background: var(--sky); border-radius: var(--radius-sm); padding: var(--s-4); font-size: var(--step--1); }
.mobile-menu__help strong { display: block; font-size: var(--step-0); color: var(--summit-deep); }

/* ---------- Section scaffolding ---------- */
.section { padding-block: var(--section); }
.section--paper { background: var(--paper); }
.section--dark { background: var(--summit-deep); color: var(--on-dark); }
.section--dark h2, .section--dark h3 { color: #fff; }
.section--dark a { color: #fff; }
.section--dark a:hover { color: var(--ray); }
.lede { font-size: var(--step-1); line-height: 1.5; color: var(--muted); max-width: 52ch; }
.help__lede { font-size: var(--step-1); line-height: 1.5; color: var(--on-dark-muted); max-width: 46ch; margin-bottom: var(--s-6); }
.section-intro { max-width: 62ch; margin-bottom: var(--s-7); }
.section-intro p { color: var(--muted); font-size: var(--step-1); line-height: 1.5; }
.section--dark .section-intro p { color: var(--on-dark-muted); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding-top: clamp(2.5rem, 2rem + 3vw, 5rem); padding-bottom: clamp(7rem, 5rem + 6vw, 10rem); }
.hero__inner { display: grid; gap: var(--s-7); align-items: center; }
.hero h1 { max-width: 16ch; }
.hero__lede { font-size: var(--step-1); line-height: 1.5; color: var(--muted); max-width: 46ch; margin-bottom: var(--s-6); }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }

.hero__photo { position: relative; margin: 0 auto; width: min(100%, 420px); isolation: isolate; }
@media (min-width: 900px) { .hero__rays { width: 240%; opacity: 0.7; } }
.hero__rays { position: absolute; left: 50%; top: 42%; width: 170%; opacity: 0.6; aspect-ratio: 1; transform: translate(-50%, -50%); z-index: -1; color: var(--ray); pointer-events: none; }
.hero__rays svg { width: 100%; height: 100%; }
.hero__photo picture, .hero__photo img { border-radius: var(--arch); }
.hero__photo img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border: 6px solid var(--paper); box-shadow: 0 30px 60px -30px rgba(19,40,95,0.55); }
.hero__photo figcaption { margin-top: var(--s-3); text-align: center; font-family: var(--serif); font-style: italic; font-size: var(--step-1); color: var(--summit-deep); }

@media (min-width: 900px) {
  .hero__inner { grid-template-columns: 1.15fr 0.85fr; }
  .hero__photo { margin-right: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  .hero__rays svg { animation: rays-in 1400ms var(--ease) both; }
  @keyframes rays-in { from { opacity: 0; transform: rotate(-8deg) scale(0.92); } to { opacity: 1; transform: none; } }
}

/* ---------- The family's letter ---------- */
.letter-wrap { position: relative; margin-top: calc(-1 * clamp(5rem, 3.5rem + 5vw, 7.5rem)); padding-bottom: var(--section); }
.letter {
  background: var(--paper); border-radius: var(--radius-sm); box-shadow: var(--shadow-paper);
  padding: clamp(1.75rem, 1rem + 3.5vw, 4rem);
  display: grid; gap: var(--s-6);
  max-width: 1040px; margin-inline: auto;
}
.letter__date { color: var(--muted); font-size: var(--step--1); margin-bottom: var(--s-2); }
.letter__salutation { font-family: var(--serif); font-size: var(--step-3); color: var(--summit); font-weight: 600; margin-bottom: var(--s-4); line-height: 1.1; }
.letter__body { font-family: var(--serif); font-size: var(--step-1); line-height: 1.62; max-width: 58ch; }
.letter__body p { margin-bottom: var(--s-5); }
.letter__body h3 { font-size: var(--step-2); margin-top: var(--s-6); }
.letter__sign { font-family: var(--serif); font-style: italic; color: var(--muted); }
.letter__count { align-self: start; border-top: 4px solid var(--max-green); padding-top: var(--s-4); }
.letter__count strong { display: block; font-family: var(--serif); font-weight: 700; font-size: clamp(3.4rem, 2.4rem + 4.4vw, 5.6rem); line-height: 0.95; color: var(--summit); font-variant-numeric: lining-nums; }
.letter__count span { display: block; margin-top: var(--s-2); color: var(--muted); max-width: 20ch; }
@media (min-width: 900px) { .letter { grid-template-columns: minmax(0, 1fr) 220px; gap: var(--s-8); } .letter__count { position: sticky; top: calc(var(--header-h) + 2rem); } }

/* ---------- Get help ---------- */
.help { display: grid; gap: var(--s-7); }
.help__lines { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3); }
.help__line {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  padding: var(--s-4) var(--s-5); min-height: 76px;
  border: 1px solid rgba(143, 211, 244, 0.35); border-radius: 14px;
  color: #fff; text-decoration: none;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.help__line:hover { background: rgba(143, 211, 244, 0.12); border-color: var(--ray); color: #fff; text-decoration: none; }
.help__line b { font-family: var(--serif); font-size: var(--step-2); font-weight: 700; line-height: 1.1; }
.help__line small { display: block; color: var(--on-dark-muted); font-size: var(--step--1); }
.help__line svg { width: 28px; height: 28px; flex: none; color: var(--ray); }
.help__note { margin-top: var(--s-5); padding-left: var(--s-4); border-left: 4px solid var(--ray); color: var(--on-dark-muted); }
.help__note strong { color: #fff; }
.help__student { background: rgba(255,255,255,0.06); border-radius: 14px; padding: clamp(1.25rem, 1rem + 1.5vw, 2rem); }
.help__student h3 { font-size: var(--step-2); }
.help__student p { color: var(--on-dark-muted); }
.help__student .contact-lines { margin-top: var(--s-5); }
@media (min-width: 900px) { .help { grid-template-columns: 1.1fr 0.9fr; align-items: start; } }

/* ---------- Story ---------- */
.story { display: grid; gap: var(--s-7); }
.story__figure { margin: 0; }
.story__figure img { border-radius: var(--arch); width: 100%; max-width: 440px; aspect-ratio: 900 / 1041; object-fit: cover; }
.story__figure figcaption { margin-top: var(--s-3); color: var(--muted); font-size: var(--step--1); max-width: 40ch; }
.prose { font-family: var(--serif); font-size: var(--step-1); line-height: 1.68; max-width: 62ch; }
.prose p { margin-bottom: var(--s-5); }
.prose blockquote { margin: var(--s-6) 0; padding: 0 0 0 var(--s-5); border-left: 4px solid var(--max-green); font-style: italic; color: var(--summit-deep); }
@media (min-width: 900px) {
  .story { grid-template-columns: 5fr 7fr; gap: var(--s-8); }
  .story__figure { position: sticky; top: calc(var(--header-h) + 2rem); align-self: start; }
}

.purpose { display: grid; gap: var(--s-7); margin-top: var(--s-8); padding-top: var(--s-7); border-top: 1px solid var(--line); }
.purpose h3 { font-size: var(--step-2); }
.peaks { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3); }
.peaks li { position: relative; padding-left: 2rem; }
.peaks li::before {
  content: ""; position: absolute; left: 0; top: 0.42em; width: 1.05rem; height: 0.8rem;
  background: var(--max-green); clip-path: polygon(0 100%, 38% 12%, 52% 42%, 66% 0, 100% 100%);
}
@media (min-width: 900px) { .purpose { grid-template-columns: 1fr 1fr; gap: var(--s-8); } }

/* ---------- Donate ---------- */
.donate { display: grid; gap: var(--s-7); }
.donate__ways { list-style: none; margin: 0; padding: 0; }
.donate__way { display: grid; gap: var(--s-3); padding-block: var(--s-6); border-top: 1px solid var(--line); }
.donate__way:last-child { border-bottom: 1px solid var(--line); }
.donate__way h3 { margin-bottom: var(--s-1); }
.donate__way p { margin: 0; color: var(--muted); }
.donate__way address { font-style: normal; font-family: var(--serif); font-size: var(--step-1); color: var(--ink); line-height: 1.45; }
.donate__way .btn { justify-self: start; margin-top: var(--s-2); }
@media (min-width: 900px) {
  .donate { grid-template-columns: 5fr 7fr; gap: var(--s-8); }
  .donate__way { grid-template-columns: 1fr auto; align-items: center; column-gap: var(--s-6); }
  .donate__way .btn { justify-self: end; margin: 0; }
}

/* ---------- Sponsors ---------- */
.tiers { display: grid; gap: 0; }
.tier { display: grid; gap: var(--s-4); padding-block: var(--s-6); position: relative; }
.tier + .tier { border-top: 1px solid var(--line); }
.tier__label { font-family: var(--serif); font-weight: 700; color: var(--summit); font-size: var(--step-2); line-height: 1; display: flex; align-items: center; gap: 0.6rem; margin: 0; }
.tier__label::before { content: ""; width: 1.4rem; height: 1.05rem; background: var(--summit); clip-path: polygon(0 100%, 50% 0, 100% 100%); flex: none; }
.tier--midpoint .tier__label::before { clip-path: polygon(0 100%, 22% 35%, 78% 35%, 100% 100%); }
.tier--base .tier__label::before { clip-path: polygon(0 100%, 0 70%, 100% 70%, 100% 100%); }
.logos {
  --tile-h: 100px; --tile-pad: 12px;
  list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-5) var(--s-4);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.25rem), 1fr));
}
.logo-tile { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.logo-tile__img {
  display: flex; align-items: center; justify-content: center;
  height: var(--tile-h); padding: var(--tile-pad); overflow: hidden;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  transition: border-color var(--t-fast) var(--ease);
}
.logo-tile:hover .logo-tile__img { border-color: #aac2da; }
.logo-tile__img picture { display: contents; }
.logo-tile__img img { display: block; width: auto; height: auto; max-width: 100%; max-height: calc(var(--tile-h) - 2 * var(--tile-pad) - 2px); object-fit: contain; }
.logo-tile__name { font-size: 0.85rem; line-height: 1.3; color: var(--muted); text-align: center; text-wrap: balance; }
@media (min-width: 640px) {
  .tier--summit .logos { --tile-h: 128px; --tile-pad: 16px; grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr)); }
  .tier--midpoint .logos { --tile-h: 108px; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); }
  .tier--base .logos { --tile-h: 96px; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); }
}
.sponsors-thanks { margin-top: var(--s-6); color: var(--muted); }
@media (min-width: 900px) {
  .tier { grid-template-columns: 200px 1fr; gap: var(--s-6); align-items: start; }
  .tier__label { padding-top: 0.15rem; }
}

/* ---------- Blog list ---------- */
.posts { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-7); }
.post-teaser { display: grid; gap: var(--s-5); align-items: center; }
.post-teaser__img { text-decoration: none; overflow: hidden; border-radius: 14px; background: var(--line); aspect-ratio: 4 / 3; }
.post-teaser__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 600ms var(--ease); }
.post-teaser:hover .post-teaser__img img { transform: scale(1.03); }
.post-teaser__img--help { display: grid; place-items: center; background: var(--summit-deep); color: #fff; text-align: center; padding: var(--s-5); }
.post-teaser__img--help b { display: block; font-family: var(--serif); font-size: clamp(3.5rem, 3rem + 3vw, 5.5rem); line-height: 1; color: var(--ray); }
.post-teaser__img--help span { font-size: var(--step--1); color: var(--on-dark-muted); }
.post-teaser h3 { font-size: var(--step-2); margin-bottom: var(--s-2); }
.post-teaser h3 a { text-decoration: none; }
.post-teaser h3 a:hover { text-decoration: underline; }
.post-teaser p { color: var(--muted); margin-bottom: var(--s-2); }
.post-meta { font-size: var(--step--1); color: var(--muted); }
@media (min-width: 700px) { .post-teaser { grid-template-columns: 240px 1fr; gap: var(--s-6); } }
@media (min-width: 1025px) { .posts--home { grid-template-columns: 1fr 1fr; } .posts--home .post-teaser { grid-template-columns: 200px 1fr; } }

/* ---------- Contact ---------- */
.contact { display: grid; gap: var(--s-7); }
.contact-lines { list-style: none; padding: 0; margin: 0 0 var(--s-5); display: grid; gap: var(--s-3); }
.contact-lines a { display: inline-flex; align-items: center; gap: 0.6rem; min-height: 44px; font-weight: 700; word-break: break-word; }
.contact-lines svg { width: 22px; height: 22px; flex: none; color: var(--green-ink); }
.section--dark .contact-lines svg { color: var(--ray); }
.socials { display: flex; gap: var(--s-2); list-style: none; padding: 0; margin: 0; }
.socials a { display: inline-flex; align-items: center; justify-content: center; flex: none; padding: 0; width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--line); color: var(--summit); transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.socials a:hover { border-color: var(--summit); background: var(--summit); color: #fff; }
.socials svg { width: 22px; height: 22px; }
@media (min-width: 900px) { .contact { grid-template-columns: 5fr 7fr; gap: var(--s-8); } }

/* ---------- Forms ---------- */
.form { display: grid; gap: var(--s-5); background: var(--paper); padding: clamp(1.25rem, 1rem + 2vw, 2.5rem); border-radius: 14px; box-shadow: var(--shadow-paper); }
.form__row { display: grid; gap: var(--s-5); }
@media (min-width: 640px) { .form__row { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: var(--s-2); }
.field label { font-weight: 700; font-size: var(--step--1); color: var(--ink); }
.field label .optional { font-weight: 400; color: var(--muted); }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--sky); border: 2px solid var(--line); border-radius: 10px; padding: 0.8rem 0.95rem; min-height: 48px;
  transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:hover, .field textarea:hover { border-color: #aac2da; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--summit); background: #fff; box-shadow: 0 0 0 4px rgba(33, 70, 155, 0.15); }
.field.is-invalid input, .field.is-invalid textarea { border-color: var(--error); background: #fff7f6; }
.field.is-valid input, .field.is-valid textarea { border-color: var(--green-ink); }
.field__error { display: none; color: var(--error); font-size: var(--step--1); font-weight: 700; }
.field.is-invalid .field__error { display: block; }
.form__note { font-size: var(--step--1); color: var(--muted); margin: 0; }
.form .btn { justify-self: start; }
.btn[aria-busy="true"] { opacity: 0.75; cursor: progress; }
.hp-field { position: absolute; left: -9999px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--summit-deep); color: var(--on-dark-muted); padding-block: var(--s-8) var(--s-5); font-size: var(--step--1); }
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--ray); }
.footer__grid { display: grid; gap: var(--s-6); }
.footer__brand img { width: 72px; height: 72px; margin-bottom: var(--s-4); }
.footer__definition { font-family: var(--serif); font-size: var(--step-1); color: #fff; line-height: 1.4; max-width: 30ch; margin: 0; }
.footer__definition cite { display: block; margin-top: var(--s-2); font-family: var(--sans); font-style: normal; font-size: var(--step--1); color: var(--on-dark-muted); }
.site-footer h2 { font-family: var(--sans); font-size: var(--step-0); color: #fff; margin-bottom: var(--s-3); }
.site-footer ul:not(.socials) { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-1); }
.site-footer ul:not(.socials) a { display: inline-flex; align-items: center; min-height: 36px; }
.site-footer .socials { margin-top: var(--s-4); }
.site-footer .socials a { border-color: rgba(255,255,255,0.3); color: #fff; }
.site-footer .socials a:hover { background: #fff; color: var(--summit-deep); border-color: #fff; }
.footer__help { margin-top: var(--s-7); padding: var(--s-4) var(--s-5); border-radius: 14px; background: rgba(143,211,244,0.1); color: #fff; }
.footer__bottom { margin-top: var(--s-6); padding-top: var(--s-5); border-top: 1px solid rgba(255,255,255,0.15); display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); justify-content: space-between; }
@media (min-width: 700px) { .footer__grid { grid-template-columns: 1.4fr 1fr 1fr; } }

/* ---------- Article (blog post) ---------- */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 120; background: transparent; pointer-events: none; }
.progress span { display: block; height: 100%; width: 100%; background: var(--max-green); transform-origin: 0 50%; transform: scaleX(0); }
.breadcrumb { font-size: var(--step--1); color: var(--muted); margin-bottom: var(--s-5); }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; }
.breadcrumb li + li::before { content: "/"; margin-right: 0.4rem; color: #9aabbf; }
.article-head { padding-top: var(--s-8); padding-bottom: var(--s-6); }
.article-head h1 { max-width: 20ch; }
.article-head .post-meta { font-size: var(--step-0); }
.article-body { padding-bottom: var(--section); }
.article-layout { display: grid; gap: var(--s-7); }
.article-figure { margin: 0; }
.article-figure img { border-radius: var(--arch); width: 100%; max-width: 380px; }
.article-figure figcaption { margin-top: var(--s-3); font-size: var(--step--1); color: var(--muted); max-width: 36ch; }
@media (min-width: 900px) {
  .article-layout { grid-template-columns: minmax(0, 62ch) 1fr; gap: var(--s-8); }
  .article-figure { position: sticky; top: calc(var(--header-h) + 2rem); align-self: start; order: 2; }
}
.update-note { background: var(--paper); border-left: 4px solid var(--max-green); border-radius: 0 10px 10px 0; padding: var(--s-5); margin: var(--s-6) 0; font-family: var(--sans); font-size: var(--step-0); line-height: 1.55; }
.update-note p:last-child { margin-bottom: 0; }
.update-note .hero__actions { margin-top: var(--s-4); }

.comments { margin-top: var(--s-8); padding-top: var(--s-7); border-top: 1px solid var(--line); max-width: 62ch; }
.comments h2 { font-size: var(--step-2); }
.comment-list { list-style: none; margin: 0 0 var(--s-7); padding: 0; display: grid; gap: var(--s-4); }
.comment { background: var(--paper); border-radius: 12px; padding: var(--s-4) var(--s-5); }
.comment p { margin: 0 0 var(--s-2); font-family: var(--serif); font-size: var(--step-1); }
.comment footer { font-size: var(--step--1); color: var(--muted); }
.comment footer b { color: var(--ink); }

/* ---------- 404 ---------- */
.notfound { min-height: 60vh; display: grid; place-items: center; text-align: center; padding-block: var(--section); }
.notfound img { width: 120px; margin: 0 auto var(--s-5); }
.notfound p { color: var(--muted); max-width: 44ch; margin-inline: auto; }
.notfound .hero__actions { justify-content: center; margin-top: var(--s-5); }

/* ---------- Reveal on scroll (only added when JS runs) ---------- */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); transition-delay: var(--delay, 0ms); }
.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: var(--s-4); visibility: hidden; pointer-events: none; }
.modal.is-open { visibility: visible; pointer-events: auto; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(19, 40, 95, 0.5); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); opacity: 0; transition: opacity var(--t-med) var(--ease); }
.modal__card {
  position: relative; width: min(100%, 480px); background: var(--paper); border-radius: 18px; padding: var(--s-6);
  box-shadow: 0 40px 80px -30px rgba(19,40,95,0.6);
  opacity: 0; transform: translateY(12px) scale(0.98); transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease);
}
.modal.is-open .modal__backdrop { opacity: 1; }
.modal.is-open .modal__card { opacity: 1; transform: none; }
.modal__icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: #e3f4ea; color: var(--green-ink); margin-bottom: var(--s-4); }
.modal__icon--info { background: #e2edf7; color: var(--summit); }
.modal__icon svg { width: 26px; height: 26px; }
.modal__title { font-size: var(--step-2); margin-bottom: var(--s-3); }
.modal__message { color: var(--muted); }
.modal__message p:last-child { margin-bottom: 0; }
.modal__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-5); }
.modal__close { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.modal__close:hover { background: var(--sky); color: var(--summit); }
.modal__close svg { width: 22px; height: 22px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 310; right: var(--s-4); bottom: var(--s-4); left: var(--s-4); display: grid; gap: var(--s-2); justify-items: end; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: var(--s-3); max-width: 400px; width: 100%;
  background: var(--summit-deep); color: #fff; border-radius: 12px; padding: var(--s-3) var(--s-4);
  border-left: 5px solid var(--max-green); box-shadow: 0 20px 40px -20px rgba(19,40,95,0.6);
  transform: translateY(16px); opacity: 0; transition: transform var(--t-med) var(--ease), opacity var(--t-med) var(--ease);
}
.toast.is-visible { transform: none; opacity: 1; }
.toast--error { border-left-color: #ff8a80; }
.toast--info { border-left-color: var(--ray); }
.toast p { margin: 0; flex: 1; font-size: var(--step--1); }
.toast button { background: none; border: 0; color: var(--on-dark-muted); cursor: pointer; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; margin: -4px -6px -4px 0; }
.toast button:hover { color: #fff; background: rgba(255,255,255,0.1); }

/* ---------- Print ---------- */
@media print {
  .site-header, .crisis-bar, .mobile-menu, .toasts, .modal, .progress, .form { display: none !important; }
  body { background: #fff; }
}
