:root {
  --bg: #ecebe7;
  --ink: #141414;
  --ink-soft: #5d5d5a;
  --line: rgba(20, 20, 20, 0.12);
  --paper: #fbfaf7;
  --accent: #141414;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.hud, .hint { transition: opacity .5s; }
body.detail-open .hud, body.detail-open .hint { opacity: 0; pointer-events: none; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
a { color: inherit; }
img { display: block; max-width: 100%; }

#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
body.hovering #scene { cursor: pointer; }

/* ---------- Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  background: var(--bg); transition: opacity .8s var(--ease), visibility .8s;
}
.loader.done { opacity: 0; visibility: hidden; }
.loader-inner { width: min(320px, 70vw); text-align: center; }
.loader-name { font-family: var(--serif); font-size: 34px; margin-bottom: 18px; }
.loader-bar { height: 2px; background: var(--line); overflow: hidden; }
.loader-slow { margin: 18px 0 0; font-size: 14px; opacity: .8; }
.loader-slow button, .loader-slow a { margin: 8px 4px 0; padding: 7px 14px; border: 1px solid currentColor; border-radius: 999px; background: none; color: inherit; font: inherit; text-decoration: none; cursor: pointer; }
.loader-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }

/* ---------- Top bar ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: max(18px, env(safe-area-inset-top)) 24px 18px;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand { font-family: var(--serif); font-size: 26px; line-height: 1; letter-spacing: -0.01em; text-align: left; }
.nav { display: flex; gap: 4px; }
.nav a {
  font-size: 13px; font-weight: 500; padding: 8px 14px; border-radius: 999px; text-decoration: none; white-space: nowrap;
  background: rgba(255,255,255,.55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line); transition: background .2s;
}
.nav a:hover, .nav a[aria-current="page"] { background: #fff; }
.nav a:focus-visible, .brand:focus-visible, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Hint ---------- */
.hint {
  position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%); z-index: 5;
  display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-soft);
  transition: opacity .8s; pointer-events: none; white-space: nowrap;
}
.hint.gone { opacity: 0; }
.hint-mouse { width: 18px; height: 28px; border: 1.5px solid currentColor; border-radius: 10px; position: relative; }
.hint-mouse i { position: absolute; left: 50%; top: 5px; width: 2px; height: 6px; margin-left: -1px; background: currentColor; border-radius: 2px; animation: wheel 1.6s infinite; }
@keyframes wheel { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(9px); opacity: 0; } }

