:root {
  --navy-950: #0a1628;
  --navy-900: #0f2744;
  --navy-800: #1e3a5f;
  --navy-700: #2d5080;
  --gold-400: #e8c872;
  --gold-500: #c9a227;
  --gold-600: #b8942e;
  --sand-50: #faf9f7;
  --sand-100: #f3f1ec;
  --sand-200: #e8e4dc;
  --ink: #1a1a1a;
  --ink-muted: #5c5c5c;
  --ink-faint: #8a8a8a;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px rgba(15, 39, 68, 0.06);
  --shadow-md: 0 4px 24px rgba(15, 39, 68, 0.08);
  --shadow-lg: 0 12px 48px rgba(15, 39, 68, 0.12);
  --radius: 12px;
  --radius-pill: 999px;
  --font-serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
  --header-h: 72px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--sand-50);
  display: flex;
  flex-direction: column;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--navy-900);
  color: var(--white);
  text-decoration: none;
}

.skip-link:focus { left: 1rem; top: 1rem; }

.demo-banner {
  background: linear-gradient(90deg, var(--navy-900), var(--navy-800));
  color: var(--gold-400);
  text-align: center;
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-bottom: 1px solid rgba(232, 200, 114, 0.25);
}

a { color: var(--navy-800); }
a:hover { color: var(--gold-600); }

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

button, input, select {
  font: inherit;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 249, 247, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--sand-200);
  transition: box-shadow 0.25s ease;
}

.site-header.compact {
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.875rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.brand-mark {
  filter: drop-shadow(0 2px 4px rgba(15, 39, 68, 0.12));
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--navy-900);
}

.brand-tag {
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

.header-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 640px;
}

.header-search.hidden { display: none; }

.search-field {
  flex: 1;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--ink-faint);
  pointer-events: none;
}

.search-field input,
.search-bar input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  border: 1px solid var(--sand-200);
  border-radius: var(--radius-pill);
  background: var(--white);
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-field input:focus,
.search-bar input:focus {
  border-color: var(--navy-700);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.12);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

.nav-link {
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink-muted);
  border-radius: var(--radius-pill);
  transition: background 0.15s, color 0.15s;
}

.nav-link:hover {
  background: var(--sand-100);
  color: var(--navy-900);
}

.nav-btn {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-pill);
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  white-space: nowrap;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: linear-gradient(135deg, var(--navy-800), var(--navy-900));
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  box-shadow: var(--shadow-md);
  background: linear-gradient(135deg, var(--navy-700), var(--navy-800));
}

.btn-secondary {
  background: var(--white);
  color: var(--navy-800);
  border-color: var(--sand-200);
}

.btn-secondary:hover {
  background: var(--sand-100);
  border-color: var(--sand-200);
}

.btn-sm { padding: 0.5rem 1rem; font-size: 0.8125rem; }
.btn-block { width: 100%; }

/* Views */
main { flex: 1; }

.view { display: none; }
.view.active { display: block; }

/* Landing */
.view-landing {
  position: relative;
  min-height: calc(100vh - var(--header-h) - 120px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem 4rem;
}

.view-landing.active {
  display: flex;
}

.landing-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 20%, rgba(232, 200, 114, 0.12), transparent),
    radial-gradient(ellipse 80% 60% at 50% 80%, rgba(30, 58, 95, 0.06), transparent);
  pointer-events: none;
}

.landing-content {
  position: relative;
  width: 100%;
  max-width: 680px;
  text-align: center;
}

.hero-logo {
  margin-bottom: 2rem;
}

.hero-logo img {
  margin: 0 auto 1.25rem;
  filter: drop-shadow(0 8px 24px rgba(15, 39, 68, 0.15));
}

.hero-title {
  margin: 0;
}

.hero-title-main {
  display: block;
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--navy-900);
  line-height: 1.1;
}

.hero-title-sub {
  display: block;
  margin-top: 0.375rem;
  font-family: var(--font-sans);
  font-size: clamp(1rem, 2.5vw, 1.125rem);
  font-weight: 400;
  color: var(--ink-muted);
}

.landing-search {
  margin-bottom: 1.5rem;
}

.search-bar {
  position: relative;
  margin-bottom: 1.25rem;
}

.search-bar input {
  padding: 1rem 1.25rem 1rem 3rem;
  font-size: 1rem;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--sand-200);
}

.search-bar .search-icon {
  left: 1.125rem;
  width: 20px;
  height: 20px;
}

.search-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.quick-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.quick-label {
  font-size: 0.8125rem;
  color: var(--ink-faint);
}

