
/* Topeka Home Insider â base CSS (v2 â upgraded design system) */
* { box-sizing: border-box; margin: 0; }

/* ========================================
   DESIGN TOKENS
   ======================================== */
:root {
  /* Colors */
  --fg: #111827;
  --fg-body: #374151;
  --fg-soft: #6b7280;
  --fg-muted: #9ca3af;
  --bg: #ffffff;
  --bg-soft: #f9fafb;
  --bg-warm: #f4f1ec;
  --line: #e5e7eb;
  --line-soft: #f3f4f6;

  /* Brand */
  --accent: #1f2937;
  --accent-rgb: 31,41,55;
  --accent-hover: #374151;
  --cta: #1d4ed8;
  --cta-hover: #1e40af;
  --cta-rgb: 29,78,216;

  /* Layout */
  --max: 1200px;
  --readable: 720px;
  --radius: 6px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.05), 0 12px 40px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08), 0 24px 64px rgba(0,0,0,0.06);

  /* Spacing scale */
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 40px;
  --space-xl: 64px;
  --space-2xl: 80px;

  /* Typography scale */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: 2.5rem;
  --text-5xl: 3rem;
}

html { scroll-behavior: smooth; }
html, body { padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--fg-body);
  background: var(--bg);
  line-height: 1.6;
  font-size: var(--text-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--cta); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(29,78,216,0.3); transition: all 0.15s ease; }
a:hover { text-decoration-color: var(--cta); text-decoration-thickness: 2px; }

/* ========================================
   TYPOGRAPHY PAIRINGS
   ======================================== */
body.fp-serif-sans h1, body.fp-serif-sans h2, body.fp-serif-sans h3 { font-family: Georgia, "Times New Roman", serif; letter-spacing: -0.01em; }
body.fp-sans-serif-display h1, body.fp-sans-serif-display h2 { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; letter-spacing: -0.03em; font-weight: 800; }
body.fp-mono-serif h1, body.fp-mono-serif h2 { font-family: "Courier New", ui-monospace, monospace; letter-spacing: 0; }
body.fp-mono-serif p { font-family: Georgia, serif; }
body.fp-humanist-sans h1, body.fp-humanist-sans h2 { font-family: "Lucida Sans", "Lucida Grande", "Trebuchet MS", sans-serif; }

/* ========================================
   NAVIGATION
   ======================================== */
.site-nav {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: box-shadow 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
}
.brand {
  font-weight: 800;
  text-decoration: none;
  color: var(--fg);
  font-size: 20px;
  letter-spacing: -0.02em;
}
.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--fg-soft);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 500;
  padding: 6px 0;
  position: relative;
  transition: color 0.15s ease;
}
.nav-links a:hover { color: var(--fg); }
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--cta);
  transform: scaleX(0);
  transition: transform 0.2s ease;
}
.nav-links a:hover::after { transform: scaleX(1); }

/* Mobile hamburger */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--fg); margin: 5px 0; transition: 0.3s; }

/* ========================================
   HERO SECTIONS
   ======================================== */
