/* ==========================================================================
   American Homes Online — Design System
   Hand-authored CSS. No build step required.
   Sections: 1 Tokens · 2 Reset · 3 Layout · 4 Typography · 5 Components
             6 Header/Nav · 7 Footer · 8 Forms · 9 Utilities · 10 Responsive
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  /* Brand — deep navy, civic blue, flag red used sparingly */
  --ink-950: #061322;
  --ink-900: #0a2240;
  --ink-800: #11314f;
  --ink-700: #1b4467;
  --ink-600: #2a5a82;

  --blue-700: #15497c;
  --blue-600: #1d64ad;
  --blue-500: #2b7fd4;
  --blue-100: #dbeafe;
  --blue-50: #eff6ff;

  --red-700: #9e0c24;
  --red-600: #c8102e;
  --red-500: #e02844;
  --red-50: #fef2f3;

  --sand-50: #faf8f4;
  --sand-100: #f4efe6;
  --sand-200: #e9e1d3;

  --slate-900: #16202c;
  --slate-700: #3c4b5c;
  --slate-600: #55677b;
  --slate-500: #71859a;
  --slate-400: #9aabbd;
  --slate-300: #c6d2de;
  --slate-200: #e2e9f0;
  --slate-100: #f1f5f9;
  --white: #ffffff;

  --green-600: #15803d;
  --green-50: #f0fdf4;
  --amber-600: #b45309;
  --amber-50: #fffbeb;

  /* Typography */
  --font-display: "Sora", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;

  /* Spacing scale */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;
  --sp-9: 6rem;

  /* Radii + shadows */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-full: 999px;

  --sh-xs: 0 1px 2px rgba(10, 34, 64, 0.06);
  --sh-sm: 0 2px 8px rgba(10, 34, 64, 0.07);
  --sh-md: 0 8px 24px -8px rgba(10, 34, 64, 0.16);
  --sh-lg: 0 20px 48px -16px rgba(10, 34, 64, 0.24);
  --sh-xl: 0 32px 72px -24px rgba(10, 34, 64, 0.3);

  --maxw: 1200px;
  --maxw-wide: 1360px;
  --maxw-prose: 760px;

  --header-h: 72px;
}

/* ---------- 2. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--slate-700);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg, video { max-width: 100%; display: block; height: auto; }

/* Inline icons sitting directly in text need an intrinsic size. Kept at low
   specificity so every component rule below still wins. */
h1 > svg, h2 > svg, h3 > svg, h4 > svg, p > svg, li > svg, span > svg,
dt > svg, dd > svg, summary > svg, label > svg, strong > svg {
  width: 1.1em;
  height: 1.1em;
  flex: none;
  display: inline-block;
  vertical-align: -0.15em;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { margin: 0; padding: 0; }
table { border-collapse: collapse; width: 100%; }
hr { border: 0; border-top: 1px solid var(--slate-200); margin: var(--sp-6) 0; }
::selection { background: var(--blue-600); color: #fff; }

/* Accessible focus ring — visible on every interactive element */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--blue-500);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: -60px;
  z-index: 200;
  background: var(--ink-900);
  color: #fff;
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-md);
  font-weight: 600;
  transition: top 0.2s ease;
}
.skip-link:focus { top: var(--sp-4); text-decoration: none; }

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

/* ---------- 3. Layout ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--sp-5); }
.wrap-wide { max-width: var(--maxw-wide); }
.wrap-prose { max-width: var(--maxw-prose); }

.section { padding-block: var(--sp-8); }
.section-lg { padding-block: var(--sp-9); }
.section-sm { padding-block: var(--sp-7); }
.bg-sand { background: var(--sand-50); }
.bg-slate { background: var(--slate-100); }
.bg-ink { background: var(--ink-900); color: var(--slate-300); }
.bg-ink h1, .bg-ink h2, .bg-ink h3, .bg-ink h4 { color: #fff; }
.bg-white { background: var(--white); }

.grid { display: grid; gap: var(--sp-5); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.g-sidebar { grid-template-columns: minmax(0, 1fr) 320px; gap: var(--sp-7); }
.g-split { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-7); align-items: center; }

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.gap-5 { gap: var(--sp-5); }

/* ---------- 4. Typography ---------- */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  color: var(--ink-900);
  line-height: 1.18;
  margin: 0 0 var(--sp-4);
  letter-spacing: -0.02em;
  font-weight: 700;
}
h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.65rem, 3vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 1.8vw, 1.5rem); }
h4 { font-size: 1.0625rem; }
p { margin: 0 0 var(--sp-4); }
p:last-child { margin-bottom: 0; }

