/* Treatment Finder design system — "Warm Monochrome".
   Spec: docs/superpowers/specs/2026-06-17-warm-monochrome-redesign-design.md
   Warmth is a material temperature (paper, warm-black ink, the serif), not a
   brand color. Color appears only as --alert, and only for genuine signals.
   All raw hex lives in :root / the dark block; every rule consumes tokens. */

@font-face {
  font-family: "InterVariable";
  src: url("/static/fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
/* Fraunces — optically-sized display serif (SIL OFL 1.1). opsz+wght axes;
   font-optical-sizing lets large headings bloom while small ones stay sturdy.
   Display type only; Inter drives body/UI. */
@font-face {
  font-family: "Fraunces";
  src: url("/static/fonts/Fraunces.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("/static/fonts/Fraunces-Italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "InterVariable", system-ui, -apple-system, sans-serif;

  /* warm-neutral canvas */
  --paper: #fbfaf8;
  --surface: #ffffff;
  --tint: #f4f1eb;        /* warm section / care-chip wash */
  --chip-bg: #f2f0eb;     /* neutral chip wash */

  /* warm-black ink ramp (all ≥ AA on --paper) */
  --ink: #1a1916;         /* ~15:1 — headings, primary text, filled actions */
  --ink-hover: #2b2823;
  --body: #56524c;        /* ~7:1  — body copy */
  --muted: #6d6962;       /* ~5.1:1 — meta/secondary; do not lighten */

  /* hairlines */
  --line: #e9e5dd;
  --line-strong: #dcd7cd;

  /* the one reserved semantic color */
  --alert: #b23f27;       /* ~5.3:1 on paper — errors, warnings, crisis numbers */
  --alert-tint: #fae9e3;

  --radius: 14px;
  --radius-lg: 18px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #16140f;
    --surface: #1f1c16;
    --tint: #1f1c16;
    --chip-bg: #26221b;
    --ink: #f4f1eb;
    --ink-hover: #e7e0d3;
    --body: #cfc8bc;
    --muted: #9a958a;
    --line: #2e2a22;
    --line-strong: #3a352b;
    --alert: #e5765c;
    --alert-tint: #3a241d;
  }
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--body);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
h1, h2, h3 {
  font-family: var(--display);
  font-optical-sizing: auto;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.08;
  letter-spacing: -.02em;
  margin: 0 0 .5rem;
}
h4 { color: var(--ink); line-height: 1.2; margin: 0 0 .4rem; }
h1 { font-size: clamp(2.2rem, 5.5vw, 3.1rem); letter-spacing: -.028em; }
h2 { font-size: 1.7rem; letter-spacing: -.024em; }
h3 { font-size: 1.2rem; font-weight: 500; letter-spacing: -.012em; }
a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; text-decoration-color: var(--line-strong); }
a:hover { text-decoration-color: var(--ink); }
main { max-width: 52rem; margin: 0 auto; padding: 1.5rem 1.25rem 3.5rem; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--ink); color: var(--paper); }
.skip-link {
  position: absolute; left: -999px; top: .5rem;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 10px;
  padding: .5rem .9rem; font-weight: 600; text-decoration: none; z-index: 10;
}
.skip-link:focus { left: .5rem; }

/* ---------- crisis banner (always legible; --alert only on numbers) ---------- */
.crisis-banner {
  background: var(--alert-tint);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  padding: .55rem 1rem; text-align: center; font-size: .82rem; font-weight: 500;
}
.crisis-banner a { color: var(--alert); text-decoration-color: var(--alert); font-weight: 600; }
.crisis-banner .banner-detail { color: var(--muted); }
.crisis-banner .banner-more { text-decoration: underline; }

