/* =========================================
   WoodburyNest — Main Stylesheet
   Brand: Navy #1a1a2e | Gold #c9a84c | Cream #faf8f3
   Fonts: Cormorant Garamond (headings) | Jost (body)
   ========================================= */

:root {
  --navy: #1a1a2e;
  --gold: #c9a84c;
  --gold-light: #e2c47a;
  --cream: #faf8f3;
  --cream-dark: #f0ece3;
  --white: #ffffff;
  --text-dark: #1a1a2e;
  --text-mid: #4a4a5e;
  --text-light: #8a8a9a;
  --border: #e0dbd0;
  --shadow: 0 4px 24px rgba(26,26,46,0.10);
  --shadow-lg: 0 8px 48px rgba(26,26,46,0.16);
  --radius: 4px;
  --radius-lg: 8px;
  --transition: all 0.25s ease;
}

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

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  font-family: 'Jost', sans-serif;
  background: var(--cream);
  color: var(--text-dark);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100vw;
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  line-height: 1.2;
  color: var(--navy);
}
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.7rem); }
h4 { font-size: 1.15rem; }

p { margin-bottom: 1rem; color: var(--text-mid); }
p:last-child { margin-bottom: 0; }

a { color: var(--gold); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--navy); }

/* ---- Layout ---- */
.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: var(--radius);
  font-family: 'Jost', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
  white-space: nowrap;
}
.btn-primary {
  background: var(--gold);
  color: var(--navy);
  border-color: var(--gold);
}
.btn-primary:hover {
  background: var(--gold-light);
  border-color: var(--gold-light);
  color: var(--navy);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.btn-outline {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}
.btn-outline:hover {
  background: var(--navy);
  color: var(--cream);
}
.btn-outline-light {
  background: transparent;
  color: var(--cream);
  border-color: var(--cream);
}
.btn-outline-light:hover {
  background: var(--cream);
  color: var(--navy);
}
.btn-sm { padding: 10px 22px; font-size: 0.82rem; }

/* ---- Navigation ---- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(250,248,243,0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
.nav.scrolled {
  box-shadow: var(--shadow);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}
.nav-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.02em;
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  text-decoration: none;
  white-space: nowrap;
}
.nav-logo .wordmark { white-space: nowrap; display: block; }
.nav-logo .wordmark span { color: var(--gold); }
.nav-logo:hover { color: var(--navy); }
.nav-logo__tagline {
  font-family: 'Jost', sans-serif;
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  margin-top: 2px;
  white-space: nowrap;
}
.nav-logo__tagline .gold { color: var(--gold); }
.nav-logo-group {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.nav-logo-kw {
  height: 28px;
  width: auto;
  opacity: 1.0;
  flex-shrink: 0;
}
/* Mobile — scale down but keep visible */
@media (max-width: 480px) {
  .nav-logo-kw { height: 18px; opacity: 0.85; }
  .nav-logo { font-size: 1.2rem; }
  .nav-logo__tagline { font-size: 0.56rem; }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}
.nav-links a {
  font-family: 'Jost', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-mid);
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: var(--transition);
}
.nav-links a:hover, .nav-links a.active {
  color: var(--navy);
  background: var(--cream-dark);
}
.nav-cta { margin-left: 8px; }

/* Mobile nav */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}
.nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--navy);
  transition: var(--transition);
  border-radius: 2px;
}
.nav-mobile {
  display: none;
  position: fixed;
  top: 84px; left: 0; right: 0;
  background: var(--cream);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px 24px;
  z-index: 999;
  box-shadow: var(--shadow);
}
.nav-mobile.open { display: block; }
.nav-mobile ul { list-style: none; }
.nav-mobile li { border-bottom: 1px solid var(--border); }
.nav-mobile a {
  display: block;
  padding: 14px 0;
  font-family: 'Jost', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--navy);
  letter-spacing: 0.04em;
}
.nav-mobile .btn { display: block; text-align: center; margin-top: 16px; }

@media (max-width: 900px) {
  .nav-links, .nav-cta { display: none; }
  .nav-hamburger { display: flex; }
}

