/* ============================================================
   Alamo Tree Leads — Design System
   Hill Country forest palette: deep evergreen, limestone, terracotta
   ============================================================ */

:root,
[data-theme='light'] {
  /* Surfaces — warm limestone */
  --color-bg: #f4f1ea;
  --color-surface: #faf8f3;
  --color-surface-2: #fffefb;
  --color-surface-offset: #ece6d8;
  --color-surface-offset-2: #e3dcc9;
  --color-surface-dynamic: #d9d1bf;
  --color-divider: #d6cdb8;
  --color-border: #cdc2a8;

  /* Text */
  --color-text: #1c2418;
  --color-text-muted: #58604f;
  --color-text-faint: #9a9583;
  --color-text-inverse: #f7f4ec;

  /* Primary — Evergreen */
  --color-primary: #214d2e;
  --color-primary-hover: #173a23;
  --color-primary-active: #0f2a18;
  --color-primary-highlight: #c8d6c4;

  /* Accent — Terracotta (emergency / high-intent CTA) */
  --color-accent: #b6552a;
  --color-accent-hover: #97431f;
  --color-accent-active: #76321a;
  --color-accent-highlight: #e6d2c2;

  /* Gold — live oak amber */
  --color-gold: #b98a1c;
  --color-gold-hover: #9a700f;

  /* Success */
  --color-success: #3d6b27;
  --color-success-highlight: #d2dfc4;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 0.875rem;
  --radius-xl: 1.25rem;
  --radius-full: 9999px;

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

  --shadow-sm: 0 1px 2px oklch(0.25 0.02 120 / 0.08);
  --shadow-md: 0 6px 18px oklch(0.25 0.02 120 / 0.12);
  --shadow-lg: 0 18px 44px oklch(0.25 0.02 120 / 0.16);

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

  --font-display: 'Zodiak', 'Georgia', serif;
  --font-body: 'General Sans', 'Helvetica Neue', sans-serif;

  /* 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);
  --text-hero: clamp(3rem, 0.5rem + 7vw, 8rem);

  /* 4px spacing scale */
  --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;
}

[data-theme='dark'] {
  --color-bg: #141a12;
  --color-surface: #1a2118;
  --color-surface-2: #20281d;
  --color-surface-offset: #1d241a;
  --color-surface-offset-2: #242c20;
  --color-surface-dynamic: #2c3527;
  --color-divider: #2a3124;
  --color-border: #3a4432;

  --color-text: #d7d4c4;
  --color-text-muted: #8a8a78;
  --color-text-faint: #5c5e50;
  --color-text-inverse: #1c2418;

  --color-primary: #7fae74;
  --color-primary-hover: #6a9a60;
  --color-primary-active: #577f4d;
  --color-primary-highlight: #2c3a28;

  --color-accent: #d97a45;
  --color-accent-hover: #c46631;
  --color-accent-active: #a8522a;
  --color-accent-highlight: #46332a;

  --color-gold: #d9a83a;
  --color-gold-hover: #c69128;
  --color-success: #7fae74;
  --color-success-highlight: #2c3a28;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-md: 0 6px 18px oklch(0 0 0 / 0.4);
  --shadow-lg: 0 18px 44px oklch(0 0 0 / 0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #141a12;
    --color-surface: #1a2118;
    --color-surface-2: #20281d;
    --color-surface-offset: #1d241a;
    --color-surface-offset-2: #242c20;
    --color-surface-dynamic: #2c3527;
    --color-divider: #2a3124;
    --color-border: #3a4432;
    --color-text: #d7d4c4;
    --color-text-muted: #8a8a78;
    --color-text-faint: #5c5e50;
    --color-text-inverse: #1c2418;
    --color-primary: #7fae74;
    --color-primary-hover: #6a9a60;
    --color-primary-active: #577f4d;
    --color-primary-highlight: #2c3a28;
    --color-accent: #d97a45;
    --color-accent-hover: #c46631;
    --color-accent-active: #a8522a;
    --color-accent-highlight: #46332a;
    --color-gold: #d9a83a;
    --color-gold-hover: #c69128;
    --color-success: #7fae74;
    --color-success-highlight: #2c3a28;
  }
}

/* ---------------- Base ---------------- */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  min-height: 100dvh;
  line-height: 1.65;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
}

img, picture, svg { display: block; max-width: 100%; height: auto; }
ul[role='list'], ol[role='list'] { list-style: none; }
input, button, textarea, select { font: inherit; color: inherit; }

h1, h2, h3, h4 { text-wrap: balance; line-height: 1.12; font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; }
p, li { text-wrap: pretty; max-width: 72ch; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: oklch(from var(--color-primary) l c h / 0.22); color: var(--color-text); }
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; border-radius: var(--radius-sm); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