/* ---------- header / footer ---------- */
.site-header {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: .5rem;
  padding: 1.1rem max(1.25rem, calc((100% - 52rem) / 2));
  border-bottom: 1px solid var(--line);
}
.site-name {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--display); font-optical-sizing: auto;
  font-weight: 500; font-size: 1.18rem; letter-spacing: -.015em;
  text-decoration: none; color: var(--ink);
}
.site-name .mark { width: 24px; height: 24px; border-radius: 7px; flex: none; }
.site-header nav { display: flex; gap: 1.4rem; font-size: .9rem; font-weight: 500; }
.site-header nav a { color: var(--body); text-decoration: none; }
.site-header nav a:hover { color: var(--ink); }
.site-footer {
  border-top: 1px solid var(--line); margin-top: 3rem; padding: 2.25rem 1.25rem;
  text-align: center; font-size: .85rem; color: var(--muted);
}
.site-footer p { margin: .3rem 0; }
.site-footer a { color: var(--body); }

/* ---------- shared: eyebrow ---------- */
.hero-badge, .browse-label, .svc-block h4, .action-cards .label {
  font-family: var(--sans); font-weight: 600; text-transform: uppercase;
  letter-spacing: .18em; color: var(--muted); font-size: .72rem;
}

/* ---------- hero (home) ---------- */
.hero { text-align: center; padding: 4rem 0 2.5rem; }
.hero-badge { display: inline-block; margin-bottom: 1.1rem; }
.hero h1 { font-size: clamp(2.6rem, 6.2vw, 4.2rem); font-weight: 400; letter-spacing: -.032em; line-height: 1.02; }
.hero .grad { font-family: var(--display); font-style: italic; font-weight: 400; color: var(--ink); }
.hero-sub { max-width: 34rem; margin: 1.3rem auto 0; font-size: 1.15rem; line-height: 1.5; color: var(--body); }

/* ---------- search pill (home) ---------- */
.search-form {
  display: flex; gap: .4rem; align-items: center; flex-wrap: wrap;
  max-width: 34rem; margin: 2.1rem auto 0;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 999px; padding: .4rem .4rem .4rem 1.25rem;
  box-shadow: 0 1px 2px rgba(26,25,22,.05), 0 10px 26px -16px rgba(26,25,22,.22);
}
.search-form input {
  flex: 1.6 1 8rem; min-width: 0; border: 0; background: transparent;
  font: inherit; font-size: 1rem; color: var(--ink);
}
.search-form input::placeholder { color: var(--muted); }
.search-form select {
  flex: 0 0 auto; border: 0; background: transparent; font: inherit;
  font-size: .92rem; color: var(--body); padding: .4rem .3rem .4rem .8rem;
  border-left: 1px solid var(--line-strong);
}

/* ---------- buttons ---------- */
button[type="submit"] {
  background: var(--ink); color: var(--paper); border: 0; border-radius: 999px;
  padding: .7rem 1.45rem; font: inherit; font-size: .92rem; font-weight: 600;
  letter-spacing: .005em; cursor: pointer; min-height: 44px; flex: 0 0 auto;
}
button[type="submit"]:hover { background: var(--ink-hover); }

/* ---------- browse chips / trust strip (home) ---------- */
.browse-label { margin: 1.6rem 0 .55rem; }
.browse-chips { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; }
.browse-chips a {
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 999px; padding: .4rem .95rem; font-size: .85rem; font-weight: 500;
  color: var(--body); text-decoration: none;
}
.browse-chips a:hover { border-color: var(--ink); color: var(--ink); }
.trust-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.25rem; margin-top: 3rem; text-align: center; }
.trust-strip svg { width: 26px; height: 26px; stroke: var(--ink); fill: none; stroke-width: 1.5; }
.trust-strip h3 { font-family: var(--sans); font-size: .95rem; font-weight: 600; color: var(--ink); margin: .6rem 0 .2rem; letter-spacing: 0; }
.trust-strip p { font-size: .88rem; line-height: 1.5; margin: 0; color: var(--muted); }

