/*
 * styles.css — trauma-informed design system for Phase 1.
 *
 * Principles (from the brief, Section 5 & 9):
 *  - Calm and sparse. White space is a feature, not empty.
 *  - Big text, high contrast — usable in bright daylight on a cracked screen.
 *  - Dead-simple navigation. Assume older, stressed users.
 *  - No progress bar. Recovery is not linear.
 *
 * Committed DARK theme — deep, restful background with light text for calm,
 * high-contrast reading. Cool, grounding tones: eucalyptus sage for the
 * psychological layer, soft teal-blue for the structural / primary layer.
 * The crisis exit ramp carries its own self-contained rose palette (below)
 * so it reads consistently and never depends on the surrounding theme.
 *
 * Note: a future light / bright-daylight variant (brief §9) could re-add a
 * `@media (prefers-color-scheme: light)` override — intentionally omitted for
 * now so everyone gets the dark look.
 */

:root {
  /* Palette — deep eucalyptus-charcoal ground, soft teal-blue + sage accents */
  --paper: #121716;        /* deep, cool near-black background */
  --surface: #1c2320;      /* cards */
  --surface-2: #262e2b;    /* subtle panels */
  --ink: #eef4f0;          /* light text (AAA on paper) */
  --ink-soft: #adbdb7;     /* secondary text */
  --line: #333d39;         /* hairline borders */

  --sage: #8fbaa2;         /* "In you" — psychological (eucalyptus green) */
  --sage-tint: #1e2b25;
  --accent: #7db8bf;       /* "Around you" / primary (calm teal-blue) */
  --accent-tint: #1a2a2b;

  --crisis: #e09a97;       /* light rose — for accent TEXT on the dark ground */
  --crisis-tint: #2e1e1e;  /* dark rose — for alert panels on the page */

  --focus: #8cc0dc;        /* accessible focus ring */

  /* Type scale — generous. Base is intentionally large. */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;

  --space: 1.25rem;
  --radius: 14px;
  --measure: 40rem;        /* readable line length */
}

/* ---- Reset-ish ---------------------------------------------------------- */
* { box-sizing: border-box; }

html {
  font-size: 18px;               /* large base */
  -webkit-text-size-adjust: 100%;
}
@media (min-width: 40rem) {
  html { font-size: 20px; }
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  font-size: 1.05rem;
  padding-bottom: 6rem;          /* room for the fixed crisis ramp */
}

h1, h2, h3 { line-height: 1.2; font-weight: 700; }
h1 { font-size: 2rem; margin: 0 0 0.5em; }
h2 { font-size: 1.5rem; margin: 0 0 0.4em; }
h3 { font-size: 1.2rem; margin: 0 0 0.3em; }

p { margin: 0 0 1em; max-width: var(--measure); }

a { color: var(--focus); }

/* Visible, high-contrast focus everywhere. */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Respect reduced-motion. */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---- Layout ------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: 52rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1rem;
  z-index: 200;
}
.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
  border-radius: 8px;
}

/* ---- Site header -------------------------------------------------------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  max-width: 52rem;
  margin: 0 auto;
  flex-wrap: wrap;
}
.site-header .brand {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  color: var(--ink);
  text-decoration: none;
}
.site-header .brand .brand-name { font-weight: 700; font-size: 1.1rem; letter-spacing: 0.01em; }
.site-header .brand .accent-word { color: var(--accent); }
.site-header .brand .brand-tagline {
  font-weight: 400; font-size: 0.78rem; color: var(--ink-soft);
  margin-top: 2px; letter-spacing: 0.01em;
}
.site-header nav a {
  color: var(--ink-soft);
  text-decoration: none;
  margin-left: 1.1rem;
  font-size: 0.95rem;
}
.site-header nav a:hover { color: var(--ink); text-decoration: underline; }

/* ---- Buttons & choices -------------------------------------------------- */
.btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius);
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn.secondary {
  background: transparent;
  color: var(--ink);
}

/* Large tappable choice cards — the core interaction. */
.choice-list { list-style: none; margin: 1.5rem 0; padding: 0; display: grid; gap: 0.9rem; }
.choice {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.12s ease, transform 0.12s ease, background 0.12s ease;
}
.choice:hover { border-color: var(--accent); transform: translateY(-1px); }
.choice .choice-label { font-weight: 700; font-size: 1.15rem; display: block; }
.choice .choice-blurb { color: var(--ink-soft); margin: 0.35rem 0 0; font-size: 0.98rem; }

