/* ============================================================
   Colorado Cares for Safety — Design Tokens & Component Styles
   ============================================================ */

:root {
  /* Type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.25rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 4.5rem);

  /* Spacing (4px base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.875rem;
  --radius-full: 9999px;
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  --content-narrow: 640px;
  --content-default: 980px;
  --content-wide: 1220px;

  --font-display: 'DM Serif Display', 'Georgia', serif;
  --font-body: 'Public Sans', 'Helvetica Neue', sans-serif;

  /* Fixed brand tokens — used for dark "band" sections (hero, impact,
     footer) that keep the same forest-green identity regardless of the
     light/dark surface toggle. */
  --brand-green: #1b3b2a;
  --brand-green-deep: #12281c;
  --brand-cream: #f7f4ea;
  --brand-gold: #d7ae66;
  --brand-gold-hover: #e8c785;
}

/* Brand palette — sampled from the Colorado Cares for Safety mark
   (forest green + antique gold on warm paper) */
:root,
[data-theme='light'] {
  --color-bg: #faf7f0;
  --color-surface: #ffffff;
  --color-surface-2: #f5f1e7;
  --color-surface-offset: #eee8da;
  --color-divider: #ddd4bf;
  --color-border: #d6cbb0;

  --color-text: #1b3b2a;
  --color-text-muted: #48594c;
  --color-text-faint: #8a9186;
  --color-text-inverse: #f7f4ea;

  --color-primary: #8a6a2f;
  --color-primary-hover: #6d5323;
  --color-primary-active: #55401b;
  --color-primary-highlight: #ebe0c6;

  --color-forest: #1b3b2a;
  --color-forest-hover: #14301f;
  --color-forest-tint: #dee6de;

  --shadow-sm: 0 1px 2px oklch(0.2 0.03 145 / 0.08);
  --shadow-md: 0 6px 20px oklch(0.2 0.03 145 / 0.1);
  --shadow-lg: 0 16px 40px oklch(0.2 0.03 145 / 0.14);
}

[data-theme='dark'] {
  --color-bg: #0f1c15;
  --color-surface: #152417;
  --color-surface-2: #182a1b;
  --color-surface-offset: #1c301f;
  --color-divider: #2a4030;
  --color-border: #33482f;

  --color-text: #eae6d8;
  --color-text-muted: #a9b6a3;
  --color-text-faint: #6c7a68;
  --color-text-inverse: #1b3b2a;

  --color-primary: #cca85b;
  --color-primary-hover: #ddbc79;
  --color-primary-active: #efd39a;
  --color-primary-highlight: #33301f;

  --color-forest: #6ea179;
  --color-forest-hover: #8bb994;
  --color-forest-tint: #1f3324;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-md: 0 6px 20px oklch(0 0 0 / 0.35);
  --shadow-lg: 0 16px 40px oklch(0 0 0 / 0.45);
}

