/* ============ TOKENS ============ */
:root {
  --navy: #1F3864;
  --navy-deep: #16294a;
  --ivory: #F7F5EF;
  --ivory-dim: #EFEBE0;
  --coral: #D9663B;
  --coral-deep: #C15530;
  --slate: #4A5568;
  --slate-light: #7C889B;
  --line: #E4E0D6;
  --line-dark: rgba(247,245,239,0.16);
  --white: #ffffff;

  --font-display: 'Newsreader', Georgia, serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --radius: 3px;
  --shadow-card: 0 1px 2px rgba(31,56,100,0.06), 0 8px 24px rgba(31,56,100,0.06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--navy-deep);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; margin: 0; color: var(--navy-deep); }
p { margin: 0; line-height: 1.6; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 0.95rem; }

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px;
}

:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}
.btn-coral { background: var(--coral); color: var(--white); }
.btn-coral:hover { background: var(--coral-deep); }
.btn-ghost {
  border-color: var(--line-dark);
  color: var(--ivory);
  background: transparent;
}
.btn-ghost:hover { background: var(--line-dark); }

.link-btn {
  background: none;
  border: none;
  color: var(--slate);
  font-size: 0.85rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
}

/* ============ HEADER ============ */
.site-header {
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--navy);
  background: var(--ivory);
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-family: var(--font-display); font-size: 1.15rem; color: var(--ivory); }
.brand-tag { font-size: 0.68rem; color: var(--slate-light); letter-spacing: 0.03em; text-transform: uppercase; }

.site-nav { display: flex; gap: 32px; }
.site-nav a {
  color: var(--ivory);
  font-size: 0.88rem;
  font-weight: 500;
  opacity: 0.82;
  transition: opacity 0.15s;
}
.site-nav a:hover { opacity: 1; }

.header-cta { white-space: nowrap; }

/* ============ HERO ============ */
.hero {
  background: var(--navy);
  color: var(--ivory);
  padding: 72px 0 0;
  position: relative;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--coral);
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(2.1rem, 4.2vw, 3.2rem);
  line-height: 1.12;
  color: var(--ivory);
  max-width: 15ch;
}
.hero h1 em {
  font-style: italic;
  color: var(--coral);
}
.hero-sub {
  margin-top: 22px;
  max-width: 52ch;
  color: rgba(247,245,239,0.78);
  font-size: 1.02rem;
}

.hero-search {
  margin-top: 36px;
  display: flex;
  align-items: end;
  gap: 14px;
  background: rgba(247,245,239,0.06);
  border: 1px solid var(--line-dark);
  padding: 18px;
  border-radius: var(--radius);
  flex-wrap: wrap;
}
.hs-field { display: flex; flex-direction: column; gap: 6px; }
.hs-field-grow { flex: 1; min-width: 220px; }
.hs-field label {
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--slate-light);
}
.hs-field select, .hs-field input {
  background: var(--ivory);
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 11px 12px;
  color: var(--navy-deep);
  min-width: 160px;
}
.hs-field input { width: 100%; }
.hs-submit { height: 42px; }

.hero-stats {
  display: flex;
  gap: 48px;
  padding: 30px 0 26px;
  border-top: 1px solid var(--line-dark);
  margin-top: 44px;
}
.stat { display: flex; flex-direction: column; }
.stat-num {
  font-family: var(--font-mono);
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--coral);
}
.stat-label {
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--slate-light);
  margin-top: 2px;
}

/* ============ DIRECTORY ============ */
.directory { padding: 72px 0 88px; }
.directory-head { max-width: 60ch; margin-bottom: 40px; }
.directory-head h2 { font-size: 1.9rem; margin-bottom: 10px; }
.directory-sub { color: var(--slate); }

