/* ==========================================================================
   Informative breathing library — base stylesheet

   BRANDING: every brand-facing value is a custom property in :root below.
   Swap the four --brand-* tokens (and the header/footer mark) when the real
   identity lands; nothing else needs to change.
   ========================================================================== */

:root {
  --brand-accent: #2f6f62;
  --brand-accent-soft: #e6f0ed;
  --brand-ink: #14181a;
  --brand-font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;

  --bg: #fbfaf8;
  --bg-raised: #ffffff;
  --bg-sunken: #f2f1ec;
  --text: var(--brand-ink);
  --text-muted: #5c6366;
  --text-faint: #838b8e;
  --line: #e2e0d9;
  --line-strong: #cfccc2;
  --accent: var(--brand-accent);
  --accent-soft: var(--brand-accent-soft);
  --focus: #1a6fd4;

  --measure: 68ch;
  --wrap: 1160px;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 24, 26, .05), 0 8px 24px rgba(20, 24, 26, .05);
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand-accent: #7fc9b6;
    --brand-accent-soft: #16302a;
    --bg: #101315;
    --bg-raised: #171b1e;
    --bg-sunken: #0b0e0f;
    --text: #e8e9e7;
    --text-muted: #a6adaf;
    --text-faint: #7d8587;
    --line: #262c30;
    --line-strong: #38403f;
    --focus: #7fb4ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .35);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--brand-font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--bg-raised); color: var(--text);
  padding: .6rem 1rem; border: 1px solid var(--line-strong); border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

/* ---------- header / footer ---------- */

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; min-height: 62px;
}
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand-logo { width: 190px; height: auto; }
.brand-logo.is-dark { display: none; }
@media (prefers-color-scheme: dark) {
  .brand-logo.is-light { display: none; }
  .brand-logo.is-dark { display: block; }
}

.site-nav { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.site-nav a {
  color: var(--text-muted); text-decoration: none; font-size: .94rem; font-weight: 500;
  padding: .35rem 0; border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--text); }
.site-nav a.is-active { color: var(--text); border-bottom-color: var(--accent); }

@media (max-width: 620px) {
  .header-inner { gap: .6rem; }
  .brand-logo { width: 148px; }
  .site-nav { gap: .85rem; flex-wrap: nowrap; }
  .site-nav a { font-size: .84rem; white-space: nowrap; }
}
@media (max-width: 400px) {
  .brand-logo { width: 122px; }
  .site-nav { gap: .7rem; }
  .site-nav a { font-size: .8rem; }
}

.site-footer {
  margin-top: 5rem; padding: 3rem 0 3.5rem;
  border-top: 1px solid var(--line); background: var(--bg-sunken);
  color: var(--text-muted); font-size: .9rem;
}
.footer-grid {
  display: grid; gap: 2rem 2.5rem;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.footer-col-wide { grid-column: span 2; max-width: 42ch; }
@media (max-width: 700px) { .footer-col-wide { grid-column: auto; } }
.footer-col h2 {
  margin: 0 0 .8rem; font-size: .74rem; font-weight: 650;
  letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint);
}
.footer-col p { margin: 0 0 .6rem; line-height: 1.6; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: .5rem; }
.footer-col a { color: var(--text-muted); text-decoration: none; }
.footer-col a:hover { color: var(--accent); text-decoration: underline; }
.footer-brand { margin: 0 0 1.1rem; }
.footer-brand .brand-logo { width: 176px; }
.footer-org address { font-style: normal; line-height: 1.6; margin: 0 0 .6rem; }
.footer-org .org-name { color: var(--text); font-weight: 620; margin-bottom: .2rem; }
.footer-org .org-line { margin: 0 0 .35rem; }
.footer-bottom {
  margin-top: 2.6rem; padding-top: 1.6rem; border-top: 1px solid var(--line);
  display: grid; gap: .8rem; font-size: .85rem;
}
.footer-bottom p { margin: 0; }
.footer-note { max-width: 72ch; }
.footer-note strong { color: var(--text); }

/* ---------- home ---------- */