button { cursor: pointer; background: none; border: none; }

a, button, [role='button'], input, textarea, select {
  transition: color var(--transition-interactive), background var(--transition-interactive),
    border-color var(--transition-interactive), box-shadow var(--transition-interactive);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------------- Layout helpers ---------------- */
.container { width: min(100% - 2.5rem, var(--content-wide)); margin-inline: auto; }
.container-narrow { width: min(100% - 2.5rem, var(--content-narrow)); margin-inline: auto; }
.section { padding-block: clamp(2.5rem, 6vw, 5rem); }
.section-tight { padding-block: clamp(1.75rem, 4vw, 3rem); }
.eyebrow {
  font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--color-primary); margin-bottom: var(--space-3); display: inline-block;
}
.lead-text { font-size: var(--text-lg); color: var(--color-text-muted); max-width: 60ch; }
.divider-rule { height: 1px; background: var(--color-divider); border: 0; }

/* ---------------- Header ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--color-bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-divider);
}
.header-inner { display: flex; align-items: center; gap: var(--space-6); min-height: 4.5rem; padding-block: var(--space-2); }
.brand { display: flex; align-items: center; gap: var(--space-3); color: var(--color-text); font-family: var(--font-display); font-weight: 600; font-size: var(--text-lg); letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 36px; height: 36px; flex: none; color: var(--color-primary); }
.brand-name b { color: var(--color-primary); }
.primary-nav { display: flex; gap: var(--space-6); margin-left: auto; align-items: center; }
.primary-nav a { color: var(--color-text-muted); font-size: var(--text-sm); font-weight: 500; margin-inline-end: var(--space-5); white-space: nowrap; }
.primary-nav a:last-child { margin-inline-end: 0; }
.primary-nav a:hover { color: var(--color-text); text-decoration: none; }
.header-cta { display: flex; align-items: center; gap: var(--space-3); }
.nav-toggle { display: none; }

@media (max-width: 880px) {
  .primary-nav { display: none; }
  .nav-toggle { display: inline-flex; }
  .primary-nav.open {
    display: flex; flex-direction: column; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--color-surface); border-bottom: 1px solid var(--color-border);
    padding: var(--space-4) var(--space-4) var(--space-6); gap: var(--space-4); box-shadow: var(--shadow-md);
  }
  .header-cta .btn-label { display: none; }
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  font-size: var(--text-sm); font-weight: 600; letter-spacing: 0.01em;
  padding: 0.7rem 1.25rem; border-radius: var(--radius-full);
  border: 1.5px solid transparent; text-decoration: none; line-height: 1;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--color-primary); color: var(--color-text-inverse); border-color: var(--color-primary); }
.btn-primary:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); }
.btn-accent { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }
.btn-accent:hover { background: var(--color-accent-hover); border-color: var(--color-accent-hover); }
.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-lg { padding: 0.9rem 1.6rem; font-size: var(--text-base); }
.btn svg { width: 1.1em; height: 1.1em; }

/* ---------------- Hero ---------------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(120% 90% at 80% 0%, oklch(from var(--color-primary) l c h / 0.16), transparent 60%),
    linear-gradient(in oklab, var(--color-surface-offset), var(--color-bg));
  border-bottom: 1px solid var(--color-divider);
}
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; padding-block: clamp(3rem, 7vw, 6rem); }
.hero h1 { font-size: var(--text-2xl); margin-bottom: var(--space-5); }
.hero h1 em { font-style: normal; color: var(--color-primary); }
.hero .lead-text { margin-bottom: var(--space-6); }
.hero-points { display: flex; flex-wrap: wrap; gap: var(--space-4) var(--space-6); margin-top: var(--space-6); }
.hero-points li { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); color: var(--color-text-muted); }
.hero-points svg { width: 18px; height: 18px; color: var(--color-success); flex: none; }

@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; padding-block: clamp(2.5rem, 8vw, 3.5rem); }
}

/* ---------------- Lead form card ---------------- */
.lead-card {
  background: var(--color-surface-2); border: 1px solid var(--color-border);
  border-radius: var(--radius-xl); padding: clamp(1.5rem, 3vw, 2.25rem);
  box-shadow: var(--shadow-lg);
}
.lead-card h2 { font-size: var(--text-xl); margin-bottom: var(--space-2); }
.lead-card .form-intro { color: var(--color-text-muted); font-size: var(--text-sm); margin-bottom: var(--space-5); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.field { margin-bottom: var(--space-3); }
.field label { display: block; font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-text-muted); margin-bottom: var(--space-2); }
.field input, .field select, .field textarea {
  width: 100%; padding: 0.7rem 0.85rem; border-radius: var(--radius-md);
  border: 1.5px solid var(--color-border); background: var(--color-surface);
  color: var(--color-text); font-size: var(--text-base);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-highlight); }