/* ---------- Layout primitives ---------- */
.wrap {
  width: 100%;
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: clamp(var(--space-5), 5vw, var(--space-12));
}
.wrap--narrow {
  max-width: var(--content-default);
}
main {
  overflow-x: clip;
}
section {
  padding-block: clamp(var(--space-16), 9vw, var(--space-24));
}
.section-label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.section-label::before {
  content: '';
  width: 1.5em;
  height: 1px;
  background: var(--color-primary);
}
h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--color-text);
}
h2 {
  font-size: var(--text-2xl);
  margin-top: var(--space-4);
}
h3 {
  font-size: var(--text-lg);
}
p {
  color: var(--color-text-muted);
}
.lede {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 46ch;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-sm);
  min-height: 44px;
  white-space: nowrap;
  text-decoration: none;
}
.btn--primary {
  background: var(--color-forest);
  color: var(--color-text-inverse);
}
[data-theme='dark'] .btn--primary {
  color: #0f1c15;
}
.btn--primary:hover {
  background: var(--color-forest-hover);
}
.btn--ghost {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn--ghost:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.btn--gold {
  background: var(--color-primary);
  color: #1b3b2a;
}
.btn--gold:hover {
  background: var(--color-primary-hover);
  color: var(--color-text-inverse);
}

/* ---------- Header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: oklch(from var(--color-bg) l c h / 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-divider);
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-3);
  gap: var(--space-4);
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-text);
  text-decoration: none;
}
.brand__mark-wrap {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
}
.brand__mark {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  object-fit: contain;
}
.brand__name {
  font-family: var(--font-display);
  font-size: var(--text-base);
  line-height: 1.15;
  white-space: nowrap;
}
@media (max-width: 480px) {
  .brand__name {
    font-size: var(--text-sm);
  }
}
.brand__name em {
  font-style: italic;
  color: var(--color-primary);
}
.nav {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}
.nav__links {
  display: flex;
  gap: var(--space-6);
}
.nav__links a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
}
.nav__links a:hover {
  color: var(--color-primary);
}
.header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
}
.theme-toggle:hover {
  color: var(--color-primary);
  background: var(--color-surface-2);
}
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
}

/* ---------- Hero ---------- */
.hero {
  background: var(--brand-green);
  color: var(--brand-cream);
  position: relative;
  padding-block: clamp(var(--space-20), 12vw, var(--space-32));
  overflow: clip;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 60% 50% at 80% 0%,
    oklch(from var(--brand-gold) l c h / 0.16),
    transparent 70%
  );
  pointer-events: none;
}
.hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(var(--space-10), 6vw, var(--space-20));
  align-items: center;
}
.hero__eyebrow {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand-gold);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}
.hero__eyebrow::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--brand-gold);
}
.hero h1 {
  color: var(--brand-cream);
  font-size: var(--text-3xl);
  letter-spacing: -0.01em;
}
.hero h1 em {
  font-style: italic;
  color: var(--brand-gold);
}
.hero__sub {
  margin-top: var(--space-6);
  font-size: var(--text-lg);
  color: oklch(from var(--brand-cream) l c h / 0.78);
  max-width: 50ch;
}
.hero__actions {
  display: flex;
  gap: var(--space-4);
  margin-top: var(--space-10);
  flex-wrap: wrap;
}
.hero__figure {
  position: relative;
  display: flex;
  justify-content: center;
}
.hero__figure .plate {
  width: min(100%, 380px);
  aspect-ratio: 1;
  border-radius: var(--radius-full);
  background: var(--brand-cream);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 24px 48px oklch(0 0 0 / 0.35);
  padding: var(--space-8);
}
.hero__figure img {
  width: 100%;
}

/* ---------- Mission ---------- */
.mission {
  background: var(--color-bg);
}
.mission__grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(var(--space-10), 6vw, var(--space-20));
  align-items: start;
}
.mission__statement {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-text);
  line-height: 1.35;
  margin-top: var(--space-5);
}
.values {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.values__item {
  display: flex;
  gap: var(--space-4);
  padding-block: var(--space-4);
  border-top: 1px solid var(--color-divider);
}
.values__item:first-child {
  border-top: none;
  padding-top: 0;
}
.values__num {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--color-primary);
  flex-shrink: 0;
  width: 2ch;
}
.values__item h3 {
  margin-bottom: var(--space-1);
}
.values__item p {
  font-size: var(--text-sm);
}

/* ---------- Programs ---------- */
.programs {
  background: var(--color-surface-2);
  border-top: 1px solid var(--color-divider);
  border-bottom: 1px solid var(--color-divider);
}
.programs__head {
  max-width: 60ch;
  margin-bottom: var(--space-12);
}
.program-list {
  display: flex;
  flex-direction: column;
}
.program {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: var(--space-8);
  padding-block: var(--space-8);
  border-top: 1px solid var(--color-divider);
}
.program:first-child {
  border-top: none;
}
.program__num {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--color-primary-highlight);
  color: var(--color-primary);
  opacity: 0.55;
  line-height: 1;
}
.program__body h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
}
.program__body p {
  font-size: var(--text-base);
  max-width: 62ch;
}

