/* =========================================================
   STEADFAST RURAL ADVISERS — Design Tokens & Component Styles
   Art Direction: Authoritative advisory, earthy warmth
   Palette: Sage green + warm stone + deep forest
   ========================================================= */

: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.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 5rem);

  /* Spacing */
  --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%;

  /* Fonts */
  --font-display: 'DM Serif Display', 'Georgia', serif;
  --font-body: 'DM Sans', 'Helvetica Neue', sans-serif;
}

/* ========================= LIGHT MODE ========================= */
:root,
[data-theme='light'] {
  /* Surfaces — Warm Stone */
  --color-bg: #f5f2ed;
  --color-surface: #faf8f5;
  --color-surface-2: #ffffff;
  --color-surface-offset: #edeae4;
  --color-surface-offset-2: #e5e1da;
  --color-surface-dynamic: #ddd9d2;
  --color-divider: #d1cdc5;
  --color-border: #c4bfb6;

  /* Text — Deep Charcoal */
  --color-text: #2a2722;
  --color-text-muted: #6b6660;
  --color-text-faint: #a39e97;
  --color-text-inverse: #faf8f5;

  /* Primary — Forest Sage */
  --color-primary: #3d6b52;
  --color-primary-hover: #2e5440;
  --color-primary-active: #1f3d2e;
  --color-primary-highlight: #d5e4da;

  /* Accent — Warm Amber */
  --color-accent: #b8860b;
  --color-accent-hover: #9a7009;
  --color-accent-highlight: #f0e6cc;

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

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

/* ========================= DARK MODE ========================= */
[data-theme='dark'] {
  --color-bg: #1a1916;
  --color-surface: #211f1c;
  --color-surface-2: #282622;
  --color-surface-offset: #1e1d1a;
  --color-surface-offset-2: #252320;
  --color-surface-dynamic: #302e2a;
  --color-divider: #2e2c28;
  --color-border: #3d3a35;
  --color-text: #d4d0ca;
  --color-text-muted: #8a857e;
  --color-text-faint: #5e5a54;
  --color-text-inverse: #1a1916;
  --color-primary: #6ba67e;
  --color-primary-hover: #549668;
  --color-primary-active: #3d8053;
  --color-primary-highlight: #2a3a30;
  --color-accent: #d4a22e;
  --color-accent-hover: #c49520;
  --color-accent-highlight: #3a3425;
  --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: #1a1916;
    --color-surface: #211f1c;
    --color-surface-2: #282622;
    --color-surface-offset: #1e1d1a;
    --color-surface-offset-2: #252320;
    --color-surface-dynamic: #302e2a;
    --color-divider: #2e2c28;
    --color-border: #3d3a35;
    --color-text: #d4d0ca;
    --color-text-muted: #8a857e;
    --color-text-faint: #5e5a54;
    --color-text-inverse: #1a1916;
    --color-primary: #6ba67e;
    --color-primary-hover: #549668;
    --color-primary-active: #3d8053;
    --color-primary-highlight: #2a3a30;
    --color-accent: #d4a22e;
    --color-accent-hover: #c49520;
    --color-accent-highlight: #3a3425;
    --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);
  }
}

/* ========================= GLOBAL ========================= */
body {
  font-family: var(--font-body);
}

a {
  color: var(--color-primary);
  text-decoration: none;
}
a:hover {
  color: var(--color-primary-hover);
}

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

@media (min-width: 768px) {
  .container {
    padding-inline: var(--space-8);
  }
}

/* ========================= HEADER ========================= */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: oklch(from var(--color-bg) l c h / 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  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);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-3);
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

@media (min-width: 768px) {
  .header-inner {
    padding-inline: var(--space-8);
  }
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.logo-icon {
  width: 36px;
  height: 36px;
  color: var(--color-primary);
}

.logo-text {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--color-text);
  line-height: 1.1;
}

.logo-text span {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.header-nav a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: 500;
  text-decoration: none;
}

.header-nav a:hover {
  color: var(--color-text);
}

.nav-links {
  display: none;
  gap: var(--space-6);
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-md);
  text-decoration: none;
  cursor: pointer;
  border: none;
  min-height: 44px;
}

.btn-primary {
  background: var(--color-primary);
  color: #ffffff;
}
.btn-primary:hover {
  background: var(--color-primary-hover);
  color: #ffffff;
}
.btn-primary:active {
  background: var(--color-primary-active);
  color: #ffffff;
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid oklch(from var(--color-primary) l c h / 0.3);
}
.btn-outline:hover {
  background: var(--color-primary-highlight);
  color: var(--color-primary-hover);
}

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

