:root {
  --ink: #1d1a16; --muted: #6b655c; --paper: #f7f3ec; --paper-2: #efe9df; --line: rgba(29,26,22,.12);
  --accent: #c8772a; --accent-ink: #fff; --panel-w: 360px; --sheet-h: 204px;
  --sky-top: #cfe0f2; --sky-bottom: #f1ede4;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { font: 14px/1.45 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink);
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 70%); }
#app { position: fixed; inset: 0; }
#sky { position: absolute; inset: 0; opacity: 0; background: linear-gradient(180deg, #2b3350 0%, #5b5f8a 38%, #d98a5a 62%, #e9c9a0 78%, #a39d97 100%); pointer-events: none; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; } /* own stacking context: CSS2DRenderer sets z-index per pin */
#labels > div { pointer-events: none; }

/* ---- pins ---- */
.pinwrap { position: relative; width: 0; height: 0; }
.pin { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%) scale(var(--s, 1)); width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: #fff; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); font: 700 11px/1 system-ui, sans-serif;
  display: grid; place-items: center; cursor: pointer; pointer-events: auto; transition: opacity .25s, background .2s; padding: 0; }
.pin.tower { background: #1d1a16; }
.pin.dim { opacity: .28; }
.pin.occluded { opacity: .22; }
.pin.hidden { opacity: 0; pointer-events: none; }
.pin.active { background: #fff; color: var(--accent); box-shadow: 0 0 0 4px rgba(200,119,42,.35), 0 2px 6px rgba(0,0,0,.35); }
.pin.tower.active { color: #1d1a16; }
.pin::after { content: attr(data-name); position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); white-space: nowrap;
  background: var(--paper); color: var(--ink); padding: 4px 9px; border-radius: 999px; font: 600 12px/1.2 system-ui, sans-serif; box-shadow: 0 2px 8px rgba(0,0,0,.2);
  opacity: 0; pointer-events: none; transition: opacity .15s; }
.pin:hover::after, .pin.active::after { opacity: 1; }

/* ---- chrome ---- */
#topbar { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center;
  padding: max(12px, env(safe-area-inset-top)) 14px 0; pointer-events: none; z-index: 5; }
#topbar > * { pointer-events: auto; }
.chip { display: inline-flex; align-items: center; gap: 8px; background: rgba(247,243,236,.85); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px 7px 10px; font-weight: 600; letter-spacing: .01em; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.actions { display: flex; gap: 8px; }
.btn { font: inherit; font-weight: 600; color: var(--ink); background: rgba(247,243,236,.85); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; cursor: pointer; }
.btn:hover { background: #fff; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; padding: 12px 22px; font-size: 15px; }
.btn.primary:hover { filter: brightness(1.05); }
.btn[disabled] { opacity: .55; cursor: default; }

#compass { position: absolute; left: 14px; bottom: max(44px, calc(env(safe-area-inset-bottom) + 44px)); width: 52px; height: 52px; border-radius: 50%;
  background: rgba(247,243,236,.88); border: 1px solid var(--line); backdrop-filter: blur(8px); z-index: 4; }
#compass .needle { position: absolute; inset: 0; transform: rotate(0deg); transition: transform .08s linear; }
#compass .needle::before { content: ""; position: absolute; left: 50%; top: 7px; margin-left: -6px; border: 6px solid transparent; border-top: 0; border-bottom: 16px solid var(--accent); }
#compass .needle::after { content: ""; position: absolute; left: 50%; top: 23px; margin-left: -6px; border: 6px solid transparent; border-bottom: 0; border-top: 16px solid #b8b0a4; }
#compass .needle span { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--paper); font-size: 9px; font-weight: 800; color: var(--ink); display: grid; place-items: center; }

#credit { position: absolute; left: 14px; bottom: max(12px, env(safe-area-inset-bottom)); font-size: 12px; color: var(--muted);
  background: rgba(247,243,236,.7); padding: 4px 10px; border-radius: 999px; z-index: 4; }
#credit a { color: inherit; font-weight: 600; text-decoration: none; }

/* ---- panel (desktop: right column) ---- */
#panel { position: absolute; top: 64px; right: 14px; bottom: 14px; width: var(--panel-w); z-index: 6; display: flex; flex-direction: column;
  background: rgba(247,243,236,.92); backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
#panel .handle { display: none; }
#panelHome, #panelDetail { flex: 1; overflow: auto; padding: 14px 14px 18px; overscroll-behavior: contain; }
.tours { display: flex; gap: 6px; margin-bottom: 12px; }
.tours button { flex: 1; font: 600 12px/1.2 system-ui, sans-serif; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 9px 8px; cursor: pointer; text-align: left; }
.tours button b { display: block; font-size: 13px; }
.tours button small { display: block; color: var(--muted); font-weight: 500; margin-top: 2px; }
.tours button:hover { border-color: var(--accent); }
.tours button.playing { background: var(--accent); color: #fff; border-color: transparent; }
.tours button.playing small { color: rgba(255,255,255,.8); }
#tourbar { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); width: min(560px, calc(100% - 28px)); z-index: 7;
  display: grid; grid-template-columns: 1fr auto auto; grid-template-rows: auto auto; gap: 6px 10px; align-items: center;
  background: rgba(29,26,22,.82); color: #fff; backdrop-filter: blur(10px); border-radius: 14px; padding: 10px 12px 10px 14px; }
#tourbar[hidden] { display: none; }
.tb-text { display: flex; gap: 10px; align-items: baseline; min-width: 0; }
.tb-text b { font-size: 13px; white-space: nowrap; }
.tb-text span { font-size: 12px; color: rgba(255,255,255,.75); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-bar { grid-column: 1 / -1; height: 4px; background: rgba(255,255,255,.2); border-radius: 2px; overflow: hidden; }
.tb-bar i { display: block; height: 100%; width: 0; background: var(--accent); }
.tb-btn { font: 700 12px/1 system-ui; color: #fff; background: rgba(255,255,255,.14); border: 0; border-radius: 999px; width: 34px; height: 34px; cursor: pointer; }
.tb-btn:hover { background: rgba(255,255,255,.26); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.facts div { font-size: 12px; color: var(--muted); }
.facts b { display: block; color: var(--ink); font-size: 13px; }
.facts .wide { grid-column: 1 / -1; word-break: break-all; }
.themes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.themes button { font: 600 12px/1 system-ui, sans-serif; color: var(--ink); background: var(--paper-2); border: 1px solid var(--line); border-radius: 999px; padding: 7px 11px; cursor: pointer; }
.themes button[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: transparent; }
.hotlist { list-style: none; margin: 0; padding: 0; }
.hotlist .group { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 12px 4px 4px; }
.hotlist li.item { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: 10px; cursor: pointer; }
.hotlist li.item:hover { background: rgba(255,255,255,.7); }
.hotlist li.item.active { background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.hotlist li.item.filtered, .hotlist li.group.filtered { display: none; }
.hotlist .n { flex: 0 0 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font: 700 11px/26px system-ui; text-align: center; }
.hotlist li.item.tower .n { background: #1d1a16; }
.hotlist .nm { flex: 1; font-weight: 500; }
.hotlist .kind { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

#panelDetail .back { font: 600 13px system-ui; background: none; border: 0; color: var(--muted); padding: 2px 0 10px; cursor: pointer; }
.detail-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.detail-head .num { flex: 0 0 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; font: 700 13px/34px system-ui; text-align: center; }
.detail-head h2 { font-size: 20px; line-height: 1.15; margin: 0; letter-spacing: -.01em; }
.postcard { margin: 0 0 10px; position: relative; }
.postcard .strip { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: 12px; background: var(--paper-2); -webkit-overflow-scrolling: touch; }
.postcard .strip::-webkit-scrollbar { display: none; }
.postcard .slide { flex: 0 0 100%; scroll-snap-align: start; scroll-snap-stop: always; }
.postcard .media { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; display: block; background: var(--paper-2); }
.postcard .strip.wide .media { aspect-ratio: 16 / 9; }
.postcard .poster { position: relative; }
.postcard .poster img { width: 100%; aspect-ratio: inherit; object-fit: cover; display: block; }
.postcard .poster .play { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: rgba(29,26,22,.7); }
.postcard .poster .play::after { content: ""; position: absolute; left: 18px; top: 13px; border-style: solid; border-width: 9px 0 9px 14px; border-color: transparent transparent transparent #fff; }
.postcard .dots { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.postcard .dot { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 50%; background: rgba(29,26,22,.22); cursor: pointer; }
.postcard .dot[aria-current="true"] { background: var(--accent); }
.postcard .arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border: 0; border-radius: 50%; background: rgba(247,243,236,.9); color: var(--ink); font: 700 18px/32px system-ui; cursor: pointer; opacity: 0; transition: opacity .15s; }
.postcard .arrow.prev { left: 8px; } .postcard .arrow.next { right: 8px; }
.postcard .arrow[disabled] { visibility: hidden; }
@media (hover: hover) { .postcard:hover .arrow:not([disabled]) { opacity: 1; } }
.postcard.single .dots, .postcard.single .arrow { display: none; }
.postcard figcaption { font-size: 11px; color: var(--muted); margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.badge { display: inline-block; white-space: nowrap; font: 700 10px/1 system-ui; letter-spacing: .06em; text-transform: uppercase; padding: 4px 7px; border-radius: 999px; background: var(--paper-2); color: var(--ink); border: 1px solid var(--line); }
.badge.ai { background: #fff2e4; border-color: #f0c9a3; color: #8a4c12; }
.badge.developer { background: #e8f0e6; border-color: #b9d1b4; color: #2f5a2a; }
.badge.video, .badge.embed { background: #e8f0e6; border-color: #b9d1b4; color: #2f5a2a; }
.badge.ai-video { background: #fff2e4; border-color: #f0c9a3; color: #8a4c12; }
.caption { margin: 0 0 12px; font-size: 14px; line-height: 1.5; }
.detail-actions { display: flex; gap: 8px; }
.detail-actions .btn { padding: 8px 12px; font-size: 13px; }

/* ---- intro ---- */
#intro { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(29,26,22,.28); backdrop-filter: blur(6px); transition: opacity .6s ease; z-index: 10; }
#intro.hide { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .6s ease, visibility 0s linear .6s; }
#intro .card { width: min(520px, calc(100% - 32px)); background: var(--paper); border-radius: 18px; padding: 28px 28px 24px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.45); }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
#intro h1 { font-size: clamp(26px, 4vw, 36px); line-height: 1.1; margin: 8px 0 4px; letter-spacing: -.01em; }
#intro .sub { margin: 0 0 14px; color: var(--muted); font-weight: 500; }
#intro .disc { margin: 0 0 18px; font-size: 13px; color: var(--muted); border-left: 3px solid var(--line); padding-left: 10px; }

/* ---- phone: bottom sheet ---- */
@media (max-width: 760px) {
  html:not(.fx-blur) .chip, html:not(.fx-blur) .btn, html:not(.fx-blur) #panel, html:not(.fx-blur) #compass, html:not(.fx-blur) #tourbar, html:not(.fx-blur) #intro { backdrop-filter: none; -webkit-backdrop-filter: none; }
  html:not(.fx-blur) .chip, html:not(.fx-blur) .btn, html:not(.fx-blur) #compass { background: rgba(247,243,236,.97); }
  html:not(.fx-blur) #panel { background: rgba(247,243,236,.98); }
  html:not(.fx-blur) #tourbar { background: rgba(29,26,22,.94); }
  #topbar { padding-left: 10px; padding-right: 10px; gap: 8px; }
  .chip { min-width: 0; max-width: 56%; }
  .chip #titleText { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .btn { padding: 8px 12px; white-space: nowrap; }
  #btnReset { font-size: 0; width: 36px; height: 36px; padding: 0; position: relative; }
  #btnReset::before { content: "↺"; font-size: 18px; line-height: 36px; }
  #credit { display: none; }
  #compass { bottom: auto; top: max(58px, calc(env(safe-area-inset-top) + 58px)); left: auto; right: 10px; width: 44px; height: 44px; }
  #compass .needle::before { top: 5px; border-bottom-width: 14px; } #compass .needle::after { top: 19px; border-top-width: 14px; }
  #panel { top: auto; left: 0; right: 0; bottom: 0; width: auto; height: 62vh; border-radius: 18px 18px 0 0; transition: transform .35s cubic-bezier(.2,.8,.2,1);
    padding-bottom: env(safe-area-inset-bottom); }
  #panel.collapsed { transform: translateY(calc(62vh - var(--sheet-h))); }
  #panel .handle { display: block; flex: 0 0 22px; background: none; border: 0; padding: 0; cursor: pointer; }
  #panel .handle span { display: block; width: 44px; height: 5px; border-radius: 3px; background: rgba(29,26,22,.25); margin: 8px auto 0; }
  #panelHome, #panelDetail { padding: 6px 14px 20px; }
  .facts { grid-template-columns: 1fr 1fr 1fr; padding-bottom: 8px; margin-bottom: 8px; }
  .tours { margin-bottom: 8px; }
  #panel.collapsed .facts .wide { display: none; }   /* RERA line only when expanded */
  .tours button { padding: 7px 8px; border-radius: 10px; }
  .tours button small { display: none; }
  .pin { --min: .85; }
  #tourbar { bottom: calc(var(--sheet-h) + 10px); width: calc(100% - 20px); padding: 8px 10px 8px 12px; }
  #panel:not(.collapsed) ~ #tourbar { display: none; }
  .facts .wide { grid-column: 1 / -1; font-size: 11px; }
  .facts .wide b { font-size: 11px; }
  .detail-head h2 { font-size: 18px; }
}