.lede { font-size: 1.1875rem; line-height: 1.6; color: var(--slate-600); }
.small { font-size: 0.875rem; }
.xs { font-size: 0.8125rem; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.bold { font-weight: 700; }
.semi { font-weight: 600; }
.center { text-align: center; }
.muted { color: var(--slate-500); }
.on-dark { color: var(--slate-300); }
.on-dark-muted { color: var(--slate-400); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue-600);
  margin-bottom: var(--sp-3);
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  background: var(--red-600);
  border-radius: 2px;
}
.eyebrow-light { color: var(--blue-100); }

.section-head { max-width: 720px; margin-bottom: var(--sp-6); }
.section-head.center { margin-inline: auto; }

/* Prose blocks for legal + article pages */
.prose { font-size: 1.0425rem; }
.prose h2 { font-size: 1.5rem; margin-top: var(--sp-7); scroll-margin-top: 100px; }
.prose h3 { font-size: 1.1875rem; margin-top: var(--sp-5); }
.prose h2:first-child, .prose h3:first-child { margin-top: 0; }
.prose ul, .prose ol { margin: 0 0 var(--sp-4); padding-left: 1.3rem; }
.prose li { margin-bottom: var(--sp-2); }
.prose ul li { list-style: none; position: relative; padding-left: var(--sp-4); }
.prose ul li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.62em;
  width: 7px; height: 7px;
  border-radius: 2px;
  background: var(--blue-500);
}
.prose ol { list-style: decimal; }
.prose ol li { list-style: decimal; }
.prose a { font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
.prose strong { color: var(--ink-900); }
.prose table { margin-bottom: var(--sp-5); }

/* ---------- 5. Components ---------- */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1;
  padding: 0.84rem 1.4rem;
  border-radius: var(--r-md);
  border: 1.5px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 17px; height: 17px; flex: none; }

