:root {
  --paper: #FAF7F0;
  --paper-deep: #EFE9DC;
  --ink: #0A0908;
  --ink-soft: #3A322A;
  --ink-faint: #6E6457;
  --rule: #A89C8A;
  --rule-soft: #D9D0BD;
  --accent: #4A3D2E;
  --moss: #4A5938;
  --rose: #6E3838;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Inter', system-ui, sans-serif;
  --transition-theme: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Dark mode */
html[data-theme="dark"] {
  --paper: #181713;
  --paper-deep: #0F0E0B;
  --ink: #FFFAF0;
  --ink-soft: #E8DFC9;
  --ink-faint: #A89E89;
  --rule: #5C4F42;
  --rule-soft: #2E2820;
  --accent: #F0DDB8;
  --moss: #C9D6A6;
  --rose: #F0BFBF;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]):not([data-theme="dark"]) {
    --paper: #181713;
    --paper-deep: #0F0E0B;
    --ink: #FFFAF0;
    --ink-soft: #E8DFC9;
    --ink-faint: #A89E89;
    --rule: #5C4F42;
    --rule-soft: #2E2820;
    --accent: #F0DDB8;
    --moss: #C9D6A6;
    --rose: #F0BFBF;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: var(--transition-theme);
}

::selection { background: var(--ink); color: var(--paper); }

/* Layout */
.container { max-width: 1440px; margin: 0 auto; padding: 0 2rem; }
.narrow { max-width: 620px; margin: 0 auto; padding: 0 2rem; }

/* Header */
header { padding: 0; }
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 0;
  border-bottom: 0.5px solid var(--rule);
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 22px;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
}
.wordmark-logo {
  flex-shrink: 0;
  color: var(--ink);
  transition: color 0.3s ease;
}
nav {
  display: flex;
  gap: 2rem;
  align-items: center;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
nav a { color: inherit; text-decoration: none; transition: color 0.2s; }
nav a:hover { color: var(--ink); }
nav a[aria-current="page"] { color: var(--ink); }

/* Theme toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: 0.5px solid var(--rule);
  border-radius: 100px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: var(--transition-theme), border-color 0.2s;
}
.theme-toggle:hover {
  color: var(--ink);
  border-color: var(--ink-soft);
}
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]):not([data-theme="dark"]) .theme-toggle .icon-sun { display: block; }
  html:not([data-theme="light"]):not([data-theme="dark"]) .theme-toggle .icon-moon { display: none; }
}

/* Hero */
.hero {
  padding: 6rem 0 5rem;
  text-align: center;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 2rem;
}
.eyebrow::before, .eyebrow::after {
  content: "—";
  margin: 0 1rem;
  color: var(--rule);
}
h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(38px, 6vw, 58px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: 1.5rem;
}
h1 em { font-style: italic; color: var(--accent); }
.lede {
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 520px;
  margin: 0 auto 2.5rem;
}
.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}
.btn {
  display: inline-block;
  padding: 14px 28px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  border: 0.5px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  transition: all 0.2s;
}
.btn:hover { background: transparent; color: var(--ink); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule);
}
.btn-ghost:hover { border-color: var(--ink); background: transparent; color: var(--ink); }

/* Ornament */
.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 5rem 0 3rem;
  color: var(--rule);
}
.ornament::before, .ornament::after {
  content: "";
  flex: 1;
  height: 0.5px;
  background: var(--rule);
  max-width: 120px;
}
.ornament-mark {
  font-family: var(--serif);
  font-style: italic;
  margin: 0 1.5rem;
  color: var(--ink-faint);
  font-size: 18px;
}

/* Page header (standalone pages) */
.page-header {
  padding: 6rem 0 0;
  text-align: center;
}

/* Section heads */
.section-label {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 1rem;
  text-align: center;
}
h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 38px;
  line-height: 1.2;
  text-align: center;
  margin-bottom: 1rem;
}
h2 em { font-style: italic; color: var(--accent); }
.section-sub {
  font-family: var(--serif);
  font-size: 18px;
  color: var(--ink-soft);
  text-align: center;
  max-width: 480px;
  margin: 0 auto 3rem;
  line-height: 1.5;
}

/* Directory */
#directory { padding: 4rem 0; }
#directory .container { max-width: 1200px; }

/* In-release notice */
.notice {
  max-width: 720px;
  margin: 0 auto 3rem;
  padding: 1.5rem 1.75rem;
  border: 0.5px solid var(--rule);
  border-left: 2px solid var(--accent);
  background: var(--paper-deep);
  border-radius: 2px;
}
.notice-label {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--accent);
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
}
.notice-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-soft);
  margin: 0;
}
.notice-text a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 0.5px solid var(--ink-faint);
  padding-bottom: 1px;
  transition: border-color 0.2s;
}
.notice-text a:hover { border-color: var(--ink); }

.filters {
  display: flex;
  gap: 12px;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  align-items: stretch;
}
.filter-search {
  flex: 1;
  min-width: 200px;
}
.filter-search input, .filter-select {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--sans);
  font-size: 14px;
  background: var(--paper);
  border: 0.5px solid var(--rule);
  color: var(--ink);
  border-radius: 2px;
  transition: border-color 0.2s;
}
.filter-search input:focus, .filter-select:focus {
  outline: none;
  border-color: var(--ink);
}
.filter-search input::placeholder { color: var(--ink-faint); }
.filter-state { min-width: 200px; }

