/* =========================================
   1. CSS Variables & Design System
   ========================================= */
:root {
  /* Palette: Earth tones & Nature texture */
  --color-primary: #1a3c28;       /* Deep Forest Green */
  --color-secondary: #d9b49c;     /* Warm Sand */
  --color-accent: #2c2c2c;        /* Charcoal Dark Grey */
  --color-bg: #f7f4f0;            /* Off-white Rice Paper */
  --color-surface: #ffffff;
  --color-text-main: #2c2c2c;
  --color-text-sub: #5c5c5c;
  --color-border: #e0dcd5;

  /* Typography */
  --font-display: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  
  /* Spacing & Layout */
  --container-width: 1200px;
  --section-gap: clamp(3rem, 5vw, 5rem);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

/* =========================================
   2. Reset & Base Styles
   ========================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s ease, opacity 0.2s ease;
}

ul, ol {
  list-style: none;
}

/* Accessibility Focus */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

/* =========================================
   3. Typography & Headings
   ========================================= */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--color-primary);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
  line-height: 1.2;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  margin-bottom: 1.5rem;
}

h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  margin-bottom: 1rem;
  position: relative;
  display: inline-block;
}

h3 {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  color: var(--color-accent);
  margin-bottom: 0.75rem;
}

p {
  color: var(--color-text-sub);
  margin-bottom: 1rem;
  max-width: 75ch;
}

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section-padding {
  padding-top: var(--section-gap);
  padding-bottom: var(--section-gap);
}

.text-center {
  text-align: center;
}

.mb-4 { margin-bottom: 2rem; }
.mb-8 { margin-bottom: 4rem; }

/* =========================================
   4. Components: Buttons & Cards
   ========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  gap: 0.5rem;
}

.btn-primary {
  background-color: var(--color-primary);
  color: #fff;
}

.btn-primary:hover {
  background-color: #122a1b;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(26, 60, 40, 0.2);
}

.btn-outline {
  background-color: transparent;
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
}

.btn-outline:hover {
  background-color: var(--color-primary);
  color: #fff;
}

.card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(26, 60, 40, 0.06);
  border-color: var(--color-secondary);
}

/* =========================================
   5. Header & Navigation
   ========================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(247, 244, 240, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  padding: 0.8rem 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-primary);
}

.brand-logo img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.main-nav ul {
  display: flex;
  gap: 2rem;
}

.main-nav a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text-sub);
  position: relative;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--color-primary);
}

.main-nav a[aria-current="page"]::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--color-secondary);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
}

/* =========================================
   6. Footer
   ========================================= */
.site-footer {
  background-color: var(--color-primary);
  color: #fff;
  padding: 4rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

.footer-col h4 {
  color: var(--color-secondary);
  font-size: 1rem;
  margin-bottom: 1.2rem;
}

.footer-col ul li {
  margin-bottom: 0.8rem;
}

.footer-col a {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
}

.footer-col a:hover {
  color: var(--color-secondary);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 2rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
}

/* =========================================
   7. Grids & Tables
   ========================================= */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin-top: 1.5rem;
}

.data-table th, .data-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.data-table th {
  font-weight: 600;
  color: var(--color-primary);
  background-color: rgba(26, 60, 40, 0.04);
}

/* =========================================
   8. FAQ Component
   ========================================= */
.faq-container {
  max-width: 800px;
  margin: 0 auto;
}

details.faq-item {
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 0;
}

summary.faq-question {
  padding: 1.2rem 0;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--color-accent);
}

summary.faq-question::-webkit-details-marker {
  display: none;
}

summary.faq-question::after {
  content: '+';
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--color-primary);
  transition: transform 0.2s ease;
}

details[open] summary.faq-question::after {
  transform: rotate(45deg);
}

.faq-answer {
  padding-bottom: 1.5rem;
  color: var(--color-text-sub);
  line-height: 1.7;
}

/* =========================================
   9. SVG Animation Utilities
   ========================================= */
.svg-icon {
  width: 28px;
  height: 28px;
  stroke-width: 1.5;
  color: var(--color-primary);
}

.hero-svg, .feature-svg, .interface-svg {
  width: 100%;
  height: auto;
  max-width: 400px;
  margin: 0 auto;
}

/* SVG Path Animations */
.draw {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw-line 3s ease forwards;
}

.breathe {
  animation: breathe 6s infinite alternate ease-in-out;
}

/* Keyframes */
@keyframes draw-line {
  from {
    stroke-dashoffset: 1;
  }
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes breathe {
  0% {
    opacity: 0.7;
    transform: scale(0.98);
  }
  100% {
    opacity: 1;
    transform: scale(1.02);
  }
}

/* Respect Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .draw {
    stroke-dashoffset: 0 !important;
  }
  .breathe {
    opacity: 1;
    transform: none;
  }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .main-nav {
    display: none;
  }
  .nav-toggle {
    display: block;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  h1 {
    font-size: 2.5rem;
  }
}