/* ---- Footer ---- */
footer {
  background: var(--navy);
  color: rgba(250,248,243,0.75);
  padding: 60px 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-brand .wordmark {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 12px;
}
.footer-brand .wordmark span { color: var(--gold); }
.footer-brand p { font-size: 0.88rem; line-height: 1.6; color: rgba(250,248,243,0.65); }

.footer-col h4 {
  font-family: 'Jost', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
}
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul a {
  font-size: 0.88rem;
  color: rgba(250,248,243,0.65);
  transition: var(--transition);
}
.footer-col ul a:hover { color: var(--cream); }
.footer-col address {
  font-style: normal;
  font-size: 0.88rem;
  color: rgba(250,248,243,0.65);
  line-height: 1.8;
}
.footer-col address a { color: rgba(250,248,243,0.65); }
.footer-col address a:hover { color: var(--gold); }

.footer-logos {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.footer-logos img {
  height: 36px;
  width: auto;
  opacity: 0.85;
  filter: brightness(0) invert(1);
}
.footer-logos .kw-logo {
  height: 28px;
  opacity: 0.9;
  filter: brightness(0) invert(1);
}

.footer-bottom {
  padding: 24px 0;
  text-align: center;
}
.footer-bottom p {
  font-size: 0.78rem;
  color: rgba(250,248,243,0.45);
  line-height: 1.7;
  max-width: 820px;
  margin: 0 auto;
}
.footer-bottom a { color: rgba(250,248,243,0.55); }
.footer-bottom a:hover { color: var(--gold); }
.footer-license {
  font-size: 0.82rem;
  color: rgba(250,248,243,0.6);
  margin-top: 8px;
  font-weight: 500;
}

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

/* ---- Hero ---- */
.hero {
  min-height: 92vh;
  display: flex;
  align-items: center;
  background: var(--navy);
  position: relative;
  overflow: hidden;
  padding-top: 84px;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(201,168,76,0.08) 0%, transparent 60%);
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 680px;
}
.hero-eyebrow {
  display: inline-block;
  font-family: 'Jost', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 20px;
  padding: 6px 14px;
  border: 1px solid rgba(201,168,76,0.35);
  border-radius: 2px;
}
.hero h1 {
  color: var(--cream);
  margin-bottom: 24px;
  font-weight: 600;
}
.hero h1 em {
  font-style: italic;
  color: var(--gold);
}
.hero .lead {
  font-size: 1.1rem;
  color: rgba(250,248,243,0.78);
  margin-bottom: 36px;
  line-height: 1.75;
}
.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }

/* ---- Cards ---- */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: var(--transition);
}
.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  border-color: var(--gold);
}
.card-body { padding: 28px; }
.card-icon {
  width: 52px; height: 52px;
  background: rgba(201,168,76,0.1);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  font-size: 1.4rem;
}

/* ---- Grid layouts ---- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

/* ---- Section headers ---- */
.section-header { text-align: center; margin-bottom: 56px; }
.section-header .eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}
.section-header h2 { margin-bottom: 14px; }
.section-header p { max-width: 560px; margin: 0 auto; }

/* ---- Divider ---- */
.divider {
  width: 48px;
  height: 2px;
  background: var(--gold);
  margin: 20px auto;
}
.divider-left { margin-left: 0; }

/* ---- Forms ---- */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-mid);
  margin-bottom: 7px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: 'Jost', sans-serif;
  font-size: 0.95rem;
  color: var(--navy);
  background: var(--white);
  transition: var(--transition);
  -webkit-appearance: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.12);
}
.form-group textarea { resize: vertical; min-height: 120px; }
.form-message {
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-top: 16px;
  display: none;
}
.form-message.success { background: #e8f5e9; color: #2e7d32; display: block; }
.form-message.error { background: #fce4ec; color: #c62828; display: block; }

/* ---- Chatbot ---- */
#chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
}
#chat-toggle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--gold);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(201,168,76,0.45);
  transition: var(--transition);
  color: var(--navy);
  font-size: 1.4rem;
}
#chat-toggle:hover {
  transform: scale(1.06);
  background: var(--gold-light);
}
#chat-box {
  display: none;
  position: absolute;
  bottom: 72px;
  right: 0;
  width: 340px;
  max-height: 480px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  flex-direction: column;
}
#chat-box.open { display: flex; }
.chat-header {
  background: var(--navy);
  color: var(--cream);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.chat-header-info { display: flex; align-items: center; gap: 10px; }
.chat-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}
.chat-header h4 {
  color: var(--cream);
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  margin: 0;
}
.chat-header p { font-size: 0.72rem; color: rgba(250,248,243,0.6); margin: 0; }
.chat-close { background: none; border: none; color: rgba(250,248,243,0.6); cursor: pointer; font-size: 1.1rem; padding: 4px; }
.chat-close:hover { color: var(--cream); }
#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 200px;
}
.chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.5;
}
.chat-msg.bot {
  background: var(--cream-dark);
  color: var(--navy);
  border-radius: 4px 12px 12px 12px;
  align-self: flex-start;
}
.chat-msg.user {
  background: var(--navy);
  color: var(--cream);
  border-radius: 12px 4px 12px 12px;
  align-self: flex-end;
}
.chat-typing { display: flex; gap: 4px; align-items: center; padding: 10px 14px; }
.chat-typing span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--gold);
  animation: typing 1.2s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing { 0%,60%,100% { opacity: 0.2; transform: scale(1); } 30% { opacity: 1; transform: scale(1.2); } }