.field textarea { resize: vertical; min-height: 80px; }
.consent { display: flex; gap: var(--space-2); align-items: flex-start; font-size: var(--text-xs); color: var(--color-text-muted); margin-top: var(--space-3); }
.consent input { margin-top: 0.2rem; flex: none; width: 16px; height: 16px; accent-color: var(--color-primary); }
.consent a { color: var(--color-primary); }
.form-success { display: none; text-align: center; padding: var(--space-6) var(--space-4); }
.form-success.show { display: block; }
.form-success svg { width: 56px; height: 56px; color: var(--color-success); margin: 0 auto var(--space-4); }
.trust-line { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-xs); color: var(--color-text-muted); margin-top: var(--space-4); justify-content: center; }
.trust-line svg { width: 16px; height: 16px; color: var(--color-success); }

@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

/* ---------------- Section: services ---------------- */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: var(--space-4); }
.card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: var(--space-6); transition: transform var(--transition-interactive), box-shadow var(--transition-interactive), border-color var(--transition-interactive);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--color-primary); }
.card .icon { width: 40px; height: 40px; color: var(--color-primary); margin-bottom: var(--space-4); }
.card h3 { font-size: var(--text-lg); margin-bottom: var(--space-2); }
.card p { color: var(--color-text-muted); font-size: var(--text-sm); }
.card .card-link { display: inline-flex; align-items: center; gap: var(--space-2); margin-top: var(--space-4); font-size: var(--text-sm); font-weight: 600; color: var(--color-primary); }

/* ---------------- Section: steps ---------------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-6); counter-reset: step; }
.step { position: relative; padding-left: var(--space-12); }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0; width: 2.25rem; height: 2.25rem;
  border-radius: var(--radius-full); background: var(--color-primary); color: var(--color-text-inverse);
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 600; font-size: var(--text-base);
}
.step h3 { font-size: var(--text-base); font-family: var(--font-body); font-weight: 700; margin-bottom: var(--space-1); }
.step p { color: var(--color-text-muted); font-size: var(--text-sm); }

/* ---------------- Stats band ---------------- */
.stats-band { background: var(--color-primary); color: var(--color-text-inverse); }
.stats-band .eyebrow { color: oklch(from var(--color-text-inverse) l c h / 0.7); }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-6); }
.stat .num { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 600; line-height: 1; }
.stat .label { font-size: var(--text-sm); opacity: 0.82; margin-top: var(--space-2); }

/* ---------------- Areas / chips ---------------- */
.chip-grid { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); }
.chip {
  display: inline-flex; align-items: center; gap: var(--space-2); padding: 0.45rem 0.9rem;
  border-radius: var(--radius-full); background: var(--color-surface); border: 1px solid var(--color-border);
  font-size: var(--text-sm); color: var(--color-text-muted);
}
.chip svg { width: 15px; height: 15px; color: var(--color-primary); }

/* ---------------- Pricing (contractors) ---------------- */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--space-5); align-items: stretch; }
.price-card {
  background: var(--color-surface); border: 1.5px solid var(--color-border); border-radius: var(--radius-lg);
  padding: var(--space-6); display: flex; flex-direction: column;
}
.price-card.featured { border-color: var(--color-primary); box-shadow: var(--shadow-md); position: relative; }
.price-card.featured::before {
  content: 'Most Popular'; position: absolute; top: -0.75rem; left: var(--space-6);
  background: var(--color-primary); color: var(--color-text-inverse); font-size: var(--text-xs); font-weight: 600;
  padding: 0.2rem 0.7rem; border-radius: var(--radius-full); letter-spacing: 0.04em;
}
.price-card .tier { font-size: var(--text-sm); font-weight: 600; color: var(--color-primary); letter-spacing: 0.06em; text-transform: uppercase; }
.price-card .price { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 600; margin-block: var(--space-2) var(--space-1); }
.price-card .price small { font-family: var(--font-body); font-size: var(--text-sm); color: var(--color-text-muted); font-weight: 400; }
.price-card .desc { color: var(--color-text-muted); font-size: var(--text-sm); margin-bottom: var(--space-5); }
.price-card ul { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-5); }
.price-card li { display: flex; gap: var(--space-2); align-items: flex-start; font-size: var(--text-sm); color: var(--color-text); }
.price-card li svg { width: 16px; height: 16px; color: var(--color-success); flex: none; margin-top: 0.15rem; }
.price-card .btn { margin-top: auto; }