/* ---------- Impact stats ---------- */
.impact {
  background: var(--brand-green);
  color: var(--brand-cream);
}
.impact__head {
  max-width: 58ch;
  margin-bottom: var(--space-12);
}
.impact__head .section-label {
  color: var(--brand-gold);
}
.impact__head h2 {
  color: var(--brand-cream);
}
.impact__head p {
  color: oklch(from var(--brand-cream) l c h / 0.75);
}
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-8);
}
.stat {
  border-top: 1px solid oklch(from var(--brand-cream) l c h / 0.2);
  padding-top: var(--space-5);
}
.stat__num {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--brand-gold);
  line-height: 1;
}
.stat__label {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: oklch(from var(--brand-cream) l c h / 0.72);
}

/* ---------- Get involved ---------- */
.involve__head {
  max-width: 60ch;
}
.involve__grid {
  margin-top: var(--space-12);
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: var(--space-6);
}
.involve-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-6);
}
.involve-card--lead {
  background: var(--color-surface-offset);
}
.involve-card h3 {
  font-size: var(--text-lg);
}
.involve-card p {
  font-size: var(--text-sm);
  margin-top: var(--space-2);
}
.involve-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* ---------- Contact ---------- */
.contact {
  background: var(--color-surface-2);
  border-top: 1px solid var(--color-divider);
}
.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(var(--space-10), 6vw, var(--space-20));
  align-items: center;
}
.contact__list {
  margin-top: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.contact__item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.contact__item span {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-faint);
}
.contact__item a,
.contact__item p {
  font-size: var(--text-base);
  color: var(--color-text);
  text-decoration: none;
}
.contact__item a:hover {
  color: var(--color-primary);
}
.contact__note {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
}
.contact__note p {
  font-size: var(--text-sm);
}

/* ---------- Footer ---------- */
.footer {
  background: var(--brand-green);
  color: var(--brand-cream);
}
.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-8);
  padding-block: var(--space-12);
  flex-wrap: wrap;
}
.footer__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.footer__brand .plate--sm {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--brand-cream);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.footer__brand .plate--sm img {
  width: 30px;
}
.footer__brand div {
  font-family: var(--font-display);
  font-size: var(--text-base);
}
.footer__tagline {
  font-size: var(--text-xs);
  color: oklch(from var(--brand-cream) l c h / 0.6);
  margin-top: var(--space-1);
}
.footer__links {
  display: flex;
  gap: var(--space-6);
}
.footer__links a {
  font-size: var(--text-sm);
  color: oklch(from var(--brand-cream) l c h / 0.78);
  text-decoration: none;
}
.footer__links a:hover {
  color: var(--brand-gold);
}
.footer__bottom {
  border-top: 1px solid oklch(from var(--brand-cream) l c h / 0.15);
  padding-block: var(--space-6);
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.footer__bottom p {
  font-size: var(--text-xs);
  color: oklch(from var(--brand-cream) l c h / 0.55);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav__links {
    display: none;
  }
  .nav-toggle {
    display: inline-flex;
  }
  .header__actions .btn--primary {
    display: none;
  }
  .hero__grid,
  .mission__grid,
  .contact__grid {
    grid-template-columns: 1fr;
  }
  .hero__figure {
    order: -1;
  }
  .hero__figure img {
    width: min(60%, 260px);
  }
  .involve__grid {
    grid-template-columns: 1fr;
  }
  .stat-row {
    grid-template-columns: repeat(2, 1fr);
    row-gap: var(--space-8);
  }
  .program {
    grid-template-columns: 56px 1fr;
  }
  .footer__inner {
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .hero__actions .btn {
    width: 100%;
    justify-content: center;
  }
  .hero__actions {
    flex-direction: column;
  }
}

/* Mobile nav drawer */
.mobile-nav {
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  z-index: 60;
  display: flex;
  flex-direction: column;
  padding: var(--space-6);
  transform: translateX(100%);
  transition: transform var(--transition-interactive);
}
.mobile-nav[data-open='true'] {
  transform: translateX(0);
}
.mobile-nav__top {
  display: flex;
  justify-content: flex-end;
}
.mobile-nav__links {
  margin-top: var(--space-12);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}
.mobile-nav__links a {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-text);
  text-decoration: none;
}
