/* =============================================
   SAVE NORTH TEXAS TREES — Design Tokens & Styles
   Art Direction: Organic / Nature / Conservation
   Palette: Forest greens, warm earth, natural cream
   ============================================= */

/* --- Type Scale --- */
:root {
  --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.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 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 --- */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

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

  /* --- Content Widths --- */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
  --content-full: 100%;

  /* --- Font Families --- */
  --font-display: 'Zodiak', 'Georgia', serif;
  --font-body: 'Work Sans', 'Helvetica Neue', sans-serif;
}

/* --- LIGHT MODE (Nature palette) --- */
:root,
[data-theme='light'] {
  /* Surfaces — warm cream/parchment */
  --color-bg: #f5f2eb;
  --color-surface: #faf8f3;
  --color-surface-2: #fcfbf8;
  --color-surface-offset: #ece8df;
  --color-surface-offset-2: #e4e0d6;
  --color-surface-dynamic: #ddd9cf;
  --color-divider: #d4cfC3;
  --color-border: #c8c3b6;

  /* Text — dark earth */
  --color-text: #2c2a22;
  --color-text-muted: #6b6960;
  --color-text-faint: #a8a59c;
  --color-text-inverse: #faf8f3;

  /* Primary — forest green */
  --color-primary: #2d6a4f;
  --color-primary-hover: #1b4332;
  --color-primary-active: #143328;
  --color-primary-highlight: #d4e8dc;

  /* Accent — warm amber */
  --color-accent: #b07d3a;
  --color-accent-hover: #8f6529;
  --color-accent-highlight: #f0e4cd;

  /* Error */
  --color-error: #a13544;

  /* Shadows */
  --shadow-sm: 0 1px 2px oklch(0.25 0.02 80 / 0.06);
  --shadow-md: 0 4px 12px oklch(0.25 0.02 80 / 0.08);
  --shadow-lg: 0 12px 32px oklch(0.25 0.02 80 / 0.12);
}

/* --- DARK MODE --- */
[data-theme='dark'] {
  --color-bg: #1a1a16;
  --color-surface: #21201b;
  --color-surface-2: #272620;
  --color-surface-offset: #1e1d18;
  --color-surface-offset-2: #2a2923;
  --color-surface-dynamic: #333228;
  --color-divider: #2e2d27;
  --color-border: #403f37;
  --color-text: #d5d2c8;
  --color-text-muted: #8a877e;
  --color-text-faint: #5e5b54;
  --color-text-inverse: #1a1a16;

  --color-primary: #52b788;
  --color-primary-hover: #40916c;
  --color-primary-active: #2d6a4f;
  --color-primary-highlight: #2a3a30;

  --color-accent: #d4a44a;
  --color-accent-hover: #c28e2f;
  --color-accent-highlight: #3d3424;

  --color-error: #dd6974;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.2);
  --shadow-md: 0 4px 12px oklch(0 0 0 / 0.3);
  --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.4);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #1a1a16;
    --color-surface: #21201b;
    --color-surface-2: #272620;
    --color-surface-offset: #1e1d18;
    --color-surface-offset-2: #2a2923;
    --color-surface-dynamic: #333228;
    --color-divider: #2e2d27;
    --color-border: #403f37;
    --color-text: #d5d2c8;
    --color-text-muted: #8a877e;
    --color-text-faint: #5e5b54;
    --color-text-inverse: #1a1a16;
    --color-primary: #52b788;
    --color-primary-hover: #40916c;
    --color-primary-active: #2d6a4f;
    --color-primary-highlight: #2a3a30;
    --color-accent: #d4a44a;
    --color-accent-hover: #c28e2f;
    --color-accent-highlight: #3d3424;
    --color-error: #dd6974;
    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.2);
    --shadow-md: 0 4px 12px oklch(0 0 0 / 0.3);
    --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.4);
  }
}

/* =============================================
   COMPONENT STYLES
   ============================================= */

