/* The building — twilight dusk architectural model with video-matched cinema veil (embedded & standalone) */
.page-building { overflow: hidden; height: 100vh; height: 100svh; color: #fff;
  background: linear-gradient(180deg, #1a2332 0%, #3a4351 34%, #7a7068 72%, #ad937a 100%); }
.page-building .site-header { background: transparent; border-bottom-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }

.bld { position: fixed; inset: 0; color: #fff; }
.bld--embedded {
  position: absolute; inset: 0; z-index: 6;
  background: linear-gradient(180deg, #1a2332 0%, #3a4351 34%, #7a7068 72%, #ad937a 100%);
  opacity: var(--bld-fade, 0); pointer-events: none; visibility: hidden;
}
/* Directional cinema veil & top header vignette matching the video scroll chapters */
.bld::before {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(90deg, rgba(11, 14, 20, .88) 0%, rgba(11, 14, 20, .68) 34%, rgba(11, 14, 20, .22) 55%, rgba(11, 14, 20, 0) 72%);
}
html[dir="rtl"] .bld::before {
  background: linear-gradient(270deg, rgba(11, 14, 20, .88) 0%, rgba(11, 14, 20, .68) 34%, rgba(11, 14, 20, .22) 55%, rgba(11, 14, 20, 0) 72%);
}
.bld--embedded::before { opacity: var(--bld-ui, 0); }
.bld::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 150px; z-index: 2; pointer-events: none;
  background: linear-gradient(180deg, rgba(10, 12, 18, .52), rgba(10, 12, 18, 0));
}

.story.bld-visible .bld--embedded { visibility: visible; }
.story.explore-on .bld--embedded { pointer-events: auto; }
.bld--embedded .bld__panel {
  opacity: var(--bld-ui, 0);
  transform: translate3d(calc((1 - var(--bld-ui, 0)) * -18px), 0, 0);
  pointer-events: none;
}
html[dir="rtl"] .bld--embedded .bld__panel {
  transform: translate3d(calc((1 - var(--bld-ui, 0)) * 18px), 0, 0);
}
.story.explore-on .bld--embedded .bld__panel { pointer-events: auto; }
.bld--embedded .bld__hint,
.bld--embedded .bld__coords { opacity: var(--bld-ui, 0); }
.bld--embedded.is-open .bld__hint { opacity: 0; }
.story.explore-on .hud__readout { opacity: 0; pointer-events: none; transition: opacity 250ms var(--ease-out); }
.story.explore-on .story__progress { background: rgba(255, 255, 255, .14); z-index: 8; }
.story.explore-on .story__progress i { background: var(--gold-2); }

.bld__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; outline: none; }
.bld--embedded .bld__canvas { touch-action: pan-y; }
.bld__canvas:active { cursor: grabbing; }

/* ---------- borderless floating panel (matches video chapters) ---------- */
.bld__panel { position: absolute; z-index: 5; inset-inline-start: var(--pad); top: 92px; bottom: 72px; width: min(420px, 35vw); display: flex; flex-direction: column; justify-content: safe center; gap: 18px; overflow-y: auto; scrollbar-width: none; padding: 0; background: none; border: 0; box-shadow: none; }
.bld.is-open .bld__panel, .is-open .bld__panel { justify-content: flex-start; }
.bld__panel::-webkit-scrollbar { display: none; }
.bld__intro .label { display: inline-flex; align-items: center; gap: 14px; color: var(--gold-2); opacity: 1; }
.bld__intro .label::after { content: ""; width: 48px; height: 1px; background: var(--gold-2); opacity: .65; }
.bld__title { font-family: var(--serif); font-weight: 800; font-size: clamp(2rem, 3.6vw, 3.8rem); line-height: 1.04; letter-spacing: -.04em; margin: 10px 0 12px; color: #fff; text-shadow: 0 2px 32px rgba(10, 8, 6, .45); }
html[lang="ar"] .bld__title { line-height: 1.24; letter-spacing: 0; }
.bld__title > span { display: block; }
.bld__title em { display: block; font-style: normal; color: var(--gold-2); }
.bld__lede { margin: 0; color: rgba(255, 255, 255, .86); font-size: 15px; max-width: 27em; text-shadow: 0 1px 16px rgba(10, 8, 6, .45); }

.bld__levels { list-style: none; margin: 0; padding: 0; border-top: 1px solid rgba(255, 255, 255, .20); }
.bld__levels button { width: 100%; display: grid; grid-template-columns: 12px 46px 1fr 14px; align-items: center; gap: 12px; padding: 10px 8px; border-bottom: 1px solid rgba(255, 255, 255, .20); text-align: start; border-radius: 0; color: #fff; transition: background-color 180ms var(--ease-out), transform 160ms var(--ease-out); }
.bld__levels button::after { content: ""; width: 7px; height: 7px; border-top: 1.5px solid var(--gold-2); border-inline-end: 1.5px solid var(--gold-2); transform: rotate(45deg); opacity: 0; transition: opacity 180ms var(--ease-out); justify-self: end; }
html[dir="rtl"] .bld__levels button::after { transform: rotate(-45deg); }
.bld__levels button i { width: 12px; height: 12px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.bld__levels button b { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .08em; color: var(--gold-2); direction: ltr; text-align: start; }
.bld__levels button > span { font-size: 16px; font-weight: 500; transition: transform 220ms var(--ease-out); text-shadow: 0 1px 12px rgba(10, 8, 6, .35); }
.bld__levels button:active { transform: scale(.985); }
.bld__levels button.is-hover, .bld__levels button.is-on { background: rgba(230, 205, 156, .14); }
.bld__levels button.is-hover::after, .bld__levels button.is-on::after { opacity: .9; }
.bld__levels button.is-hover > span, .bld__levels button.is-on > span { transform: translateX(6px); }
html[dir="rtl"] .bld__levels button.is-hover > span, html[dir="rtl"] .bld__levels button.is-on > span { transform: translateX(-6px); }
@media (hover: hover) and (pointer: fine) { .bld__levels button:hover { background: rgba(230, 205, 156, .14); } }
.bld.is-open .bld__levels, .is-open .bld__levels { display: none; }

/* ---------- an open level ---------- */
.bld__detail { display: grid; gap: 12px; }
.bld__detail[hidden] { display: none; }
.bld__back { display: inline-flex; align-items: center; gap: 10px; justify-self: start; height: 40px; padding-inline: 14px 18px; border-radius: 999px; background: rgba(255, 255, 255, .10); border: 1px solid rgba(255, 255, 255, .24); color: #fff; font-size: 13.5px; font-weight: 500; transition: transform 160ms var(--ease-out), background-color 200ms var(--ease-out), color 200ms var(--ease-out), border-color 200ms var(--ease-out); }
.bld__back svg { width: 15px; height: 15px; }
html[dir="rtl"] .bld__back svg { transform: scaleX(-1); }
.bld__back:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) { .bld__back:hover { background: var(--gold-2); color: var(--ink); border-color: var(--gold-2); } }
.bld__num { margin: 8px 0 0; font-family: var(--mono); font-size: 12px; letter-spacing: .14em; color: var(--gold-2); }
.bld__dtitle { margin: 0; font-family: var(--serif); font-weight: 800; font-size: clamp(2rem, 3.2vw, 3.3rem); line-height: 1.08; letter-spacing: -.035em; color: #fff; text-shadow: 0 2px 24px rgba(10, 8, 6, .45); }
html[lang="ar"] .bld__dtitle { line-height: 1.35; letter-spacing: 0; }
.bld__ddesc { margin: 0; color: rgba(255, 255, 255, .82); font-size: 15px; text-shadow: 0 1px 14px rgba(10, 8, 6, .45); }
.bld__rooms { display: grid; gap: 7px; margin-top: 4px; }
.bld__room { display: grid; grid-template-columns: 10px 1fr; gap: 12px; align-items: center; text-align: start; padding: 11px 14px; border-radius: 12px; background: rgba(11, 16, 24, .56); border: 1px solid rgba(255, 255, 255, .16); color: #fff; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); font-size: 14.5px; font-weight: 500; transition: background-color 180ms var(--ease-out), color 180ms var(--ease-out), border-color 180ms var(--ease-out), transform 160ms var(--ease-out); }
.bld__room i { width: 10px; height: 10px; border-radius: 50%; }
.bld__room:active { transform: scale(.985); }
.bld__room.is-on { background: var(--gold-2); color: var(--ink); border-color: var(--gold-2); box-shadow: 0 12px 30px rgba(8, 12, 18, .28); }
@media (hover: hover) and (pointer: fine) { .bld__room:not(.is-on):hover { background: rgba(255, 255, 255, .14); border-color: rgba(230, 205, 156, .45); } }
.bld__card { padding: 16px 18px; border-radius: 12px; background: rgba(11, 16, 24, .88); border: 1px solid rgba(255, 255, 255, .14); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); color: #fff; display: grid; gap: 8px; }
.bld__card[hidden] { display: none; }
.bld__card-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; margin-bottom: 4px; display: block; }
.bld__card b { font-family: var(--serif); font-size: 1.2rem; font-weight: 700; letter-spacing: -.02em; }
.bld__card p { margin: 0; opacity: .84; font-size: 14px; line-height: 1.65; }
.bld__wa {
  margin-top: 4px; justify-self: start; display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding-inline: 16px; border-radius: 999px;
  background: var(--gold-2); color: var(--ink); font-size: 13px; font-weight: 600;
  transition: background-color 180ms var(--ease-out), transform 160ms var(--ease-out);
}
.bld__wa[hidden] { display: none; }
.bld__wa:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) { .bld__wa:hover { background: #fff; } }
.bld__link { justify-self: start; font-size: 14px; color: var(--gold-2); border-bottom: 1px solid rgba(230, 205, 156, .45); padding-bottom: 2px; }
.bld__link[hidden] { display: none; }

/* ---------- hover preview window ---------- */
.bld__preview {
  position: absolute; z-index: 6; bottom: 72px; inset-inline-end: var(--pad);
  width: min(340px, 31vw); border-radius: 12px; overflow: hidden;
  background: rgba(11, 16, 24, .92); color: #fff;
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 24px 60px rgba(8, 12, 18, .42);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  opacity: 0; pointer-events: none;
  transform: translate3d(0, 10px, 0) scale(.98);
  transition: opacity 200ms var(--ease-out), transform 220ms var(--ease-out);
}
.bld__preview.is-on { opacity: 1; pointer-events: auto; transform: translate3d(0, 0, 0) scale(1); }
.bld__preview-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; background: rgba(255, 255, 255, .05);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.bld__preview-dots { display: inline-flex; gap: 5px; }
.bld__preview-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .28); }
.bld__preview-host {
  font-family: var(--mono); font-size: 11px; color: rgba(255, 255, 255, .72);
  direction: ltr; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bld__preview-badge {
  font-family: var(--mono); font-size: 10.5px; font-weight: 600; color: #0b1018;
  padding: 2px 7px; border-radius: 999px; direction: ltr;
}
.bld__preview-media { aspect-ratio: 16 / 9; background: #141a24; overflow: hidden; }
.bld__preview-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bld__preview-body { padding: 12px 14px 14px; display: grid; gap: 6px; }
.bld__preview-body b { font-family: var(--serif); font-size: 1.05rem; font-weight: 700; line-height: 1.3; }
.bld__preview-body p { margin: 0; font-size: 12.5px; line-height: 1.55; color: rgba(255, 255, 255, .78); }
.bld__preview-foot { margin-top: 4px; display: flex; align-items: center; }
.bld__preview-site {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: var(--gold-2); color: var(--ink); font-size: 12px; font-weight: 600;
  transition: background-color 160ms var(--ease-out);
}
.bld__preview-site[hidden], .bld__preview-hint[hidden] { display: none; }
@media (hover: hover) and (pointer: fine) { .bld__preview-site:hover { background: #fff; } }
.bld__preview-hint { font-size: 11.5px; color: rgba(255, 255, 255, .56); }

/* ---------- floating labels ---------- */
.bld__labels { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.bld__pill { position: absolute; left: 0; top: 0; pointer-events: auto; padding: 7px 13px; border-radius: 999px; background: rgba(11, 16, 24, .88); border: 1px solid rgba(255, 255, 255, .18); color: #fff; font-size: 12.5px; font-weight: 600; white-space: nowrap; box-shadow: 0 8px 22px rgba(8, 12, 18, .28); opacity: 0; transition: opacity 220ms var(--ease-out), background-color 160ms var(--ease-out), color 160ms var(--ease-out), border-color 160ms var(--ease-out); }
.bld__pill.is-on { background: var(--gold-2); color: var(--ink); border-color: var(--gold-2); }
.bld__tag { position: absolute; left: 0; top: 0; z-index: 4; pointer-events: none; display: flex; align-items: center; gap: 10px; padding: 8px 15px 8px 12px; border-radius: 999px; background: rgba(11, 16, 24, .90); border: 1px solid rgba(255, 255, 255, .16); color: #fff; font-size: 13.5px; font-weight: 500; white-space: nowrap; opacity: 0; margin-top: -18px; }
.bld__tag b { font-family: var(--mono); font-size: 11.5px; font-weight: 500; color: var(--gold-2); letter-spacing: .08em; direction: ltr; }
html[dir="rtl"] .bld__tag { margin-inline-start: 0; }

/* ---------- hints ---------- */
.bld__hint { position: absolute; z-index: 4; bottom: 26px; left: 50%; transform: translateX(-50%); display: flex; gap: 22px; padding: 10px 20px; border-radius: 999px; background: rgba(11, 16, 24, .62); border: 1px solid rgba(255, 255, 255, .14); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: rgba(255, 255, 255, .86); font-size: 13px; white-space: nowrap; transition: opacity 300ms var(--ease-out); }
.bld__hint > span { display: inline-flex; align-items: center; gap: 8px; }
.bld__hint svg { width: 17px; height: 17px; }
.bld.is-open .bld__hint, .is-open .bld__hint { opacity: 0; pointer-events: none; }
.bld__coords { position: absolute; z-index: 4; bottom: 30px; inset-inline-end: var(--pad); margin: 0; display: flex; align-items: center; gap: 12px; font-family: var(--mono); font-size: 11px; color: rgba(255, 255, 255, .76); }
.bld__coords i { width: 64px; height: 6px; border: 1.2px solid currentColor; border-top: 0; opacity: .7; }

@media (max-width: 1024px) {
  .bld__panel { width: min(330px, 41vw); top: 96px; bottom: 78px; gap: 20px; }
  .bld__title { font-size: clamp(1.9rem, 3.6vw, 2.7rem); }
  .bld__coords { display: none; }
  .bld__pill { font-size: 11.5px; padding: 6px 11px; }
}
@media (max-width: 720px) {
  .bld::before {
    background: linear-gradient(0deg, rgba(11, 14, 20, .86) 0%, rgba(11, 14, 20, .35) 48%, rgba(11, 14, 20, 0) 72%);
  }
  .bld__panel { top: auto; bottom: 0; inset-inline: 0; width: auto; max-height: 50svh; justify-content: flex-start; gap: 14px; padding: 16px var(--pad) 22px; border-radius: 16px 16px 0 0; background: rgba(11, 16, 24, .90); border: 1px solid rgba(255, 255, 255, .14); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: 0 -12px 40px rgba(8, 12, 18, .35); }
  .bld--embedded .bld__panel { bottom: 68px; border-radius: 16px; inset-inline: 10px; max-height: 46svh; }
  .bld__title { font-size: 1.85rem; margin: 4px 0 6px; }
  .bld__lede, .bld__hint { display: none; }
  .bld__levels button { padding: 10px 6px; }
  .bld__levels button > span { font-size: 15px; }
  .bld__dtitle { font-size: 1.65rem; }
  .page-building .mobile-bar { display: none; }
  .bld__pill { font-size: 10.5px; padding: 5px 9px; }
  .bld__preview { display: none; }
}
@media (prefers-reduced-motion: reduce) { .bld__levels button > span { transition: none; } }