/* ---------- Bottom HUD ---------- */
.hud {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, 2fr) auto; align-items: center; gap: 24px;
  padding: 18px 24px max(20px, env(safe-area-inset-bottom));
}
.hud-now { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.hud-num { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--ink-soft); white-space: nowrap; }
.hud-title { font-family: var(--serif); font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.hud-title:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.hud-progress { height: 2px; background: var(--line); position: relative; overflow: hidden; }
.hud-progress i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--accent); }
.hud-keys { display: flex; gap: 6px; }
.hud-keys button {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(255,255,255,.55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.hud-keys button:hover { background: #fff; }

/* ---------- Detail drawer ---------- */
.detail {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 20;
  width: min(440px, 42vw); background: var(--paper);
  border-left: 1px solid var(--line); box-shadow: -30px 0 60px rgba(0,0,0,.06);
  transform: translateX(105%); transition: transform .6s var(--ease);
}
.detail.open { transform: none; }
.detail-scroll { height: 100%; overflow-y: auto; padding: 72px 36px 36px; }
.detail-img { display: none; width: 100%; background: #e9e8e4; padding: 18px; margin-bottom: 24px; cursor: zoom-in; }
.detail-img img { margin: 0 auto; max-height: 44vh; object-fit: contain; }
.pill {
  display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); margin-bottom: 14px;
}
.pill[data-status="Available"] { background: #e3f1e4; border-color: #bcd9be; color: #1f5a27; }
.pill[data-status="Sold"] { background: #f6e1df; border-color: #e5bbb6; color: #8a2a1f; }
.pill[data-status="Reserved"] { background: #f7efd9; border-color: #e6d3a3; color: #7a5a0e; }
.detail h2 { font-family: var(--serif); font-weight: 400; font-size: 44px; line-height: 1.02; margin: 0 0 10px; letter-spacing: -0.01em; }
.meta { color: var(--ink-soft); margin: 0 0 22px; }
.desc p { margin: 0 0 14px; }
.price { font-size: 17px; font-weight: 500; margin: 20px 0 0; }
.price:empty { display: none; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 32px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
  font-size: 14px; font-weight: 500; padding: 12px 18px; border-radius: 999px; border: 1px solid var(--line);
  transition: transform .15s, background .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.ghost:hover { background: #fff; }
.detail-nav { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 18px; font-size: 13px; }
.detail-nav span { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.detail-nav button:hover { text-decoration: underline; text-underline-offset: 3px; }

.close {
  position: absolute; top: 18px; right: 20px; z-index: 2; width: 40px; height: 40px; border-radius: 50%;
  font-size: 26px; line-height: 1; border: 1px solid var(--line); background: rgba(255,255,255,.7);
}
.close:hover { background: #fff; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 40; background: rgba(15, 15, 15, .94);
  display: grid; place-items: center; padding: 64px 24px 24px;
  opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 100px); object-fit: contain; }
.lightbox .close { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.2); }

/* ---------- No-WebGL fallback ---------- */
body.no-webgl #scene, body.no-webgl .hud, body.no-webgl .hint { display: none; }
body.no-webgl .fallback { display: grid; }
.fallback, .noscript {
  position: fixed; inset: 0; z-index: 5; display: none; place-content: center; justify-items: center; gap: 16px;
  background: var(--bg); margin: 0; text-align: center; padding: 24px;
}
.noscript { display: grid; }
.fallback p, .noscript p { margin: 0; }

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  .topbar { padding-left: 16px; padding-right: 16px; flex-direction: column; align-items: flex-start; gap: 10px; }
  .brand { font-size: 22px; max-width: 90vw; }
  .nav { flex-wrap: wrap; }
  .nav a { padding: 12px 10px; min-height: 44px; display: inline-flex; align-items: center; font-size: 12px; }
  .hud-keys button { width: 44px; height: 44px; }
  .close { width: 44px; height: 44px; }
  .hud { grid-template-columns: 1fr auto; gap: 12px 16px; padding-left: 16px; padding-right: 16px; }
  .hud-progress { grid-column: 1 / -1; grid-row: 2; }
  .hud-title { font-size: 19px; }
  .hint { bottom: 110px; }
  .detail { width: 100%; top: auto; height: 92vh; height: 92dvh; border-left: 0; border-radius: 18px 18px 0 0; transform: translateY(105%); }
  .detail-scroll { padding: 64px 20px 32px; }
  .detail-img { display: block; }
  .detail h2 { font-size: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
}

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Door icons + room transition ---------- */
.nav .door { display: inline-block; width: 8px; height: 12px; margin-right: 7px; vertical-align: -1px; border-radius: 2px 2px 0 0; background: var(--door, #999); box-shadow: inset -2px 0 0 rgba(0,0,0,.18); }
.fade { position: fixed; inset: 0; z-index: 60; background: var(--bg); opacity: 0; pointer-events: none; transition: opacity .6s ease; }
.fade.on { opacity: 1; pointer-events: auto; }

/* ---------- Social icons: a vertical rail on the right (desktop), a row in the phone menu ---------- */
.social-icons { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; }
.social-icons a { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; color: var(--ink); text-decoration: none; transition: color .2s, background .2s, transform .2s; }
.social-icons a:hover { background: #fff; transform: translateY(-1px); }
.social-icons a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.social-icons .soc-ico { width: 19px; height: 19px; }
.social-icons a[data-net="instagram"]:hover { color: #d62976; }
.social-icons a[data-net="facebook"]:hover { color: #1877f2; }
.social-icons a[data-net="linkedin"]:hover { color: #0a66c2; }
.social-icons a[data-net="behance"]:hover { color: #1769ff; }
.social-icons a[data-net="youtube"]:hover { color: #ff0000; }
.social-icons a[data-net="pinterest"]:hover { color: #e60023; }
.social-icons a[data-net="dribbble"]:hover { color: #ea4c89; }
.social-icons a[data-net="whatsapp"]:hover { color: #25d366; }
.nav .nav-social { display: none; }
.social-rail { position: fixed; z-index: 6; right: max(14px, env(safe-area-inset-right)); top: 50%; transform: translateY(-50%); flex-direction: column; padding: 6px; border-radius: 28px; background: rgba(255,255,255,.55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--line); transition: opacity .3s; }
body.detail-open .social-rail { opacity: 0; pointer-events: none; }
@media (max-width: 760px) {
  .social-rail { display: none; }
  .js .nav .nav-social { display: flex; flex-wrap: wrap; margin-top: auto; padding: 16px 4px 0; border-top: 1px solid var(--line); }
  .js .nav .nav-social a { width: 48px; height: 48px; min-height: 48px; padding: 0; font-size: inherit; border-radius: 50%; }
  .js .nav .nav-social .soc-ico { width: 24px; height: 24px; }
}

/* ---------- Phone menu (hamburger + full-screen sheet; progressive enhancement via html.js + js/site.js) ---------- */
.menu-toggle { display: none; }
@media (max-width: 760px) {
  .js .topbar { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: nowrap; gap: 8px; }
  .js.menu-open .topbar { z-index: 35; }
  .js .topbar .brand { position: relative; z-index: 3; max-width: 70vw; }
  .js .menu-toggle {
    position: relative; z-index: 3; display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; margin-right: -8px; border-radius: 50%;
    background: rgba(255,255,255,.55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--line);
  }
  .bars, .bars::before, .bars::after { display: block; width: 20px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .25s; }
  .bars { position: relative; }
  .bars::before, .bars::after { content: ""; position: absolute; left: 0; }
  .bars::before { top: -6px; }
  .bars::after { top: 6px; }
  .menu-toggle[aria-expanded="true"] .bars { background: transparent; }
  .menu-toggle[aria-expanded="true"] .bars::before { top: 0; transform: rotate(45deg); }
  .menu-toggle[aria-expanded="true"] .bars::after { top: 0; transform: rotate(-45deg); }
  .js .nav {
    display: none; position: fixed; z-index: 2; inset: 0; flex-direction: column; flex-wrap: nowrap; gap: 4px; overflow-y: auto;
    background: var(--bg); padding: calc(var(--header-h, 64px) + 20px) max(20px, env(safe-area-inset-right)) calc(28px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  }
  .js.menu-open .nav { display: flex; }
  .js .nav a {
    font-family: var(--serif); font-size: 36px; font-weight: 400; min-height: 60px; padding: 8px 12px; border-radius: 12px;
    border: 0; background: none; backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  .js .nav a .door { width: 14px; height: 22px; margin-right: 16px; border-radius: 3px 3px 0 0; }
  .js .nav a[aria-current="page"] { background: var(--accent); color: #fff; }
}