/* style.css — Dyslexia Family Advocacy design system */

:root,
[data-theme='light'] {
  /* Surfaces — warm parchment cream */
  --color-bg: #faf6ee;
  --color-surface: #ffffff;
  --color-surface-2: #fdfbf6;
  --color-surface-offset: #f1eadc;
  --color-surface-offset-2: #e9dfcc;
  --color-surface-dynamic: #e3d8c2;
  --color-divider: #e3dac9;
  --color-border: #d8ccb4;

  /* Text — deep indigo-charcoal */
  --color-text: #211d2c;
  --color-text-muted: #6b6478;
  --color-text-faint: #a79fb0;
  --color-text-inverse: #faf6ee;

  /* Primary accent — deep indigo (trust, justice) */
  --color-primary: #33437a;
  --color-primary-hover: #263364;
  --color-primary-active: #1c2650;
  --color-primary-highlight: #dbe0ef;

  /* Warm accent — amber (hope, urgency for CTAs) */
  --color-accent: #c97a2b;
  --color-accent-hover: #a8611e;
  --color-accent-active: #824a16;
  --color-accent-highlight: #f3ddbb;

  /* Semantic (kept for form/alert states) */
  --color-success: #3f7a4f;
  --color-success-highlight: #d7e8dc;
  --color-error: #9c3b3b;
  --color-error-highlight: #ecd7d7;

  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  --shadow-sm: 0 1px 2px oklch(0.2 0.03 280 / 0.08);
  --shadow-md: 0 6px 20px oklch(0.2 0.03 280 / 0.10);
  --shadow-lg: 0 18px 44px oklch(0.2 0.03 280 / 0.16);

  --content-narrow: 640px;
  --content-default: 800px;
  --content-wide: 1180px;
  --content-full: 100%;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Atkinson Hyperlegible Next', 'Atkinson Hyperlegible', 'Work Sans', sans-serif;
}

[data-theme='dark'] {
  --color-bg: #14121f;
  --color-surface: #1b1830;
  --color-surface-2: #201c38;
  --color-surface-offset: #23203d;
  --color-surface-offset-2: #2a2648;
  --color-surface-dynamic: #302b52;
  --color-divider: #2e2a4a;
  --color-border: #3a3560;

  --color-text: #ece7f5;
  --color-text-muted: #a79fc0;
  --color-text-faint: #6e6690;
  --color-text-inverse: #14121f;

  --color-primary: #8b9be0;
  --color-primary-hover: #a4b2e8;
  --color-primary-active: #b9c4ee;
  --color-primary-highlight: #2a3560;

  --color-accent: #e5a256;
  --color-accent-hover: #eeb473;
  --color-accent-active: #f4c791;
  --color-accent-highlight: #4a3620;

  --color-success: #7dbb8b;
  --color-success-highlight: #23392a;
  --color-error: #d68686;
  --color-error-highlight: #3c2626;

  --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 18px 44px oklch(0 0 0 / 0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #14121f;
    --color-surface: #1b1830;
    --color-surface-2: #201c38;
    --color-surface-offset: #23203d;
    --color-surface-offset-2: #2a2648;
    --color-surface-dynamic: #302b52;
    --color-divider: #2e2a4a;
    --color-border: #3a3560;
    --color-text: #ece7f5;
    --color-text-muted: #a79fc0;
    --color-text-faint: #6e6690;
    --color-text-inverse: #14121f;
    --color-primary: #8b9be0;
    --color-primary-hover: #a4b2e8;
    --color-primary-active: #b9c4ee;
    --color-primary-highlight: #2a3560;
    --color-accent: #e5a256;
    --color-accent-hover: #eeb473;
    --color-accent-active: #f4c791;
    --color-accent-highlight: #4a3620;
    --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 18px 44px oklch(0 0 0 / 0.5);
  }
}

/* Type scale */
:root {
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.9rem, 0.85rem + 0.3vw, 1.0625rem);
  --text-base: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  --text-lg: clamp(1.2rem, 1.05rem + 0.75vw, 1.55rem);
  --text-xl: clamp(1.55rem, 1.25rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.3rem + 2.5vw, 3.4rem);
  --text-3xl: clamp(2.4rem, 1.1rem + 4vw, 4.6rem);
  --text-hero: clamp(2.8rem, 0.8rem + 6vw, 6.4rem);
}

/* Spacing */
:root {
  --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;
}

body {
  overflow-x: hidden;
}

/* ---------- Layout helpers ---------- */
.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);
}
.section {
  padding-block: clamp(var(--space-16), 8vw, var(--space-32));
}
.section--tight {
  padding-block: clamp(var(--space-10), 5vw, var(--space-16));
}
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-4);
}
.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-xl);
  color: var(--color-text);
  margin-bottom: var(--space-4);
}
.section-lede {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 62ch;
}

