:root {
  --navy: #1e3a5f;
  --navy-deep: #14263f;
  --green: #6ba439;
  --green-deep: #4f7f25;
  --cream: #faf8f4;
  --paper: #f5f1e8;
  --ink: #1a1a1a;
  --ink-soft: #4a4a4a;
  --rule: rgba(26,26,26,0.12);
  --gold: #c9922a;
  --gold-light: #f0c96e;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }

/* ============ NAV ============ */
nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250,248,244,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  max-width: 1280px; margin: 0 auto;
  padding: 18px 32px;
  display: flex; align-items: center; justify-content: space-between;
}
.logo {
  font-family: 'Source Serif 4', serif;
  font-size: 22px; font-weight: 600; color: var(--navy);
  letter-spacing: -0.01em;
  text-decoration: none;
}
.logo span { color: var(--green); font-style: italic; }
.nav-links { display: flex; gap: 32px; list-style: none; }
.nav-links a {
  color: var(--ink-soft); font-size: 14px; font-weight: 500;
  text-decoration: none; transition: color 0.15s;
}
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-links a.active { color: var(--navy); }
.nav-cta { display: flex; gap: 12px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 600; text-decoration: none;
  transition: all 0.2s; border: 1px solid transparent;
  cursor: pointer; font-family: inherit;
}
.btn-ghost { color: var(--ink); background: transparent; border-color: var(--rule); }
.btn-ghost:hover { background: var(--ink); color: var(--cream); }
.btn-primary { background: var(--navy); color: var(--cream); }
.btn-primary:hover { background: var(--navy-deep); }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-inner { padding: 16px 20px; }
  .nav-cta .btn-ghost { display: none; }
}

/* ============ FOOTER ============ */
footer {
  background: var(--ink);
  color: rgba(250,248,244,0.7);
  padding: 64px 32px 32px;
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}
footer .footer-brand {
  font-family: 'Source Serif 4', serif;
  font-size: 22px;
  color: var(--cream);
  font-weight: 500;
  margin-bottom: 12px;
}
footer .footer-brand span { color: var(--green); font-style: italic; }
footer .footer-tagline {
  font-size: 14px;
  color: rgba(250,248,244,0.5);
  line-height: 1.6;
  max-width: 280px;
}
footer h4 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(250,248,244,0.5);
  margin-bottom: 16px;
  font-weight: 500;
}
footer ul { list-style: none; }
footer ul li { margin-bottom: 10px; }
footer ul a {
  color: rgba(250,248,244,0.85);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.15s;
}
footer ul a:hover { color: var(--green); }
.footer-bottom {
  border-top: 1px solid rgba(250,248,244,0.1);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  max-width: 1280px;
  margin: 0 auto;
  font-size: 13px;
  color: rgba(250,248,244,0.4);
}
.footer-compliance { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 16px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 1px solid rgba(250,248,244,0.1); }
.eho-badge { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; color: rgba(250,248,244,0.7); flex-shrink: 0; letter-spacing: .04em; text-transform: uppercase; }
.eho-icon { width: 34px; height: 34px; border: 1px solid rgba(250,248,244,0.4); border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; letter-spacing: .04em; color: rgba(250,248,244,0.75); }
.footer-fairhousing { font-size: 11px; line-height: 1.55; color: rgba(250,248,244,0.55); margin: 0; max-width: 720px; }
.footer-legal { font-size: 12px; line-height: 1.7; color: rgba(250,248,244,0.6); display: flex; flex-direction: column; gap: 2px; }
.footer-legal-links a { color: rgba(250,248,244,0.75); text-decoration: underline; }
.footer-legal-links a:hover { color: rgba(250,248,244,1); }
@media (max-width: 768px) { .footer-compliance { flex-direction: column; gap: 12px; } }

@media (max-width: 900px) {
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 500px) {
  .footer-inner { grid-template-columns: 1fr; }
}