/* ---------------- FAQ ---------------- */
.faq { display: flex; flex-direction: column; gap: var(--space-3); }
details.faq-item { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-4) var(--space-5); }
details.faq-item summary { cursor: pointer; font-weight: 600; font-size: var(--text-base); list-style: none; display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); }
details.faq-item summary::-webkit-details-marker { display: none; }
details.faq-item summary::after { content: '+'; font-size: var(--text-lg); color: var(--color-primary); transition: transform var(--transition-interactive); }
details.faq-item[open] summary::after { transform: rotate(45deg); }
details.faq-item p { margin-top: var(--space-3); color: var(--color-text-muted); font-size: var(--text-sm); }

/* ---------------- Split / feature ---------------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (max-width: 880px) { .split { grid-template-columns: 1fr; } }
.split-visual { border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 4 / 3; background: var(--color-surface-offset); border: 1px solid var(--color-border); }

/* ---------------- CTA band ---------------- */
.cta-band {
  background:
    radial-gradient(110% 80% at 100% 0%, oklch(from var(--color-accent) l c h / 0.22), transparent 55%),
    var(--color-primary);
  color: var(--color-text-inverse); border-radius: var(--radius-xl);
  padding: clamp(2rem, 5vw, 3.5rem); display: flex; flex-wrap: wrap; gap: var(--space-6); align-items: center; justify-content: space-between;
}
.cta-band h2 { color: var(--color-text-inverse); font-size: var(--text-xl); margin-bottom: var(--space-2); }
.cta-band p { color: oklch(from var(--color-text-inverse) l c h / 0.85); font-size: var(--text-sm); }
.cta-band .btn-primary { background: var(--color-text-inverse); color: var(--color-primary); border-color: var(--color-text-inverse); }
.cta-band .btn-primary:hover { background: var(--color-surface-offset); }
.cta-band .btn-outline { color: var(--color-text-inverse); border-color: oklch(from var(--color-text-inverse) l c h / 0.5); }
.cta-band .btn-outline:hover { border-color: var(--color-text-inverse); color: var(--color-text-inverse); background: oklch(from var(--color-text-inverse) l c h / 0.1); }

/* ---------------- Page header (interior) ---------------- */
.page-header { background: linear-gradient(in oklab, var(--color-surface-offset), var(--color-bg)); border-bottom: 1px solid var(--color-divider); }
.page-header .container { padding-block: clamp(2.5rem, 6vw, 4rem); }
.page-header h1 { font-size: var(--text-2xl); margin-bottom: var(--space-4); }
.breadcrumb { font-size: var(--text-xs); color: var(--color-text-faint); margin-bottom: var(--space-4); letter-spacing: 0.04em; text-transform: uppercase; }
.breadcrumb a { color: var(--color-text-muted); }

/* ---------------- Footer ---------------- */
.site-footer { background: var(--color-surface); border-top: 1px solid var(--color-divider); padding-block: clamp(2.5rem, 5vw, 4rem) var(--space-6); margin-top: clamp(3rem, 7vw, 6rem); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: var(--space-8); margin-bottom: var(--space-8); }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-6); } }
.footer-brand .brand { margin-bottom: var(--space-3); }
.footer-brand p { font-size: var(--text-sm); color: var(--color-text-muted); }
.footer-col h4 { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.1em; color: var(--color-text-muted); margin-bottom: var(--space-3); font-family: var(--font-body); font-weight: 700; }
.footer-col ul { display: flex; flex-direction: column; gap: var(--space-2); }
.footer-col a { color: var(--color-text-muted); font-size: var(--text-sm); }
.footer-col a:hover { color: var(--color-primary); }
.footer-bottom { border-top: 1px solid var(--color-divider); padding-top: var(--space-5); display: flex; flex-wrap: wrap; gap: var(--space-3); justify-content: space-between; align-items: center; font-size: var(--text-xs); color: var(--color-text-faint); }
.footer-bottom .disclosure { max-width: 70ch; }

/* ---------------- Theme toggle ---------------- */
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: var(--radius-full); border: 1.5px solid var(--color-border); color: var(--color-text-muted); }
.theme-toggle:hover { color: var(--color-primary); border-color: var(--color-primary); }

/* ---------------- Utility ---------------- */
.text-center { text-align: center; }
.mx-auto { margin-inline: auto; }
.mt-8 { margin-top: var(--space-8); }
.muted { color: var(--color-text-muted); }
.section-title { font-size: var(--text-xl); margin-bottom: var(--space-3); }
.section-intro { color: var(--color-text-muted); font-size: var(--text-lg); max-width: 62ch; margin-bottom: var(--space-8); }
.headline-block { max-width: 64ch; margin-bottom: var(--space-8); }
ul.check-list { display: flex; flex-direction: column; gap: var(--space-3); }
ul.check-list li { display: flex; gap: var(--space-3); align-items: flex-start; }
ul.check-list svg { width: 20px; height: 20px; color: var(--color-success); flex: none; margin-top: 0.1rem; }