/* ---- Front door --------------------------------------------------------- */
.hero {
  text-align: center;
  padding: 2.5rem 0 1rem;
}
.hero .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 1rem;
}
.hero h1 { font-size: 2.3rem; max-width: 22ch; margin-inline: auto; }
.hero .lede {
  font-size: 1.25rem;
  color: var(--ink-soft);
  max-width: 34rem;
  margin: 1rem auto 2rem;
}
.hero .cta-row { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; }

/* ---- Phase overview grid ------------------------------------------------ */
.nonlinear-note {
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  color: var(--ink-soft);
  font-size: 0.98rem;
  margin: 1.25rem 0 2rem;
}
.phase-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; margin: 1rem 0; }
@media (min-width: 34rem) { .phase-grid { grid-template-columns: 1fr 1fr; } }

.phase-card {
  display: block;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.12s ease, transform 0.12s ease;
}
.phase-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.phase-card .phase-name { font-size: 1.35rem; font-weight: 700; margin: 0.2rem 0; }
.phase-card .phase-time { color: var(--accent); font-weight: 600; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.06em; }
.phase-card .phase-orient { color: var(--ink-soft); margin: 0.5rem 0 0; font-size: 0.98rem; }

/* ---- Single R screen ---------------------------------------------------- */
.orientation {
  font-family: var(--serif);
  font-size: 1.5rem;
  line-height: 1.4;
  color: var(--ink);
  max-width: 30ch;
  margin: 0.5rem 0 2rem;
}
.pullquote {
  border-left: 4px solid var(--accent);
  padding: 0.25rem 0 0.25rem 1.25rem;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-style: italic;
  color: var(--ink);
  margin: 0 0 2.5rem;
  max-width: var(--measure);
}

/* Two faces — side by side on wide screens, stacked on mobile. */
.two-faces { display: grid; gap: 1rem; grid-template-columns: 1fr; margin: 1.5rem 0; }
@media (min-width: 44rem) { .two-faces { grid-template-columns: 1fr 1fr; } }

.face { border-radius: var(--radius); padding: 1.5rem; border: 2px solid transparent; }
.face .face-heading {
  font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 700; margin-bottom: 0.75rem;
}
.face.around { background: var(--accent-tint); border-color: var(--accent); }
.face.around .face-heading { color: var(--accent); }
.face.inyou { background: var(--sage-tint); border-color: var(--sage); }
.face.inyou .face-heading { color: var(--sage); }
.face ul { margin: 0.75rem 0 0; padding-left: 1.1rem; }
.face li { margin-bottom: 0.5rem; }
.face p { color: var(--ink); }

.normalization {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  font-size: 1.15rem;
  line-height: 1.5;
  margin: 2rem 0;
}
.normalization .voice-tag {
  display: block; font-size: 0.8rem; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--ink-soft); margin-bottom: 0.5rem;
}

.resources { margin: 2rem 0; }
.resources h2 { font-size: 1.2rem; }
.resource {
  display: block;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  text-decoration: none;
  color: var(--ink);
}
.resource[href]:hover { border-color: var(--accent); }
.resource .resource-label { font-weight: 700; }
.resource .resource-note { color: var(--ink-soft); font-size: 0.95rem; margin-top: 0.25rem; }
.resource.pending { opacity: 0.85; }
.resource .pending-tag {
  display: inline-block; font-size: 0.75rem; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--accent); font-weight: 700; margin-top: 0.4rem;
}

/* Phase-to-phase navigation (non-linear: both directions, plus "all phases"). */
.phase-nav {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  margin: 2.5rem 0 1rem; padding-top: 1.5rem; border-top: 1px solid var(--line);
}
.phase-nav a { text-decoration: none; color: var(--ink); font-weight: 600; }
.phase-nav a:hover { color: var(--accent); }

/* ---- Conversational path stub ------------------------------------------- */
.conversation {
  background: var(--sage-tint);
  border: 2px solid var(--sage);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 2rem 0;
}
.conversation .conv-opener { font-size: 1.25rem; font-weight: 700; color: var(--sage); margin-bottom: 1rem; }
.conv-choices { display: grid; gap: 0.75rem; }
.conv-choice {
  font: inherit; text-align: left; background: var(--surface);
  border: 2px solid var(--line); border-radius: var(--radius);
  padding: 0.9rem 1.1rem; cursor: pointer; color: var(--ink);
}
.conv-choice:hover { border-color: var(--sage); }
.conv-reflection {
  margin-top: 1rem; padding: 1rem 1.25rem; background: var(--surface);
  border-radius: var(--radius); border: 2px solid var(--sage);
}
.conv-reflection[hidden] { display: none; }
.conv-stub-note { font-size: 0.85rem; color: var(--ink-soft); margin-top: 1rem; }