/* ============ MOBILE MENU ============ */
.nav-hamburger {
  display: none;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 999px;
  width: 42px;
  height: 42px;
  cursor: pointer;
  padding: 0;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  transition: border-color 0.2s;
}
.nav-hamburger:hover { border-color: var(--ink); }
.nav-hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: all 0.25s;
}
body.drawer-open .nav-hamburger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body.drawer-open .nav-hamburger span:nth-child(2) { opacity: 0; }
body.drawer-open .nav-hamburger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20,38,63,0.5);
  backdrop-filter: blur(2px);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.25s;
}
body.drawer-open .mobile-overlay { display: block; opacity: 1; }
.mobile-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(360px, 88vw);
  background: var(--cream);
  z-index: 999;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  box-shadow: -8px 0 32px rgba(0,0,0,0.12);
}
body.drawer-open .mobile-drawer { transform: translateX(0); }
.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--rule);
  flex-shrink: 0;
}
.mobile-drawer-header .logo {
  font-family: 'Source Serif 4', serif;
  font-size: 19px;
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
}
.mobile-drawer-header .logo span { color: var(--green); font-style: italic; }
.mobile-drawer-close {
  background: transparent;
  border: none;
  font-size: 32px;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
  padding: 0 4px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.15s;
}
.mobile-drawer-close:hover { background: rgba(20,38,63,0.06); }
.mobile-drawer-nav {
  display: flex;
  flex-direction: column;
  padding: 12px 0;
}
.mobile-drawer-nav a {
  padding: 16px 24px;
  font-family: 'Source Serif 4', serif;
  font-size: 22px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: background 0.15s, color 0.15s;
}
.mobile-drawer-nav a:hover,
.mobile-drawer-nav a:active,
.mobile-drawer-nav a.active {
  background: rgba(30,58,95,0.04);
  color: var(--navy);
}
.mobile-drawer-nav a:last-child { border-bottom: none; }
.mobile-drawer-cta {
  padding: 20px 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--rule);
}
.mobile-drawer-cta .btn-block {
  width: 100%;
  justify-content: center;
  padding: 14px 24px;
  font-size: 15px;
}
.mobile-drawer-footer {
  padding: 16px 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-soft);
  border-top: 1px solid var(--rule);
  margin-top: auto;
}
.mobile-drawer-footer a {
  color: var(--navy);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
  align-self: flex-start;
}
.mobile-drawer-footer a:hover { border-color: var(--navy); }
.mobile-drawer-footer span { line-height: 1.5; margin-top: 4px; }
body.drawer-open { overflow: hidden; }
@media (max-width: 768px) {
  .nav-hamburger { display: flex; }
  .nav-cta .btn-ghost,
  .nav-cta .btn-primary { display: none; }
}

/* ============ PAGE / CONTAINER ============ */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

.page-hero {
  padding: 80px 0 60px;
  background: white;
  border-bottom: 1px solid var(--rule);
}
.page-hero .eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}
.page-hero h1 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 600;
  color: var(--navy);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  max-width: 720px;
}
.page-hero p.lead {
  font-size: 18px;
  color: var(--ink-soft);
  line-height: 1.7;
  max-width: 640px;
}

.listings-section { padding: 64px 0 80px; }
.listings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.listing-card {
  background: white;
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}
.listing-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(30,58,95,0.12);
}
.listing-photo {
  aspect-ratio: 16/10;
  background: #ddd;
  background-image: linear-gradient(135deg, #e0e0e0 0%, #c8c8c8 100%);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
}
.listing-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.listing-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: var(--green);
  color: white;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 4px;
}
.listing-badge.open-house {
  background: var(--gold);
  color: var(--navy);
}

