/* ==========================================================================
   Twin Cities ADU — shared design system
   ========================================================================== */

:root {
  --charcoal: #23272B;
  --charcoal-soft: #2E3338;
  --charcoal-muted: #5B6168;
  --cobalt: #2D6CDF;
  --cobalt-dark: #2456B5;
  --cobalt-tint: #E8F0FD;
  --success: #3F9C6D;
  --success-tint: #E4F4EC;
  --bg: #F4F4F5;
  --white: #FFFFFF;
  --border: #E2E3E6;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;

  --shadow-sm: 0 1px 2px rgba(35, 39, 43, .06), 0 1px 1px rgba(35, 39, 43, .05);
  --shadow-md: 0 10px 28px rgba(35, 39, 43, .09);
  --shadow-lg: 0 24px 55px rgba(35, 39, 43, .16);

  --container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--charcoal);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 .6em;
  color: var(--charcoal);
  letter-spacing: -.01em;
}

h1 { font-size: clamp(2.3rem, 4.4vw, 3.6rem); }
h2 { font-size: clamp(1.8rem, 3.2vw, 2.5rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.05rem; }

@media (max-width: 600px) {
  h1 { font-size: 1.9rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.15rem; }
}

p { margin: 0 0 1em; }
a { color: var(--cobalt); text-decoration: none; }
a:hover { text-decoration: underline; }

ul, ol { padding-left: 1.2em; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--cobalt);
}
.eyebrow.on-dark { color: #8FB4F2; }

.section { padding: 5.5rem 0; }
.section-tight { padding: 3rem 0; }
@media (max-width: 720px) {
  .section { padding: 3.5rem 0; }
}

.section-head { max-width: 680px; margin: 0 0 3rem; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head p { color: var(--charcoal-muted); font-size: 1.08rem; }

.muted { color: var(--charcoal-muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: .85rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: .98rem;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, color .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-lg { padding: 1rem 2rem; font-size: 1.05rem; }
.btn-block { width: 100%; }

.btn-primary { background: var(--cobalt); color: var(--white); box-shadow: 0 8px 20px rgba(45,108,223,.28); }
.btn-primary:hover { background: var(--cobalt-dark); }

.btn-dark { background: var(--charcoal); color: var(--white); }
.btn-dark:hover { background: var(--charcoal-soft); }

.btn-outline { background: transparent; color: var(--charcoal); border-color: var(--border); }
.btn-outline:hover { border-color: var(--charcoal); }

.btn-outline-invert { background: transparent; color: var(--white); border-color: rgba(255,255,255,.4); }
.btn-outline-invert:hover { border-color: var(--white); background: rgba(255,255,255,.08); }

.btn-success { background: var(--success); color: var(--white); }
.btn-success:hover { background: #348059; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: .3rem .7rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 700;
}
.badge-success { background: var(--success-tint); color: var(--success); }
.badge-accent { background: var(--cobalt-tint); color: var(--cobalt-dark); }
.badge-dark { background: rgba(255,255,255,.1); color: var(--white); }
.badge-neutral { background: var(--bg); color: var(--charcoal-muted); border: 1px solid var(--border); }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(244,244,245,.9);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.18rem;
  color: var(--charcoal);
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--charcoal);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brand-mark svg { width: 20px; height: 20px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2.1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--charcoal);
  font-weight: 600;
  font-size: .95rem;
}
.nav-links a:hover { color: var(--cobalt); text-decoration: none; }
.nav-links a.active { color: var(--cobalt); }

.nav-cta { display: flex; align-items: center; gap: .9rem; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--charcoal);
  margin: 5px 0;
  border-radius: 2px;
}

@media (max-width: 900px) {
  .nav-links { position: fixed; top: 76px; left: 0; right: 0; background: var(--white); flex-direction: column; align-items: flex-start; gap: 0; padding: 0 24px; max-height: 0; overflow: hidden; border-bottom: 1px solid var(--border); transition: max-height .25s ease; }
  .nav-links.open { max-height: 420px; padding: 12px 24px 20px; }
  .nav-links li { width: 100%; padding: .7rem 0; border-bottom: 1px solid var(--border); }
  .nav-links li:last-child { border-bottom: none; }
  .nav-toggle { display: block; }
}

/* ---------- Hero ---------- */
.hero {
  background: var(--charcoal);
  color: var(--white);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse 80% 60% at 70% 20%, black 40%, transparent 85%);
}
.hero-inner {
  position: relative;
  padding-top: 5.5rem;
  padding-bottom: 4.5rem;
  display: grid;
  gap: 2rem;
}
.hero h1 { color: var(--white); max-width: 780px; }
.hero-sub { font-size: 1.15rem; color: rgba(255,255,255,.78); max-width: 620px; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: .5rem; }