/* ---- Crisis exit ramp (fixed, always present) --------------------------- */
/* Self-contained palette: a serious deep rose bar + a light alert panel, so
   it reads consistently and never depends on the page theme. */
.crisis-ramp {
  --cr-deep: #8a4a49;          /* deep rose — bar + action pills */
  --cr-panel: #f5e8e7;         /* light alert panel */
  --cr-ink: #2a1f1e;           /* text on the light panel */
  --cr-ink-soft: #6a524f;      /* secondary text on the light panel */
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 100;
  background: var(--cr-deep);
  color: #fff;
  border-top: 3px solid rgba(255,255,255,0.25);
}
.crisis-ramp__bar {
  max-width: 52rem; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.75rem 1.25rem;
}
.crisis-ramp__label { font-weight: 700; font-size: 1rem; }
.crisis-ramp__toggle {
  font: inherit; font-weight: 700;
  background: #fff; color: var(--cr-deep);
  border: none; border-radius: 999px;
  padding: 0.5rem 1.1rem; cursor: pointer;
}
.crisis-ramp__panel {
  background: var(--cr-panel);
  color: var(--cr-ink);
  border-top: 1px solid rgba(0,0,0,0.1);
}
.crisis-ramp__panel[hidden] { display: none; }
.crisis-ramp__inner { max-width: 52rem; margin: 0 auto; padding: 1.25rem; }
.crisis-ramp__inner p { color: var(--cr-ink); }
.crisis-contact {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.85rem 0; border-bottom: 1px solid rgba(138,74,73,0.25); flex-wrap: wrap;
}
.crisis-contact:last-child { border-bottom: none; }
.crisis-contact .cc-name { font-weight: 700; color: var(--cr-ink); }
.crisis-contact .cc-detail { color: var(--cr-ink-soft); font-size: 0.95rem; }
.crisis-contact .cc-action {
  background: var(--cr-deep); color: #fff; text-decoration: none;
  padding: 0.55rem 1.1rem; border-radius: 999px; font-weight: 700; white-space: nowrap;
}
.crisis-contact .cc-unverified {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--cr-deep); font-weight: 700;
}

/* ---- Site footer + legal ------------------------------------------------ */
.site-footer {
  max-width: 52rem; margin: 2.5rem auto 0; padding: 1.5rem 1.25rem;
  color: var(--ink-soft); font-size: 0.85rem; border-top: 1px solid var(--line);
}
.footer-links {
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; margin-bottom: 1.25rem;
}
.footer-links a { color: var(--ink); text-decoration: none; font-weight: 600; }
.footer-links a:hover { color: var(--accent); text-decoration: underline; }
.site-footer .disclaimer { margin: 0 0 0.75rem; padding: 0; border: 0; }
.site-footer strong { color: var(--ink); }
.legal-draft { color: var(--crisis); }
.copyright { margin-top: 1rem; }

/* Legal document pages. */
.legal { max-width: 44rem; }
.legal h2 { margin-top: 2rem; font-size: 1.3rem; }
.legal h3 { margin-top: 1.5rem; font-size: 1.1rem; }
.legal p, .legal li { color: var(--ink-soft); }
.legal li { margin-bottom: 0.4rem; }
.legal .updated { color: var(--ink-soft); font-size: 0.9rem; }
.draft-banner {
  background: var(--crisis-tint); border: 2px solid var(--crisis);
  border-radius: var(--radius); padding: 1rem 1.25rem; margin: 1.25rem 0 2rem;
  color: var(--ink);
}
.draft-banner strong { color: var(--crisis); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- Mutual aid directory ----------------------------------------------- */
.directory-intro {
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  color: var(--ink-soft);
  font-size: 0.98rem;
  margin: 1.25rem 0 1.5rem;
  max-width: none;
}

/* Category filter chips. */
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0 1.5rem; }
.filter-chip {
  font: inherit; font-size: 0.9rem; font-weight: 600;
  background: var(--surface); color: var(--ink);
  border: 2px solid var(--line); border-radius: 999px;
  padding: 0.4rem 1rem; cursor: pointer;
}
.filter-chip:hover { border-color: var(--accent); }
.filter-chip[aria-pressed="true"] {
  background: var(--accent); border-color: var(--accent); color: #fff;
}

.listing-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; margin: 1rem 0; }
@media (min-width: 40rem) { .listing-grid { grid-template-columns: 1fr 1fr; } }

