/* Maison Estates — warm monochrome luxury system */
:root {
  --canvas: #F6F5F2;
  --stone: #ECEAE4;
  --ink: #111111;
  --muted: #6E6D68;
  --hair: rgba(17, 17, 17, 0.08);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html { scroll-behavior: auto; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
body { background: var(--canvas); color: var(--ink); overflow-x: hidden; }
section[id] { scroll-margin-top: 68px; }
::selection { background: var(--ink); color: #fff; }

.display { letter-spacing: -0.04em; line-height: 1.04; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 8px; }
::-webkit-scrollbar-track { background: var(--canvas); }
::-webkit-scrollbar-thumb { background: #cfcdc6; border-radius: 999px; border: 2px solid var(--canvas); }
::-webkit-scrollbar-thumb:hover { background: #b5b3ab; }

/* Nav */
.nav-link { color: var(--muted); transition: color .3s var(--ease); }
.nav-link:hover { color: var(--ink); }

/* Staggered reveal */
.reveal {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
  transition-delay: var(--d, 0ms);
  will-change: transform, opacity;
}
.reveal.in { opacity: 1; transform: translate3d(0, 0, 0); }

/* Hero search */
.chip {
  border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 500;
  background: var(--stone); color: var(--ink); border: 0; cursor: pointer;
  transition: background .3s var(--ease), color .3s var(--ease), transform .3s var(--ease);
}
.chip:hover { transform: translate3d(0, -1px, 0); }
.chip.active { background: var(--ink); color: #fff; }
.field-wrap { display: block; background: var(--stone); border-radius: 16px; padding: 10px 14px; }
.field-label { display: block; font-size: 11px; color: var(--muted); }
.field-select {
  width: 100%; background: transparent; border: 0; outline: 0; font: inherit;
  font-size: 14px; font-weight: 500; color: var(--ink); margin-top: 2px; cursor: pointer;
}

/* Gliding reel — left to right */
.reel { overflow: hidden; width: 100%; }
.reel-track {
  display: flex; width: max-content;
  animation: marqueeLeftToRight 80s linear infinite;
  will-change: transform; transform: translate3d(-50%, 0, 0);
}
.reel:hover .reel-track { animation-play-state: paused; }
@keyframes marqueeLeftToRight {
  0%   { transform: translate3d(-50%, 0, 0); }
  100% { transform: translate3d(0, 0, 0); }
}
.reel-card {
  position: relative; flex: 0 0 auto; width: 440px; height: 300px; margin-right: 20px;
  border-radius: 24px; overflow: hidden; background: var(--stone); cursor: pointer;
  text-align: left; border: 0; padding: 0; color: #fff; isolation: isolate;
  transform: translateZ(0);
}
.reel-card img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2;
  transition: transform .9s var(--ease); will-change: transform; transform: translate3d(0, 0, 0);
}
.reel-card:hover img { transform: translate3d(0, 0, 0) scale(1.05); }
.reel-card::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to top, rgba(0,0,0,.72) 0%, rgba(0,0,0,.25) 38%, rgba(0,0,0,0) 62%);
}
.glass-pill {
  position: absolute; top: 16px; left: 16px; background: rgba(255,255,255,.88);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  color: var(--ink); font-size: 12px; font-weight: 600; padding: 6px 13px; border-radius: 999px;
}
.reel-meta { position: absolute; left: 22px; right: 22px; bottom: 20px; display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; }
.reel-meta h3 { font-size: 22px; font-weight: 500; letter-spacing: -0.03em; line-height: 1.1; }
.reel-meta p { font-size: 13px; opacity: .8; margin-top: 4px; }
.reel-meta .price { font-size: 15px; font-weight: 500; margin-top: 8px; opacity: 1; }
.arrow-btn {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 999px; background: #fff; color: var(--ink);
  display: flex; align-items: center; justify-content: center; font-size: 17px;
  transition: transform .5s var(--ease);
}
.reel-card:hover .arrow-btn { transform: translate3d(2px, -2px, 0) rotate(0deg); }

/* Partner strip */
.partner {
  background: var(--stone); border-radius: 16px; padding: 22px; text-align: left; border: 0; cursor: pointer;
  display: flex; flex-direction: column; justify-content: space-between; min-height: 160px;
  transition: background .4s var(--ease), transform .5s var(--ease);
}
.partner:hover { transform: translate3d(0, -4px, 0); background: #e4e1d9; }
.partner.active { background: var(--ink); }
.partner.active .count { background: #fff; color: var(--ink); }
.partner img { height: 34px; max-width: 130px; object-fit: contain; object-position: left center; mix-blend-mode: multiply; }
.partner.active img { filter: brightness(0) invert(1); mix-blend-mode: normal; }
.count { align-self: flex-start; background: #fff; border-radius: 999px; font-size: 12px; font-weight: 500; padding: 5px 12px; }

/* Residence card */
.res-card { cursor: pointer; }
.res-img { position: relative; height: 350px; border-radius: 16px; overflow: hidden; background: var(--stone); }
.res-img img {
  width: 100%; height: 100%; object-fit: cover; will-change: transform;
  transform: translate3d(0, 0, 0); transition: transform .7s var(--ease);
}
.res-card:hover .res-img img { transform: translate3d(0, 0, 0) scale(1.05); }
.res-img .dev-pill {
  position: absolute; top: 16px; left: 16px; background: #fff; border-radius: 999px;
  font-size: 12px; font-weight: 600; padding: 6px 13px;
}
.res-img .go {
  position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; border-radius: 999px; background: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
  opacity: 0; transform: translate3d(0, 0, 0) scale(.6); transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.res-card:hover .go { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
.mini-pill {
  border-radius: 999px; background: var(--stone); padding: 8px 16px; font-size: 13px; font-weight: 500;
  border: 0; cursor: pointer; color: var(--ink); text-decoration: none; display: inline-block;
  transition: background .3s var(--ease), color .3s var(--ease);
}
.mini-pill:hover { background: var(--ink); color: #fff; }

/* Inputs */
.soft-input {
  width: 100%; background: var(--stone); border: 1.5px solid transparent; border-radius: 16px;
  padding: 16px 20px; font: inherit; font-size: 15px; color: var(--ink); outline: 0;
  transition: border-color .3s var(--ease), background .3s var(--ease);
  appearance: none; -webkit-appearance: none;
}
select.soft-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23111' stroke-width='1.6'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 20px center; padding-right: 48px;
}
.soft-input::placeholder { color: var(--muted); }
.soft-input:focus { border-color: var(--ink); }
.soft-input.invalid { border-color: #b3261e; }

/* Drawer */
.overlay {
  position: fixed; inset: 0; z-index: 50; background: rgba(17,17,17,.35);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity .5s var(--ease);
}
.overlay.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 60; width: min(560px, 100vw);
  background: var(--canvas); transform: translate3d(100%, 0, 0); visibility: hidden;
  transition: transform .7s var(--ease), visibility 0s linear .7s; will-change: transform;
  box-shadow: -20px 0 60px rgba(0,0,0,.08);
}
.drawer.open { transform: translate3d(0, 0, 0); visibility: visible; transition: transform .7s var(--ease), visibility 0s; }
.drawer-scroll { position: relative; height: 100%; overflow-y: auto; overscroll-behavior: contain; }
.thumb {
  flex: 0 0 auto; width: 84px; height: 62px; border-radius: 12px; overflow: hidden; border: 0; padding: 0;
  cursor: pointer; opacity: .5; background: var(--stone); transition: opacity .3s var(--ease);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.active, .thumb:hover { opacity: 1; }
.cfg-row { display: flex; justify-content: space-between; padding: 14px 0; font-size: 15px; }
.cfg-row span:last-child { color: var(--muted); }

@media (max-width: 640px) {
  .reel-card { width: 320px; height: 280px; }
  .res-img { height: 300px; }
}
@media (prefers-reduced-motion: reduce) {
  .reel-track { animation: none; transform: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ===== Hero redesign ===== */
.hero-slides { position: absolute; inset: 0; z-index: 0; }
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.4s var(--ease); will-change: opacity; }
.hero-slide.active { opacity: 1; }
.hero-slide img {
  width: 100%; height: 100%; object-fit: cover; transform: translate3d(0, 0, 0) scale(1);
  transition: transform 7s linear; will-change: transform;
}
.hero-slide.active img { transform: translate3d(0, 0, 0) scale(1.05); }
.hero-overlay {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(17,17,17,0.35) 0%, rgba(17,17,17,0.20) 45%, rgba(17,17,17,0.88) 100%);
}
.hero-frame h1 { text-shadow: 0 2px 30px rgba(0,0,0,.15); }

.hero-bar { position: relative; width: 36px; height: 3px; border-radius: 999px; background: rgba(255,255,255,.3); border: 0; padding: 0; cursor: pointer; overflow: hidden; }
.hero-bar::before { content: ""; position: absolute; inset: -10px 0; } /* bigger hit area */
.hero-bar .fill { position: absolute; inset: 0; background: #fff; transform: scaleX(0); transform-origin: left; }
.hero-bar.done .fill { transform: scaleX(1); }
.hero-bar.active .fill { animation: heroFill 4.5s linear forwards; }
@keyframes heroFill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Compact cards, left to right */
.hero-reel { overflow: hidden; }
.hero-track {
  display: flex; width: max-content; padding: 4px 0;
  transform: translate3d(-50%, 0, 0); will-change: transform;
  animation: heroMarqueeLTR 70s linear infinite;
}
.hero-reel:hover .hero-track { animation-play-state: paused; }
@keyframes heroMarqueeLTR {
  0%   { transform: translate3d(-50%, 0, 0); }
  100% { transform: translate3d(0, 0, 0); }
}
.hero-card {
  position: relative; flex: 0 0 auto; width: 340px; height: 108px; margin-right: 16px;
  border-radius: 16px; background: rgba(255,255,255,.9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  padding: 10px; display: flex; align-items: center; gap: 14px; text-align: left; color: var(--ink);
  box-shadow: 0 10px 30px rgba(0,0,0,.18); border: 1px solid rgba(255,255,255,.3); cursor: pointer;
  transition: transform .5s var(--ease); transform: translate3d(0, 0, 0);
}
.hero-card:hover { transform: translate3d(0, -3px, 0); }
.hero-card img { width: 90px; height: 88px; flex: 0 0 auto; border-radius: 12px; object-fit: cover; background: var(--stone); }
.hero-card-body { min-width: 0; flex: 1; padding-right: 34px; }
.hero-card-pill { display: inline-block; background: var(--stone); border-radius: 999px; font-size: 10px; font-weight: 600; padding: 2px 8px; }
.hero-card h3 { font-size: 14px; font-weight: 600; letter-spacing: -0.02em; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-card p { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-card p.hc-price { color: var(--ink); font-weight: 600; font-size: 12.5px; margin-top: 1px; }
.hero-card-go {
  position: absolute; right: 12px; bottom: 12px; width: 30px; height: 30px; border-radius: 999px;
  background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px;
}
@media (max-width: 640px) { .hero-card { width: 300px; } }
@media (prefers-reduced-motion: reduce) {
  .hero-track { animation: none; transform: none; }
  .hero-slide.active img { transform: none; }
}

.hero-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hero-chips .chip { width: 100%; text-align: center; padding: 10px 8px; white-space: nowrap; }
.hero-frame .field-wrap { min-height: 60px; }

/* Form textarea and custom opt-in checkbox */
textarea.soft-input { min-height: 110px; resize: vertical; }
.optin-label {
  display: flex; align-items: flex-start; gap: 10px; font-size: 12.5px;
  line-height: 1.5; color: var(--muted); cursor: pointer; user-select: none;
}
.optin-label input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px; flex: 0 0 auto; margin-top: 2px;
  border: 1.5px solid rgba(17, 17, 17, 0.25); border-radius: 5px;
  background-color: #fff; cursor: pointer; position: relative;
  transition: all 0.2s var(--ease);
}
.optin-label input[type="checkbox"]:checked {
  background-color: var(--ink); border-color: var(--ink);
}
.optin-label input[type="checkbox"]:checked::after {
  content: ""; position: absolute; left: 5px; top: 2px; width: 5px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.optin-label input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--ink); outline-offset: 2px;
}
.optin-label a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.optin-label a:hover { opacity: 0.7; }

/* ===== Comprehensive Mobile & Multi-Device Responsive System ===== */
* { -webkit-tap-highlight-color: transparent; }

/* Prevent iOS Safari 16px auto-zoom on input focus */
@media (max-width: 768px) {
  .soft-input, select.soft-input, textarea.soft-input, input.soft-input {
    font-size: 16px !important;
  }
}

/* Mobile adjustments */
@media (max-width: 640px) {
  body {
    padding-bottom: 76px; /* space for mobile bottom quick action bar */
  }

  /* Safe margins & radii */
  .hero-frame {
    border-radius: 20px;
    min-height: calc(100svh - 84px) !important;
    padding: 18px 16px !important;
  }
  
  /* Hero card scaling for small mobile screens */
  .hero-card {
    width: 290px;
    height: 94px;
    padding: 8px;
    margin-right: 12px;
  }
  .hero-card img {
    width: 78px;
    height: 76px;
    border-radius: 10px;
  }
  .hero-card h3 {
    font-size: 13px;
  }
  .hero-card p {
    font-size: 11px;
  }
  .hero-card p.hc-price {
    font-size: 12px;
  }
  .hero-card-go {
    width: 26px;
    height: 26px;
    font-size: 11px;
    right: 8px;
    bottom: 8px;
  }
  .hero-card-body {
    padding-right: 28px;
  }

  /* Partner card on mobile */
  .partner {
    min-height: 120px;
    padding: 16px;
  }
  .partner img {
    height: 26px;
    max-width: 100px;
  }
  .partner .count {
    font-size: 11px;
    padding: 4px 10px;
  }

  /* Residences grid image */
  .res-img {
    height: 250px;
  }

  /* Full screen slide-over drawer on mobile */
  .drawer {
    width: 100vw !important;
    max-width: 100vw !important;
  }
  .drawer-scroll {
    padding-bottom: max(32px, env(safe-area-inset-bottom));
  }

  /* Opt-in label tap comfort */
  .optin-label {
    font-size: 12px;
    gap: 10px;
  }
  .optin-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
  }
}

/* Tablet & iPad optimizations (641px to 1024px) */
@media (min-width: 641px) and (max-width: 1024px) {
  .hero-frame {
    min-height: 720px;
    padding: 32px !important;
  }
  .res-img {
    height: 300px;
  }
}

/* Support for notch / dynamic island devices */
@supports (padding: max(0px)) {
  .drawer-scroll {
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }
}

/* Hide Netlify branding badge & drawer */
[class*="netlify"],
[id*="netlify"],
iframe[src*="netlify"],
a[href*="netlify.com"],
.netlify-badge,
div[style*="z-index: 10000"],
div[style*="z-index: 2147483647"] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