.hero-stats {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 1px solid rgba(255,255,255,.14);
}
.hero-stat .num { font-family: 'Space Grotesk', sans-serif; font-size: 1.9rem; font-weight: 700; color: var(--white); }
.hero-stat .lbl { font-size: .85rem; color: rgba(255,255,255,.65); margin-top: .2rem; }

@media (max-width: 800px) {
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
}

/* Page (non-home) hero, shorter */
.page-hero { background: var(--charcoal); color: var(--white); position: relative; overflow: hidden; }
.page-hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse 70% 100% at 85% 0%, black 30%, transparent 80%);
}
.page-hero-inner { position: relative; padding-top: 3.6rem; padding-bottom: 3.2rem; }
.page-hero h1 { color: var(--white); margin-bottom: .5rem; }
.page-hero p { color: rgba(255,255,255,.75); max-width: 640px; font-size: 1.05rem; }
.breadcrumb { font-size: .85rem; color: rgba(255,255,255,.55); margin-bottom: 1rem; }
.breadcrumb a { color: rgba(255,255,255,.75); }

@media (max-width: 600px) {
  .hero-inner { padding-top: 3rem; padding-bottom: 2.6rem; gap: 1.5rem; }
  .hero-sub { font-size: 1rem; }
  .page-hero-inner { padding-top: 2.2rem; padding-bottom: 2rem; }
  .page-hero p { font-size: .98rem; }
}

/* ---------- Cards ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 2.2rem; }

.icon-tile {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.3rem;
}
.icon-tile svg { width: 26px; height: 26px; }
.icon-tile.accent { background: var(--cobalt-tint); color: var(--cobalt); }
.icon-tile.success { background: var(--success-tint); color: var(--success); }
.icon-tile.dark { background: var(--charcoal); color: var(--white); }

/* ---------- Dual-flow "For Homeowners / For ADU Builders" ---------- */
.dual-flow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
}
@media (max-width: 820px) {
  .dual-flow { grid-template-columns: 1fr; }
}
.flow-card {
  border-radius: var(--radius-lg);
  padding: 2.6rem;
  position: relative;
  overflow: hidden;
}
.flow-card.homeowner { background: var(--white); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.flow-card.builder { background: var(--charcoal); color: var(--white); }
.flow-card h3 { font-size: 1.6rem; }
.flow-card.builder h3 { color: var(--white); }
.flow-card p.desc { font-size: 1.02rem; margin-bottom: 1.8rem; }
.flow-card.builder p.desc { color: rgba(255,255,255,.75); }
.flow-card.homeowner p.desc { color: var(--charcoal-muted); }
.flow-list { list-style: none; padding: 0; margin: 0 0 1.9rem; display: grid; gap: .6rem; }
.flow-list li { display: flex; gap: .6rem; align-items: flex-start; font-size: .95rem; }
.flow-list svg { flex-shrink: 0; margin-top: 3px; width: 18px; height: 18px; }
.flow-card.homeowner .flow-list svg { color: var(--success); }
.flow-card.builder .flow-list svg { color: #7FD3A6; }

/* ---------- City rule cards (home page preview) ---------- */
.city-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.75rem; }
@media (max-width: 820px) { .city-grid { grid-template-columns: 1fr; } }

.city-card { padding: 2rem; }
.city-card-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.4rem; gap: 1rem; }
.city-card-head h3 { margin: 0; }
.stat-mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.4rem 0 1.6rem; }
.stat-mini { background: var(--bg); border-radius: var(--radius-sm); padding: .85rem 1rem; }
.stat-mini .v { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.15rem; }
.stat-mini .k { font-size: .78rem; color: var(--charcoal-muted); text-transform: uppercase; letter-spacing: .04em; margin-top: .15rem; }