/* --- Skip Link --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  text-decoration: none;
}
.skip-link:focus {
  top: var(--space-2);
}

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: oklch(from var(--color-bg) l c h / 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid oklch(from var(--color-text) l c h / 0.08);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.site-header--scrolled {
  box-shadow: var(--shadow-sm);
}
.header-inner {
  max-width: var(--content-wide);
  margin-inline: auto;
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--color-text);
}
.logo-mark {
  width: 34px;
  height: auto;
  flex-shrink: 0;
}
.logo-wordmark {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.logo-wordmark-name {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.02em;
}
.logo-wordmark-tagline {
  font-family: var(--font-body);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  line-height: 1.2;
}

/* Nav */
.main-nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}
.main-nav a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.main-nav a:hover {
  color: var(--color-text);
}

/* Theme Toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
}
.theme-toggle:hover {
  background: var(--color-surface-offset);
  color: var(--color-text);
}

/* Mobile nav */
.mobile-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text);
}
@media (max-width: 767px) {
  .main-nav {
    display: none;
  }
  .main-nav.is-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-surface);
    padding: var(--space-4);
    border-bottom: 1px solid var(--color-divider);
    box-shadow: var(--shadow-md);
    gap: var(--space-1);
  }
  .main-nav.is-open a {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--text-base);
  }
  .main-nav.is-open a:hover {
    background: var(--color-surface-offset);
  }
  .mobile-toggle {
    display: flex;
  }
}

/* --- Container --- */
.container {
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: var(--space-4);
}
.container--narrow {
  max-width: var(--content-default);
}

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    oklch(0.15 0.02 80 / 0.92) 0%,
    oklch(0.15 0.02 80 / 0.6) 40%,
    oklch(0.15 0.02 80 / 0.1) 100%
  );
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: var(--content-wide);
  margin-inline: auto;
  padding: var(--space-16) var(--space-4) var(--space-12);
  width: 100%;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 500;
  color: #f5f2eb;
  margin-bottom: var(--space-4);
  max-width: 16ch;
  letter-spacing: -0.02em;
}
.hero p {
  font-size: var(--text-lg);
  color: oklch(0.9 0.01 80 / 0.85);
  max-width: 52ch;
  margin-bottom: var(--space-8);
  line-height: 1.5;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.01em;
  min-height: 44px;
}
.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}
.btn-primary:hover {
  background: var(--color-primary-hover);
}
.btn-secondary {
  background: oklch(from var(--color-text-inverse) l c h / 0.15);
  color: #f5f2eb;
  border: 1px solid oklch(1 0 0 / 0.2);
}
.btn-secondary:hover {
  background: oklch(from var(--color-text-inverse) l c h / 0.25);
}
.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}
.btn-outline:hover {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

/* --- Section --- */
.section {
  padding-block: clamp(var(--space-12), 8vw, var(--space-24));
}
.section-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-3);
}
.section-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--color-text);
  margin-bottom: var(--space-4);
}
.section-subtitle {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 60ch;
  line-height: 1.6;
}

/* --- Stats Bar --- */
.stats-bar {
  background: var(--color-surface);
  border-top: 1px solid var(--color-divider);
  border-bottom: 1px solid var(--color-divider);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-1);
  padding-block: var(--space-8);
}
.stat {
  text-align: center;
  padding-inline: var(--space-4);
}
.stat:not(:last-child) {
  border-right: 1px solid var(--color-divider);
}
.stat-number {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 500;
  color: var(--color-primary);
  line-height: 1.2;
  margin-bottom: var(--space-1);
}
.stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
}
@media (max-width: 767px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
  }
  .stat:not(:last-child) {
    border-right: none;
  }
  .stat:nth-child(odd) {
    border-right: 1px solid var(--color-divider);
  }
}

/* --- Opportunity Section (asymmetric 2-col) --- */
.opportunity-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: center;
}
.opportunity-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.opportunity-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4/3;
}
.opportunity-content {
  max-width: 520px;
}
.opportunity-content p {
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
  line-height: 1.7;
}
.opportunity-content p:last-of-type {
  margin-bottom: var(--space-6);
}
@media (max-width: 767px) {
  .opportunity-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
}