/* ---------- Typography ---------- */
h1,
h2,
h3 {
  font-family: var(--font-display);
  color: var(--color-text);
}
strong {
  color: var(--color-text);
  font-weight: 700;
}
.eyebrow-inline {
  color: var(--color-primary);
  font-weight: 700;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  z-index: 100;
}
.skip-link:focus {
  left: var(--space-4);
  top: var(--space-4);
}

/* ---------- Announcement banner ---------- */
.banner {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}
.banner__inner {
  max-width: var(--content-wide);
  margin-inline: auto;
  padding: var(--space-2) clamp(var(--space-5), 5vw, var(--space-12));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  font-size: var(--text-xs);
  text-align: center;
}
.banner__inner a {
  color: var(--color-text-inverse);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: color-mix(in oklab, var(--color-text-inverse) 50%, transparent);
  text-underline-offset: 2px;
  white-space: nowrap;
}
.banner__inner a:hover {
  text-decoration-color: var(--color-text-inverse);
}

/* ---------- Header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--color-bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-divider);
}
.header__inner {
  max-width: var(--content-wide);
  margin-inline: auto;
  padding: var(--space-4) clamp(var(--space-5), 5vw, var(--space-12));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-text);
  text-decoration: none;
}
.brand__mark {
  width: 34px;
  height: 34px;
  color: var(--color-primary);
  flex-shrink: 0;
}
.brand__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-base);
  line-height: 1.1;
}
.nav {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}
.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  list-style: none;
}
.nav__links a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-1) 0;
  border-bottom: 2px solid transparent;
}
.nav__links a:hover,
.nav__links a[aria-current='page'] {
  color: var(--color-text);
  border-bottom-color: var(--color-accent);
}
.nav__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}
.theme-toggle:hover {
  color: var(--color-text);
  border-color: var(--color-primary);
}
.nav-toggle {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  align-items: center;
  justify-content: center;
  color: var(--color-text);
}

.mobile-menu {
  display: none;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-4) clamp(var(--space-5), 5vw, var(--space-12)) var(--space-6);
  border-bottom: 1px solid var(--color-divider);
  background: var(--color-bg);
}
.mobile-menu__cta {
  margin-top: var(--space-2);
  justify-content: center;
}
.mobile-menu a {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 600;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-divider);
}
.mobile-menu.is-open {
  display: flex;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-weight: 700;
  font-size: var(--text-sm);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
}
.btn--primary {
  background: var(--color-accent);
  color: #2a1a06;
}
.btn--primary:hover {
  background: var(--color-accent-hover);
  box-shadow: var(--shadow-md);
}
.btn--outline {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn--outline:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.btn--ghost {
  background: transparent;
  color: var(--color-primary);
  padding-inline: 0;
  border-radius: 0;
}
.btn--ghost:hover {
  color: var(--color-accent);
}
.btn--lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
}
.btn--block {
  width: 100%;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(var(--space-16), 10vw, var(--space-32));
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(var(--space-10), 6vw, var(--space-20));
  align-items: center;
}
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-primary-highlight);
  color: var(--color-primary);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-6);
}
[data-theme='dark'] .hero__eyebrow {
  color: var(--color-text-inverse);
}
.hero h1 {
  font-size: var(--text-2xl);
  font-weight: 600;
  line-height: 1.08;
  margin-bottom: var(--space-6);
}
.hero h1 em {
  font-style: normal;
  color: var(--color-accent);
}
.hero__lede {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  margin-bottom: var(--space-8);
  max-width: 54ch;
}
.hero__actions {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.hero__figure {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.hero__figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 16/11;
}
.hero__figure figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: var(--space-4) var(--space-5);
  font-size: var(--text-xs);
  color: var(--color-text-inverse);
  background: linear-gradient(to top, oklch(0.15 0.03 280 / 0.65), transparent);
  max-width: none;
}

/* ---------- Quote ---------- */
.pull-quote {
  border-left: 3px solid var(--color-accent);
  padding-left: var(--space-6);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-style: italic;
  color: var(--color-text);
  margin-block: var(--space-8);
  max-width: 62ch;
}

/* ---------- Story / editorial two-column ---------- */
.story {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(var(--space-10), 6vw, var(--space-16));
  align-items: start;
}
.story--reverse .story__figure {
  order: 2;
}
.story__figure {
  position: sticky;
  top: calc(var(--space-16) + 72px);
}
.story__figure img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
@media (max-width: 900px) {
  .story__figure {
    position: static;
  }
}
.story__body p + p {
  margin-top: var(--space-5);
}
.story__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* ---------- Stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
}
.stat {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  text-align: center;
}
.stat__value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: var(--space-2);
}
.stat__label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* ---------- Cards / grid ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
}
.card__num {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--color-accent);
  margin-bottom: var(--space-3);
}
.card h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-3);
}
.card p {
  color: var(--color-text-muted);
}