.btn-primary { background: var(--blue-600); color: #fff; box-shadow: var(--sh-sm); }
.btn-primary:hover { background: var(--blue-700); box-shadow: var(--sh-md); color: #fff; }

.btn-red { background: var(--red-600); color: #fff; box-shadow: var(--sh-sm); }
.btn-red:hover { background: var(--red-700); box-shadow: var(--sh-md); color: #fff; }

.btn-ink { background: var(--ink-900); color: #fff; }
.btn-ink:hover { background: var(--ink-800); color: #fff; box-shadow: var(--sh-md); }

.btn-outline { border-color: var(--slate-300); color: var(--ink-900); background: #fff; }
.btn-outline:hover { border-color: var(--blue-600); color: var(--blue-700); background: var(--blue-50); }

.btn-ghost-light { border-color: rgba(255, 255, 255, 0.35); color: #fff; }
.btn-ghost-light:hover { background: rgba(255, 255, 255, 0.12); border-color: #fff; color: #fff; }

.btn-white { background: #fff; color: var(--ink-900); }
.btn-white:hover { background: var(--sand-100); color: var(--ink-900); box-shadow: var(--sh-md); }

.btn-sm { padding: 0.58rem 1rem; font-size: 0.875rem; }
.btn-lg { padding: 1.02rem 1.85rem; font-size: 1rem; }
.btn-block { width: 100%; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-weight: 600;
  font-size: 0.9375rem;
}
.link-arrow svg { width: 16px; height: 16px; transition: transform 0.2s ease; }
.link-arrow:hover { text-decoration: none; }
.link-arrow:hover svg { transform: translateX(4px); }

/* Badges / pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.3rem 0.6rem;
  border-radius: var(--r-sm);
  background: var(--slate-100);
  color: var(--slate-700);
  white-space: nowrap;
}
.badge-new { background: var(--green-50); color: var(--green-600); }
.badge-open { background: var(--blue-50); color: var(--blue-700); }
.badge-hot { background: var(--red-50); color: var(--red-700); }
.badge-cut { background: var(--amber-50); color: var(--amber-600); }
.badge-dark { background: rgba(6, 19, 34, 0.78); color: #fff; backdrop-filter: blur(4px); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0.42rem 0.9rem;
  border-radius: var(--r-full);
  background: var(--slate-100);
  color: var(--slate-700);
  font-size: 0.8125rem;
  font-weight: 500;
}
.pill-light { background: rgba(255, 255, 255, 0.12); color: #fff; }

/* Cards */
.card {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.card-lift:hover {
  transform: translateY(-5px);
  box-shadow: var(--sh-lg);
  border-color: var(--slate-300);
}
.card-flat { box-shadow: none; }
.card-pad-lg { padding: var(--sp-6); }

.icon-box {
  width: 48px; height: 48px;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  background: var(--blue-50);
  color: var(--blue-600);
  margin-bottom: var(--sp-4);
  flex: none;
}
.icon-box svg { width: 23px; height: 23px; }
.icon-box-red { background: var(--red-50); color: var(--red-600); }
.icon-box-sand { background: var(--sand-100); color: var(--amber-600); }
.icon-box-green { background: var(--green-50); color: var(--green-600); }
.icon-box-ink { background: var(--ink-900); color: #fff; }
.icon-box-sm { width: 38px; height: 38px; border-radius: var(--r-sm); margin-bottom: 0; }
.icon-box-sm svg { width: 18px; height: 18px; }

/* Property listing card */
.listing {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.listing:hover { transform: translateY(-5px); box-shadow: var(--sh-lg); }
.listing-media { position: relative; aspect-ratio: 4 / 3; background: var(--slate-200); overflow: hidden; }
.listing-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.listing:hover .listing-media img { transform: scale(1.05); }
.listing-tags { position: absolute; top: var(--sp-3); left: var(--sp-3); display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.listing-fav {
  position: absolute;
  top: var(--sp-3); right: var(--sp-3);
  width: 36px; height: 36px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.92);
  display: grid; place-items: center;
  color: var(--slate-600);
  box-shadow: var(--sh-sm);
  transition: color 0.2s ease, transform 0.2s ease;
}
.listing-fav:hover { transform: scale(1.1); color: var(--red-600); }
.listing-fav svg { width: 18px; height: 18px; }
.listing-fav[aria-pressed="true"] { color: var(--red-600); }
.listing-fav[aria-pressed="true"] svg { fill: currentColor; }
.listing-body { padding: var(--sp-4) var(--sp-5) var(--sp-5); display: flex; flex-direction: column; flex: 1; }
.listing-price { font-family: var(--font-display); font-size: 1.375rem; font-weight: 700; color: var(--ink-900); letter-spacing: -0.02em; }
.listing-addr { font-size: 0.9375rem; color: var(--slate-600); margin-top: var(--sp-1); }
.listing-city { font-size: 0.8125rem; color: var(--slate-500); }
.listing-facts {
  display: flex;
  gap: var(--sp-4);
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--slate-200);
  font-size: 0.875rem;
  color: var(--slate-700);
  flex-wrap: wrap;
}
.listing-facts span { display: inline-flex; align-items: center; gap: 0.3rem; }
.listing-facts svg { width: 16px; height: 16px; color: var(--slate-400); }
.listing-foot {
  margin-top: var(--sp-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}

/* Stat blocks */
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-5); }
.stat-val {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  font-weight: 700;
  color: var(--ink-900);
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.stat-lab { font-size: 0.8125rem; color: var(--slate-500); margin-top: var(--sp-1); }
.bg-ink .stat-val { color: #fff; }
.bg-ink .stat-lab { color: var(--slate-400); }

/* Roofline divider — signature motif */
.roofline {
  height: 10px;
  width: 100%;
  background-image: linear-gradient(135deg, var(--ink-900) 25%, transparent 25%),
                    linear-gradient(225deg, var(--ink-900) 25%, transparent 25%);
  background-size: 20px 20px;
  background-position: 0 0;
  opacity: 0.12;
}
.rule-accent {
  width: 56px; height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--red-600), var(--blue-600));
  margin-bottom: var(--sp-4);
}

/* Hero */
.hero { position: relative; color: #fff; overflow: hidden; background: var(--ink-950); }
.hero-bg { position: absolute; inset: 0; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.hero-bg::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(105deg, rgba(6, 19, 34, 0.94) 0%, rgba(10, 34, 64, 0.86) 45%, rgba(10, 34, 64, 0.55) 100%);
}
.hero-inner { position: relative; padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.hero h1 { color: #fff; max-width: 15ch; }
.hero .lede { color: rgba(255, 255, 255, 0.84); max-width: 54ch; }

.page-hero { background: var(--ink-900); color: #fff; padding-block: var(--sp-7); position: relative; overflow: hidden; }
.page-hero::after {
  content: "";
  position: absolute;
  right: -80px; top: -80px;
  width: 340px; height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(43, 127, 212, 0.3), transparent 70%);
}
.page-hero h1 { color: #fff; margin-bottom: var(--sp-3); }
.page-hero .lede { color: rgba(255, 255, 255, 0.8); max-width: 62ch; }

.breadcrumb { display: flex; flex-wrap: wrap; gap: var(--sp-2); font-size: 0.8125rem; margin-bottom: var(--sp-4); color: rgba(255, 255, 255, 0.6); }
.breadcrumb a { color: rgba(255, 255, 255, 0.85); }
.breadcrumb li { list-style: none; display: inline-flex; gap: var(--sp-2); align-items: center; }
.breadcrumb li + li::before { content: "/"; color: rgba(255, 255, 255, 0.4); }

/* Search panel */
.search-panel {
  background: #fff;
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xl);
  padding: var(--sp-5);
  color: var(--slate-700);
}
.search-tabs { display: flex; gap: var(--sp-1); border-bottom: 1px solid var(--slate-200); margin-bottom: var(--sp-4); }
.search-tab {
  padding: 0.6rem 1.1rem;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--slate-500);
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.search-tab[aria-selected="true"] { color: var(--ink-900); border-bottom-color: var(--red-600); }
.search-tab:hover { color: var(--ink-900); }
.search-row { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: var(--sp-3); align-items: end; }

/* Steps / timeline */
.steps { counter-reset: step; display: grid; gap: var(--sp-5); }
.step { position: relative; padding-left: 68px; }
.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0; top: 0;
  width: 48px; height: 48px;
  border-radius: var(--r-md);
  background: var(--ink-900);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  display: grid; place-items: center;
}
.step h3 { margin-bottom: var(--sp-2); }

.timeline { position: relative; padding-left: var(--sp-6); }
.timeline::before {
  content: "";
  position: absolute;
  left: 7px; top: 8px; bottom: 8px;
  width: 2px;
  background: linear-gradient(var(--blue-500), var(--slate-200));
}
.timeline-item { position: relative; padding-bottom: var(--sp-6); }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--sp-6) + 1px);
  top: 7px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--blue-600);
}
.timeline-item h3 { font-size: 1.125rem; margin-bottom: var(--sp-1); }

/* Metro / city card */
.city-card {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  aspect-ratio: 3 / 4;
  display: block;
  color: #fff;
}
.city-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.city-card::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(6, 19, 34, 0.92) 0%, rgba(6, 19, 34, 0.25) 55%, transparent 100%);
}
.city-card:hover { text-decoration: none; }
.city-card:hover img { transform: scale(1.07); }
.city-body { position: absolute; inset: auto 0 0 0; padding: var(--sp-4); z-index: 1; }
.city-body h3 { color: #fff; font-size: 1.125rem; margin-bottom: 2px; }
.city-meta { font-size: 0.8125rem; color: rgba(255, 255, 255, 0.78); }
.city-delta { font-size: 0.75rem; font-weight: 700; }
.up { color: #6ee7a0; }
.down { color: #fda4af; }

/* Agent card */
.agent-card { text-align: center; }
.agent-photo {
  width: 104px; height: 104px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto var(--sp-4);
  border: 4px solid var(--white);
  box-shadow: var(--sh-md);
}
.agent-card h3 { font-size: 1.0625rem; margin-bottom: 2px; }
.stars { display: inline-flex; gap: 2px; color: var(--amber-600); }
.stars svg { width: 15px; height: 15px; fill: currentColor; }

/* Testimonial */
.quote-card { background: #fff; border: 1px solid var(--slate-200); border-radius: var(--r-lg); padding: var(--sp-6); }
.quote-card blockquote { margin: 0 0 var(--sp-5); font-size: 1.0625rem; color: var(--slate-700); }
.quote-who { display: flex; align-items: center; gap: var(--sp-3); }
.quote-who img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }

/* Accordion */
.acc-item { border-bottom: 1px solid var(--slate-200); }
.acc-item summary {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--sp-4);
  padding: var(--sp-4) 0;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.0425rem;
  color: var(--ink-900);
  list-style: none;
}
.acc-item summary::-webkit-details-marker { display: none; }
.acc-item summary::after {
  content: "";
  flex: none;
  width: 11px; height: 11px;
  margin-top: 7px;
  border-right: 2.5px solid var(--blue-600);
  border-bottom: 2.5px solid var(--blue-600);
  transform: rotate(45deg);
  transition: transform 0.25s ease;
}
.acc-item[open] summary::after { transform: rotate(-135deg); }
.acc-body { padding-bottom: var(--sp-5); color: var(--slate-600); }
.acc-body p + p { margin-top: var(--sp-3); }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--slate-200); border-radius: var(--r-lg); background: #fff; }
.tbl { font-size: 0.9375rem; min-width: 620px; }
.tbl th, .tbl td { padding: 0.85rem 1.1rem; text-align: left; border-bottom: 1px solid var(--slate-200); }
.tbl th {
  background: var(--slate-100);
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-900);
  white-space: nowrap;
}
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--sand-50); }
.tbl td.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* Callouts */
.note {
  border-left: 4px solid var(--blue-600);
  background: var(--blue-50);
  padding: var(--sp-4) var(--sp-5);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  font-size: 0.9375rem;
  color: var(--ink-800);
}
.note-warn { border-left-color: var(--amber-600); background: var(--amber-50); }
.note-legal { border-left-color: var(--slate-400); background: var(--slate-100); color: var(--slate-700); }

.checklist li {
  list-style: none;
  position: relative;
  padding-left: 32px;
  margin-bottom: var(--sp-3);
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 0; top: 4px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--green-50);
  border: 1.5px solid var(--green-600);
}
.checklist li::after {
  content: "";
  position: absolute;
  left: 6px; top: 10px;
  width: 7px; height: 4px;
  border-left: 2px solid var(--green-600);
  border-bottom: 2px solid var(--green-600);
  transform: rotate(-45deg);
}

/* CTA band */
.cta-band {
  background: linear-gradient(120deg, var(--ink-950) 0%, var(--ink-800) 55%, var(--blue-700) 100%);
  color: #fff;
  border-radius: var(--r-xl);
  padding: clamp(2rem, 4vw, 3.4rem);
  position: relative;
  overflow: hidden;
}
.cta-band::before {
  content: "";
  position: absolute;
  inset: auto -60px -120px auto;
  right: -60px;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 16, 46, 0.35), transparent 68%);
}
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255, 255, 255, 0.82); }
.cta-inner { position: relative; z-index: 1; }