/* ---------- filters (results / meetings) ---------- */
.filters { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin: .4rem 0 0; }
.filters input, .filters select {
  width: 100%; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 10px;
  padding: .65rem .8rem; font: inherit; font-size: .9rem; min-width: 0;
}
.filters button[type="submit"] { grid-column: 1 / -1; justify-self: end; min-width: 9rem; }
.filter-help { font-size: .82rem; margin: .6rem 0 0; text-align: right; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 1.3rem; border-bottom: 1px solid var(--line); margin: .5rem 0 1.25rem; }
.tabs a {
  padding: .55rem .1rem; margin-bottom: -1px; font-size: .92rem; font-weight: 500;
  text-decoration: none; color: var(--body); border-bottom: 2px solid transparent;
  min-height: 44px; display: inline-flex; align-items: center;
}
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); border-bottom-color: var(--ink); }

/* ---------- results meta / callouts ---------- */
.result-meta { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; margin: 1.25rem 0 .35rem; }
.result-count { font-size: .95rem; color: var(--ink); margin: 0; }
.sort-note { font-size: .8rem; color: var(--muted); }
.callout-warn, .unknown-note, .note, .freshness-line { border-radius: 10px; font-size: .85rem; margin: .6rem 0; }
.callout-warn { background: var(--alert-tint); border-left: 3px solid var(--alert); color: var(--ink); padding: .6rem .85rem; }
.call-first { font-weight: 600; color: var(--alert); }
.unknown-note { background: var(--tint); border: 1px solid var(--line); color: var(--body); padding: .65rem .85rem; }
.note { background: var(--tint); color: var(--body); padding: .55rem .75rem; font-size: .85rem; }
.note-sm { color: var(--muted); font-size: .82rem; margin: .45rem 0 0; }
.freshness-line { color: var(--muted); font-size: .85rem; }

/* ---------- results / meetings list (hairline rows, not cards) ---------- */
.result {
  padding: 1.4rem .5rem; margin: 0; border-bottom: 1px solid var(--line);
  border-radius: 10px;
}
.result-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.result h3 { margin: 0 0 .2rem; font-size: 1.2rem; font-weight: 500; }
.result h3 a { color: var(--ink); text-decoration: none; }
.result h3 a:hover { text-decoration: underline; }
.distance { color: var(--muted); font-size: .9rem; margin: 0; }
.call-btn {
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 999px;
  padding: .55rem 1rem; font-size: .85rem; font-weight: 600; text-decoration: none;
  white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center; flex: none;
}
.call-btn:hover { border-color: var(--ink); background: var(--tint); }
.badges { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .65rem; }
.chip { border-radius: 6px; padding: .2rem .6rem; font-size: .74rem; font-weight: 600; }
.chip-care { background: var(--tint); color: var(--ink); }
.chip-pay { background: var(--chip-bg); color: var(--body); }
.chip-meet { background: var(--tint); color: var(--body); }
.chip-fellowship { background: var(--ink); color: var(--paper); }
.chip-more { font-size: .74rem; color: var(--muted); align-self: center; }

/* ---------- empty / start states / pagination ---------- */
.empty-state, .start-card { text-align: center; padding: 2.5rem 1rem; }
.state-list { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; flex-wrap: wrap; gap: .45rem; justify-content: center; }
.state-list a {
  display: inline-block; background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 8px; padding: .35rem .65rem; font-size: .82rem; font-weight: 500;
  text-decoration: none; color: var(--body);
}
.state-list a:hover { border-color: var(--ink); color: var(--ink); }
.pagination { display: flex; gap: .75rem; justify-content: center; margin: 1.75rem 0 .5rem; }
.pagination a {
  border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px;
  padding: .5rem 1.1rem; font-size: .85rem; font-weight: 500; text-decoration: none; color: var(--body);
}
.pagination a:hover { border-color: var(--ink); color: var(--ink); }