.listing {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem;
}
.listing-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.35rem;
}
.listing-name { font-size: 1.2rem; font-weight: 700; margin: 0; }
.listing-cat {
  color: var(--accent); font-weight: 700; font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.listing-offer { margin: 0.5rem 0 1rem; }
.listing-meta { margin-top: auto; color: var(--ink-soft); font-size: 0.9rem; }
.listing-meta div { margin-bottom: 0.25rem; }

/* Trust badges. */
.badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.78rem; font-weight: 700; border-radius: 999px;
  padding: 0.25rem 0.7rem; white-space: nowrap;
}
.badge-vetted { background: var(--sage-tint); color: var(--sage); border: 1px solid var(--sage); }
.badge-basis { background: var(--accent-tint); color: var(--accent); border: 1px solid var(--accent); }
.badge-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.5rem 0 0.75rem; }

.listing-contacts {
  display: flex; flex-wrap: wrap; gap: 0.35rem 1.1rem;
  margin-top: 1rem; padding-top: 0.85rem; border-top: 1px solid var(--line);
}
.listing-contacts a { font-weight: 600; text-decoration: none; color: var(--accent); }
.listing-contacts a:hover { text-decoration: underline; }
.listing-actions {
  display: flex; align-items: center; justify-content: flex-start;
  gap: 1rem; margin-top: 0.6rem;
}
.listing-actions a { font-weight: 600; text-decoration: none; color: var(--accent); }
.report-btn {
  font: inherit; font-size: 0.85rem; background: none; border: none;
  color: var(--ink-soft); text-decoration: underline; cursor: pointer;
}
.report-btn:hover { color: var(--crisis); }

/* Offer-ideas panel. */
.offer-ideas {
  background: var(--sage-tint); border: 2px solid var(--sage);
  border-radius: var(--radius); padding: 1.5rem; margin: 2.5rem 0;
}
.offer-ideas h2 { color: var(--sage); }
.offer-ideas ul { margin: 1rem 0 1.25rem; padding-left: 1.1rem; }
.offer-ideas li { margin-bottom: 0.6rem; max-width: var(--measure); }

/* ---- Forms -------------------------------------------------------------- */
.form-intro { color: var(--ink-soft); font-size: 1.1rem; max-width: 38rem; margin-bottom: 1.5rem; }

.privacy-note {
  display: flex; gap: 0.75rem; align-items: flex-start;
  border-radius: var(--radius); padding: 1rem 1.25rem; margin: 1.25rem 0 2rem;
  font-size: 0.95rem;
}
.privacy-note.anon { background: var(--sage-tint); border: 2px solid var(--sage); }
.privacy-note.identified { background: var(--accent-tint); border: 2px solid var(--accent); }
.privacy-note strong { display: block; margin-bottom: 0.2rem; }

.field { margin-bottom: 1.5rem; max-width: 38rem; }
.field > label, .field > .field-label {
  display: block; font-weight: 700; margin-bottom: 0.5rem;
}
.field .hint { color: var(--ink-soft); font-size: 0.9rem; font-weight: 400; margin-top: 0.2rem; }
.field .optional { color: var(--ink-soft); font-weight: 400; font-size: 0.85rem; }

input[type="text"],
input[type="email"],
input[type="url"],
input[type="date"],
select,
textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line); border-radius: 10px;
  padding: 0.75rem 0.9rem;
}
textarea { min-height: 6rem; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: 3px solid var(--focus); outline-offset: 2px; border-color: var(--accent);
}

.check-grid { display: grid; gap: 0.6rem; }
@media (min-width: 34rem) { .check-grid { grid-template-columns: 1fr 1fr; } }
.check {
  display: flex; align-items: flex-start; gap: 0.6rem;
  background: var(--surface); border: 2px solid var(--line);
  border-radius: 10px; padding: 0.7rem 0.9rem; cursor: pointer;
}
.check:hover { border-color: var(--accent); }
.check input { width: 1.2rem; height: 1.2rem; margin-top: 0.15rem; flex: none; }

.req { color: var(--crisis); font-weight: 700; }

.form-status {
  border-radius: var(--radius); padding: 1.25rem 1.5rem; margin: 1.5rem 0;
  background: var(--sage-tint); border: 2px solid var(--sage);
}
.form-status[hidden] { display: none; }

.stub-banner {
  background: var(--crisis-tint); border: 2px solid var(--crisis);
  border-radius: var(--radius); padding: 0.85rem 1.1rem; margin-bottom: 1.5rem;
  font-size: 0.88rem; color: var(--ink);
}
.stub-banner strong { color: var(--crisis); }