.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}
.filter-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-block { margin-bottom: 4px; }
.filter-block-label {
  display: block;
  font-size: 0.82rem;
  color: var(--navy-deep);
  font-weight: 600;
  margin-bottom: 10px;
}
.filter-block-hint {
  font-weight: 400;
  color: var(--slate-light);
  font-size: 0.78rem;
}
/* ============ STEP WIZARD ============ */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 32px;
}
.step-dot {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.5;
  transition: opacity 0.2s;
}
.step-dot.active, .step-dot.done { opacity: 1; }
.step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--line);
  color: var(--slate);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  transition: background 0.2s, color 0.2s;
}
.step-dot.active .step-num { background: var(--coral); color: var(--white); }
.step-dot.done .step-num { background: var(--navy); color: var(--white); }
.step-label { font-size: 0.82rem; font-weight: 600; color: var(--navy-deep); }
.step-line { width: 40px; height: 1px; background: var(--line); }

.wizard-step-title { font-size: 1.15rem; margin-bottom: 6px; }
.wizard-step-hint { color: var(--slate); font-size: 0.9rem; margin-bottom: 20px; }
.wizard-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.wizard-step:first-child .wizard-actions { justify-content: flex-end; }
.btn-ghost-dark {
  background: none;
  border: 1px solid var(--line);
  color: var(--slate);
  padding: 12px 22px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 600;
}
.btn-ghost-dark:hover { border-color: var(--navy); color: var(--navy-deep); }

.search-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 28px;
}
.search-summary-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: var(--ivory-dim);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 5px 12px;
  font-size: 0.8rem;
  color: var(--navy-deep);
  font-weight: 500;
}

.mode-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}
.mode-btn {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--slate);
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.mode-btn:hover { border-color: var(--navy); color: var(--navy-deep); }
.mode-btn.active { background: var(--navy); border-color: var(--navy); color: var(--ivory); }
.borough-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.submarket-groups {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.submarket-group {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}
.mode-toggle-inline { margin: 0; }
.mode-btn-sm { padding: 6px 12px; font-size: 0.78rem; }
.submarket-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy-deep);
  border-bottom: 1px solid var(--line);
}
.submarket-group-count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--slate-light);
}
.submarket-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 16px;
}
.submarket-option {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  color: var(--navy-deep);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 6px 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.submarket-option:hover { border-color: var(--slate-light); }
.submarket-option:has(input:checked) {
  border-color: var(--coral);
  background: #FBEAE1;
  color: var(--coral-deep);
  font-weight: 500;
}
.submarket-option input { margin: 0; accent-color: var(--coral); }
.pill {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--slate);
  padding: 9px 16px;
  border-radius: 100px;
  font-size: 0.84rem;
  font-weight: 500;
  transition: all 0.15s;
}
.pill:hover { border-color: var(--navy); color: var(--navy-deep); }
.pill.active { background: var(--navy); border-color: var(--navy); color: var(--ivory); }

.filter-controls { display: flex; gap: 12px; flex-wrap: wrap; }
.filter-controls select, .filter-controls input {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--white);
  color: var(--navy-deep);
  min-width: 170px;
}
#filter-text { flex: 1; min-width: 200px; }
.street-grid-label { font-size: 0.78rem; color: var(--slate); align-self: center; white-space: nowrap; }
.street-grid-note { font-size: 0.76rem; color: var(--slate-light); align-self: center; }

