:root {
  --bg: #08080a;
  --bg-elevated: #111114;
  --fg: #f4f4f2;
  --fg-dim: #9a9aa2;
  --fg-faint: #616168;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --accent: #f4f4f2;
  --radius: 18px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  padding: 26px 5vw;
  background: linear-gradient(to bottom, rgba(8, 8, 10, 0.9), rgba(8, 8, 10, 0));
  backdrop-filter: blur(6px);
  text-align: center;
}

.wordmark {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.site-nav { display: flex; gap: 28px; }

.site-nav a {
  font-size: 13px;
  color: var(--fg-dim);
  transition: color 0.25s var(--ease);
}

.site-nav a:hover { color: var(--fg); }

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

.hero {
  padding: 8vh 5vw 6vh;
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-eyebrow {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin: 0 0 18px;
}

.hero-title {
  font-size: clamp(34px, 6vw, 68px);
  line-height: 1.04;
  letter-spacing: -0.03em;
  font-weight: 700;
  margin: 0 0 20px;
}

.hero-sub {
  font-size: clamp(15px, 1.6vw, 18px);
  color: var(--fg-dim);
  max-width: 480px;
  margin: 0;
  line-height: 1.5;
}

/* ---------- Grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
  padding: 0 5vw 14vh;
}

.card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  cursor: pointer;
  aspect-ratio: 4 / 5;
  isolation: isolate;
  transform: translateY(0);
  transition: transform 0.5s var(--ease), border-color 0.5s var(--ease);
}

.card:hover { transform: translateY(-4px); border-color: var(--line-strong); }

.card:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
}

.card-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--focus, center);
  transform: scale(1.02);
  transition: transform 0.7s var(--ease), filter 0.7s var(--ease);
  filter: saturate(0.85) brightness(0.72);
}

.card:hover .card-media img {
  transform: scale(1.08);
  filter: saturate(1) brightness(0.6);
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.15) 55%, rgba(0, 0, 0, 0.05) 100%);
}

.card-body {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.card-top-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.card-tag {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(244, 244, 242, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 5px 10px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

.card-status {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #08080a;
  background: #b6f09c;
  padding: 5px 10px;
  border-radius: 999px;
}

.card-status-forsale {
  color: rgba(244, 244, 242, 0.92);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(4px);
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}

.card-status-forsale:hover {
  background: #fff;
  color: #08080a;
  border-color: #fff;
}

.card-arrow {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.35s var(--ease), color 0.35s var(--ease), transform 0.35s var(--ease);
}

.card:hover .card-arrow {
  background: #ffffff;
  color: #08080a;
  transform: rotate(45deg);
}

.card-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #ffffff;
  margin: 0 0 6px;
}

.card-summary {
  font-size: 13.5px;
  color: rgba(244, 244, 242, 0.7);
  margin: 0;
  line-height: 1.4;
}

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

.site-footer {
  padding: 32px 5vw 48px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.site-footer p {
  margin: 0;
  font-size: 12.5px;
  color: var(--fg-faint);
}

/* ---------- Modal ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  pointer-events: none;
}

.modal-overlay.is-open {
  visibility: visible;
  pointer-events: auto;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 4, 5, 0.7);
  backdrop-filter: blur(14px) saturate(1.1);
  opacity: 0;
}

.modal-shell {
  position: relative;
  width: min(1180px, 94vw);
  /* svh (small viewport height) ignores mobile/browser-chrome show-hide during
     scroll, so the pinned canvas below never resizes mid-scrub. vh is the
     fallback for older browsers that don't understand svh. */
  height: min(860px, 92vh);
  height: min(860px, 92svh);
  background: var(--bg);
  border-radius: 22px;
  border: 1px solid var(--line-strong);
  overflow: hidden;
  opacity: 0;
  transform: scale(0.96) translateY(14px);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 30;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(20, 20, 22, 0.6);
  border: 1px solid var(--line-strong);
  color: var(--fg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}

.modal-close:hover { background: rgba(255, 255, 255, 0.12); transform: rotate(90deg); }

.modal-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 25;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px 84px 22px 28px;
  background: linear-gradient(to bottom, rgba(8, 8, 10, 0.65), rgba(8, 8, 10, 0));
  pointer-events: none;
}

.modal-topbar-inner { pointer-events: auto; }

.modal-kicker {
  display: block;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 4px;
}

.modal-title {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.modal-visit {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--fg);
  border: 1px solid var(--line-strong);
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(20, 20, 22, 0.55);
  backdrop-filter: blur(10px);
  white-space: nowrap;
  margin-top: 3px;
  transition: background 0.25s var(--ease);
}

.modal-visit:hover { background: rgba(255, 255, 255, 0.12); }

.modal-scroll {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
}

.modal-scroll::-webkit-scrollbar { width: 6px; }
.modal-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 3px; }

