:root {
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Dark Theme Tokens (Default) */
  --bg-base: #070B14;
  --bg-surface: #0E1626;
  --bg-surface-elevated: #152238;
  --bg-card: rgba(18, 28, 48, 0.75);
  --bg-card-hover: rgba(26, 40, 68, 0.88);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(14, 165, 233, 0.5);

  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;

  --accent-cyan: #0EA5E9;
  --accent-cyan-glow: rgba(14, 165, 233, 0.25);
  --accent-indigo: #6366F1;
  --emerald: #10B981;
  --emerald-glow: rgba(16, 185, 129, 0.25);
  --amber: #F59E0B;
  --red: #EF4444;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.65);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 9999px;
}

[data-theme="light"] {
  --bg-base: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-surface-elevated: #F1F5F9;
  --bg-card: rgba(255, 255, 255, 0.92);
  --bg-card-hover: #FFFFFF;
  --border-subtle: #E2E8F0;
  --border-focus: #0EA5E9;

  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

html {
  scroll-behavior: smooth;
}

section {
  scroll-margin-top: 90px;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.glow-top {
  position: absolute;
  top: 0;
  left: 30%;
  width: 700px;
  height: 500px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.12) 0%, rgba(16, 185, 129, 0.05) 50%, transparent 70%);
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 28px;
  position: relative;
  z-index: 1;
}

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  background: rgba(7, 11, 20, 0.88);
  border-bottom: 1px solid var(--border-subtle);
  padding: 16px 0;
}
[data-theme="light"] header {
  background: rgba(248, 250, 252, 0.92);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-symbol {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #0EA5E9 0%, #10B981 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 16px var(--accent-cyan-glow);
}

.brand-name {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.brand-name span {
  color: var(--accent-cyan);
}

.brand-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
}

.nav-link {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}
.nav-link:hover {
  color: var(--text-primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary {
  background: linear-gradient(135deg, #0EA5E9 0%, #0284C7 100%);
  color: #FFFFFF;
  box-shadow: 0 2px 10px var(--accent-cyan-glow);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(14, 165, 233, 0.45);
}

.btn-emerald {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #FFFFFF;
  box-shadow: 0 2px 10px var(--emerald-glow);
}
.btn-emerald:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.45);
}

.btn-ghost {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border-color: var(--border-subtle);
}
.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-surface-elevated);
  border-color: rgba(255, 255, 255, 0.2);
}

.theme-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Hero Section */
.hero {
  padding: 55px 0 35px;
  text-align: center;
  position: relative;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(14, 165, 233, 0.3);
  color: var(--accent-cyan);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.hero h1 {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.18;
  max-width: 960px;
  margin: 0 auto 16px;
}
.hero h1 span {
  background: linear-gradient(135deg, #0EA5E9 0%, #10B981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 16.5px;
  color: var(--text-secondary);
  max-width: 760px;
  margin: 0 auto 30px;
  line-height: 1.6;
}

/* Global Search Bar in Hero */
.hero-search-wrapper {
  max-width: 680px;
  margin: 0 auto 24px;
  position: relative;
}

.hero-search-input {
  width: 100%;
  background: var(--bg-surface);
  border: 2px solid rgba(14, 165, 233, 0.35);
  border-radius: var(--radius-pill);
  padding: 17px 24px 17px 56px;
  font-size: 15.5px;
  color: var(--text-primary);
  font-family: var(--font-main);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35), 0 0 20px var(--accent-cyan-glow);
  outline: none;
}
.hero-search-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 8px 36px rgba(0, 0, 0, 0.5), 0 0 28px var(--accent-cyan-glow);
}

.hero-search-icon {
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent-cyan);
  width: 22px;
  height: 22px;
}

/* Quick Search Suggestions */
.quick-tags {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text-muted);
}
.quick-tag-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  color: var(--text-secondary);
  font-weight: 500;
  transition: all 0.15s ease;
}
.quick-tag-item:hover {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
  background: var(--bg-surface-elevated);
}

/* Stat Ticker Cards */
.stats-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 34px 0 46px;
}

.stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  backdrop-filter: blur(12px);
  position: relative;
}
.stat-box::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--border-subtle), transparent);
}

.stat-box-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}