/* Equal Housing mark */
.eho-mark { display: inline-flex; align-items: center; gap: var(--sp-3); }
.eho-mark svg { width: 34px; height: 34px; flex: none; }

/* Table of contents (legal pages) */
.toc { position: sticky; top: calc(var(--header-h) + 20px); }
.toc ul li { list-style: none; }
.toc a {
  display: block;
  padding: 0.4rem 0 0.4rem var(--sp-4);
  border-left: 2px solid var(--slate-200);
  font-size: 0.875rem;
  color: var(--slate-600);
}
.toc a:hover, .toc a.active {
  color: var(--blue-700);
  border-left-color: var(--blue-600);
  font-weight: 600;
  text-decoration: none;
}

/* Mortgage calculator */
.calc-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--sp-6); align-items: start; }
.calc-out {
  background: var(--ink-900);
  color: #fff;
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  position: sticky;
  top: calc(var(--header-h) + 20px);
}
.calc-total { font-family: var(--font-display); font-size: 2.6rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1; color: #fff; }
.calc-break { margin-top: var(--sp-5); display: grid; gap: var(--sp-3); }
.calc-line { display: flex; align-items: center; justify-content: space-between; font-size: 0.9375rem; gap: var(--sp-3); }
.calc-line .k { display: inline-flex; align-items: center; gap: var(--sp-2); color: var(--slate-300); }
.calc-line .v { font-family: var(--font-mono); font-weight: 500; color: #fff; }
.swatch { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.calc-donut { display: grid; place-items: center; margin-bottom: var(--sp-5); }

.range-row { display: flex; align-items: center; gap: var(--sp-4); }
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--slate-200);
  outline-offset: 6px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--blue-600);
  border: 3px solid #fff;
  box-shadow: var(--sh-sm);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--blue-600);
  border: 3px solid #fff;
  cursor: pointer;
}

