/* ===========================================================
   3311 West 189th Street — Listing Landing Page
   Coastal / California palette: warm white, sand, sage, charcoal, soft gold
   =========================================================== */

:root {
  --color-bg: #faf8f4;
  --color-bg-alt: #f3efe6;
  --color-sand: #e8e1d4;
  --color-sand-dark: #d9cfba;
  --color-sage: #8a9a7e;
  --color-sage-dark: #66765b;
  --color-charcoal: #2b2b28;
  --color-charcoal-soft: #4a4944;
  --color-gold: #b9974f;
  --color-white: #ffffff;
  --color-border: #e2dbcb;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Jost", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --max-width: 1400px;
  --radius: 6px;
  --shadow-soft: 0 10px 40px rgba(43, 43, 40, 0.08);
  --shadow-med: 0 20px 60px rgba(43, 43, 40, 0.14);
  --transition: 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-charcoal);
  background: var(--color-bg);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration: none; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
}

.eyebrow {
  font-family: var(--font-body);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--color-sage-dark);
  font-weight: 500;
  margin: 0 0 14px;
}
.eyebrow.center { text-align: center; }

.section-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.9rem, 3vw, 2.6rem);
  margin: 0 0 20px;
  color: var(--color-charcoal);
  letter-spacing: -0.01em;
}
.section-title.center { text-align: center; }

.section-lede {
  max-width: 680px;
  margin: 0 auto 56px;
  text-align: center;
  color: var(--color-charcoal-soft);
  font-size: 1.05rem;
}
.section-lede.left { margin: 0 0 32px; text-align: left; }

.property-description {
  max-width: 760px;
  margin: 0 auto 56px;
  color: var(--color-charcoal-soft);
  font-size: 1.05rem;
  line-height: 1.75;
}
.property-description p {
  margin: 0 0 22px;
}
.property-description p:last-child {
  margin-bottom: 0;
}

code {
  background: var(--color-sand);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 30px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: var(--color-charcoal);
  color: var(--color-bg);
}
.btn-primary:hover {
  background: var(--color-sage-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}
.btn-ghost {
  background: transparent;
  color: var(--color-charcoal);
  border-color: var(--color-charcoal);
}
.btn-ghost:hover {
  background: var(--color-charcoal);
  color: var(--color-bg);
  transform: translateY(-2px);
}
.btn-block { width: 100%; }
.btn-nav { display: none; }

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(250, 248, 244, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: box-shadow var(--transition), background var(--transition);
  /* Isolates the blurred fixed header on its own compositing layer — without
     this, Safari can fail to repaint the page below it during fast scroll
     (a known backdrop-filter + position:fixed bug), making content flash blank. */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  will-change: transform;
}
.site-header.scrolled {
  box-shadow: 0 2px 20px rgba(43, 43, 40, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--color-charcoal);
  color: var(--color-bg);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.brand-text {
  font-size: 1.05rem;
  color: var(--color-charcoal);
}
.brand-text em {
  display: block;
  font-style: normal;
  font-family: var(--font-body);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-sage-dark);
  margin-top: 2px;
}

.main-nav {
  display: flex;
  gap: 32px;
  margin: 0 auto;
}
.main-nav a {
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  color: var(--color-charcoal-soft);
  position: relative;
  padding-bottom: 4px;
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--color-gold);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition);
}
.main-nav a:hover { color: var(--color-charcoal); }
.main-nav a:hover::after { transform: scaleX(1); transform-origin: left; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  display: block;
  height: 1.5px;
  width: 100%;
  background: var(--color-charcoal);
  transition: transform var(--transition), opacity var(--transition);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(43,43,40,0.15) 0%, rgba(43,43,40,0.55) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  color: var(--color-white);
  max-width: 760px;
  padding-top: 100px;
}
.hero .eyebrow { color: var(--color-white); opacity: 0.85; }
.hero h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.4rem, 5.2vw, 4.2rem);
  line-height: 1.08;
  margin: 0 0 18px;
  letter-spacing: -0.01em;
}
.hero-price {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: #f2e6c9;
  margin: 0 0 10px;
  font-weight: 500;
}
.hero-meta {
  font-size: 1.02rem;
  opacity: 0.92;
  margin: 0 0 40px;
  letter-spacing: 0.02em;
}
.hero-actions {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.hero .btn-ghost {
  color: var(--color-white);
  border-color: rgba(255,255,255,0.6);
}
.hero .btn-ghost:hover {
  background: var(--color-white);
  color: var(--color-charcoal);
}

.scroll-cue {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: 26px;
  height: 42px;
  border: 1.5px solid rgba(255,255,255,0.7);
  border-radius: 20px;
}
.scroll-cue span {
  position: absolute;
  top: 8px; left: 50%;
  width: 4px; height: 4px;
  margin-left: -2px;
  background: #fff;
  border-radius: 50%;
  animation: scrollcue 1.8s ease-in-out infinite;
}
@keyframes scrollcue {
  0% { opacity: 1; top: 8px; }
  70% { opacity: 0; top: 22px; }
  100% { opacity: 0; top: 22px; }
}

/* ---------- Sections ---------- */

.section {
  padding: 110px 0;
}
.section-alt {
  background: var(--color-bg-alt);
}

/* ---------- Stats / Features ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.stat-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 36px 24px;
  text-align: center;
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-soft);
}
.stat-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 18px;
  color: var(--color-gold);
}
.stat-icon svg { width: 100%; height: 100%; }
.stat-value {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 500;
  color: var(--color-charcoal);
}
.stat-label {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-charcoal-soft);
  margin-top: 6px;
}

/* ---------- Upgrades ---------- */

.upgrades-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 40px 32px;
}