.hero {
  padding: var(--space-2xl) 24px;
  max-width: var(--max);
  margin: 0 auto;
}
.hero .page-h1 {
  font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl));
  color: var(--fg);
  margin: 0 0 16px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.hero-sub {
  color: var(--fg-soft);
  font-size: var(--text-lg);
  max-width: 640px;
  margin: 0 0 var(--space-md);
  line-height: 1.5;
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 14px 28px;
  background: var(--cta);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: var(--text-base);
  box-shadow: 0 2px 8px rgba(29,78,216,0.3);
  transition: all 0.2s ease;
}
.hero-cta:hover {
  background: var(--cta-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(29,78,216,0.4);
  text-decoration: none;
  color: #fff;
}

/* Hero variant: full-bleed */
.hero-full-bleed { position: relative; padding: 96px 24px 80px; max-width: 100%; color: #fff; overflow: hidden; }
.hero-full-bleed .hero-bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(var(--accent-rgb),0.97) 0%, rgba(var(--accent-rgb),0.80) 60%, rgba(var(--cta-rgb),0.70) 100%);
  z-index: 0;
}
.hero-full-bleed .hero-overlay { display: none; }
.hero-full-bleed .hero-content { position: relative; z-index: 1; max-width: var(--max); margin: 0 auto; }
.hero-full-bleed .hero-sub { color: rgba(255,255,255,0.8); }
.hero-full-bleed .hero-cta { background: #fff; color: var(--cta); box-shadow: 0 2px 12px rgba(0,0,0,0.15); }
.hero-full-bleed .hero-cta:hover { background: #f0f4ff; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.2); color: var(--cta); }

/* Hero variant: split */
.hero-split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; padding: var(--space-2xl) 24px; }
.hero-split .hero-left { padding-right: 16px; }
.hero-split .hero-right {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  min-height: 360px;
  position: relative;
  overflow: hidden;
}
.hero-split .hero-art {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(var(--accent-rgb),0.12), rgba(var(--cta-rgb),0.25)),
              radial-gradient(circle at 25% 25%, rgba(255,255,255,0.6) 0 80px, transparent 100px),
              radial-gradient(circle at 75% 75%, rgba(var(--cta-rgb),0.15) 0 60px, transparent 80px);
}

/* Hero variant: minimal text */
.hero-minimal { padding: var(--space-2xl) 24px var(--space-xl); border-bottom: 1px solid var(--line); }
.hero-minimal .hero-eyebrow {
  display: inline-block;
  color: var(--cta);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.hero-minimal .page-h1 { font-size: clamp(var(--text-3xl), 5.5vw, var(--text-5xl)); }

/* Hero variant: data grid */
.hero-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center;
  padding: var(--space-xl) 24px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
}
.hero-grid .hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hero-grid .stat {
  background: var(--bg);
  border: 1px solid var(--line);
  border-left: 4px solid var(--cta);
  padding: 20px;
  border-radius: var(--radius);
  transition: box-shadow 0.2s;
}
.hero-grid .stat:hover { box-shadow: var(--shadow); }
.hero-grid .stat-num { font-size: var(--text-3xl); font-weight: 800; color: var(--cta); letter-spacing: -0.02em; }
.hero-grid .stat-label { font-size: var(--text-xs); color: var(--fg-soft); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 4px; }

/* ========================================
   PAGE SHELL + BODY
   ======================================== */
.page-shell {
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--space-lg) 24px var(--space-2xl);
}
.page-body { max-width: var(--readable); margin: 0 auto; }
.page-body > * { margin-block: 0.75em; }
.page-body h1 { font-size: var(--text-4xl); color: var(--fg); line-height: 1.15; font-weight: 800; letter-spacing: -0.02em; margin-top: 0; }
.page-body h2 {
  font-size: var(--text-2xl);
  color: var(--fg);
  line-height: 1.2;
  font-weight: 700;
  margin-top: 2em;
  padding-top: 1.5em;
  border-top: 1px solid var(--line);
  letter-spacing: -0.01em;
}
.page-body h3 { font-size: var(--text-xl); color: var(--fg); line-height: 1.25; font-weight: 600; margin-top: 1.5em; }
.page-body p { font-size: var(--text-lg); line-height: 1.7; color: var(--fg-body); }
.page-body ul, .page-body ol { padding-left: 24px; }
.page-body li { margin-bottom: 6px; font-size: var(--text-base); line-height: 1.6; }
.page-body table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.page-body table th, .page-body table td { border: 1px solid var(--line); padding: 10px 14px; text-align: left; }
.page-body table th { background: var(--bg-soft); font-weight: 600; color: var(--fg); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.04em; }
.page-body table td { color: var(--fg-body); }
.table-wrap { overflow-x: auto; margin: 1.5em 0; border-radius: var(--radius); border: 1px solid var(--line); }
.table-wrap table { border: none; }
.table-wrap table th:first-child, .table-wrap table td:first-child { border-left: none; }
.table-wrap table th:last-child, .table-wrap table td:last-child { border-right: none; }