.chip {
  padding: 0.375rem 0.875rem;
  border: 1px solid var(--sand-200);
  border-radius: var(--radius-pill);
  background: var(--white);
  color: var(--navy-800);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.chip:hover {
  border-color: var(--gold-500);
  background: rgba(232, 200, 114, 0.08);
}

.landing-note {
  font-size: 0.8125rem;
  color: var(--ink-faint);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.5;
}

/* Results */
.view-results {
  padding: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.results-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2rem;
  align-items: start;
}

.filters-panel {
  position: sticky;
  top: calc(var(--header-h) + 1rem);
  background: var(--white);
  border: 1px solid var(--sand-200);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.filters-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--navy-900);
}

.filter-group {
  display: block;
  margin-bottom: 1rem;
}

.filter-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  margin-bottom: 0.375rem;
}

.filter-group select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--sand-200);
  border-radius: 8px;
  background: var(--sand-50);
  color: var(--ink);
}

.results-meta {
  margin-bottom: 1rem;
}

.results-count {
  margin: 0;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.results-query {
  margin: 0.25rem 0 0;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--navy-900);
}

.broker-banner {
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, rgba(15, 39, 68, 0.04), rgba(232, 200, 114, 0.08));
  border: 1px solid rgba(201, 162, 39, 0.25);
  border-radius: var(--radius);
}

.broker-banner-content p {
  margin: 0.375rem 0 0;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.broker-banner-name {
  font-family: var(--font-serif);
  font-size: 1.25rem !important;
  font-weight: 600;
  color: var(--navy-900) !important;
  margin-top: 0.5rem !important;
}

.broker-banner-role {
  font-size: 0.8125rem !important;
  color: var(--ink-muted) !important;
}

.broker-banner-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem 0.5rem;
  margin-top: 0.625rem;
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

.broker-banner-contact a {
  font-weight: 500;
}

.broker-badge {
  display: inline-block;
  padding: 0.2rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--navy-900);
  color: var(--gold-400);
  border-radius: var(--radius-pill);
}

.results-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.property-card {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.25rem;
  background: var(--white);
  border: 1px solid var(--sand-200);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}

.property-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.property-image-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--sand-100);
}

.property-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.property-card:hover .property-image-wrap img {
  transform: scale(1.03);
}

.property-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.25rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.95);
  color: var(--navy-900);
  border-radius: var(--radius-pill);
}

.property-body {
  padding: 1.25rem 1.25rem 1.25rem 0;
  display: flex;
  flex-direction: column;
}

.property-price {
  font-family: var(--font-serif);
  font-size: 1.625rem;
  font-weight: 600;
  color: var(--navy-900);
  margin: 0 0 0.25rem;
}

.property-address {
  font-size: 0.9375rem;
  color: var(--ink);
  margin: 0 0 0.75rem;
}

.property-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

.property-stat strong {
  color: var(--ink);
  font-weight: 600;
}

.property-desc {
  font-size: 0.875rem;
  color: var(--ink-muted);
  margin: 0 0 0.875rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.property-broker-strip {
  padding: 0.875rem 1rem;
  margin-bottom: 0.875rem;
  background: linear-gradient(135deg, rgba(15, 39, 68, 0.03), rgba(232, 200, 114, 0.06));
  border: 1px solid rgba(201, 162, 39, 0.2);
  border-radius: 8px;
}

.property-broker-name {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--navy-900);
}

.property-broker-title {
  margin: 0.125rem 0 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-muted);
}

.property-broker-contact {
  margin: 0.375rem 0 0;
  font-size: 0.75rem;
  color: var(--ink-faint);
}

.property-broker-contact a {
  font-weight: 500;
}

.property-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.property-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 0.75rem;
  border-top: 1px solid var(--sand-100);
}

.property-broker-note {
  font-size: 0.75rem;
  color: var(--ink-faint);
}

.property-broker-note a {
  font-weight: 500;
}

.results-disclaimer-inline {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--sand-200);
  font-size: 0.8125rem;
  color: var(--ink-faint);
}

/* Disclaimer page */
.view-disclaimer {
  padding: 2rem 1.5rem 4rem;
  max-width: 720px;
  margin: 0 auto;
}

.legal-doc h1 {
  font-family: var(--font-serif);
  font-size: 2.25rem;
  font-weight: 600;
  color: var(--navy-900);
  margin: 0 0 0.5rem;
}

.legal-lead {
  font-size: 1.0625rem;
  color: var(--ink-muted);
  margin: 0 0 2rem;
}

.legal-doc section {
  margin-bottom: 1.75rem;
}