/* ---------- 6. Header / Nav ---------- */
.utility-bar {
  background: var(--ink-950);
  color: var(--slate-400);
  font-size: 0.8125rem;
}
.utility-bar .wrap { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-4); min-height: 38px; flex-wrap: wrap; }
.utility-bar a { color: var(--slate-300); }
.utility-bar a:hover { color: #fff; }
.utility-list { display: flex; align-items: center; gap: var(--sp-5); flex-wrap: wrap; }
.utility-list li { list-style: none; display: inline-flex; align-items: center; gap: 0.4rem; }
.utility-list svg { width: 14px; height: 14px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--slate-200);
}
.site-header.scrolled { box-shadow: var(--sh-md); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-5); min-height: var(--header-h); }

.brand { display: inline-flex; align-items: center; gap: var(--sp-3); flex: none; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 40px; height: 40px; flex: none; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--ink-900);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.brand-sub { font-size: 0.6875rem; color: var(--slate-500); letter-spacing: 0.08em; text-transform: uppercase; }

.nav-list { display: flex; align-items: center; gap: var(--sp-1); }
.nav-list li { list-style: none; position: relative; }
.nav-list > li > a, .nav-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.55rem 0.72rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--slate-700);
  border-radius: var(--r-sm);
  transition: color 0.18s ease, background-color 0.18s ease;
}
.nav-list > li > a:hover, .nav-toggle-btn:hover { color: var(--blue-700); background: var(--blue-50); text-decoration: none; }
.nav-list > li > a[aria-current="page"] { color: var(--blue-700); font-weight: 600; }
.nav-caret { width: 12px; height: 12px; transition: transform 0.2s ease; }