/* Issues list (the-case.html) */
.issue {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-6);
  padding-block: var(--space-8);
  border-top: 1px solid var(--color-divider);
}
.issue:first-of-type {
  border-top: none;
}
.issue__tag {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text-faint);
  padding-top: var(--space-1);
}
.issue h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-3);
}
.issue p {
  color: var(--color-text-muted);
}

/* Callout */
.callout {
  background: var(--color-surface-offset);
  border-radius: var(--radius-lg);
  padding: clamp(var(--space-6), 4vw, var(--space-10));
  border-left: 4px solid var(--color-primary);
}
.callout h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-3);
}
.callout p {
  color: var(--color-text-muted);
}

/* Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.timeline__item {
  display: grid;
  grid-template-columns: 160px auto 1fr;
  gap: var(--space-5);
  align-items: start;
  padding-block: var(--space-6);
}
.timeline__item + .timeline__item {
  border-top: 1px solid var(--color-divider);
}
.timeline__date {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-primary);
}
.timeline__marker {
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  margin-top: var(--space-1);
}
.timeline__item--future .timeline__marker {
  background: var(--color-border);
}
.timeline__body h3 {
  font-size: var(--text-base);
  font-weight: 700;
  margin-bottom: var(--space-1);
}
.timeline__body p {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* Fund breakdown (donate.html) */
.fund-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}
.fund-item {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
}
.fund-item__icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background: var(--color-primary-highlight);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
[data-theme='dark'] .fund-item__icon {
  color: var(--color-text-inverse);
}
.fund-item h3 {
  font-size: var(--text-base);
  font-weight: 700;
  margin-bottom: var(--space-1);
}
.fund-item p {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* FAQ */
.faq-item {
  border-top: 1px solid var(--color-divider);
  padding-block: var(--space-6);
}
.faq-item:first-of-type {
  border-top: none;
}
.faq-item h3 {
  font-size: var(--text-base);
  font-weight: 700;
  margin-bottom: var(--space-2);
}
.faq-item p {
  color: var(--color-text-muted);
}

/* CTA band */
.cta-band {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-radius: var(--radius-xl);
  padding: clamp(var(--space-10), 6vw, var(--space-16));
  text-align: center;
}
.cta-band h2 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-4);
  color: var(--color-text-inverse);
}
.cta-band p {
  color: color-mix(in oklab, var(--color-text-inverse) 82%, transparent);
  max-width: 60ch;
  margin-inline: auto;
  margin-bottom: var(--space-8);
}
.cta-band__actions {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  flex-wrap: wrap;
}
.cta-band .btn--outline {
  color: var(--color-text-inverse);
  border-color: color-mix(in oklab, var(--color-text-inverse) 40%, transparent);
}
.cta-band .btn--outline:hover {
  border-color: var(--color-text-inverse);
  color: var(--color-text-inverse);
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--color-divider);
  background: var(--color-surface-offset);
}
.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1.3fr;
  gap: var(--space-10);
  padding-block: clamp(var(--space-12), 6vw, var(--space-20));
}
.footer__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.footer__brand .brand__mark {
  width: 28px;
  height: 28px;
}
.footer p {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}
.footer h4 {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-faint);
  margin-bottom: var(--space-4);
}
.footer ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.footer a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: var(--text-sm);
}
.footer a:hover {
  color: var(--color-primary);
}
.footer__legal {
  border-top: 1px solid var(--color-divider);
  padding-block: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.footer__legal p {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  max-width: 90ch;
}
.footer__copyright {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  padding-bottom: var(--space-8);
}

/* ---------- Scroll reveal ---------- */
[data-reveal] {
  opacity: 0;
  clip-path: inset(12% 0 0 0);
  transition:
    opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    clip-path 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-reveal].is-visible {
  opacity: 1;
  clip-path: inset(0 0 0 0);
}

/* ---------- Page hero (interior pages) ---------- */
.page-hero {
  padding-block: clamp(var(--space-12), 6vw, var(--space-20));
  border-bottom: 1px solid var(--color-divider);
}
.page-hero .section-eyebrow {
  color: var(--color-primary);
}
.page-hero h1 {
  font-size: var(--text-2xl);
  font-weight: 600;
  margin-bottom: var(--space-4);
}
.page-hero p {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 64ch;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero__grid,
  .story,
  .story--reverse .story__figure,
  .footer__grid {
    grid-template-columns: 1fr;
  }
  .story__figure {
    order: -1 !important;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .cards,
  .fund-grid {
    grid-template-columns: 1fr;
  }
  .nav__links {
    display: none;
  }
  .nav-toggle {
    display: inline-flex;
  }
  .nav__actions .btn--primary {
    display: none;
  }
  .timeline__item {
    grid-template-columns: auto 1fr;
  }
  .timeline__date {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .hero h1 {
    font-size: var(--text-2xl);
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .banner__inner {
    font-size: 0.7rem;
  }
}