.listing-body {
  padding: 24px 28px 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.listing-price {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 30px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.listing-address {
  font-size: 15px;
  color: var(--navy);
  margin-bottom: 4px;
  font-weight: 600;
}
.listing-city {
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 18px;
}
.listing-stats {
  display: flex;
  gap: 18px;
  border-top: 1px solid var(--rule);
  padding-top: 16px;
  font-size: 13px;
  color: var(--navy);
}
.listing-stats > div { display: flex; gap: 4px; }
.listing-stats strong { font-weight: 700; }
.listing-stats span { color: var(--ink-soft); }
.open-house-tag {
  margin-top: 14px;
  font-size: 13px;
  color: var(--gold);
  font-weight: 600;
}

.empty-state {
  text-align: center;
  padding: 80px 24px;
  background: white;
  border: 1px dashed var(--rule);
  border-radius: 12px;
}
.empty-state h3 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 26px;
  font-weight: 500;
  color: var(--navy);
  margin-bottom: 12px;
}
.empty-state p { color: var(--ink-soft); max-width: 460px; margin: 0 auto; }

.bottom-cta {
  background: var(--navy);
  color: white;
  padding: 64px 0;
  text-align: center;
}
.bottom-cta .eyebrow {
  font-family: 'JetBrains Mono', monospace;
  color: var(--gold-light);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.bottom-cta h2 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: clamp(28px, 3.5vw, 36px);
  font-weight: 500;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}
.bottom-cta p {
  color: rgba(255,255,255,0.8);
  max-width: 600px;
  margin: 0 auto 28px;
  font-size: 16px;
}
.bottom-cta a {
  display: inline-block;
  background: var(--gold);
  color: var(--navy);
  padding: 16px 32px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.2s;
}
.bottom-cta a:hover { background: var(--gold-light); }

@media (max-width: 768px) {
  .listings-grid { grid-template-columns: 1fr; }
  .page-hero { padding: 56px 0 40px; }
  .listings-section { padding: 48px 0 64px; }
}

/* ============ HOME — landing-specific additions ============ */
.home-hero {
  position: relative;
  background: var(--navy);
  color: var(--cream);
  padding: 96px 0 88px;
  overflow: hidden;
}
.home-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 400px at 80% -10%, rgba(107,164,57,0.18), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(201,146,42,0.12), transparent 55%);
  pointer-events: none;
}
.home-hero .container { position: relative; z-index: 1; }
.home-hero .eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: 16px;
}
.home-hero h1 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  max-width: 880px;
}
.home-hero h1 em { color: var(--gold-light); font-style: italic; }
.home-hero p.lead {
  font-size: 19px;
  color: rgba(250,248,244,0.82);
  line-height: 1.7;
  max-width: 620px;
  margin-bottom: 32px;
}
.home-hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.home-hero-cta .btn-primary { background: var(--gold); color: var(--navy); padding: 14px 26px; font-size: 15px; }
.home-hero-cta .btn-primary:hover { background: var(--gold-light); }
.home-hero-cta .btn-ghost { color: var(--cream); border-color: rgba(250,248,244,0.4); padding: 14px 26px; font-size: 15px; }
.home-hero-cta .btn-ghost:hover { background: rgba(250,248,244,0.1); color: var(--cream); }

.home-section { padding: 72px 0; }
.home-section.alt { background: white; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.section-head { max-width: 680px; margin-bottom: 40px; }
.section-head .eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 12px;
}
.section-head h2 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 600; color: var(--navy);
  line-height: 1.1; letter-spacing: -0.01em;
  margin-bottom: 14px;
}
.section-head p { font-size: 17px; color: var(--ink-soft); line-height: 1.7; }

.value-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.value-card {
  background: var(--cream);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 28px;
}
.home-section.alt .value-card { background: var(--paper); }
.home-section.alt .home-hero-cta .btn-ghost { color: var(--navy); border-color: var(--navy); }
.home-section.alt .home-hero-cta .btn-ghost:hover { background: var(--navy); color: var(--cream); }
.value-card h3 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 20px; font-weight: 600; color: var(--navy);
  margin-bottom: 10px;
}
.value-card p { font-size: 15px; color: var(--ink-soft); line-height: 1.65; }
@media (max-width: 900px) { .value-grid { grid-template-columns: 1fr; } }

/* ============ WCAG 2.1 AA pass ============ */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--navy, #1e3a5f); color: var(--cream, #faf8f4);
  padding: 10px 16px; z-index: 10000; border-radius: 4px;
  text-decoration: none; font-weight: 600; font-size: 14px;
}
.skip-link:focus { left: 8px; top: 8px; outline: 2px solid #ffffff; outline-offset: 2px; }
*:focus-visible { outline: 2px solid var(--navy, #1e3a5f); outline-offset: 2px; }
::placeholder { color: rgba(74, 74, 74, 0.72); opacity: 1; }
::-webkit-input-placeholder { color: rgba(74, 74, 74, 0.72); }
.nav-hamburger, .nav-toggle, .mobile-toggle, .hamburger { min-width: 44px; min-height: 44px; }