.has-menu > .submenu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 248px;
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: var(--r-md);
  box-shadow: var(--sh-lg);
  padding: var(--sp-2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}
.has-menu:hover > .submenu,
.has-menu:focus-within > .submenu { opacity: 1; visibility: visible; transform: translateY(0); }
.submenu li { list-style: none; }
.submenu a {
  display: block;
  padding: 0.56rem 0.75rem;
  border-radius: var(--r-sm);
  font-size: 0.9rem;
  color: var(--slate-700);
}
.submenu a:hover { background: var(--blue-50); color: var(--blue-700); text-decoration: none; }
.submenu .sm-desc { display: block; font-size: 0.75rem; color: var(--slate-500); margin-top: 1px; }

.nav-cta { display: flex; align-items: center; gap: var(--sp-3); flex: none; }
.burger { display: none; width: 44px; height: 44px; border-radius: var(--r-sm); color: var(--ink-900); }
.burger svg { width: 24px; height: 24px; margin-inline: auto; }

.mobile-panel {
  display: none;
  border-top: 1px solid var(--slate-200);
  background: #fff;
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: var(--sp-4) 0 var(--sp-6);
}
.mobile-panel.open { display: block; }
.mobile-panel ul li { list-style: none; }
.mobile-panel > .wrap > ul > li > a,
.mobile-panel .m-group > span {
  display: block;
  padding: 0.72rem 0;
  font-weight: 600;
  color: var(--ink-900);
  border-bottom: 1px solid var(--slate-200);
}
.mobile-panel .m-group ul { padding: var(--sp-2) 0 var(--sp-3) var(--sp-4); }
.mobile-panel .m-group ul a { display: block; padding: 0.45rem 0; font-size: 0.9375rem; color: var(--slate-600); }
.mobile-actions { display: grid; gap: var(--sp-3); margin-top: var(--sp-5); }

/* ---------- 7. Footer ---------- */
.site-footer { background: var(--ink-950); color: var(--slate-400); font-size: 0.9rem; }
.footer-top { padding-block: var(--sp-8) var(--sp-7); }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: var(--sp-6); }
.footer-grid h4 {
  color: #fff;
  font-size: 0.8125rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--sp-4);
}
.footer-grid ul li { list-style: none; margin-bottom: 0.56rem; }
.footer-grid a { color: var(--slate-400); font-size: 0.9rem; }
.footer-grid a:hover { color: #fff; }
.footer-brand .brand-name { color: #fff; }
.footer-brand .brand-sub { color: var(--slate-500); }
.footer-contact li { list-style: none; display: flex; gap: var(--sp-3); margin-bottom: var(--sp-3); align-items: flex-start; }
.footer-contact svg { width: 16px; height: 16px; color: var(--blue-500); flex: none; margin-top: 3px; }
.social { display: flex; gap: var(--sp-2); margin-top: var(--sp-5); }
.social a {
  width: 38px; height: 38px;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.07);
  display: grid; place-items: center;
  color: var(--slate-300);
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.social a:hover { background: var(--blue-600); color: #fff; transform: translateY(-2px); }
.social svg { width: 17px; height: 17px; }

.footer-news {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-block: var(--sp-5);
}
.footer-news .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-5); flex-wrap: wrap; }
.news-form { display: flex; gap: var(--sp-3); flex-wrap: wrap; }
.news-form input {
  min-width: 260px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  padding: 0.78rem 1rem;
  border-radius: var(--r-md);
}
.news-form input::placeholder { color: var(--slate-500); }
.news-form input:focus { border-color: var(--blue-500); background: rgba(255, 255, 255, 0.1); }

.footer-legal { padding-block: var(--sp-5) var(--sp-6); font-size: 0.8125rem; color: var(--slate-500); }
.footer-legal-links { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); margin-bottom: var(--sp-4); }
.footer-legal-links li { list-style: none; }
.footer-legal-links a { color: var(--slate-400); font-size: 0.8125rem; }
.footer-legal p { margin-bottom: var(--sp-3); max-width: 100ch; line-height: 1.6; }
.footer-bottom { display: flex; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; align-items: center; }