/* ========================= HERO ========================= */
.hero {
  padding: var(--space-16) var(--space-4) var(--space-12);
  text-align: left;
  position: relative;
  overflow: hidden;
}

@media (min-width: 768px) {
  .hero {
    padding: var(--space-24) var(--space-8) var(--space-16);
  }
}

.hero-inner {
  max-width: var(--content-wide);
  margin-inline: auto;
  display: grid;
  gap: var(--space-8);
  align-items: center;
}

@media (min-width: 768px) {
  .hero-inner {
    grid-template-columns: 1.1fr 0.9fr;
    gap: var(--space-12);
  }
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-4);
}

.hero-label::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--color-text);
  margin-bottom: var(--space-4);
  max-width: 18ch;
}

.hero p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 48ch;
  margin-bottom: var(--space-6);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.hero-image {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4/3;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-stat-bar {
  display: flex;
  gap: var(--space-6);
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid oklch(from var(--color-text) l c h / 0.08);
}

.hero-stat {
  text-align: left;
}

.hero-stat-number {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-text);
  line-height: 1;
}

.hero-stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

/* ========================= SECTION DEFAULTS ========================= */
.section {
  padding: var(--space-12) var(--space-4);
}

@media (min-width: 768px) {
  .section {
    padding: var(--space-16) var(--space-8);
  }
}

@media (min-width: 1024px) {
  .section {
    padding: var(--space-20) var(--space-12);
  }
}

.section-inner {
  max-width: var(--content-wide);
  margin-inline: auto;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-3);
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-text);
  margin-bottom: var(--space-4);
  max-width: 24ch;
}

.section-desc {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 56ch;
  margin-bottom: var(--space-8);
  line-height: 1.7;
}

/* ========================= PAIN POINTS ========================= */
.pain-section {
  background: var(--color-surface);
}

.pain-grid {
  display: grid;
  gap: var(--space-6);
}

@media (min-width: 768px) {
  .pain-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
  }
}

.pain-card {
  padding: var(--space-6);
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  border: 1px solid oklch(from var(--color-text) l c h / 0.06);
}

.pain-card-icon {
  width: 24px;
  height: 24px;
  color: var(--color-accent);
  margin-bottom: var(--space-3);
}

.pain-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.pain-card p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.65;
}

/* ========================= UNDERSTANDING ========================= */
.understand-section {
  background: var(--color-primary-active);
  color: var(--color-text-inverse);
}

.understand-section .section-label {
  color: var(--color-primary-highlight);
}

.understand-section .section-title {
  color: #fff;
}

.understand-section .section-desc {
  color: oklch(1 0 0 / 0.7);
}

.understand-grid {
  display: grid;
  gap: var(--space-6);
}

@media (min-width: 768px) {
  .understand-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.understand-item {
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background: oklch(1 0 0 / 0.06);
  border: 1px solid oklch(1 0 0 / 0.08);
}

.understand-item h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: #fff;
  margin-bottom: var(--space-2);
}

.understand-item p {
  font-size: var(--text-sm);
  color: oklch(1 0 0 / 0.7);
  line-height: 1.65;
}

/* ========================= PROCESS ========================= */
.process-grid {
  display: grid;
  gap: var(--space-6);
  counter-reset: process;
}

@media (min-width: 768px) {
  .process-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.process-card {
  counter-increment: process;
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  border: 1px solid oklch(from var(--color-text) l c h / 0.06);
  position: relative;
}

.process-card::before {
  content: counter(process, decimal-leading-zero);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-primary-highlight);
  display: block;
  margin-bottom: var(--space-3);
  line-height: 1;
}

[data-theme='dark'] .process-card::before {
  color: oklch(from var(--color-primary) l c h / 0.3);
}

.process-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.process-card p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.65;
}

/* ========================= TESTIMONIAL / QUOTE ========================= */
.quote-section {
  background: var(--color-surface);
}

.quote-block {
  max-width: 680px;
  margin-inline: auto;
  text-align: center;
}

.quote-mark {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  color: var(--color-primary-highlight);
  line-height: 0.5;
  margin-bottom: var(--space-4);
}

[data-theme='dark'] .quote-mark {
  color: oklch(from var(--color-primary) l c h / 0.3);
}

