/* Anxieties – calm, readable, fast. System fonts only (no font downloads). */
:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --text: #1f2a2c;
  --muted: #56666a;
  --line: #dfe3df;
  --brand: #2f6f6a;
  --brand-dark: #1f4f4b;
  --brand-soft: #e3efec;
  --accent: #b5532f;
  --urgent-bg: #fbeee8;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 40, 40, .06), 0 4px 16px rgba(20, 40, 40, .05);
  --max: 1120px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121817;
    --surface: #1a2221;
    --text: #e6ecea;
    --muted: #a3b2af;
    --line: #2c3836;
    --brand: #7cc4bb;
    --brand-dark: #a6dbd4;
    --brand-soft: #1e302d;
    --accent: #f0a17f;
    --urgent-bg: #2e211c;
    --shadow: none;
  }
}

*, *::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: 1.0625rem/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
img { max-width: 100%; height: auto; }
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-dark); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin: 0 0 .5rem; }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.7rem); margin: 2.2rem 0 .6rem; }
h3 { font-size: 1.15rem; margin: 1.6rem 0 .4rem; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 780px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 8px; }

/* Crisis bar and header */
.crisis-bar { background: var(--urgent-bg); font-size: .9rem; padding: .45rem 0; text-align: center; }
.crisis-bar a { color: var(--accent); font-weight: 600; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-top: .8rem; padding-bottom: .8rem; }
.brand { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1.2rem; color: var(--text); text-decoration: none; margin: 0; }
.main-nav { display: flex; flex-wrap: wrap; gap: .25rem; }
.main-nav a { padding: .4rem .7rem; border-radius: 999px; text-decoration: none; color: var(--text); font-size: .95rem; }
.main-nav a:hover { background: var(--brand-soft); }
.main-nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.main-nav .nav-urgent { color: var(--accent); font-weight: 600; }