.legal-doc h2 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--navy-800);
  margin: 0 0 0.5rem;
}

.legal-doc p {
  margin: 0 0 0.75rem;
  color: var(--ink-muted);
  font-size: 0.9375rem;
}

.legal-contact-list {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  color: var(--ink-muted);
  font-size: 0.9375rem;
}

.legal-contact-list li {
  margin-bottom: 0.375rem;
}

.legal-doc .btn { margin-top: 1rem; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--sand-200);
  background: var(--white);
  padding: 1.5rem;
  margin-top: auto;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--navy-900);
  margin-bottom: 0.75rem;
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 0.75rem;
}

.footer-nav a {
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink-muted);
}

.footer-nav a:hover { color: var(--navy-800); }

.footer-legal {
  margin: 0;
  font-size: 0.75rem;
  color: var(--ink-faint);
  max-width: 640px;
  margin-inline: auto;
  line-height: 1.5;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--ink-muted);
}

.empty-state h3 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--navy-900);
  margin: 0 0 0.5rem;
}

/* Responsive */
@media (max-width: 900px) {
  .results-layout {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .filters-panel {
    position: static;
  }

  .property-card {
    grid-template-columns: 1fr;
    border-radius: var(--radius);
  }

  .property-image-wrap {
    aspect-ratio: 16 / 10;
  }

  .property-body {
    padding: 1rem 1.125rem 1.25rem;
  }

  .header-search.hidden {
    display: none !important;
  }

  .header-search:not(.hidden) {
    display: flex !important;
    order: 3;
    width: 100%;
    max-width: none;
    padding: 0 1rem 0.75rem;
  }

  .header-inner {
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
  }

  .header-nav-desktop { display: none; }

  .menu-toggle { display: flex; }

  .view-results {
    padding: 1rem 0 1.5rem;
  }

  .results-main {
    padding: 0 1rem;
  }

  .broker-banner-contact {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .broker-banner-contact span[aria-hidden="true"] {
    display: none;
  }
}

@media (max-width: 600px) {
  .demo-banner {
    font-size: 0.6875rem;
    line-height: 1.45;
    padding: 0.5rem 0.75rem;
  }

  .view-landing {
    padding: 1.5rem 1rem 3rem;
    min-height: auto;
  }

  .hero-logo img {
    width: 72px;
    height: 72px;
  }

  .hero-title-main {
    font-size: 2.25rem;
  }

  .search-bar input {
    font-size: 16px;
    padding: 0.9375rem 1rem 0.9375rem 2.875rem;
  }

  .search-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .search-actions .btn {
    width: 100%;
    min-height: 48px;
  }

  .quick-filters {
    gap: 0.375rem;
  }

  .chip {
    min-height: 40px;
    padding: 0.5rem 1rem;
  }

  .landing-note {
    font-size: 0.75rem;
    padding: 0 0.25rem;
  }

  .property-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .property-actions {
    flex-direction: column;
  }

  .property-actions .btn {
    width: 100%;
    min-height: 48px;
    justify-content: center;
  }

  .property-price {
    font-size: 1.375rem;
  }

  .results-query {
    font-size: 1.25rem;
  }

  .legal-doc h1 {
    font-size: 1.75rem;
  }

  .footer-nav {
    flex-direction: column;
    gap: 0.75rem;
  }

  .site-footer {
    padding: 1.5rem 1rem calc(1.5rem + env(safe-area-inset-bottom));
  }
}

/* Mobile menu */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  margin-left: auto;
  border: 1px solid var(--sand-200);
  border-radius: 12px;
  background: var(--white);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.menu-bar {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  background: var(--navy-900);
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}

.menu-toggle[aria-expanded="true"] .menu-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-bar:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] .menu-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem 1rem 1rem;
  background: var(--white);
  border-bottom: 1px solid var(--sand-200);
  box-shadow: var(--shadow-md);
}

.mobile-nav[hidden] {
  display: none;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--navy-800);
  text-decoration: none;
  border-radius: 12px;
  background: transparent;
  border: none;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  width: 100%;
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav-link:active,
.mobile-nav-link:hover {
  background: var(--sand-50);
}

.mobile-nav-btn {
  color: var(--ink-muted);
}

/* Touch & safe areas */
@supports (padding: env(safe-area-inset-top)) {
  .site-header {
    padding-top: env(safe-area-inset-top);
  }

  body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}

input, select, textarea, .btn {
  -webkit-tap-highlight-color: transparent;
}

.search-field input,
.search-bar input,
.filter-group select {
  font-size: 16px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