/* ---------- Stats banner (rules pages) ---------- */
.stat-banner { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; margin-top: -2.2rem; position: relative; z-index: 2; }
@media (max-width: 820px) { .stat-banner { grid-template-columns: 1fr 1fr; } }
.stat-box { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-md); padding: 1.4rem 1.3rem; }
.stat-box .v { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.5rem; color: var(--charcoal); }
.stat-box .k { font-size: .82rem; color: var(--charcoal-muted); margin-top: .25rem; }

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } }
.step { position: relative; }
.step-num {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--charcoal); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  margin-bottom: 1rem;
}

/* ---------- Topic / resource chips ---------- */
.topic-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
@media (max-width: 820px) { .topic-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .topic-grid { grid-template-columns: 1fr; } }
.topic-card {
  display: flex; align-items: center; justify-content: space-between; gap: .8rem;
  padding: 1.2rem 1.4rem; background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-md); font-weight: 600; color: var(--charcoal);
  transition: border-color .15s ease, transform .15s ease;
}
.topic-card:hover { border-color: var(--cobalt); transform: translateY(-2px); text-decoration: none; }
.topic-card svg { width: 18px; height: 18px; color: var(--cobalt); flex-shrink: 0; }

/* ---------- City directory grid ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 2.4rem; }
.filter-pill {
  padding: .5rem 1.1rem; border-radius: 999px; border: 1px solid var(--border);
  background: var(--white); color: var(--charcoal); font-size: .88rem; font-weight: 600;
  cursor: pointer; transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.filter-pill:hover { border-color: var(--cobalt); }
.filter-pill.is-active { background: var(--charcoal); border-color: var(--charcoal); color: var(--white); }

.directory-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
@media (max-width: 900px) { .directory-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .directory-grid { grid-template-columns: 1fr; } }

.directory-card { padding: 1.7rem; display: flex; flex-direction: column; gap: 1rem; transition: transform .15s ease, box-shadow .15s ease; }
.directory-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.directory-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .6rem; }
.directory-card-head h4 { margin: 0; font-size: 1.15rem; }
.directory-stats { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.directory-stats .v { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: .98rem; color: var(--charcoal); }
.directory-stats .k { font-size: .72rem; color: var(--charcoal-muted); text-transform: uppercase; letter-spacing: .03em; margin-top: .1rem; }
.directory-card .btn { margin-top: auto; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--white); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 520px; }
th, td { text-align: left; padding: .9rem 1.2rem; border-bottom: 1px solid var(--border); }
thead th { background: var(--charcoal); color: var(--white); font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) { background: var(--bg); }

/* ---------- Callout ---------- */
.callout {
  display: flex; gap: 1rem; align-items: flex-start;
  background: var(--cobalt-tint); border-left: 4px solid var(--cobalt);
  border-radius: var(--radius-sm); padding: 1.2rem 1.4rem; font-size: .93rem; color: var(--charcoal-soft);
}
.callout svg { width: 20px; height: 20px; color: var(--cobalt); flex-shrink: 0; margin-top: 2px; }
.callout a { font-weight: 600; }

/* ---------- FAQ ---------- */
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--white); margin-bottom: .8rem; overflow: hidden; }
.faq-item summary {
  cursor: pointer; list-style: none; padding: 1.15rem 1.4rem; font-weight: 600;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: ""; flex-shrink: 0; width: 10px; height: 10px;
  border-right: 2px solid var(--charcoal-muted); border-bottom: 2px solid var(--charcoal-muted);
  transform: rotate(45deg); transition: transform .2s ease; margin-top: -4px;
}
.faq-item[open] summary::after { transform: rotate(-135deg); margin-top: 4px; }
.faq-item .faq-body { padding: 0 1.4rem 1.3rem; color: var(--charcoal-muted); }