/* Hero and bands */
.hero { background: linear-gradient(180deg, var(--brand-soft), var(--bg)); padding: 3.5rem 0 2.5rem; }
.hero .lede { max-width: 640px; }
.lede { font-size: 1.15rem; color: var(--muted); margin: 0 0 1rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.btn { display: inline-block; background: var(--brand); color: #fff; padding: .7rem 1.2rem; border-radius: 999px; text-decoration: none; font-weight: 600; }
.btn:hover { background: var(--brand-dark); color: #fff; }
@media (prefers-color-scheme: dark) { .btn, .btn:hover { color: #0d1514; } }
.btn-ghost { background: transparent; color: var(--brand); border: 2px solid var(--brand); }
.btn-ghost:hover { background: var(--brand-soft); color: var(--brand-dark); }
.band { padding-top: 2rem; padding-bottom: 1rem; }
.band-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.band-head h2 { margin-top: 0; }
.help-panel { background: var(--urgent-bg); border-radius: var(--radius); padding: 1.5rem; }
.help-panel h2 { margin-top: 0; }

/* Cards */
.cards { list-style: none; padding: 0; margin: 1rem 0 2rem; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.card a { display: flex; flex-direction: column; height: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: border-color .15s; }
.card a:hover { border-color: var(--brand); }
.card h3 { margin: 0 0 .4rem; color: var(--brand-dark); }
.card p { margin: 0 0 .8rem; color: var(--muted); font-size: .97rem; flex: 1; }
.card .more { font-size: .9rem; font-weight: 600; color: var(--brand); }

/* Breadcrumbs */
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .3rem; padding: 0; margin: 1.2rem 0 0; font-size: .9rem; color: var(--muted); }
.breadcrumbs li + li::before { content: "›"; margin-right: .3rem; }
.breadcrumbs a { color: var(--muted); }

/* Article */
.article-grid { display: grid; gap: 2.5rem; grid-template-columns: minmax(0, 1fr); padding-bottom: 3rem; }
@media (min-width: 960px) { .article-grid { grid-template-columns: minmax(0, 1fr) 260px; } }
.article { max-width: 760px; }
.article-head { padding: 1.2rem 0 .5rem; }
.meta { font-size: .9rem; color: var(--muted); margin: 0; }
.hub-head { padding: 1.2rem 0 0; max-width: 760px; }
.page-body { padding-bottom: 3rem; }
.page-body h1 { margin-top: 1.2rem; }
.narrow-prose { max-width: 760px; }

.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin: .3rem 0; }
.prose table { border-collapse: collapse; width: 100%; }
.callout { background: var(--brand-soft); border-left: 4px solid var(--brand); border-radius: 0 var(--radius) var(--radius) 0; padding: .3rem 1.2rem; margin: 1.5rem 0; }

.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; margin: 1rem 0 1.5rem; }
.toc-title { font-weight: 700; margin: 0 0 .3rem; }
.toc ol { margin: 0; padding-left: 1.2rem; columns: 2 220px; }

.crisis-note { background: var(--urgent-bg); border-radius: var(--radius); padding: .2rem 1.2rem; margin: 2rem 0 1rem; }
.disclaimer { font-size: .9rem; color: var(--muted); }

.sidebar { align-self: start; position: sticky; top: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; margin-top: 1.2rem; }
.sidebar-title { font-weight: 700; margin: 0 0 .4rem; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { margin: .35rem 0; font-size: .95rem; }

/* Ads: reserve space so pages don't jump when an ad loads */
.ad { margin: 2rem 0; min-height: 280px; text-align: center; }
.ad-label { display: block; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: .3rem; }

/* Footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); margin-top: 2rem; padding-top: 2rem; font-size: .95rem; }
.footer-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.footer-title { font-weight: 700; margin: 0 0 .4rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: .3rem 0; }
.footer-base { border-top: 1px solid var(--line); margin-top: 1.5rem; padding-top: .8rem; padding-bottom: 1.5rem; color: var(--muted); font-size: .85rem; }

@media print {
  .crisis-bar, .site-header, .site-footer, .sidebar, .ad, .toc { display: none; }
  body { background: #fff; color: #000; }
}

/* Interactive tools */
.tool { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; margin: 1rem 0 2rem; box-shadow: var(--shadow); }
@media (min-width: 640px) { .tool { padding: 1.6rem 1.8rem; } }

.quiz-intro { margin-top: 0; }
.quiz-q { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 1rem 0; }
.quiz-q legend { font-weight: 600; padding: 0; margin-bottom: .6rem; display: flex; gap: .6rem; align-items: baseline; }
.quiz-num { display: inline-grid; place-items: center; min-width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); font-size: .85rem; }
.quiz-options { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.quiz-options label { display: flex; align-items: center; gap: .5rem; border: 1px solid var(--line); border-radius: 10px; padding: .55rem .7rem; cursor: pointer; font-size: .95rem; }
.quiz-options label:hover { border-color: var(--brand); }
.quiz-options input { accent-color: var(--brand); width: 1.1rem; height: 1.1rem; margin: 0; flex: none; }
.quiz-options label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.quiz-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1rem; }
.quiz-actions button { font: inherit; cursor: pointer; border: 2px solid var(--brand); }
.quiz-error { color: var(--accent); font-weight: 600; }
.quiz-privacy, .quiz-note { font-size: .9rem; color: var(--muted); }
.quiz-result { margin-top: 1.5rem; border-top: 3px solid var(--brand); padding-top: 1rem; }
.quiz-result:focus { outline: none; }
.quiz-score { margin: 0; color: var(--muted); }
.quiz-score span { font-size: 2.6rem; font-weight: 700; color: var(--brand-dark); margin-right: .3rem; }
.quiz-band { margin: .2rem 0 .6rem; }

.breather-controls { display: flex; flex-wrap: wrap; gap: 1rem; }
.breather-controls label { display: grid; gap: .3rem; font-weight: 600; font-size: .95rem; }
.breather-controls select { font: inherit; padding: .45rem .6rem; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.breather-stage { position: relative; display: grid; place-items: center; height: 300px; margin: 1rem 0; }
.breather-ring { width: 260px; height: 260px; max-width: 80vw; max-height: 80vw; border-radius: 50%; border: 2px dashed var(--line); display: grid; place-items: center; }
.breather-circle { width: 100%; height: 100%; border-radius: 50%; background: radial-gradient(circle at 35% 35%, var(--brand-soft), var(--brand)); opacity: .85; transform: scale(.35); transition: transform 1s ease-in-out; }
.breather-circle.is-in, .breather-circle.is-hold { transform: scale(1); }
.breather-circle.is-out, .breather-circle.is-rest { transform: scale(.35); }
.breather-text { position: absolute; text-align: center; pointer-events: none; }
.breather-cue { font-size: 1.4rem; font-weight: 700; margin: 0; color: var(--text); text-shadow: 0 0 12px var(--surface); }
.breather-count { font-size: 2rem; margin: 0; color: var(--brand-dark); text-shadow: 0 0 12px var(--surface); }
.breather-actions { display: flex; align-items: center; gap: 1rem; }
.breather-actions button { font: inherit; cursor: pointer; border: 0; min-width: 7rem; }
.breather-left { margin: 0; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .breather-circle { transition: none !important; } }