.results-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
#results-count {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--slate);
  letter-spacing: 0.02em;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.listing-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s, transform 0.15s;
}
.listing-card:hover {
  box-shadow: 0 2px 4px rgba(31,56,100,0.08), 0 12px 28px rgba(31,56,100,0.1);
  transform: translateY(-2px);
}
.lc-photo {
  display: block;
  width: 100%;
  height: 160px;
  background: var(--line);
  flex-shrink: 0;
  overflow: hidden;
}
.lc-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.lc-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
}
.lc-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.lc-company {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 500;
}
.lc-borough-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 100px;
  white-space: nowrap;
  flex-shrink: 0;
}
.tag-manhattan { background: #E9EEF6; color: var(--navy); }
.tag-brooklyn { background: #FBEAE1; color: var(--coral-deep); }
.tag-queens { background: #EEF0E9; color: #52603C; }

.detail-photo-gallery { margin-bottom: 18px; }
.detail-photo {
  width: 100%;
  height: 260px;
  border-radius: var(--radius);
  background: var(--line);
  object-fit: cover;
  display: block;
}
.detail-photo-link { display: block; }
.detail-photo-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.detail-thumb {
  width: 84px;
  height: 60px;
  border-radius: 6px;
  background: var(--line);
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}
.lc-address { font-size: 0.92rem; color: var(--navy-deep); line-height: 1.45; }
.lc-submarket {
  font-size: 0.78rem;
  color: var(--slate-light);
  font-family: var(--font-mono);
}
.lc-desc { font-size: 0.85rem; color: var(--slate); line-height: 1.5; }
.lc-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.lc-price { font-size: 0.84rem; color: var(--navy-deep); font-weight: 500; }
.lc-inquire {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--coral-deep);
}
.lc-inquire:hover { text-decoration: underline; }

.no-results {
  text-align: center;
  color: var(--slate);
  padding: 60px 0;
}
.no-results a { color: var(--coral-deep); text-decoration: underline; }

/* ============ HOW IT WORKS ============ */
.how { background: var(--ivory-dim); padding: 76px 0; }
.how-inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}
.how-num {
  font-family: var(--font-mono);
  color: var(--coral);
  font-size: 0.85rem;
  font-weight: 600;
}
.how-step h3 { font-size: 1.15rem; margin: 14px 0 10px; }
.how-step p { color: var(--slate); font-size: 0.92rem; }

/* ============ FAQ ============ */
.faq { background: var(--ivory); padding: 76px 0; }
.faq-heading { font-size: 1.9rem; margin-bottom: 32px; text-align: center; }
.faq-list { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  padding: 4px 20px;
}
.faq-item summary {
  padding: 16px 0;
  cursor: pointer;
  font-weight: 600;
  color: var(--navy-deep);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  color: var(--coral);
  font-size: 1.3rem;
  font-weight: 400;
  transition: transform 0.15s;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { color: var(--slate); line-height: 1.65; padding-bottom: 18px; font-size: 0.92rem; }

/* ============ CONTACT ============ */
.contact { background: var(--navy); color: var(--ivory); padding: 88px 0; }
.contact-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
}
.eyebrow-light { color: var(--coral); }
.contact-copy h2 { color: var(--ivory); font-size: 2rem; margin: 16px 0 18px; max-width: 16ch; }
.contact-copy p { color: rgba(247,245,239,0.78); max-width: 42ch; }
.contact-direct {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line-dark);
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.92rem;
}
.contact-direct a { color: var(--coral); font-weight: 600; }
.contact-direct a:hover { text-decoration: underline; }

.contact-form {
  background: var(--ivory);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cf-row { display: flex; flex-direction: column; gap: 6px; }
.cf-row label {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--slate);
}
.cf-row input, .cf-row textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 12px;
  background: var(--white);
  color: var(--navy-deep);
  resize: vertical;
}
.cf-2col { flex-direction: row; gap: 14px; }
.cf-2col > div { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.cf-submit { justify-content: center; margin-top: 4px; }
.cf-status { font-size: 0.85rem; min-height: 1em; color: var(--navy-deep); }
.cf-status.error { color: var(--coral-deep); }

/* ============ FOOTER ============ */
.site-footer { background: var(--navy-deep); color: var(--slate-light); padding: 40px 0; }
.footer-inner { display: flex; flex-direction: column; gap: 16px; }
.footer-inner > div { display: flex; align-items: center; gap: 10px; }
.footer-brand-name { font-family: var(--font-display); color: var(--ivory); font-size: 1rem; }
.footer-note { font-size: 0.8rem; line-height: 1.6; max-width: 70ch; }
.footer-note a { color: var(--coral); }
.footer-note a:hover { text-decoration: underline; }
.footer-copy { font-size: 0.76rem; }

/* ============ RESPONSIVE ============ */
@media (min-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .site-nav { display: none; }
  .results-grid { grid-template-columns: repeat(2, 1fr); }
  .how-inner { grid-template-columns: 1fr; gap: 32px; }
  .contact-inner { grid-template-columns: 1fr; gap: 40px; }
  .cf-2col { flex-direction: column; }
}
@media (max-width: 600px) {
  .wrap { padding: 0 20px; }
  .results-grid { grid-template-columns: 1fr; }
  .hero-search { flex-direction: column; align-items: stretch; }
  .hs-field select, .hs-field input { min-width: 0; }
  .header-cta { display: none; }
  .hero-stats { gap: 28px; flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