.stat-box-val {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-box-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Section Common */
.section-title-wrap {
  margin-bottom: 22px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
}
.section-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.section-subtitle {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Unified Master Filter Deck */
.filter-toolbar {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}

.filter-controls-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-search-box {
  flex: 1.4;
  min-width: 240px;
  position: relative;
  display: flex;
  align-items: center;
}

.filter-search-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.filter-search-input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  font-size: 13.5px;
  font-family: var(--font-main);
  outline: none;
  transition: all 0.2s ease;
}
.filter-search-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px var(--accent-cyan-glow);
}

.filter-select-state {
  flex: 1.2;
  min-width: 260px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  font-size: 13.5px;
  font-family: var(--font-main);
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}
.filter-select-state:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px var(--accent-cyan-glow);
}

.filter-select-sort {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  color: var(--text-secondary);
  font-size: 13px;
  font-family: var(--font-main);
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.zoning-segmented-tabs {
  display: flex;
  background: var(--bg-surface-elevated);
  padding: 4px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  gap: 3px;
  flex-wrap: wrap;
}

.zoning-tab-btn {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.zoning-tab-btn:hover {
  color: var(--text-primary);
}
.zoning-tab-btn.active {
  background: var(--accent-cyan);
  color: #FFFFFF;
  box-shadow: 0 2px 8px var(--accent-cyan-glow);
}

/* Secondary Filter Bar with Active Badges */
.filter-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  font-size: 12.5px;
}

.active-filter-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(14, 165, 233, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(14, 165, 233, 0.3);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 600;
}
.filter-tag-pill span.remove-tag {
  cursor: pointer;
  font-weight: 800;
}
.filter-tag-pill span.remove-tag:hover {
  color: var(--red);
}

/* Counties Grid */
.counties-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
  margin-bottom: 50px;
}

.county-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 24px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}
.county-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-md), 0 8px 24px rgba(14, 165, 233, 0.14);
}

.county-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.county-title {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.25;
}

.county-state-tag {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  display: block;
  margin-top: 3px;
}

.county-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.county-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.stat-item-label {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
}

.stat-item-val {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}

.county-rules-snippet {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  background: rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  border-left: 3px solid var(--accent-cyan);
}

.county-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
  color: var(--text-muted);
}

/* Interactive Calculators Section */
.calculators-section {
  background: linear-gradient(135deg, rgba(14, 22, 38, 0.85) 0%, rgba(21, 34, 56, 0.85) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 36px;
  margin-bottom: 50px;
  box-shadow: var(--shadow-md);
}

.calc-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
  overflow-x: auto;
}

.calc-tab-btn {
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.calc-tab-btn.active {
  background: var(--bg-surface);
  color: var(--accent-cyan);
  border-color: rgba(14, 165, 233, 0.3);
  box-shadow: var(--shadow-sm);
}

.calc-container {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 36px;
}

.calc-inputs-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.input-group label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-secondary);
}
.input-group label span {
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-weight: 700;
}

.calc-input, .calc-select {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 14px;
  outline: none;
}
.calc-input:focus, .calc-select:focus {
  border-color: var(--accent-cyan);
}

.calc-range {
  width: 100%;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--border-subtle);
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
  margin-top: 6px;
}
.calc-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-cyan);
  border: 2px solid #FFFFFF;
  box-shadow: 0 0 8px var(--accent-cyan-glow);
  cursor: pointer;
}

.calc-results-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.calc-result-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}
.calc-result-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.calc-res-label {
  font-size: 13px;
  color: var(--text-muted);
}
.calc-res-val {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
}

/* Modal Drawer */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.98);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}
.modal-overlay.active .modal-box {
  transform: translateY(0) scale(1);
}

.modal-head {
  padding: 24px 28px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: sticky;
  top: 0;
  background: var(--bg-surface);
  z-index: 10;
}

.modal-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
}
.modal-close-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.15);
}

.modal-body {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* High-Ticket Lead Gen Box */
.lead-box {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(14, 165, 233, 0.08) 100%);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-top: 10px;
}

/* Footer */
footer {
  border-top: 1px solid var(--border-subtle);
  padding: 40px 0;
  margin-top: 60px;
  color: var(--text-muted);
  font-size: 13px;
}

@media (max-width: 900px) {
  .calc-container {
    grid-template-columns: 1fr;
  }
  .hero h1 {
    font-size: 32px;
  }
}