.scrub-section {
  position: relative;
  height: 350vh;
  height: 350svh;
}

.scrub-sticky {
  /* Pinning is owned entirely by native CSS sticky -- it's compositor-driven
     and never janks. GSAP ScrollTrigger (see script.js) only reads scroll
     progress here; it must NOT also set `pin` on this element. */
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  max-height: min(860px, 92vh);
  max-height: min(860px, 92svh);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #000;
}

.scrub-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.scrub-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  box-shadow: inset 0 0 140px 40px rgba(0, 0, 0, 0.55);
}

.scrub-copy-wrap {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 0 9%;
  pointer-events: none;
}

.scrub-copy-scrim {
  position: absolute;
  left: -10%;
  right: -10%;
  top: 26%;
  bottom: 20%;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(2, 2, 3, 0) 0%, rgba(2, 2, 3, 0.46) 28%, rgba(2, 2, 3, 0.46) 72%, rgba(2, 2, 3, 0) 100%);
}

.scrub-lines {
  position: relative;
  width: 100%;
  min-height: clamp(76px, 11vw, 128px);
}

.scrub-line {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  text-align: center;
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
  font-size: clamp(19px, 2.9vw, 32px);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
  color: #fdfdfc;
  text-shadow: 0 4px 28px rgba(0, 0, 0, 0.6);
  opacity: 0;
  will-change: opacity, transform;
}

.scrub-caption-cta {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #08080a;
  background: var(--fg);
  padding: 11px 18px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  will-change: opacity, transform;
  transition: box-shadow 0.25s var(--ease);
}

.scrub-caption-cta:hover { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); }

.scrub-hint {
  position: absolute;
  z-index: 2;
  top: 96px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: rgba(244, 244, 242, 0.6);
  animation: floaty 2.2s ease-in-out infinite;
}

@keyframes floaty {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 6px); }
}

.scrub-progress {
  position: absolute;
  z-index: 3;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
}

.scrub-progress span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--fg);
}

.modal-info {
  padding: 64px 6vw 90px;
  background: var(--bg);
}

.modal-info-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 60px;
  max-width: 980px;
}

.modal-summary {
  font-size: clamp(20px, 2.4vw, 27px);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.35;
  margin: 0 0 18px;
}

.modal-description {
  font-size: 15px;
  line-height: 1.7;
  color: var(--fg-dim);
  margin: 0;
  max-width: 52ch;
}

.modal-field {
  margin-bottom: 22px;
}

.modal-field span {
  display: block;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: 6px;
}

.modal-field p {
  margin: 0;
  font-size: 14px;
  color: var(--fg);
}

.modal-highlights {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.modal-highlights li {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--fg-dim);
  display: flex;
  gap: 10px;
}

.modal-highlights li::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--fg-faint);
  margin-top: 7px;
  flex-shrink: 0;
}

@media (max-width: 720px) {
  .modal-shell { width: 100vw; height: 100vh; height: 100svh; border-radius: 0; }
  .modal-info-grid { grid-template-columns: 1fr; gap: 36px; }
  .modal-topbar { padding: 18px 66px 18px 18px; }
  .modal-title { font-size: 18px; }
  .modal-visit span { display: none; }
  .scrub-section { height: 280vh; height: 280svh; }
}

@media (prefers-reduced-motion: reduce) {
  .card, .card-media img, .card-arrow, .modal-close, .scrub-hint {
    transition: none;
    animation: none;
  }
}