/* ---------- 8. Forms ---------- */
.field { display: block; margin-bottom: var(--sp-4); }
.field > label, .label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-900);
  margin-bottom: 0.4rem;
}
.req { color: var(--red-600); }
.input, input[type="text"], input[type="email"], input[type="tel"],
input[type="number"], input[type="search"], select, textarea {
  width: 100%;
  padding: 0.78rem 0.95rem;
  border: 1.5px solid var(--slate-300);
  border-radius: var(--r-md);
  background: #fff;
  font-size: 0.9375rem;
  color: var(--slate-900);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.input:hover, input:hover, select:hover, textarea:hover { border-color: var(--slate-400); }
.input:focus, input:focus, select:focus, textarea:focus {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 4px rgba(43, 127, 212, 0.14);
  outline: none;
}
input[type="range"]:hover, input[type="range"]:focus { box-shadow: none; }
textarea { min-height: 136px; resize: vertical; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2355677b' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 17px;
  padding-right: 2.4rem;
}
.hint { font-size: 0.75rem; color: var(--slate-500); margin-top: 0.35rem; }
.err { font-size: 0.75rem; color: var(--red-600); margin-top: 0.35rem; display: none; font-weight: 500; }
.field.invalid .err { display: block; }
.field.invalid .input, .field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--red-600); }

.input-affix { position: relative; }
.input-affix .affix {
  position: absolute;
  left: 0.95rem; top: 50%;
  transform: translateY(-50%);
  color: var(--slate-500);
  font-size: 0.9375rem;
  pointer-events: none;
}
.input-affix input { padding-left: 2.1rem; }
.input-affix.suffix .affix { left: auto; right: 0.95rem; }
.input-affix.suffix input { padding-left: 0.95rem; padding-right: 2.5rem; }

.check { display: flex; gap: var(--sp-3); align-items: flex-start; margin-bottom: var(--sp-3); font-size: 0.875rem; }
.check input { width: 18px; height: 18px; flex: none; margin-top: 2px; accent-color: var(--blue-600); }
.check label { color: var(--slate-600); }

.form-note {
  font-size: 0.75rem;
  color: var(--slate-500);
  margin-top: var(--sp-3);
  line-height: 1.55;
}
.form-status { display: none; margin-bottom: var(--sp-4); padding: var(--sp-4); border-radius: var(--r-md); font-size: 0.9rem; }
.form-status.ok { display: block; background: var(--green-50); color: var(--green-600); border: 1px solid #bbf7d0; }
.form-status.bad { display: block; background: var(--red-50); color: var(--red-700); border: 1px solid #fecdd3; }

.filter-bar {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  box-shadow: var(--sh-sm);
}
.filter-grid { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr) auto; gap: var(--sp-3); align-items: end; }
.filter-grid .field { margin-bottom: 0; }
.filter-more { display: none; margin-top: var(--sp-4); padding-top: var(--sp-4); border-top: 1px solid var(--slate-200); }
.filter-more.open { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-4); }

.results-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; margin-block: var(--sp-5) var(--sp-5); }
.empty-state { text-align: center; padding: var(--sp-8) var(--sp-5); border: 2px dashed var(--slate-300); border-radius: var(--r-lg); color: var(--slate-500); }