.chat-input-area {
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
}
.chat-input-area input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-family: 'Jost', sans-serif;
  font-size: 0.88rem;
  color: var(--navy);
}
.chat-input-area input:focus { outline: none; border-color: var(--gold); }
.chat-send {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--gold);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
  font-size: 0.9rem;
  transition: var(--transition);
  flex-shrink: 0;
}
.chat-send:hover { background: var(--navy); color: var(--cream); }

/* ---- Utilities ---- */
.text-center { text-align: center; }
.text-gold { color: var(--gold); }
.text-navy { color: var(--navy); }
.bg-navy { background: var(--navy); }
.bg-cream { background: var(--cream); }
.bg-white { background: var(--white); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 36px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 36px; }
.pt-nav { padding-top: 84px; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 400px; }
th {
  background: var(--navy);
  color: var(--cream);
  font-family: 'Jost', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 16px;
  text-align: left;
}
td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
  color: var(--text-mid);
}
tr:nth-child(even) td { background: rgba(250,248,243,0.5); }
tr:hover td { background: rgba(201,168,76,0.06); }

/* ---- Badge ---- */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.badge-gold { background: rgba(201,168,76,0.15); color: #8a6e2a; }
.badge-navy { background: rgba(26,26,46,0.08); color: var(--navy); }

/* ---- Page hero (interior pages) ---- */
.page-hero {
  background: var(--navy);
  padding: 100px 0 60px;
  text-align: center;
}
.page-hero h1 { color: var(--cream); }
.page-hero .lead { color: rgba(250,248,243,0.72); max-width: 580px; margin: 16px auto 0; }

/* ---- CTA Banner ---- */
.cta-banner {
  background: var(--navy);
  padding: 72px 0;
  text-align: center;
}
.cta-banner h2 { color: var(--cream); margin-bottom: 14px; }
.cta-banner p { color: rgba(250,248,243,0.72); max-width: 520px; margin: 0 auto 32px; }
.cta-banner .btn-row { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ---- KW badge in footer ---- */
.kw-affiliation {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.kw-affiliation img { height: 30px; width: auto; filter: brightness(0) invert(1); opacity: 0.85; }
.kw-affiliation span {
  font-size: 0.78rem;
  color: rgba(250,248,243,0.5);
  line-height: 1.4;
}

/* ---- Fair Housing ---- */
.fair-housing-logos {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.fair-housing-logos img {
  height: 32px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.7;
}

/* ---- Scroll animation ---- */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 480px) {
  .btn { padding: 12px 24px; font-size: 0.85rem; }
  .section { padding: 56px 0; }
  .hero { min-height: 88vh; }
  #chat-box { width: calc(100vw - 48px); right: 0; }
}

/* Market stats grid — 2x2 on mobile */
@media (max-width: 640px) {
  .stats-grid-4 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}
/* Homepage 2-col sections — stack on mobile */
@media (max-width: 700px) {
  .home-split-2 {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
  .home-split-2 > div:last-child {
    text-align: left !important;
  }
}
/* About page grid — single column on mobile */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 48px;
  align-items: start;
}
@media (max-width: 780px) {
  .about-grid {
    grid-template-columns: 1fr !important;
    gap: 32px;
  }
  .about-grid > div:first-child {
    max-width: 260px;
    margin: 0 auto;
  }
}