/* ---------- Forms ---------- */
.form-card { padding: 2.4rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: .45rem; margin-bottom: 1.2rem; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: .82rem; font-weight: 700; color: var(--charcoal-soft); text-transform: uppercase; letter-spacing: .03em; }
.field .hint { font-size: .8rem; color: var(--charcoal-muted); font-weight: 400; text-transform: none; letter-spacing: 0; }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], select, textarea {
  font-family: inherit; font-size: 1rem; padding: .8rem 1rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--white); color: var(--charcoal); width: 100%;
}
textarea { resize: vertical; min-height: 100px; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--cobalt); box-shadow: 0 0 0 3px var(--cobalt-tint);
}
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
@media (max-width: 560px) { .check-grid { grid-template-columns: 1fr; } }
.check-row { display: flex; align-items: center; gap: .55rem; font-size: .95rem; }
.check-row input { accent-color: var(--cobalt); width: 17px; height: 17px; flex-shrink: 0; }
.radio-row { display: flex; gap: 1.5rem; }
.consent { display: flex; gap: .7rem; align-items: flex-start; font-size: .88rem; color: var(--charcoal-muted); margin: 1.4rem 0; }
.consent input { accent-color: var(--cobalt); width: 17px; height: 17px; flex-shrink: 0; margin-top: 3px; }

.form-success {
  display: none; text-align: center; padding: 3rem 2rem;
}
.form-success.show { display: block; }
.form-success .icon-tile { margin: 0 auto 1.2rem; }

/* ---------- Pricing cards (contractors) ---------- */
.price-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.75rem; }
@media (max-width: 720px) { .price-grid { grid-template-columns: 1fr; } }
.price-card { padding: 2.2rem; text-align: left; }
.price-card .amount { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 2.6rem; color: var(--charcoal); }
.price-card .amount span { font-size: 1rem; font-weight: 600; color: var(--charcoal-muted); }
.price-card.featured { border: 2px solid var(--success); position: relative; }

/* ---------- CTA banner ---------- */
.cta-banner {
  background: var(--charcoal); color: var(--white); border-radius: var(--radius-lg);
  padding: 3.2rem; text-align: center; position: relative; overflow: hidden;
}
.cta-banner h2 { color: var(--white); }
.cta-banner p { color: rgba(255,255,255,.75); max-width: 520px; margin: 0 auto 1.8rem; }
.cta-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.site-footer { background: var(--charcoal); color: rgba(255,255,255,.65); padding: 4rem 0 2rem; margin-top: 4rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2.5rem; padding-bottom: 3rem; border-bottom: 1px solid rgba(255,255,255,.12); }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand .brand { color: var(--white); margin-bottom: .9rem; }
.footer-brand p { font-size: .92rem; max-width: 320px; }
.footer-col h4 { color: var(--white); font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 1.1rem; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .7rem; }
.footer-col a { color: rgba(255,255,255,.65); font-size: .93rem; }
.footer-col a:hover { color: var(--white); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 1.7rem; font-size: .82rem; flex-wrap: wrap; gap: .8rem; }

/* ---------- Utility ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.75rem; }
@media (max-width: 820px) { .grid-2 { grid-template-columns: 1fr; } }
.split-layout { display: grid; grid-template-columns: 1.7fr 1fr; gap: 2.5rem; align-items: start; }
@media (max-width: 900px) { .split-layout { grid-template-columns: 1fr; } }
.sidebar-list { list-style: none; padding: 0; margin: 0 0 1.6rem; display: grid; gap: 1.1rem; }
.sidebar-list li { display: flex; gap: .9rem; align-items: flex-start; font-size: .92rem; }
.sidebar-num { width: 26px; height: 26px; border-radius: 50%; background: var(--charcoal); color: var(--white); font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: .8rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sticky-side { position: sticky; top: 100px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.75rem; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .grid-3 { grid-template-columns: 1fr; } }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
