/* ============================================================================
   Sobbr Life — public site ("The Everlight")
   Each page opens in its time of day (the dawn clock); you read in warm morning
   light on paper. Consumes tokens.css. Mobile-first; enhances up. Every motion
   has a reduced-motion / no-JS fallback (content is fully present without JS).
   ============================================================================ */

*, *::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(--dawn-cream);
  color: var(--pub-ink-on-dawn);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--dawn-magenta); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--rose-pressed); }

/* focus — always visible, high-contrast, never removed */
:focus-visible { outline: 3px solid var(--dawn-rose); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 720px; }

/* skip link */
.skip { position: absolute; left: -9999px; top: 0; background: var(--rose); color: #fff; padding: 12px 16px; z-index: 100; border-radius: 0 0 10px 0; }
.skip:focus { left: 0; }

/* -- type ------------------------------------------------------------------- */
h1, h2, h3, .display { font-family: var(--font-display); font-weight: 340; line-height: var(--lh-tight); letter-spacing: -0.015em; margin: 0 0 0.4em; text-wrap: balance; font-variation-settings: "opsz" 110, "SOFT" 0; }
.display { font-weight: 320; letter-spacing: -0.02em; font-variation-settings: "opsz" 144, "SOFT" 0; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: 1.35rem; }
.italic { font-style: italic; font-weight: 300; font-variation-settings: "opsz" 72, "SOFT" 45; }
.eyebrow, .kicker { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: var(--tracking-label); font-size: var(--fs-label); color: var(--pub-ink-on-dawn-soft); }
.lede { font-size: var(--fs-lead); color: var(--pub-ink-on-dawn-soft); max-width: 60ch; }
p { max-width: 64ch; }

/* -- header / nav ----------------------------------------------------------- */
.site-header { position: absolute; top: 0; left: 0; right: 0; z-index: 30; }
.site-header .wrap { display: flex; align-items: center; gap: 18px; padding-top: 18px; padding-bottom: 18px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; color: inherit; }
.brand svg { width: 34px; height: 34px; }
.brand .wm { font-family: var(--font-display); font-size: 1.35rem; font-weight: 460; letter-spacing: -0.01em; }
.nav { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.nav a { font-family: var(--font-body); font-size: 0.98rem; text-decoration: none; padding: 9px 12px; border-radius: 9px; font-weight: 600; }
.nav a.give { background: var(--rose); color: #fff; }
.nav a.give:hover { background: var(--rose-pressed); }
/* on dark hero, header text is light; JS/no-JS both fine (hero is dark by default) */
.hero-dark .site-header .brand, .hero-dark .site-header .nav a:not(.give) { color: var(--pub-ink-on-night); }
.hero-dark .site-header .nav a:not(.give):hover { color: #fff; }
.hero-dark .site-header .nav-toggle { color: var(--pub-ink-on-night); } /* was invisible: dark bars on a dark hero */
.nav-toggle { display: none; }

@media (max-width: 760px) {
  .nav { position: fixed; inset: 0 0 0 auto; width: min(78vw, 320px); background: var(--dawn-plum);
         flex-direction: column; align-items: stretch; gap: 2px; padding: 84px 16px 24px; transform: translateX(100%);
         transition: transform var(--dur-move) var(--ease-out-soft); box-shadow: -20px 0 60px rgba(0,0,0,.4); }
  .nav a { color: var(--pub-ink-on-night) !important; font-size: 1.1rem; padding: 14px 14px; }
  .nav a.give { background: var(--rose); text-align: center; margin-top: 8px; }
  body.nav-open .nav { transform: translateX(0); }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; margin-left: auto;
                width: var(--tap-min); height: var(--tap-min); border: 0; background: transparent; cursor: pointer; z-index: 40; }
  .nav-toggle span, .nav-toggle span::before, .nav-toggle span::after { content:""; display:block; width: 24px; height: 2px; background: currentColor; position: relative; transition: transform var(--dur-state); }
  .nav-toggle span::before { position: absolute; top: -7px; } .nav-toggle span::after { position: absolute; top: 7px; }
  body.nav-open .nav-toggle span { background: transparent; }
  body.nav-open .nav-toggle span::before { transform: translateY(7px) rotate(45deg); }
  body.nav-open .nav-toggle span::after { transform: translateY(-7px) rotate(-45deg); }
}

/* -- the dawn sky (hero background) ----------------------------------------- */
.hero { position: relative; overflow: hidden; padding: clamp(120px, 22vh, 200px) 0 clamp(56px, 9vh, 92px); isolation: isolate; }
.hero > .wrap { position: relative; z-index: 2; }
.hero canvas.sky-canvas { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.hero .scrim { position: absolute; inset: 0; z-index: 1; background: var(--pub-scrim); }
/* dawn-clock skies, per page's place in the sunrise */
.sky-night    { background: linear-gradient(180deg, #07070f 0%, #141a44 40%, #241041 78%, #43205a 100%); }
.sky-predawn  { background: linear-gradient(180deg, #141a44 0%, #241041 34%, #43205a 66%, #7c2f6b 100%); }
.sky-breaking { background: linear-gradient(180deg, #241041 0%, #7c2f6b 42%, #c2497f 72%, #ff8f63 100%); }
/* a genuinely LIGHT morning sky (no dark top) so dark ink reads across the whole
   hero, header included — paired with hero-light on the "full morning" pages. */
.sky-morning  { background: linear-gradient(180deg, #e79d86 0%, #f2b489 38%, #ffcf9a 72%, #ffe6c4 100%); }
/* scoped to the hero SECTION so the body.hero-dark class (used only to light the
   header over a dark hero) never washes out the dark-on-cream sections below */
.hero.hero-dark { color: var(--pub-ink-on-night); }
.hero.hero-dark .eyebrow { color: var(--dawn-peach); opacity: .9; }
.hero.hero-dark h1, .hero.hero-dark .display { color: #fdf6ec; text-shadow: 0 1px 24px rgba(10,6,20,.5); }
.hero.hero-dark .lede { color: #f0e4d6; }
.hero.hero-light { color: var(--pub-ink-on-dawn); }
.hero.hero-light .eyebrow { color: var(--pub-ink-on-dawn); } /* dark ink for AA on the light sky */
.hero.hero-light .scrim { display: none; } /* the dark scrim would only hurt dark ink */

/* -- buttons ---------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap-min);
       padding: 13px 22px; border-radius: var(--radius-btn); font-family: var(--font-body); font-weight: 700; font-size: 1rem;
       text-decoration: none; border: 1.5px solid transparent; cursor: pointer; transition: transform var(--dur-press) var(--ease-standard), background var(--dur-state), box-shadow var(--dur-state); }
.btn:active { transform: scale(.975); }
.btn-primary { background: var(--rose); color: #fff; }
.btn-primary:hover { background: var(--rose-pressed); color: #fff; box-shadow: 0 6px 20px rgba(166,55,106,.28); }
.btn-light { background: var(--dawn-cream); color: var(--pub-ink-on-dawn); }
.btn-light:hover { background: #fff; color: var(--pub-ink-on-dawn); }
.btn-ghost { background: transparent; border-color: currentColor; color: inherit; }
.btn-lg { font-size: 1.08rem; padding: 16px 26px; }

/* -- split hero (Home) ------------------------------------------------------ */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; border-radius: var(--radius-card); overflow: hidden; box-shadow: var(--shadow-card); margin-top: 28px; }
.door { padding: clamp(24px, 4vw, 40px); min-height: 260px; display: flex; flex-direction: column; justify-content: flex-end; gap: 14px; text-decoration: none; transition: filter var(--dur-state); }
.door:hover { filter: brightness(1.04); }
.door-need { background: linear-gradient(155deg, #241041, #43205a 68%, #7c2f6b); color: var(--pub-ink-on-night); }
.door-help { background: linear-gradient(155deg, #c9789e, #e79d86 55%, #ffd9a6); color: var(--pub-ink-on-dawn); }
.door .kicker { color: inherit; opacity: .82; }
.door h2 { font-size: clamp(1.5rem, 3.6vw, 2.1rem); color: inherit; margin-bottom: 4px; }
.door .crisis-line { font-size: 0.92rem; opacity: .92; }
.door .crisis-line a { color: inherit; font-weight: 700; }
@media (max-width: 620px) { .split { grid-template-columns: 1fr; } .door { min-height: 200px; } }

/* -- sections & cards (warm reading light on paper) ------------------------- */
.section { padding: clamp(48px, 8vh, 90px) 0; }
.section-tint { background: linear-gradient(180deg, #fff8ee, var(--dawn-cream)); }
.card { background: var(--db-surface); border: 1px solid var(--db-hairline); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: clamp(20px, 3vw, 30px); }
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 820px) { .grid-3 { grid-template-columns: 1fr; } .grid-2 { grid-template-columns: 1fr; } }

/* house cards */
.house { position: relative; overflow: hidden; border-radius: var(--radius-card); color: var(--pub-ink-on-night); min-height: 230px; display: flex; flex-direction: column; justify-content: flex-end; padding: 24px; box-shadow: var(--shadow-card); }
.house .kicker { color: var(--dawn-peach); }
.house h3 { color: #fff6ea; font-size: 1.5rem; }
.house p { color: #efe0d2; font-size: 0.98rem; }
/* scrim so the bottom-anchored light text keeps AA contrast over the lightest
   part of each gradient (phoenix's coral, everlight's rose) */
.house::after { content: ""; position: absolute; inset: 0; z-index: 0; background: linear-gradient(180deg, transparent 42%, rgba(12,6,22,.5) 100%); }
.house > * { position: relative; z-index: 1; }
.house.starfish   { background: linear-gradient(160deg, #241041, #7c2f6b); }
.house.everlight  { background: linear-gradient(160deg, #43205a, #c2497f); }
.house.phoenix    { background: linear-gradient(160deg, #7c2f6b, #ff8f63); }
.badge-new { position: absolute; top: 16px; right: 16px; background: var(--dawn-gold); color: #5a2d12; font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: .12em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px; font-weight: 700; }

/* stat row */
.stats { display: flex; flex-wrap: wrap; gap: 14px; }
.stat { flex: 1 1 150px; }
.stat .n { font-family: var(--font-display); font-weight: 460; font-size: clamp(2rem, 5vw, 2.8rem); font-variation-settings: "opsz" 120; }
.stat .l { color: var(--pub-ink-on-dawn-soft); font-size: 0.95rem; }

/* partner grid */
.partners { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.partner { background: #fff; border: 1px solid var(--db-hairline); border-radius: 14px; padding: 20px; text-align: center; color: var(--pub-ink-on-dawn-soft); font-weight: 600; font-size: 0.95rem; min-height: 84px; display: flex; align-items: center; justify-content: center; }

/* -- butterfly divider ------------------------------------------------------ */
.bfly-divider { display: flex; align-items: center; gap: 18px; color: #e4d6c6; margin: 8px 0; }
.bfly-divider::before, .bfly-divider::after { content: ""; height: 1px; flex: 1; background: currentColor; }
.bfly-divider svg { width: 26px; height: 26px; color: var(--rose); opacity: .8; }

/* -- forms (apply / contact / volunteer) ------------------------------------ */
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 1rem; }
.field .hint { color: var(--pub-ink-on-dawn-soft); font-size: 0.9rem; margin: 2px 0 8px; }
.field input, .field select, .field textarea { width: 100%; min-height: var(--tap-min); padding: 12px 14px; font: inherit;
  border: 1.5px solid #d9cdbe; border-radius: var(--radius-input); background: #fff; color: var(--pub-ink-on-dawn); }
.field textarea { min-height: 120px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--rose); outline: none; box-shadow: 0 0 0 3px rgba(166,55,106,.4); }
fieldset { border: 0; padding: 0; margin: 0 0 8px; }
.form-status { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--rose-wash); color: var(--pub-ink-on-dawn); font-weight: 600; }

/* -- reveals (native, 0-KB; JS-gated so no-JS shows everything) -------------- */
.js .rv { opacity: 0; transform: translateY(16px); transition: opacity 640ms var(--ease-quart), transform 640ms var(--ease-expo); }
.js .rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .rv { opacity: 1 !important; transform: none !important; transition: none; } }

/* -- footer + crisis ------------------------------------------------------- */
.crisis-bar { background: var(--dawn-plum); color: var(--pub-ink-on-night); font-size: 0.92rem; }
.crisis-bar .wrap { display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 12px 20px; align-items: center; justify-content: center; text-align: center; }
.crisis-bar strong { color: #fff; } .crisis-bar a { color: var(--dawn-peach); font-weight: 700; }
.site-footer { background: linear-gradient(180deg, #241041, #141a44); color: var(--pub-ink-on-night); padding: 56px 0 40px; }
.site-footer a { color: var(--dawn-peach); }
.site-footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 30px; }
@media (max-width: 720px) { .site-footer .cols { grid-template-columns: 1fr; gap: 22px; } }
.site-footer h4 { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .2em; font-size: .68rem; color: var(--dawn-gold); margin: 0 0 12px; }
.site-footer nav a { display: block; padding: 5px 0; text-decoration: none; }
.footer-counter { font-family: var(--font-display); }
.footer-counter .n { font-size: 1.6rem; font-weight: 500; color: var(--dawn-gold); font-variant-numeric: tabular-nums; }
.footer-mark { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.footer-mark svg { width: 30px; height: 30px; color: var(--dawn-rose); }
.footer-mark .wm { font-family: var(--font-display); font-size: 1.3rem; }
.legal { color: #b9a9bd; font-size: 0.82rem; margin-top: 26px; }

/* -- the reduce-motion toggle (satisfies WCAG 2.2.2; serves users who can't set an OS pref) */
.motion-toggle { position: fixed; left: 12px; bottom: 12px; z-index: 50; background: rgba(36,16,65,.9); color: #f5eee4;
  border: 1px solid rgba(255,255,255,.15); border-radius: 999px; padding: 8px 14px; font: 600 0.8rem var(--font-body); cursor: pointer; }
.motion-toggle:hover { background: var(--dawn-plum); }

/* -- quick-exit (safety) ---------------------------------------------------- */
.quick-exit { position: fixed; right: 12px; bottom: 12px; z-index: 60; background: #b23a2e; color: #fff; border: 0; border-radius: 999px; padding: 11px 16px; font: 700 0.82rem var(--font-body); cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.3); min-height: 44px; }
.quick-exit:hover { background: #9a3125; }

.spacer { height: 1px; }
.center { text-align: center; }
.mt-1{margin-top:8px}.mt-2{margin-top:16px}.mt-3{margin-top:24px}.mt-4{margin-top:36px}
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