.quote-text {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-text);
  line-height: 1.4;
  margin-bottom: var(--space-4);
  font-style: italic;
}

.quote-author {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* ========================= FAQ ========================= */
.faq-list {
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.faq-item {
  border-bottom: 1px solid oklch(from var(--color-text) l c h / 0.08);
}

.faq-question {
  width: 100%;
  text-align: left;
  padding: var(--space-4) 0;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
}

.faq-question:hover {
  color: var(--color-primary);
}

.faq-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--color-text-muted);
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.faq-answer-inner {
  padding-bottom: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.7;
  max-width: 60ch;
}

/* ========================= ABOUT ========================= */
.about-layout {
  display: grid;
  gap: var(--space-10);
  align-items: start;
}

@media (min-width: 768px) {
  .about-layout {
    grid-template-columns: 1.1fr 0.9fr;
    gap: var(--space-16);
  }
}

.about-text p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.75;
  max-width: 58ch;
  margin-bottom: var(--space-4);
}

.about-text p:last-child {
  margin-bottom: 0;
}

.about-card-inner {
  background: var(--color-surface);
  border: 1px solid oklch(from var(--color-text) l c h / 0.06);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.about-card-icon {
  color: var(--color-primary);
  margin-bottom: var(--space-4);
}

.about-card-inner h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--color-text);
  margin-bottom: var(--space-3);
}

.about-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.about-list li {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  padding-left: var(--space-4);
  position: relative;
  line-height: 1.5;
  max-width: none;
}

.about-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
}

.about-divider {
  height: 1px;
  background: oklch(from var(--color-text) l c h / 0.08);
  margin: var(--space-4) 0;
}

/* ========================= CONTACT FORM ========================= */
.form-section {
  background: var(--color-surface);
}

.form-layout {
  display: grid;
  gap: var(--space-8);
}

@media (min-width: 768px) {
  .form-layout {
    grid-template-columns: 1fr 1.2fr;
    gap: var(--space-12);
    align-items: start;
  }
}

.form-intro h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-text);
  margin-bottom: var(--space-3);
}

.form-intro p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: var(--space-6);
}

.form-trust {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.form-trust-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.form-trust-icon {
  width: 20px;
  height: 20px;
  color: var(--color-primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.contact-form {
  background: var(--color-bg);
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  border: 1px solid oklch(from var(--color-text) l c h / 0.06);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.form-row {
  display: grid;
  gap: var(--space-4);
}

@media (min-width: 480px) {
  .form-row-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.form-group label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
}

.form-group input,
.form-group textarea,
.form-group select {
  padding: var(--space-2) var(--space-3);
  border: 1px solid oklch(from var(--color-text) l c h / 0.12);
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  font-size: var(--text-sm);
  color: var(--color-text);
  min-height: 44px;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--color-text-faint);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px oklch(from var(--color-primary) l c h / 0.12);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b6660' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: var(--space-8);
}

.form-note {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  text-align: center;
}

.form-success {
  display: none;
  text-align: center;
  padding: var(--space-8) var(--space-4);
}

.form-success.active {
  display: block;
}

.form-success h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.form-success p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  max-width: 40ch;
  margin-inline: auto;
}

/* ========================= FOOTER ========================= */
.footer {
  padding: var(--space-8) var(--space-4);
  border-top: 1px solid oklch(from var(--color-text) l c h / 0.08);
}

.footer-inner {
  max-width: var(--content-wide);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  align-items: center;
  text-align: center;
}

@media (min-width: 768px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.footer-copy {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

.footer-links {
  display: flex;
  gap: var(--space-4);
}

.footer-links a {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.footer-links a:hover {
  color: var(--color-text);
}

/* ========================= SCROLL ANIMATION ========================= */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========================= MOBILE NAV ========================= */
.mobile-nav-toggle {
  display: flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
}

@media (min-width: 768px) {
  .mobile-nav-toggle {
    display: none;
  }
}

.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  top: 0;
  z-index: 100;
  background: oklch(from var(--color-bg) l c h / 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: var(--space-16) var(--space-6);
  flex-direction: column;
  gap: var(--space-6);
}

.mobile-nav.open {
  display: flex;
}

.mobile-nav a {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-text);
  text-decoration: none;
}

.mobile-nav a:hover {
  color: var(--color-primary);
}

.mobile-nav-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
}
