/* CleanWaterGrade v1.0 — Luxury-Modern Scientific Utility Design (Sanzo Wada Coastal Mineral Palette) */
:root {
  --navy: #0F1E2E;
  --navy-mid: #162B40;
  --navy-soft: #243B53;
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-alt: #F1F5F9;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --text: #0F1E2E;
  --text-muted: #475569;
  --accent: #0369A1;
  --accent-dark: #075985;
  --accent-soft: #E0F2FE;
  --emerald: #047857;
  --emerald-soft: #D1FAE5;
  --amber: #92400E;
  --amber-soft: #FEF3C7;
  --coral: #B91C1C;
  --coral-soft: #FEE2E2;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(15, 30, 46, 0.06), 0 1px 2px rgba(15, 30, 46, 0.04);
  --shadow-md: 0 10px 25px -5px rgba(15, 30, 46, 0.08), 0 4px 10px -3px rgba(15, 30, 46, 0.04);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--accent-dark); text-decoration: underline; }
img, svg { max-width: 100%; height: auto; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* Header & Navigation */
.site-header {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  gap: 16px;
  flex-wrap: wrap;
}
.brand-link { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none !important; }
.main-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.main-nav a {
  color: var(--text);
  font-weight: 600;
  font-size: 0.93rem;
  padding: 10px 14px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.main-nav a:hover { background: var(--surface-alt); color: var(--accent); }
.main-nav a.nav-cta {
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
}
.main-nav a.nav-cta:hover { background: var(--accent-dark); color: #fff; }

/* Hero & Direct Answer Box */
.hero {
  background: linear-gradient(180deg, #FFFFFF 0%, #F1F5F9 100%);
  border-bottom: 1px solid var(--border);
  padding: 44px 0 52px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}
h1 {
  font-size: clamp(1.9rem, 3.8vw, 2.85rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
  color: var(--navy);
  font-weight: 850;
}
.direct-answer-box {
  background: var(--surface);
  border-left: 4px solid var(--accent);
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 16px 20px;
  margin: 0 0 28px;
  font-size: 1.02rem;
  color: var(--navy);
  box-shadow: var(--shadow-sm);
}
.direct-answer-box strong { color: var(--navy); }

/* Interactive ZIP Calculator Panel */
.calc-card {
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
}
.calc-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.calc-input {
  flex: 1 1 240px;
  min-height: 52px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 2px solid #334E68;
  background: #162B40;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 600;
}
.calc-input::placeholder { color: #94A3B8; }
.calc-input:focus { outline: none; border-color: #38BDF8; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.98rem;
  border: none;
  cursor: pointer;
  text-decoration: none !important;
  transition: transform 0.12s ease, background 0.15s ease;
}
.btn-primary { background: #0369a1; color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-emerald { background: #047857; color: #fff; }
.btn-emerald:hover { background: #065F46; color: #fff; }
.btn-outline { background: transparent; border: 2px solid var(--border-strong); color: var(--navy); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.quick-zips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 0.85rem;
  color: #CBD5E1;
}
.zip-pill {
  background: rgba(255, 255, 255, 0.1);
  color: #F8FAFC;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 8px 13px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}
.zip-pill:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Dynamic Result Report Card */
.report-result {
  margin-top: 22px;
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-md);
  padding: 24px;
  border: 1px solid var(--border);
}
.report-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  padding-bottom: 18px;
  margin-bottom: 20px;
}
.grade-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  min-height: 88px;
  border-radius: var(--radius-md);
  font-weight: 900;
  padding: 10px 16px;
  text-align: center;
}
.grade-badge .letter { font-size: 2.35rem; line-height: 1; }
.grade-badge .sub { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 4px; }
.grade-a, .grade-b { background: var(--emerald-soft); color: #065F46; border: 2px solid var(--emerald); }
.grade-c { background: var(--amber-soft); color: #92400E; border: 2px solid var(--amber); }
.grade-d, .grade-f { background: var(--coral-soft); color: #991B1B; border: 2px solid var(--coral); }

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.metric-box {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.metric-label { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); }
.metric-val { font-size: 1.55rem; font-weight: 850; color: var(--navy); margin: 4px 0; }
.metric-limit { font-size: 0.82rem; color: var(--text-muted); }
.status-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}
.status-warn { background: var(--coral-soft); color: #b91c1c; }
.status-caution { background: var(--amber-soft); color: #92400e; }
.status-ok { background: var(--emerald-soft); color: var(--emerald); }

/* V2 Visual-First Educational Card (#homeowner-math.edu-callout) */
#homeowner-math.edu-callout {
  background: var(--surface);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin: 36px 0;
  box-shadow: var(--shadow-md);
}
.edu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.edu-kicker {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-dark);
  background: var(--accent-soft);
  padding: 5px 11px;
  border-radius: 999px;
}
.edu-title {
  font-size: 1.45rem;
  font-weight: 850;
  margin: 6px 0 0;
  color: var(--navy);
}
.edu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.edu-col {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px 20px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.edu-col.winner {
  background: #F0FDF4;
  border: 2px solid var(--emerald);
  position: relative;
}
.edu-pill {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.edu-pill.bad { background: var(--coral-soft); color: var(--coral); }
.edu-pill.mid { background: var(--amber-soft); color: var(--amber); }
.edu-pill.good { background: var(--emerald-soft); color: #065F46; }
.edu-giant {
  font-size: clamp(1.85rem, 3vw, 2.45rem);
  font-weight: 900;
  line-height: 1.05;
  color: var(--navy);
  letter-spacing: -0.03em;
  margin: 4px 0 8px;
}
.edu-sub {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}
.edu-bullets {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.edu-bullets li { margin-bottom: 6px; padding-left: 18px; position: relative; }
.edu-bullets li::before { content: "•"; position: absolute; left: 4px; font-weight: 900; color: var(--accent); }

/* Sections, Cards & Tables */
.section { padding: 48px 0; border-bottom: 1px solid var(--border); }
.section-title { font-size: clamp(1.5rem, 2.6vw, 2.05rem); font-weight: 850; color: var(--navy); margin: 0 0 10px; letter-spacing: -0.02em; }
.section-lead { color: var(--text-muted); font-size: 1.05rem; margin: 0 0 28px; max-width: 780px; }

.cards-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}
.product-card.featured { border: 2px solid var(--accent); }
.product-tag {
  display: inline-block;
  align-self: flex-start;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.product-title { font-size: 1.25rem; font-weight: 800; margin: 0 0 6px; color: var(--navy); }
.product-price { font-size: 1.35rem; font-weight: 850; color: var(--emerald); margin-bottom: 12px; }
.spec-list { padding-left: 18px; margin: 0 0 20px; color: var(--text-muted); font-size: 0.92rem; }
.spec-list li { margin-bottom: 6px; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); }
table { width: 100%; border-collapse: collapse; min-width: 620px; }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.93rem; }
th { background: var(--surface-alt); font-weight: 800; color: var(--navy); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.03em; }
tr:last-child td { border-bottom: none; }

/* Continuity & Dealer Callout Boxes */
.split-engines {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}
.engine-box {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}
.form-row { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.input-field, .select-field {
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.96rem;
  width: 100%;
  background: #fff;
}

/* Footer */
.site-footer {
  background: var(--navy);
  color: #CBD5E1;
  padding: 48px 0 36px;
  font-size: 0.9rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 28px;
  margin-bottom: 32px;
}
.site-footer h4, .site-footer .footer-heading { color: #fff; margin: 0 0 12px; font-size: 0.95rem; font-weight: 700; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: #CBD5E1; min-height: 44px; display: inline-flex; align-items: center; }
.site-footer a:hover { color: #38BDF8; }
.legal-bar { border-top: 1px solid #243B53; padding-top: 22px; font-size: 0.82rem; color: #94A3B8; }

@media (max-width: 860px) {
  .edu-grid { grid-template-columns: 1fr; }
  .nav-bar { padding: 10px 0; }
  .calc-card { padding: 20px; }
}