.hero { padding: clamp(3rem, 8vw, 6rem) 0 clamp(2rem, 4vw, 3rem); }
.eyebrow {
  margin: 0 0 .9rem; font-size: .8rem; font-weight: 600;
  letter-spacing: .09em; text-transform: uppercase; color: var(--text-faint);
}
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { color: var(--accent); }
.hero h1 {
  margin: 0 0 1.1rem; max-width: 20ch;
  font-size: clamp(2.1rem, 5.4vw, 3.4rem); line-height: 1.08;
  letter-spacing: -.025em; font-weight: 680;
}
.lede { margin: 0; max-width: 58ch; font-size: clamp(1.05rem, 1.8vw, 1.2rem); color: var(--text-muted); }
.hero-actions { margin: 2rem 0 0; }
.btn {
  display: inline-block; padding: .7rem 1.4rem; border-radius: 999px;
  background: var(--accent); color: var(--bg); font-weight: 600; font-size: .95rem;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }

.library { padding-bottom: 2rem; }
.group { padding: 2.6rem 0; border-top: 1px solid var(--line); }
.group > h2 {
  margin: 0 0 .4rem; font-size: clamp(1.35rem, 2.6vw, 1.7rem);
  letter-spacing: -.015em; font-weight: 650;
}
.group-blurb { margin: 0 0 1.8rem; max-width: 62ch; color: var(--text-muted); }

.card-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 1.1rem;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
}
.card > a {
  display: flex; flex-direction: column; height: 100%;
  background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.card > a:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--shadow); }
.card-img { display: block; flex: 0 0 auto; background: var(--bg-sunken); }
.card-img img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.card-body { display: block; flex: 1 1 auto; padding: 1.05rem 1.15rem 1.3rem; }
.card-title { display: block; font-weight: 620; line-height: 1.35; letter-spacing: -.012em; }
.card-desc {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  margin-top: .5rem; font-size: .9rem; line-height: 1.55; color: var(--text-muted);
}

/* ---------- article ---------- */

.page-head { padding: clamp(2.5rem, 6vw, 4rem) 0 1rem; }
.page-head h1 { margin: 0; font-size: clamp(1.9rem, 4.4vw, 2.7rem); letter-spacing: -.022em; }

.hero-media { background: var(--bg-sunken); border-bottom: 1px solid var(--line); }
.hero-media img { width: 100%; max-height: 380px; object-fit: cover; }

.article-head-inner { padding: clamp(2rem, 5vw, 3.2rem) 0 0; max-width: var(--measure); }
.article-head h1 {
  margin: 0 0 1rem; font-size: clamp(1.9rem, 4.4vw, 2.7rem);
  line-height: 1.13; letter-spacing: -.022em; font-weight: 680;
}
.standfirst { margin: 0 0 1rem; font-size: 1.1rem; line-height: 1.6; color: var(--text-muted); }
.meta { margin: 0; font-size: .85rem; color: var(--text-faint); }

.article-layout {
  display: grid; gap: 3rem;
  grid-template-columns: minmax(0, 1fr);
  padding-top: 2.5rem;
}
@media (min-width: 1000px) {
  .article-layout { grid-template-columns: 250px minmax(0, 1fr); gap: 3.5rem; }
  .toc { position: sticky; top: 88px; align-self: start; max-height: calc(100vh - 120px); overflow-y: auto; }
}

.toc {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-raised); padding: 1.1rem 1.2rem;
}
.toc-title {
  margin: 0 0 .7rem; font-size: .74rem; font-weight: 650;
  letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint);
}
.toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; }
.toc li { counter-increment: toc; margin-bottom: .55rem; font-size: .88rem; line-height: 1.45; }
.toc li:last-child { margin-bottom: 0; }
.toc a { color: var(--text-muted); text-decoration: none; display: block; }
.toc a::before {
  content: counter(toc, decimal-leading-zero) ". ";
  color: var(--text-faint); font-variant-numeric: tabular-nums;
}
.toc a:hover, .toc a.is-current { color: var(--accent); }

/* --- article body --- */

.article-body { max-width: var(--measure); font-size: 1.06rem; }
.article-body .chapter { padding-bottom: .5rem; scroll-margin-top: 84px; }
.article-body .chapter + .chapter { margin-top: 2.6rem; padding-top: 2.6rem; border-top: 1px solid var(--line); }

.article-body h2 {
  margin: 0 0 1.1rem; font-size: clamp(1.4rem, 3vw, 1.75rem);
  line-height: 1.22; letter-spacing: -.018em; font-weight: 660;
}
.article-body h3 {
  margin: 2.2rem 0 .8rem; font-size: 1.18rem; line-height: 1.3;
  letter-spacing: -.01em; font-weight: 640;
}
.article-body h4 { margin: 1.8rem 0 .6rem; font-size: 1.02rem; font-weight: 640; }
.article-body p { margin: 0 0 1.15rem; }
.article-body strong { font-weight: 640; }
.article-body ul, .article-body ol { margin: 0 0 1.3rem; padding-left: 1.35rem; }
.article-body li { margin-bottom: .55rem; }
.article-body li::marker { color: var(--text-faint); }

