:root {
  --ink: #f4efe6;
  --muted: rgba(244, 239, 230, 0.62);
  --glass: rgba(16, 18, 22, 0.55);
  --glass-strong: rgba(12, 14, 18, 0.78);
  --line: rgba(244, 239, 230, 0.14);
  --accent: #e8a05a;
  --accent-2: #7db7a4;
  --danger: #d97b6c;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", serif;
  --sans: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0b0d10; color: var(--ink); font-family: var(--sans); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }

#app { min-height: 100%; }

.phase {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

/* Landing */
.landing {
  display: grid;
  place-items: center;
  padding: 48px 24px;
  background:
    radial-gradient(1200px 600px at 20% 0%, rgba(232, 160, 90, 0.18), transparent 55%),
    radial-gradient(900px 500px at 90% 80%, rgba(125, 183, 164, 0.12), transparent 50%),
    #0b0d10;
}
.landing-card {
  width: min(880px, 100%);
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 48px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}
.kicker {
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--accent);
  margin: 0 0 16px;
}
.landing h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 7vw, 72px);
  line-height: 0.95;
  margin: 0 0 16px;
}
.lede {
  font-size: 18px;
  line-height: 1.5;
  color: var(--muted);
  max-width: 54ch;
}
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 32px; }
.btn {
  border: 1px solid var(--line);
  background: rgba(244, 239, 230, 0.08);
  border-radius: 999px;
  padding: 12px 20px;
}
.btn:hover { background: rgba(244, 239, 230, 0.16); }
.btn-primary {
  background: var(--ink);
  color: #161416;
  border-color: var(--ink);
}
.btn-primary:hover { filter: brightness(0.95); }
.landing-notes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 40px;
}
.landing-notes h3 { margin: 0 0 6px; font-size: 14px; }
.landing-notes p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }

/* Board */
.board {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  min-height: 100vh;
  background:
    radial-gradient(900px 400px at 50% -10%, rgba(232, 160, 90, 0.12), transparent 40%),
    #101216;
}
.topbar, .bottombar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 28px;
  flex-wrap: wrap;
}
.brand { font-family: var(--serif); font-size: 28px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip, .select {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
}
.select { background: var(--glass-strong); }
.chip[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.ribbon {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 12px 28px 32px;
  scroll-snap-type: x mandatory;
}
.listing-card {
  flex: 0 0 280px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow);
  text-align: left;
  padding: 0;
  transform: perspective(1200px) rotateY(-6deg);
  transition: transform 180ms ease, border-color 180ms ease;
}
.listing-card:hover, .listing-card.saved {
  transform: perspective(1200px) rotateY(0deg) translateY(-6px);
  border-color: var(--accent);
}
.listing-card img { width: 100%; height: 170px; object-fit: cover; display: block; }
.card-body { padding: 14px 16px 16px; }
.price { font-family: var(--serif); font-size: 26px; margin: 0 0 4px; }
.addr { margin: 0; font-size: 13px; color: var(--muted); }
.meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.tag {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
}
.tag.tour { color: var(--accent-2); border-color: rgba(125, 183, 164, 0.45); }
.tag.quiet { opacity: 0.55; }
.office { margin: 10px 0 0; font-size: 11px; color: var(--muted); }
.bottombar { border-top: 1px solid var(--line); background: rgba(8, 9, 12, 0.5); }
.disclaimer { font-size: 11px; color: var(--muted); max-width: 52ch; }
.brand { background: none; border: none; padding: 0; cursor: pointer; }
.search input {
  background: var(--glass-strong);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  min-width: 180px;
}
.hoods { padding: 0 28px 8px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.img-fallback {
  height: 170px;
  display: grid;
  place-items: center;
  background: #1a1c20;
  color: var(--muted);
  font-size: 13px;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 40;
  background: var(--glass-strong);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.toast[hidden] { display: none !important; }
.btn:disabled, .chip:disabled { opacity: 0.4; cursor: not-allowed; }
.btn:focus-visible, .chip:focus-visible, .select:focus-within, .search input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
a.btn { text-decoration: none; display: inline-flex; align-items: center; }

/* Drive */
.drive, .curb, .inside, .compare { height: 100vh; }
#map { position: absolute; inset: 0; }
.hud {
  position: absolute;
  left: 24px;
  right: 24px;
  top: 24px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}
.hud > * { pointer-events: auto; }
.hud-panel {
  background: var(--glass-strong);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 18px;
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}
.hud-panel h2 { margin: 0; font-family: var(--serif); font-size: 22px; }
.hud-panel p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.drive-dock {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  background: var(--glass-strong);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px;
  backdrop-filter: blur(18px);
}
.maplibregl-ctrl-attrib { font-size: 10px; }

.approach-card {
  position: absolute;
  right: 24px;
  bottom: 110px;
  width: min(340px, calc(100% - 48px));
  background: var(--glass-strong);
  border: 1px solid rgba(232, 160, 90, 0.45);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.approach-card img { width: 100%; height: 140px; object-fit: cover; }
.approach-card .card-body { padding: 14px 16px 16px; }
.car-marker {
  width: 18px;
  height: 18px;
  background: var(--accent);
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(232, 160, 90, 0.28);
}
.pin {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #8a8680;
  padding: 0;
}
.pin.match { background: var(--accent); width: 16px; height: 16px; }
.pin.tour { box-shadow: 0 0 0 4px rgba(125, 183, 164, 0.45); }
.pin.quiet { opacity: 0.35; }
.map-status {
  position: absolute;
  left: 50%;
  top: 110px;
  transform: translateX(-50%);
  z-index: 8;
  background: var(--glass-strong);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 18px;
  box-shadow: var(--shadow);
}

/* Curb */
.curb-stage {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: saturate(0.9) contrast(1.05);
}
.curb-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(8, 9, 12, 0.55), transparent 45%, rgba(8, 9, 12, 0.35));
}
.curb-volume {
  position: absolute;
  left: 28px;
  top: 50%;
  transform: translateY(-50%);
  width: min(420px, calc(100% - 56px));
  background: var(--glass-strong);
  border: 1px solid var(--line);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}
.curb-volume img { width: 100%; height: 220px; object-fit: cover; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.facts div {
  background: rgba(244, 239, 230, 0.06);
  border-radius: 12px;
  padding: 8px;
  font-size: 12px;
  color: var(--muted);
}
.facts strong { display: block; color: var(--ink); font-size: 16px; font-family: var(--serif); }
.gallery-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 10px 0 0;
}
.dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
}
.dot.on { background: var(--accent); border-color: var(--accent); }
.note {
  display: block;
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}
.note textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  border-radius: 12px;
  background: rgba(244, 239, 230, 0.06);
  border: 1px solid var(--line);
  padding: 8px 10px;
  resize: vertical;
  min-height: 52px;
}

/* Inside */
.inside-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.inside-hint {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: var(--glass-strong);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 13px;
}
.room-chip {
  position: absolute;
  transform: translate(-50%, -50%);
  background: rgba(16, 18, 22, 0.7);
  border: 1px solid var(--accent-2);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 12px;
}

/* Compare */
.compare {
  padding: 28px;
  background: #101216;
}
.compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.empty {
  padding: 80px 28px;
  color: var(--muted);
}

@media (max-width: 720px) {
  .landing-card { padding: 28px 20px; }
  .listing-card { transform: none; }
  .curb-volume { top: auto; bottom: 0; left: 0; width: 100%; transform: none; border-radius: 24px 24px 0 0; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .search input { min-width: 120px; width: 100%; }
  .topbar, .filters { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .listing-card, .listing-card:hover, .listing-card.saved {
    transform: none;
    transition: none;
  }
}