/* ========================================
   CALLOUT (Quick Facts)
   ======================================== */
.page-body blockquote.callout {
  background: rgba(var(--cta-rgb), 0.04);
  border-left: 4px solid var(--cta);
  padding: var(--space-md);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  margin: 2em 0;
}
.page-body blockquote.callout p { margin: 0.4em 0; font-size: var(--text-sm); color: var(--fg-body); }
.page-body blockquote.callout ul { margin: 0.5em 0; }
.page-body blockquote.callout li { font-size: var(--text-sm); }

/* ========================================
   LEAD-CAPTURE FORMS
   ======================================== */
.lead-offer {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  margin: 2.5em 0;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease;
}
.lead-offer:hover { box-shadow: var(--shadow-md); }
.lead-offer.offer-primary {
  border: 2px solid var(--cta);
  background: linear-gradient(180deg, rgba(var(--cta-rgb),0.03), var(--bg) 60%);
  box-shadow: var(--shadow-md);
}
.lead-offer.offer-mid { border-left: 4px solid var(--cta); }
.lead-offer.offer-bottom { background: var(--bg-soft); border: 1px dashed var(--fg-muted); }
.lead-offer .offer-headline h3 {
  margin: 0 0 8px;
  color: var(--fg);
  font-size: var(--text-xl);
  line-height: 1.3;
  font-weight: 700;
}
.lead-offer .offer-reason { color: var(--fg-soft); margin: 8px 0 20px; font-size: var(--text-sm); line-height: 1.5; }

.lead-form .form-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 16px;
}
@media (min-width: 640px) { .lead-form .form-fields { grid-template-columns: 1fr 1fr; } }
.lead-form label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--fg-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lead-form input, .lead-form select {
  height: 48px;
  padding: 0 14px;
  border: 1px solid #d1d5db;
  border-radius: var(--radius);
  font-size: var(--text-base);
  font-family: inherit;
  background: var(--bg);
  color: var(--fg);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.lead-form input:focus, .lead-form select:focus {
  outline: none;
  border-color: var(--cta);
  box-shadow: 0 0 0 3px rgba(var(--cta-rgb), 0.15);
}
.lead-form input::placeholder { color: var(--fg-muted); }

/* CTA buttons */
.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 14px 28px;
  background: var(--cta);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: var(--text-base);
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(var(--cta-rgb), 0.25);
  transition: all 0.2s ease;
  width: 100%;
  text-decoration: none;
}
.cta-btn:hover {
  background: var(--cta-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(var(--cta-rgb), 0.35);
}
.cta-btn:active { transform: translateY(0); }

.trust-microcopy {
  color: var(--fg-muted);
  font-size: var(--text-xs);
  margin: 10px 0 0;
  text-align: center;
}
.lead-form.success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: var(--space-md);
  border-radius: var(--radius);
  text-align: center;
}

/* ========================================
   CALCULATOR UI
   ======================================== */