.upgrade-category h3 {
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-gold);
  font-weight: 500;
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-sand-dark);
}

.upgrade-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.upgrade-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.95rem;
  color: var(--color-charcoal-soft);
  line-height: 1.45;
}

.upgrade-list li::before {
  content: '\2713';
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--color-sage);
  color: var(--color-white);
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}

/* ---------- Gallery ---------- */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 260px;
  gap: 18px;
}
.gallery-item {
  position: relative;
  border: none;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  background: var(--color-sand);
  transition: transform var(--transition), box-shadow var(--transition);
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--transition);
}
.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-med);
}
.gallery-item:hover img {
  transform: scale(1.04);
}
.gallery-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 14px 16px;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  color: var(--color-white);
  background: linear-gradient(0deg, rgba(0,0,0,0.55), transparent);
  text-align: left;
}

/* ---------- Virtual Tour ---------- */

.tour-embed {
  position: relative;
  width: 100%;
  max-width: 960px;
  margin: 0 auto 32px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--color-border);
  background: var(--color-sand);
}
.tour-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.tour-actions {
  text-align: center;
}

/* ---------- Contact ---------- */

.contact-card {
  max-width: 640px;
  margin: 0 auto;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 40px;
}

.agent-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 0 28px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 28px;
}
.agent-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-sage);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.15rem;
  flex-shrink: 0;
}
.agent-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
}
.agent-title {
  font-size: 0.84rem;
  color: var(--color-charcoal-soft);
  margin: 3px 0 8px;
}
.agent-phone {
  font-size: 1rem;
  color: var(--color-gold);
  font-weight: 500;
  border-bottom: 1px solid transparent;
}
.agent-phone:hover { border-color: var(--color-gold); }

.contact-meta {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.92rem;
  color: var(--color-charcoal-soft);
}
.contact-meta strong {
  display: inline-block;
  min-width: 90px;
  color: var(--color-charcoal);
  font-weight: 500;
}

.comp-badge {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
  padding: 20px 22px;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-sand-dark);
  border-radius: var(--radius);
}
.comp-badge svg {
  width: 32px;
  height: 32px;
  color: var(--color-gold);
  flex-shrink: 0;
}
.comp-badge-value {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--color-charcoal);
}
.comp-badge-label {
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-sage-dark);
  margin-top: 3px;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--color-charcoal);
  color: rgba(250, 248, 244, 0.75);
  padding: 48px 0;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 24px;
}
.footer-brand .brand-mark { background: var(--color-sage); }
.footer-brand .brand-text { color: #fff; }
.footer-brand .brand-text em { color: rgba(250,248,244,0.6); }
.footer-address {
  margin: 10px 0 0;
  font-size: 0.88rem;
}
.footer-compliance {
  text-align: right;
  font-size: 0.85rem;
}
.footer-legal {
  margin-top: 8px;
  font-size: 0.76rem;
  opacity: 0.65;
}

.footer-disclaimer {
  border-top: 1px solid rgba(250, 248, 244, 0.12);
  margin-top: 40px;
  padding-top: 24px;
}
.footer-disclaimer p {
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.6;
  opacity: 0.55;
  max-width: 900px;
}

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(20, 20, 18, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  animation: fadein 0.25s ease;
}
.lightbox[hidden] { display: none; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.lightbox-content {
  max-width: 1100px;
  width: 100%;
}
.lightbox-placeholder {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-med);
}
.lightbox-placeholder img {
  display: block;
  width: 100%;
  max-height: 80vh;
  object-fit: contain;
}
.lightbox-caption {
  color: #fff;
  text-align: center;
  margin-top: 20px;
  font-size: 1rem;
  letter-spacing: 0.02em;
}
.lightbox-close {
  position: absolute;
  top: 24px;
  right: 32px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
}

/* ---------- Scroll reveal ---------- */

/* Hidden-until-revealed state only applies once JS confirms it can reveal
   them again (progressive enhancement — content stays visible if JS fails). */
html.js-reveal .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
html.js-reveal .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .main-nav { display: none; }
  .btn-nav { display: none; }
  .nav-toggle { display: flex; }
  .header-inner { padding-top: 14px; padding-bottom: 14px; }
  .site-header.nav-open .main-nav {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    flex-direction: column;
    background: var(--color-bg);
    padding: 20px 32px 28px;
    gap: 18px;
    box-shadow: var(--shadow-soft);
  }
  .section { padding: 72px 0; }
  .section-lede { margin-bottom: 40px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-card { padding: 28px; }
  .comp-badge { flex-direction: column; align-items: flex-start; text-align: left; }
  .footer-inner { flex-direction: column; }
  .footer-compliance { text-align: left; }
}

@media (max-width: 480px) {
  .container { padding: 0 20px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .hero-content { padding-top: 130px; }
}