/* --- Impact Cards --- */
.impact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: var(--space-6);
  margin-top: var(--space-10);
}
.impact-card {
  background: var(--color-surface);
  border: 1px solid oklch(from var(--color-text) l c h / 0.08);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: box-shadow var(--transition-interactive),
              transform var(--transition-interactive);
}
.impact-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.impact-icon {
  width: 44px;
  height: 44px;
  color: var(--color-primary);
  margin-bottom: var(--space-4);
}
.impact-card h3 {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-2);
}
.impact-card p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* --- Native Trees Section (full-bleed image + overlay text) --- */
.native-trees {
  position: relative;
  min-height: 500px;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.native-trees-bg {
  position: absolute;
  inset: 0;
}
.native-trees-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.native-trees-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    oklch(0.15 0.02 80 / 0.88) 0%,
    oklch(0.15 0.02 80 / 0.7) 50%,
    oklch(0.15 0.02 80 / 0.3) 100%
  );
}
.native-trees-content {
  position: relative;
  z-index: 1;
  max-width: var(--content-wide);
  margin-inline: auto;
  padding: var(--space-16) var(--space-4);
  width: 100%;
}
.native-trees-content .section-label {
  color: #52b788;
}
.native-trees-content .section-title {
  color: #f5f2eb;
  max-width: 18ch;
}
.tree-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: var(--space-4);
  margin-top: var(--space-8);
  max-width: 700px;
}
.tree-item {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: var(--space-3) var(--space-4);
  background: oklch(1 0 0 / 0.08);
  border-radius: var(--radius-md);
  border: 1px solid oklch(1 0 0 / 0.1);
}
.tree-item-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: #52b788;
  margin-top: 2px;
}
.tree-item-text {
  color: oklch(0.9 0.01 80 / 0.9);
}
.tree-item-text strong {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: #f5f2eb;
}
.tree-item-text span {
  font-size: var(--text-xs);
  color: oklch(0.9 0.01 80 / 0.65);
}

/* --- How to Help (Action Grid) --- */
.help-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  margin-top: var(--space-10);
}
.help-card {
  padding: var(--space-8);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  border: 1px solid oklch(from var(--color-text) l c h / 0.08);
}
.help-card-number {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 500;
  color: var(--color-primary);
  opacity: 0.4;
  margin-bottom: var(--space-3);
}
.help-card h3 {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-2);
}
.help-card p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
}
@media (max-width: 767px) {
  .help-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Resources Section --- */
.resources-list {
  margin-top: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.resource-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
  background: var(--color-surface);
  border: 1px solid oklch(from var(--color-text) l c h / 0.08);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--color-text);
  transition: box-shadow var(--transition-interactive),
              border-color var(--transition-interactive);
}
.resource-link:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--color-primary);
}
.resource-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.resource-info strong {
  font-size: var(--text-base);
  font-weight: 600;
}
.resource-info span {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.resource-arrow {
  width: 20px;
  height: 20px;
  color: var(--color-text-faint);
  flex-shrink: 0;
  transition: transform var(--transition-interactive),
              color var(--transition-interactive);
}
.resource-link:hover .resource-arrow {
  color: var(--color-primary);
  transform: translateX(4px);
}

/* --- CTA Banner --- */
.cta-banner {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}
.cta-inner {
  max-width: var(--content-wide);
  margin-inline: auto;
  padding: var(--space-16) var(--space-4);
  text-align: center;
}
.cta-inner .section-title {
  color: var(--color-text-inverse);
  margin-bottom: var(--space-4);
}
.cta-inner p {
  color: oklch(from var(--color-text-inverse) l c h / 0.8);
  font-size: var(--text-base);
  max-width: 50ch;
  margin-inline: auto;
  margin-bottom: var(--space-8);
}
.btn-cta {
  background: var(--color-text-inverse);
  color: var(--color-primary);
  font-weight: 600;
}
.btn-cta:hover {
  background: oklch(from var(--color-text-inverse) l c h / 0.9);
}

/* --- Footer --- */
.site-footer {
  background: var(--color-surface-offset);
  border-top: 1px solid var(--color-divider);
  padding-block: var(--space-12);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-12);
}
.footer-about p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-4);
  max-width: 36ch;
  line-height: 1.6;
}
.footer-col h4 {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-4);
  color: var(--color-text);
}
.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.footer-col a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
}
.footer-col a:hover {
  color: var(--color-primary);
}
.footer-bottom {
  margin-top: var(--space-10);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-divider);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-disclaimer {
  margin-top: var(--space-4);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  text-align: center;
  max-width: none;
  font-style: italic;
}
@media (max-width: 767px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
}

/* --- Scroll Animations --- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