.calc {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: var(--space-md);
  margin: 2em 0;
  box-shadow: var(--shadow);
}
.calc h3 { margin-top: 0; color: var(--fg); font-weight: 700; }
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 16px 0; }
.calc label { font-size: var(--text-xs); color: var(--fg-soft); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; display: flex; flex-direction: column; gap: 6px; }
.calc input, .calc select { height: 44px; padding: 0 12px; border: 1px solid #d1d5db; border-radius: var(--radius); font-size: var(--text-base); font-family: inherit; }
.calc input:focus, .calc select:focus { outline: none; border-color: var(--cta); box-shadow: 0 0 0 3px rgba(var(--cta-rgb), 0.12); }
.calc-result {
  background: rgba(var(--cta-rgb), 0.05);
  border-left: 4px solid var(--cta);
  padding: 20px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-top: 16px;
}
.calc-result h4 { margin: 0 0 10px; color: var(--fg); font-weight: 700; }
.calc-result-num { font-size: var(--text-3xl); font-weight: 800; color: var(--cta); letter-spacing: -0.02em; }

/* ========================================
   PAGE-TYPE VARIANTS
   ======================================== */
.page-core_invest .page-body h2 { border-top: 2px solid var(--cta); }
.page-core_tool .hero-minimal { background: var(--bg-soft); }
.page-core_neighborhood_deep .page-body { font-size: var(--text-lg); }
.page-neighborhood .page-body h2 { padding-left: 14px; border-left: 4px solid var(--accent); border-top: none; padding-top: 0; }

/* ========================================
   HOMEPAGE SPECIFIC
   ======================================== */
.page-home .hero-full-bleed { padding: 120px 24px 100px; }
.page-home .hero-full-bleed .page-h1 { font-size: clamp(var(--text-3xl), 5.5vw, 3.5rem); max-width: 800px; }
.page-home .hero-full-bleed .hero-sub { font-size: var(--text-xl); max-width: 720px; line-height: 1.5; color: rgba(255,255,255,0.85); }

.page-home .page-body h2 {
  font-size: var(--text-2xl);
  border-top: none;
  padding-top: 0;
  margin-top: 2em;
  margin-bottom: 0.75em;
  color: var(--fg);
  position: relative;
}
.page-home .page-body h2::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: var(--cta);
  margin-top: 8px;
  border-radius: 2px;
}

.page-home .page-body ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 12px;
}
.page-home .page-body li {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  transition: all 0.15s ease;
  font-size: var(--text-base);
  line-height: 1.5;
}
.page-home .page-body li:hover {
  border-color: var(--cta);
  box-shadow: var(--shadow-sm);
  transform: translateX(4px);
}
.page-home .page-body li a {
  font-weight: 600;
  text-decoration: none;
  color: var(--cta);
}
.page-home .page-body li a:hover { text-decoration: underline; }

/* ========================================
   FOOTER
   ======================================== */
.site-footer {
  border-top: 1px solid var(--line);
  padding: var(--space-xl) 24px var(--space-2xl);
  background: var(--bg-soft);
  margin-top: var(--space-xl);
}
.footer-inner { max-width: var(--max); margin: 0 auto; }
.footer-inner > p:first-child { font-weight: 600; color: var(--fg); margin-bottom: 8px; }
.footer-disclaimer { font-size: var(--text-xs); color: var(--fg-muted); margin: 8px 0 var(--space-md); max-width: var(--readable); line-height: 1.5; }
.footer-links { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 16px; margin: 0; }
.footer-links a { font-size: var(--text-sm); color: var(--fg-soft); text-decoration: none; }
.footer-links a:hover { color: var(--cta); }

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
  .nav-inner { padding: 12px 16px; }
  .nav-links { display: none; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: 16px; gap: 0; box-shadow: var(--shadow-md); }
  .nav-links.open { display: flex; }
  .nav-links li { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
  .nav-links li:last-child { border: none; }
  .nav-toggle { display: block; }
  .hero-split, .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero-grid .hero-stats { grid-template-columns: 1fr 1fr; }
  .hero-full-bleed, .page-home .hero-full-bleed { padding: 64px 16px 56px; }
  .page-shell { padding: var(--space-md) 16px var(--space-xl); }
  .lead-offer { padding: var(--space-md); }
  .calc-grid { grid-template-columns: 1fr; }
  .page-home .page-body ul { grid-template-columns: 1fr; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .nav-links { gap: 1.25rem; }
  .hero-split { gap: 32px; }
}

/* Accessibility: focus-visible for keyboard users */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--cta);
  outline-offset: 2px;
}