.article-body a { color: var(--accent); }
.article-body a.internal-link { text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); }

.article-body figure { margin: 1.9rem 0; }
.article-body figure img { border-radius: var(--radius); width: 100%; }
.article-body figcaption {
  margin-top: .6rem; font-size: .86rem; color: var(--text-faint); line-height: 1.5;
}
.article-body .w-richtext-align-floatright {
  float: right; width: min(42%, 280px); margin: .4rem 0 1.2rem 1.6rem;
}
.article-body .w-richtext-align-center { margin-inline: auto; max-width: 560px; }
@media (max-width: 620px) {
  .article-body .w-richtext-align-floatright { float: none; width: 100%; margin: 1.6rem 0; }
}

/* Video embeds keep their original 16:9 ratio. */
.article-body .w-richtext-figure-type-video > div { position: relative; padding-top: 56.25%; }
.article-body .w-richtext-figure-type-video iframe {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border: 0; border-radius: var(--radius);
}

.article-body table {
  width: 100%; border-collapse: collapse; margin: 1.6rem 0;
  font-size: .95rem; display: block; overflow-x: auto;
}
.article-body table tbody { display: table; width: 100%; }
.article-body td, .article-body th {
  padding: .7rem .85rem; border: 1px solid var(--line); vertical-align: top; text-align: left;
}
.article-body tr:nth-child(odd) td { background: var(--bg-raised); }
.article-body td p { margin: 0 0 .5rem; }
.article-body td p:last-child { margin-bottom: 0; }

/* ---------- related ---------- */

.related { margin-top: 3.5rem; padding-top: 2.4rem; border-top: 1px solid var(--line); }
.related h2 { margin: 0 0 1.3rem; font-size: 1.25rem; letter-spacing: -.012em; }
.related-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: .85rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.related-list a {
  display: block; height: 100%; padding: 1rem 1.1rem;
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.related-list a:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.rel-title { display: block; font-weight: 620; line-height: 1.35; font-size: .98rem; }
.rel-desc {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-top: .35rem; font-size: .86rem; color: var(--text-muted); line-height: 1.5;
}

/* ---------- static prose pages ---------- */

.prose { max-width: var(--measure); padding-bottom: 1rem; }
.prose h2 {
  margin: 2.6rem 0 .8rem; font-size: 1.3rem; letter-spacing: -.014em;
  padding-top: 1.4rem; border-top: 1px solid var(--line);
}
.prose > h2:first-of-type { border-top: 0; padding-top: 0; }
.prose h3 { margin: 1.9rem 0 .6rem; font-size: 1.05rem; font-weight: 640; }
.prose p { margin: 0 0 1.15rem; }
.prose ul, .prose ol { margin: 0 0 1.3rem; padding-left: 1.35rem; }
.prose li { margin-bottom: .6rem; }
.prose li::marker { color: var(--text-faint); }

.legal-updated {
  font-size: .85rem; color: var(--text-faint);
  padding-bottom: 1.4rem; border-bottom: 1px solid var(--line); margin-bottom: 1.8rem;
}

.callout {
  padding: 1.1rem 1.25rem; border-radius: var(--radius);
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}
.editor-note {
  padding: .8rem 1rem; border-radius: var(--radius);
  border: 1px dashed var(--line-strong); background: var(--bg-sunken);
  font-size: .88rem; color: var(--text-faint);
}
.contact-block {
  font-style: normal; line-height: 1.7; margin: 0 0 1.3rem;
  padding: 1rem 1.2rem; border-left: 3px solid var(--accent);
  background: var(--bg-raised); border-radius: 0 var(--radius) var(--radius) 0;
}
.contact-primary { font-size: 1.15rem; font-weight: 620; margin-bottom: .8rem; }

.hero-org {
  margin: 2rem 0 0; max-width: 58ch; font-size: .92rem;
  color: var(--text-faint); line-height: 1.6;
}
.hero-org strong { color: var(--text-muted); font-weight: 620; }
.btn-quiet {
  display: inline-block; margin-left: .9rem; padding: .7rem .4rem;
  color: var(--text-muted); font-weight: 600; font-size: .95rem;
}
