/* ──────────────────────────────────────────────────────────────
   HAVEN. A dark stage for the deck, warm paper for the rest.
   The deck: five cards in a straight stack at rest, each peeking
   above the one in front. Hover the deck and the whole stack turns
   in perspective so the cards spread out in depth; hover a card and
   it lifts out of the row with its label.
   ────────────────────────────────────────────────────────────── */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --ink: #101012;
  --paper: #f4f1ec;
  --muted: #6b6b70;
  --line: rgba(16, 16, 18, .12);
  --pad: clamp(22px, 5vw, 88px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  /* card geometry: the size in the reference, roughly 4:3 with soft corners */
  --card-w: clamp(240px, 26vw, 400px);
  --card-h: calc(var(--card-w) * .78);
  --card-r: 22px;
}

html { scroll-behavior: smooth; }
body { font-family: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif; font-size: 16px; line-height: 1.55; letter-spacing: -.012em; color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3 { font-weight: 600; letter-spacing: -.03em; line-height: 1.04; }
h2 { font-size: clamp(32px, 4vw, 54px); }
h3 { font-size: 22px; letter-spacing: -.02em; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.lead { margin-top: 14px; max-width: 52ch; color: var(--muted); font-size: clamp(15px, 1.1vw, 17px); }
.section-head { max-width: 720px; }
.section-head .eyebrow + h2 { margin-top: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 13px 24px; border-radius: 980px; background: var(--ink); color: #fff; font-size: 15px; font-weight: 500; transition: transform .3s var(--ease), opacity .3s; }
.btn:hover { transform: translateY(-1px); opacity: .9; }
.link { font-size: 15px; font-weight: 500; border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.link:hover { border-color: var(--ink); }

/* ══════════════ nav ══════════════ */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 100; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 var(--pad); height: 64px; color: #fff; transition: background .35s, color .35s, border-color .35s; border-bottom: 1px solid transparent; }
.nav.is-stuck { background: rgba(244, 241, 236, .88); color: var(--ink); backdrop-filter: blur(16px); border-color: var(--line); }
.nav__logo { font-weight: 700; font-size: 15px; letter-spacing: .3em; }
.nav__links { display: flex; gap: clamp(18px, 3vw, 36px); font-size: 14px; font-weight: 500; opacity: .85; }
.nav__links a:hover { opacity: 1; }
.nav__cta { font-size: 14px; font-weight: 500; padding: 9px 16px; border-radius: 980px; border: 1px solid currentColor; transition: background .3s, color .3s; }
.nav__cta:hover { background: #fff; color: var(--ink); }
.nav.is-stuck .nav__cta:hover { background: var(--ink); color: #fff; }

/* ══════════════ hero ══════════════ */
.hero { position: relative; min-height: 100svh; background: #0a0a0b; color: #fff; display: grid; grid-template-columns: minmax(300px, 1fr) minmax(0, 1.25fr); align-items: center; gap: 24px; padding: 96px var(--pad) 80px; overflow: hidden; }
.hero__copy { max-width: 470px; }
.hero__copy .eyebrow { color: rgba(255, 255, 255, .6); }
.hero__copy h1 { margin-top: 16px; font-size: clamp(40px, 5vw, 76px); }
.hero__copy .lead { color: rgba(255, 255, 255, .68); }
.hint { margin-top: 30px; display: inline-flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: rgba(255, 255, 255, .5); transition: opacity .4s; }
.hint::before { content: ""; width: 26px; height: 1px; background: currentColor; }
.hint.is-off { opacity: 0; }

/* ── the deck ── */
.deck { position: relative; height: calc(var(--card-h) + 190px); display: grid; place-items: center; perspective: 1400px; perspective-origin: 40% 45%; }
.deck__stage { position: relative; width: var(--card-w); height: var(--card-h); transform-style: preserve-3d; transition: transform 1s var(--ease); }
.card {
  position: absolute; inset: 0; width: var(--card-w); height: var(--card-h); border-radius: var(--card-r); overflow: hidden; background: #1a1a1c;
  box-shadow: 0 30px 60px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .06) inset;
  transform-style: preserve-3d; backface-visibility: hidden;
  transition: transform .9s var(--ease), filter .9s var(--ease), opacity .6s var(--ease);
  /* at rest: a straight stack, each card 34px higher and a touch smaller than the one in front */
  transform: translateY(calc(var(--i) * -34px)) translateZ(calc(var(--i) * -2px)) scale(calc(1 - var(--i) * .045));
  z-index: calc(10 - var(--i));
  filter: brightness(calc(1 - var(--i) * .16));
}
.card img { width: 100%; height: 100%; object-fit: cover; }
.card__label {
  position: absolute; left: 50%; top: -18px; transform: translate(-50%, 6px); white-space: nowrap; padding: 6px 12px; border-radius: 980px;
  background: #fff; color: var(--ink); font-size: 12px; font-weight: 600; letter-spacing: -.01em; opacity: 0; transition: opacity .35s, transform .35s var(--ease);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
}

/* the deck is turned: everything spreads out in depth to the right */
.deck.is-open .deck__stage { transform: translateX(-84%) scale(.8) rotateY(-30deg) rotateX(7deg); }
.deck.is-open .card {
  transform: translateX(calc(var(--i) * 30%)) translateZ(calc(var(--i) * -210px)) translateY(calc(var(--i) * 6px)) scale(1);
  filter: brightness(calc(1 - var(--i) * .12));
}
/* the card under the cursor lifts out of the row and names itself */
.deck.is-open .card.is-lifted {
  transform: translateX(calc(var(--i) * 30%)) translateZ(calc(var(--i) * -210px + 70px)) translateY(-64px) scale(1.02);
  filter: brightness(1);
}
.deck.is-open .card.is-lifted .card__label { opacity: 1; transform: translate(-50%, -100%); }
.deck.is-open .card.is-lifted .card__label { top: -12px; }

/* ══════════════ the chosen home ══════════════ */
.home { display: grid; grid-template-columns: 1.15fr 1fr; min-height: 80svh; }
.home__media { position: relative; overflow: hidden; background: #ddd; }
.home__media img { width: 100%; height: 100%; object-fit: cover; transition: opacity .5s; }
.home__media img.is-swapping { opacity: 0; }
.home__body { padding: clamp(48px, 6vw, 96px) var(--pad); display: flex; flex-direction: column; justify-content: center; }
.home__body h2 { margin-top: 12px; }
.home__where { margin-top: 8px; color: var(--muted); }
.home__price { margin-top: 18px; font-size: clamp(28px, 2.6vw, 38px); font-weight: 600; letter-spacing: -.03em; }
.home__facts { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.home__facts li { padding: 6px 12px; border-radius: 980px; border: 1px solid var(--line); font-size: 13px; font-weight: 500; }
.home__desc { margin-top: 18px; color: var(--muted); max-width: 52ch; }
.home__row { margin-top: 26px; display: flex; align-items: center; gap: 22px; }

/* ══════════════ sections ══════════════ */
section:not(.hero):not(.home) { padding: clamp(72px, 9vw, 130px) var(--pad); }
.why { background: #fff; }
.why__grid { margin-top: clamp(30px, 4vw, 56px); display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.why__grid article { padding: 28px; border-radius: 20px; background: var(--paper); }
.why__grid span { font-size: 12px; font-weight: 600; letter-spacing: .16em; color: var(--muted); }
.why__grid h3 { margin-top: 14px; }
.why__grid p { margin-top: 10px; color: var(--muted); font-size: 15px; }

.agent { display: grid; grid-template-columns: minmax(260px, 420px) 1fr; gap: clamp(30px, 5vw, 80px); align-items: center; }
.agent img { border-radius: 24px; aspect-ratio: 3 / 4; object-fit: cover; }
.agent__body h2 { margin-top: 12px; }
.agent__body .btn { margin-top: 24px; }

.viewing { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(30px, 5vw, 80px); background: #fff; }
.viewing__form { display: grid; gap: 14px; }
.viewing__form label { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
.viewing__form input, .viewing__form select { font: inherit; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); }
.viewing__form .btn { justify-self: start; margin-top: 6px; }
.form-note { font-size: 13px; color: var(--muted); }
.form-note.is-ok { color: #1f7a3a; }

.foot { padding: 24px var(--pad) 28px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.foot__top { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.foot__top nav { display: flex; gap: 20px; }
.foot__bottom { margin-top: 12px; display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }

/* ══════════════ phones ══════════════ */
@media (max-width: 900px) {
  :root { --card-w: min(74vw, 340px); }
  .nav__links { display: none; }
  .hero { grid-template-columns: 1fr; padding-top: 88px; gap: 10px; }
  .hero__copy h1 { font-size: 40px; }
  .deck { height: calc(var(--card-h) + 220px); perspective-origin: 50% 40%; }
  .deck.is-open .deck__stage { transform: rotateY(-26deg) rotateX(6deg) translateX(-14%); }
  .deck.is-open .card { transform: translateX(calc(var(--i) * 26%)) translateZ(calc(var(--i) * -150px)) translateY(calc(var(--i) * 8px)); }
  .deck.is-open .card.is-lifted { transform: translateX(calc(var(--i) * 26%)) translateZ(calc(var(--i) * -150px + 50px)) translateY(-52px); }
  .home, .agent, .viewing { grid-template-columns: 1fr; }
  .home__media { aspect-ratio: 4 / 3; }
  .why__grid { grid-template-columns: 1fr; }
}