.chips {
  display: flex;
  gap: 8px;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.chip {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 8px 16px;
  border: 0.5px solid var(--rule);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  border-radius: 100px;
  transition: all 0.2s;
}
.chip:hover { border-color: var(--ink-soft); color: var(--ink); }
.chip.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.results-count {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: var(--ink-faint);
  margin-bottom: 1.5rem;
  text-align: center;
}

.group {
  padding: 1.75rem 0;
  border-bottom: 0.5px solid var(--rule-soft);
}
.group:last-child { border-bottom: none; }
.group-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.5rem;
}
.group-name {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.3;
}
.group-location {
  font-size: 13px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
  margin-bottom: 0.75rem;
}
.group-desc {
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 1rem;
}
.group-meta {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  font-size: 13px;
  color: var(--ink-faint);
  flex-wrap: wrap;
}
.badge {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border: 0.5px solid currentColor;
  border-radius: 2px;
}
.badge.in-person { color: var(--moss); }
.badge.online { color: var(--accent); }
.badge.hotline { color: var(--rose); }
.group-link {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 0.5px solid var(--ink-faint);
  padding-bottom: 1px;
  transition: border-color 0.2s;
}
.group-link:hover { border-color: var(--ink); }

.empty {
  text-align: center;
  padding: 3rem 1rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  color: var(--ink-faint);
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 2.5rem 0 1rem;
}
.load-more {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 12px 24px;
  background: transparent;
  color: var(--ink-soft);
  border: 0.5px solid var(--rule);
  border-radius: 100px;
  cursor: pointer;
  transition: var(--transition-theme), border-color 0.2s;
}
.load-more:hover {
  color: var(--ink);
  border-color: var(--ink-soft);
}
.load-more:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Resources */
#resources { padding: 4rem 0 5rem; background: var(--paper-deep); }
#resources .container { max-width: 1280px; }
.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0;
  border-top: 0.5px solid var(--rule);
  border-left: 0.5px solid var(--rule);
}
.resource {
  display: flex;
  flex-direction: column;
  padding: 2rem 1.75rem;
  border-right: 0.5px solid var(--rule);
  border-bottom: 0.5px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  transition: background 0.3s;
  cursor: pointer;
}
.resource:hover { background: var(--paper-deep); }
html[data-theme="dark"] .resource:hover { background: var(--rule-soft); }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]):not([data-theme="dark"]) .resource:hover { background: var(--rule-soft); }
}
.resource-num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-faint);
  margin-bottom: 1rem;
}
.resource-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.25;
  margin-bottom: 0.75rem;
  color: var(--ink);
}
.resource-desc {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}
.resource-source {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: auto;
  transition: color 0.2s;
}
.resource:hover .resource-source { color: var(--accent); }

/* Contact form */
#contact { padding: 4rem 0 5rem; }
.contact-form { display: flex; flex-direction: column; gap: 1.25rem; }
.form-field { display: flex; flex-direction: column; gap: 0.5rem; }
.form-field label {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--sans);
  font-size: 14px;
  background: var(--paper);
  border: 0.5px solid var(--rule);
  color: var(--ink);
  border-radius: 2px;
  transition: border-color 0.2s, background 0.3s;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--ink);
}
.form-field input::placeholder,
.form-field textarea::placeholder { color: var(--ink-faint); }
.form-field textarea { resize: vertical; min-height: 130px; line-height: 1.6; }
.form-field select { appearance: none; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236E6457' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.form-actions { padding-top: 0.5rem; }
.contact-success {
  text-align: center;
  padding: 3rem 1rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
  color: var(--ink-soft);
  border: 0.5px solid var(--rule-soft);
  border-radius: 2px;
}

/* Footer */
footer {
  margin-top: 4rem;
  padding: 0;
  font-size: 13px;
  color: var(--ink-soft);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 2rem;
  padding: 4rem 0 3rem;
  border-top: 0.5px solid var(--rule);
}
.footer-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  color: var(--ink);
  margin-bottom: 0.75rem;
}
.footer-mark-logo {
  flex-shrink: 0;
  color: var(--ink);
}
.footer-tag {
  font-size: 13px;
  color: var(--ink-faint);
  max-width: 280px;
  margin-bottom: 1rem;
}
.footer-credit {
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
}
.footer-credit a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 0.5px solid var(--ink-faint);
  padding-bottom: 1px;
  transition: border-color 0.2s;
}
.footer-credit a:hover { border-color: var(--ink); }
.footer-crisis { text-align: right; }
.footer-crisis-label {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.5rem;
}
.footer-crisis-number {
  font-family: var(--serif);
  font-size: 20px;
  color: var(--ink);
}

/* Responsive */
@media (max-width: 600px) {
  .container, .narrow { padding: 0 1.25rem; }
  nav a { display: none; }
  nav { gap: 0; }
  .wordmark { font-size: 18px; }
  .header-inner {
    padding: 1.5rem 0;
    border-bottom-width: 1px;
  }
  .hero { padding: 4rem 0 3rem; }
  .page-header { padding: 3rem 0 0; }
  h1 { font-size: 38px; }
  h2 { font-size: 30px; }
  .lede { font-size: 19px; }
  .group-head { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .footer-inner {
    flex-direction: column;
    padding: 3rem 0 2.5rem;
    border-top-width: 1px;
  }
  .footer-crisis { text-align: left; }
  .filters { gap: 8px; }
  .filter-search, .filter-state { min-width: 100%; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