/* ---------- detail ---------- */
.facility-detail .verified { font-size: .85rem; color: var(--muted); margin: 0 0 1.25rem; }
.facility-detail .verified .call-first { color: var(--alert); }
.action-cards { display: flex; gap: .6rem; margin: 0 0 1.25rem; }
.action-cards a {
  flex: 1; background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius); padding: .85rem .7rem; text-align: center;
  text-decoration: none; min-height: 44px;
}
.action-cards a:hover { border-color: var(--ink); background: var(--tint); }
.action-cards .label { display: block; margin-bottom: .25rem; }
.action-cards .value { font-size: .9rem; font-weight: 600; color: var(--ink); }
.detail-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 1.15rem 1.25rem; margin-bottom: .9rem;
}
.detail-card h2 { font-size: 1.35rem; position: relative; padding-bottom: .55rem; }
.detail-card h2::after { content: ""; position: absolute; left: 0; bottom: 0; width: 2.5rem; height: 2px; background: var(--ink); border-radius: 2px; }
.svc-block { margin: 0 0 .85rem; }
.svc-block:last-child { margin-bottom: 0; }
.svc-values { display: flex; gap: .4rem; flex-wrap: wrap; }
.svc-values span { background: var(--tint); color: var(--ink); border-radius: 6px; padding: .25rem .6rem; font-size: .8rem; }
.detail-card dl { margin: 0; }
.detail-card dt { font-weight: 600; color: var(--ink); font-size: .85rem; margin-top: .55rem; }
.detail-card dd { margin: .12rem 0 0; font-size: .9rem; }
.call-checklist { margin: 0; padding-left: 1.15rem; }
.call-checklist li { font-size: .92rem; margin-bottom: .35rem; }
.contact-line { font-size: .9rem; margin: .3rem 0; }

/* ---------- static pages / errors ---------- */
.prose { max-width: 40rem; }
.prose p, .prose li { font-size: 1rem; }
.error-inline { color: var(--alert); font-size: .9rem; }
.ambient { display: block; width: 100%; height: auto; margin: .5rem 0 1.75rem; color: var(--line-strong); }
.ambient .sky { fill: var(--tint); }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .result, .action-cards a, .call-btn, .browse-chips a, .state-list a, .pagination a {
    transition: background 160ms ease-out, border-color 160ms ease-out, transform 160ms ease-out;
  }
  .result:hover { background: var(--surface); }
  .action-cards a:hover, .call-btn:hover { transform: translateY(-1px); }
  button[type="submit"] { transition: background 150ms ease-out, transform 150ms ease-out; }
  button[type="submit"]:hover { transform: translateY(-1px); }
  #results.htmx-settling { animation: settle 120ms ease-out; }
  @keyframes settle { from { opacity: .55; } to { opacity: 1; } }

  .hero > * { animation: rise 600ms cubic-bezier(.22,1,.36,1) backwards; }
  .hero-badge { animation-delay: 40ms; }
  .hero h1 { animation-delay: 110ms; }
  .hero-sub { animation-delay: 200ms; }
  .hero .search-form { animation-delay: 300ms; }
  .hero .browse-label, .hero .browse-chips { animation-delay: 380ms; }
  .hero .trust-strip { animation-delay: 460ms; }
  @keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
}

/* ---------- responsive ---------- */
@media (max-width: 520px) {
  .filters { grid-template-columns: 1fr 1fr; }
  .filters button[type="submit"] { grid-column: 1 / -1; justify-self: stretch; }
  .search-form input { flex-basis: 100%; }
  .search-form select { border-left: 0; }
  .search-form button[type="submit"] { flex: 1 1 auto; justify-content: center; }
  .trust-strip { grid-template-columns: 1fr; gap: 1.6rem; }
  .action-cards { flex-direction: column; }
  .result-top { flex-direction: column; }
  .call-btn { align-self: stretch; justify-content: center; }
  .site-header { justify-content: center; row-gap: .35rem; }
  .crisis-banner { font-size: .76rem; padding: .45rem .75rem; }
  .banner-detail { display: none; }
  h1 { font-size: 1.9rem; }
}
