/* --- Base --- */
:root {
  --bg: #0b0c0f;
  --panel: #111317;
  --text: #e5e7eb;
  --muted: #9aa3af;
  --accent: #1e90ff;
  --border: #242832;
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

/* --- Layout helpers --- */
.wrap { width: min(1100px, 92vw); margin: 0 auto; }
.section { padding: 3rem 0; }
.section.alt { background: #0e1014; }
.two-col { display: grid; gap: 2rem; grid-template-columns: 2fr 1fr; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

/* --- Header --- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(6px);
  background: rgba(11,12,15,0.6);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; padding: .75rem 0; }
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; }
.brand-logo { font-size: 1.2rem; }
.site-nav a { color: var(--text); text-decoration: none; margin-left: 1rem; opacity: .9; }
.site-nav a:hover { opacity: 1; }

/* --- Hero --- */
.hero { padding: 3.5rem 0 2rem; }
.hero .subtitle { color: var(--muted); margin: .2rem 0 .8rem; }
.hero .lede { max-width: 70ch; color: #d2d7de; }
.hero-media img {
  width: 100%; height: auto; display: block;
  border-radius: 14px; box-shadow: var(--shadow);
}

/* --- Price Bar --- */
.pricebar { padding: 0; }
.pricebar-wrap {
  display: flex; align-items: center; gap: 1rem;
  background: #0e1014;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: .9rem 0;
}
.price-pill {
  display: inline-flex; align-items: baseline; gap: .5rem;
  background: #0f141b;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .4rem .75rem;
  box-shadow: var(--shadow);
}
.price-label { color: var(--muted); font-size: .9rem; }
.price-amount { font-weight: 700; letter-spacing: .2px; }
.price-note { color: var(--muted); font-size: .95rem; }
@media (max-width: 640px) {
  .pricebar-wrap { flex-direction: column; align-items: flex-start; gap: .4rem; }
}

/* --- Story/Callout --- */
.callout {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.2rem;
}

/* --- Highlights --- */
.feature-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.feature {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 1rem; box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

/* --- Matterport --- */
.mp-wrap {
  background: #0e1014; border: 1px solid var(--border); border-radius: 12px; padding: .5rem;
}
.mp-wrap iframe { width: 100%; min-height: 480px; border: 0; border-radius: 8px; }

/* --- Gallery --- */
.gallery-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.carousel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .75rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.carousel img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  cursor: zoom-in;
}

/* nav buttons */
.car-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: rgba(0,0,0,0.4);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  cursor: pointer;
}
.car-prev { left: .5rem; }
.car-next { right: .5rem; }

/* dots flow INSIDE card */
.car-dots {
  display: flex;
  justify-content: center;
  gap: .4rem;
  flex-wrap: wrap;
  margin-top: .6rem;
  padding: 0 .5rem;
}
.car-dot {
  width: 8px; height: 8px;
  border-radius: 50%; border: 0;
  background: #555;
  cursor: pointer;
}
.car-dot.active { background: #fff; }
.car-cap { margin-top: .5rem; font-size: .9rem; opacity: .85; }

/* --- Heritage --- */
.archive-note { color: var(--muted); font-size: .9rem; margin-top: .5rem; }

/* --- Location --- */
.location-list {
  list-style: none;
  padding-left: 0;
  margin: 0 0 1rem;
}
.location-list li { margin: .35rem 0; line-height: 1.5; }
.map-embed {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .5rem;
  box-shadow: var(--shadow);
}
.note { color: var(--muted); font-size: .95rem; }

/* --- Contact --- */
.contact .note { color: var(--muted); }

/* --- Footer --- */
.site-footer { border-top: 1px solid var(--border); padding: 1.5rem 0; color: var(--muted); }

/* --- Lightbox --- */
.lb {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.92);
  display: grid; place-items: center; padding: 2rem;
}
.lb[aria-hidden="true"] { display: none; }
.lb[aria-hidden="false"] { display: grid; }
.lb-img { max-width: 92vw; max-height: 80vh; border-radius: 8px; }
.lb-close, .lb-btn {
  position: absolute;
  border: 0;
  background: rgba(0,0,0,0.5);
  color: #fff;
  width: 40px; height: 40px;
  border-radius: 999px;
  cursor: pointer;
}
.lb-close { top: 1rem; right: 1rem; }
.lb-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 1rem; top: 50%; transform: translateY(-50%); }
.lb-caption, .lb-counter {
  position: absolute;
  left: 50%; transform: translateX(-50%);
  color: #fff;
}
.lb-caption { bottom: 1.9rem; text-align: center; }
.lb-counter { bottom: .8rem; font-size: .85rem; opacity: .85; }

/* --- Compliance Modal --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1.5rem;
}
.modal-backdrop[aria-hidden="false"] { display: flex; }
.modal {
  width: min(720px, 92vw);
  background: #111317;
  color: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
  padding: 1.25rem 1.25rem 1rem;
}
.modal h2 { margin: 0 0 .5rem; font-size: 1.3rem; line-height: 1.25; }
.modal p { margin: .5rem 0; }
.modal-small { opacity: .85; font-size: .9rem; }
.modal-list { margin: .5rem 0 1rem 1.25rem; }
.modal-list li { margin: .35rem 0; }
.modal-actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: .75rem; }
.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  border-radius: 10px;
  padding: .6rem 1rem;
  font-weight: 600;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:focus, .btn-secondary:focus { outline: 2px solid #fff; outline-offset: 2px; }
.btn-secondary { background: #2a2f36; color: #fff; }

/* Prevent background scroll while modal is open */
body.modal-open { overflow: hidden; }
/* Optional: visually de-emphasize background */
.app-inert { filter: blur(2px) brightness(.9); pointer-events: none; user-select: none; }

/* ----- Mobile polish (phones & small tablets) ----- */
@media (max-width: 640px) {
  /* Layout + spacing */
  .wrap { width: min(1000px, 94vw); }
  .section { padding: 2rem 0; }
  .two-col { gap: 1.25rem; }

  /* Header nav: swipeable tabs */
  .site-nav {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-left: .25rem;
    padding-bottom: .25rem;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a {
    display: inline-block;
    padding: .4rem .65rem;
    margin-left: .25rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: .95rem;
    opacity: 1;
  }

  /* Price bar stacks already; tighten a bit */
  .pricebar-wrap { gap: .25rem; }
  .price-note { font-size: .9rem; }

  /* Carousels: larger touch targets, tighter chrome */
  .carousel { padding: .6rem; }
  .car-btn { width: 44px; height: 44px; }
  .car-dots { gap: .3rem; margin-top: .4rem; }
  .car-dot { width: 7px; height: 7px; }

  /* Floorplan & gallery images already fluid via .carousel img */
  /* Make highlight cards breathe on small screens */
  .feature { padding: .85rem; }

  /* Matterport: lock aspect & reduce height on phones */
  .mp-wrap iframe {
    aspect-ratio: 16 / 9;
    min-height: 220px;
    height: auto;
  }

  /* Lightbox: keep captions readable without crowding */
  .lb { padding: 1rem; }
  .lb-img { max-width: 96vw; max-height: 72vh; }
  .lb-caption { bottom: 1.4rem; font-size: .95rem; }
  .lb-counter { bottom: .5rem; }
}

/* Ultra-small devices */
@media (max-width: 380px) {
  .site-header .wrap { padding: .6rem 0; }
  .brand-text { font-size: .95rem; }
  .hero { padding: 2.2rem 0 1.2rem; }
}

/* --- Ensure disclaimer/compliance modal is visible on phones --- */
.modal-backdrop {
  /* allow the backdrop to scroll if content is tall */
  overflow-y: auto;
}

/* Fit the modal within the phone viewport and allow internal scrolling */
.modal {
  max-height: 90vh;
  overflow: auto;
}

/* Mobile refinements */
@media (max-width: 640px) {
  /* Start the modal at the top instead of vertically centering it */
  .modal-backdrop {
    align-items: flex-start;
    padding: 0.75rem; /* a bit tighter on phones */
  }

  /* Modal fills width nicely, stays within viewport height */
  .modal {
    width: 100%;
    max-height: 86vh;
  }
}

/* Defensive: make small disclaimer notes explicit blocks so they don’t get collapsed */
.note,
.archive-note {
  display: block;
}

/* --- Seller Highlights Video --- */
.video-wrap {
  background: #0e1014;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .5rem;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  justify-content: center;
}

.video-wrap video {
  width: 100%;
  max-width: 720px; /* lock resolution to prevent pixelation */
  height: auto;
  border-radius: 8px;
  display: block;
  object-fit: cover;
}

@media (max-width: 768px) {
  .video-wrap video { max-width: 100%; }
}