.pager { display: flex; justify-content: center; gap: var(--sp-2); margin-top: var(--sp-7); flex-wrap: wrap; }
.pager button {
  min-width: 42px;
  padding: 0.5rem 0.8rem;
  border: 1.5px solid var(--slate-300);
  border-radius: var(--r-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--slate-700);
  background: #fff;
  transition: all 0.18s ease;
}
.pager button:hover:not(:disabled) { border-color: var(--blue-600); color: var(--blue-700); }
.pager button[aria-current="true"] { background: var(--ink-900); border-color: var(--ink-900); color: #fff; }
.pager button:disabled { opacity: 0.4; cursor: not-allowed; }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  background: rgba(6, 19, 34, 0.72);
  backdrop-filter: blur(3px);
}
.modal.open { display: flex; }
.modal-box {
  background: #fff;
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 880px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--sh-xl);
  position: relative;
}
.modal-close {
  position: absolute;
  top: var(--sp-4); right: var(--sp-4);
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  display: grid; place-items: center;
  color: var(--ink-900);
  box-shadow: var(--sh-sm);
  z-index: 2;
}
.modal-close svg { width: 20px; height: 20px; }
.modal-hero { aspect-ratio: 16 / 9; background: var(--slate-200); }
.modal-hero img { width: 100%; height: 100%; object-fit: cover; }
.modal-body { padding: var(--sp-6); }
body.no-scroll { overflow: hidden; }

/* Article */
.article-card { display: flex; flex-direction: column; overflow: hidden; }
.article-media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--slate-200); }
.article-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.article-card:hover .article-media img { transform: scale(1.05); }
.article-body { padding: var(--sp-5); display: flex; flex-direction: column; flex: 1; }
.article-meta { font-size: 0.75rem; color: var(--slate-500); display: flex; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-3); }
.article-body h3 { font-size: 1.125rem; margin-bottom: var(--sp-2); }
.article-body h3 a { color: var(--ink-900); }
.article-body h3 a:hover { color: var(--blue-700); text-decoration: none; }

.byline { display: flex; align-items: center; gap: var(--sp-3); margin-top: auto; padding-top: var(--sp-4); }
.byline img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }

/* ---------- 9. Utilities ---------- */
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.mt-5 { margin-top: var(--sp-5); }
.mt-6 { margin-top: var(--sp-6); }
.mt-7 { margin-top: var(--sp-7); }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-3 { margin-bottom: var(--sp-3); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-5 { margin-bottom: var(--sp-5); }
.mb-6 { margin-bottom: var(--sp-6); }
.rounded { border-radius: var(--r-lg); }
.rounded-xl { border-radius: var(--r-xl); }
.shadow { box-shadow: var(--sh-md); }
.shadow-lg { box-shadow: var(--sh-lg); }
.overflow-hidden { overflow: hidden; }
.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;
}
.img-cover { width: 100%; height: 100%; object-fit: cover; }
.ratio-43 { aspect-ratio: 4 / 3; }
.ratio-11 { aspect-ratio: 1 / 1; }
.ratio-169 { aspect-ratio: 16 / 9; }
.full-height { height: 100%; }
.hide-mobile { display: initial; }
.hide-desktop { display: none; }

.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- 10. Responsive ---------- */
@media (max-width: 1080px) {
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .calc-grid { grid-template-columns: 1fr; }
  .calc-out { position: static; }
  .filter-grid { grid-template-columns: 1fr 1fr 1fr; }
  .g-sidebar { grid-template-columns: 1fr; }
  .toc { position: static; }
}

@media (max-width: 960px) {
  .nav-list, .nav-cta .btn { display: none; }
  .burger { display: block; }
  .nav-cta { gap: var(--sp-2); }
  .g-4, .g-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-split { grid-template-columns: 1fr; gap: var(--sp-6); }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search-row { grid-template-columns: 1fr 1fr; }
  .search-row .btn { grid-column: 1 / -1; }
  .filter-more.open { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hide-mobile { display: none; }
  .hide-desktop { display: initial; }
}

@media (max-width: 680px) {
  :root { --sp-8: 3rem; --sp-9: 3.75rem; }
  .g-2, .g-3, .g-4, .g-6 { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
  .filter-grid, .filter-more.open { grid-template-columns: 1fr; }
  .search-row { grid-template-columns: 1fr; }
  .utility-bar .utility-list.secondary { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .news-form input { min-width: 0; flex: 1; }
  .news-form { width: 100%; }
  .modal-body { padding: var(--sp-5); }
  .card-pad-lg { padding: var(--sp-5); }
  .step { padding-left: 0; padding-top: 60px; }
  .cta-band { padding: var(--sp-6) var(--sp-5); }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .site-footer, .utility-bar, .mobile-panel, .btn, .modal { display: none !important; }
  body { color: #000; font-size: 11pt; }
  a { text-decoration: underline; }
  .page-hero { background: none; color: #000; }
  .page-hero h1, .page-hero .lede { color: #000; }
}
