/* ===================== ШРИФТЫ (самохостинг, офлайн/ТСПУ-устойчиво) ===================== */
@font-face { font-family:'Inter'; font-style:normal; font-weight:400; font-display:swap;
  src:url('../fonts/inter-latin-400.woff2') format('woff2');
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+2000-206F,U+2074,U+20AC,U+2122,U+2212,U+FEFF,U+FFFD; }
@font-face { font-family:'Inter'; font-style:normal; font-weight:400; font-display:swap;
  src:url('../fonts/inter-cyrillic-400.woff2') format('woff2');
  unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+20BD,U+2116; }
@font-face { font-family:'Inter'; font-style:normal; font-weight:500; font-display:swap;
  src:url('../fonts/inter-latin-500.woff2') format('woff2');
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+2000-206F,U+2074,U+20AC,U+2122,U+2212,U+FEFF,U+FFFD; }
@font-face { font-family:'Inter'; font-style:normal; font-weight:500; font-display:swap;
  src:url('../fonts/inter-cyrillic-500.woff2') format('woff2');
  unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+20BD,U+2116; }
@font-face { font-family:'Cormorant'; font-style:normal; font-weight:500; font-display:swap;
  src:url('../fonts/cormorant-latin-500.woff2') format('woff2');
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+2000-206F,U+20AC,U+2122,U+FEFF,U+FFFD; }
@font-face { font-family:'Cormorant'; font-style:normal; font-weight:500; font-display:swap;
  src:url('../fonts/cormorant-cyrillic-500.woff2') format('woff2');
  unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+20BD,U+2116; }
@font-face { font-family:'Cormorant'; font-style:normal; font-weight:600; font-display:swap;
  src:url('../fonts/cormorant-latin-600.woff2') format('woff2');
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+2000-206F,U+20AC,U+2122,U+FEFF,U+FFFD; }
@font-face { font-family:'Cormorant'; font-style:normal; font-weight:600; font-display:swap;
  src:url('../fonts/cormorant-cyrillic-600.woff2') format('woff2');
  unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+20BD,U+2116; }

/* ===================== ДИЗАЙН-ТОКЕНЫ — Editorial / архитектурный ===================== */
:root {
  --paper: #ECE7DC;          /* фон-страница, тёплая кость */
  --surface: #F4F0E8;        /* панели/карточки */
  --surface-2: #E4DED1;      /* инсеты, тайлы, план */
  --ink: #211F1B;            /* основной текст */
  --ink-2: #6E685D;          /* вторичный */
  --ink-3: #948C7D;          /* лейблы/подсказки */
  --line: rgba(33,31,27,0.13);   /* волосяная линия */
  --line-2: rgba(33,31,27,0.24); /* акцентная линия */

  /* --- БРЕНДИНГ застройщика: 2 акцента + имя/город в data.js --------------- */
  --bronze: #9B7A4A;         /* акцент: цена, выбранный этаж, ссылки */
  --bronze-d: #7B5E36;       /* тёмная бронза (текст на бронзе) */
  --green: #2E4636;          /* основное действие (кнопки) */
  --green-d: #20332715;      /* зелёная подложка */
  /* ----------------------------------------------------------------------- */

  --available: #2E4636;      /* свободна — зелёный */
  --booked: #9B7A4A;         /* бронь — бронза */
  --sold: #A39B8C;           /* продана — тёплый серый */

  --r: 12px;
  --r-sm: 8px;
  --shadow: 0 18px 48px rgba(45,36,20,0.10);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --serif: 'Cormorant', Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(130% 120% at 50% -10%, #F2EDE3 0%, #E7E1D3 60%, #E1DACB 100%);
  display: flex; flex-direction: column; user-select: none;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
.serif { font-family: var(--serif); font-weight: 500; }
.lbl { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; }

/* ===================== ШАПКА ===================== */
.topbar {
  height: 74px; flex: 0 0 auto; display: flex; align-items: center; gap: 24px;
  padding: 0 28px; background: rgba(244,240,232,0.82); border-bottom: 1px solid var(--line);
  z-index: 30; backdrop-filter: saturate(115%) blur(8px);
}
.brand { display: flex; align-items: center; gap: 13px; }
.brand__logo {
  width: 40px; height: 40px; border-radius: 7px; display: grid; place-items: center;
  font-family: var(--serif); font-weight: 600; font-size: 22px; color: var(--ink);
  background: transparent; border: 1px solid var(--ink);
}
.brand__name { font-family: var(--serif); font-size: 22px; font-weight: 600; letter-spacing: .01em; line-height: 1.05; }
.brand__sub { font-size: 11px; color: var(--ink-3); margin-top: 3px; letter-spacing: .12em; text-transform: uppercase; }

.breadcrumbs { display: flex; align-items: center; gap: 4px; flex: 1; font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }
.crumb { display: inline-flex; align-items: center; padding: 5px 9px; border: none; background: transparent; color: var(--ink-2); cursor: pointer; transition: .15s; white-space: nowrap; letter-spacing: .02em; border-radius: 0; }
.crumb:hover { color: var(--ink); }
.crumb--active { color: var(--ink); box-shadow: inset 0 -1px 0 var(--bronze); }
.crumb__sep { color: var(--ink-3); margin: 0 2px; }

.topbar__right { display: flex; align-items: center; gap: 22px; }
.legend { display: flex; gap: 16px; font-size: 11px; color: var(--ink-3); letter-spacing: .1em; text-transform: uppercase; }
.legend__item { display: inline-flex; align-items: center; gap: 7px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot--available { background: var(--available); }
.dot--booked { background: var(--booked); }
.dot--sold { background: var(--sold); }

.btn {
  font-family: var(--font); font-size: 13px; font-weight: 500; letter-spacing: .03em;
  padding: 11px 18px; border-radius: var(--r-sm); border: 1px solid var(--line-2);
  background: transparent; color: var(--ink); cursor: pointer; transition: .15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:hover { background: var(--surface-2); border-color: var(--ink); }
.btn--ghost { background: transparent; }
.btn--accent { background: var(--green); color: var(--paper); border-color: var(--green); }
.btn--accent:hover { background: #25382B; color: var(--paper); }
.btn--block, .btn--wide { width: 100%; }
.btn--lg { padding: 14px 22px; font-size: 14px; }
.btn[disabled] { cursor: not-allowed; }

/* ===================== СЦЕНА ===================== */
.stage { position: relative; flex: 1 1 auto; overflow: hidden; }
.view { position: absolute; inset: 0; touch-action: none; }
.view[hidden] { display: none; }
canvas { display: block; width: 100%; height: 100%; touch-action: none; }

.hintbar {
  flex: 0 0 auto; height: 42px; display: grid; place-items: center;
  font-size: 11px; color: var(--ink-3); letter-spacing: .14em; text-transform: uppercase;
  background: rgba(244,240,232,0.7); border-top: 1px solid var(--line);
}

/* Ярлык над этажом */
.floor-tip {
  position: absolute; z-index: 20; pointer-events: none; transform: translate(-50%, -120%);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 9px 15px; box-shadow: var(--shadow); white-space: nowrap;
}
.floor-tip__f { font-family: var(--serif); font-size: 20px; font-weight: 600; color: var(--bronze-d); }
.floor-tip__m { font-size: 11px; color: var(--ink-2); margin-top: 1px; letter-spacing: .04em; }
.floor-tip[hidden] { display: none; }

/* ===================== КАРТОЧКА КВАРТИРЫ ===================== */
.apt-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: 430px; z-index: 25;
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow);
  transform: translateX(0); transition: transform .4s cubic-bezier(.22,1,.36,1);
  display: flex; flex-direction: column; overflow: hidden;
}
.apt-panel[hidden] { display: none; }
.apt-panel.is-hidden { transform: translateX(100%); }
.apt-head { padding: 24px 26px 18px; border-bottom: 1px solid var(--line); }
.apt-head__top { display: flex; align-items: flex-start; justify-content: space-between; }
.apt-num { font-size: 11px; color: var(--ink-3); letter-spacing: .14em; text-transform: uppercase; }
.apt-title { font-family: var(--serif); font-size: 32px; font-weight: 600; margin-top: 6px; line-height: 1; }
.apt-rooms { font-size: 13px; color: var(--ink-2); margin-top: 6px; letter-spacing: .02em; }
.badge { font-size: 10.5px; font-weight: 500; padding: 5px 12px; border-radius: 30px; letter-spacing: .12em; text-transform: uppercase; border: 1px solid currentColor; background: transparent; }
.badge--available { color: var(--available); }
.badge--booked { color: var(--bronze-d); }
.badge--sold { color: var(--sold); }
.badge--real { color: var(--bronze-d); border-color: var(--bronze); }
.apt-close { width: 36px; height: 36px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: transparent; color: var(--ink); font-size: 17px; cursor: pointer; }
.apt-close:hover { background: var(--surface-2); }

.apt-body { flex: 1; overflow-y: auto; padding: 20px 26px; touch-action: pan-y; }
.apt-plan { width: 100%; aspect-ratio: 4/3; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); margin-bottom: 8px; }
.apt-plan-cap { font-size: 10.5px; color: var(--ink-3); margin: 0 0 16px; text-align: center; letter-spacing: .1em; text-transform: uppercase; }
.apt-expl { margin: 0 0 20px; }
.apt-expl__r { display: flex; justify-content: space-between; padding: 9px 0; font-size: 13.5px; border-top: 1px solid var(--line); }
.apt-expl__r:first-child { border-top: none; }
.apt-expl__r span:first-child { color: var(--ink-2); }
.apt-expl__r span:last-child { font-weight: 500; }
.apt-price { font-family: var(--serif); font-size: 38px; font-weight: 600; line-height: 1; }
.apt-perm { font-size: 11px; color: var(--ink-3); margin-top: 6px; margin-bottom: 20px; letter-spacing: .12em; text-transform: uppercase; }

.specs { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; margin-bottom: 20px; }
.spec { border-top: 1px solid var(--line); padding: 11px 0; }
.spec__k { font-size: 10.5px; color: var(--ink-3); letter-spacing: .12em; text-transform: uppercase; }
.spec__v { font-size: 16px; font-weight: 500; margin-top: 4px; }

.apt-actions { display: flex; flex-direction: column; gap: 10px; padding: 18px 26px; border-top: 1px solid var(--line); }
.apt-actions .row { display: flex; gap: 10px; }
.apt-actions .row .btn { flex: 1; }

/* ===================== HOTSPOT-МАРКЕРЫ (тур / инфра) ===================== */
.hotspot {
  position: absolute; z-index: 15; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 9px; cursor: pointer;
  padding: 7px 15px 7px 7px; border-radius: 30px;
  background: rgba(244,240,232,0.92); border: 1px solid var(--line-2);
  white-space: nowrap; transition: .15s; box-shadow: var(--shadow);
}
.hotspot:hover { border-color: var(--bronze); transform: translate(-50%, -50%) scale(1.05); }
.hotspot__ic { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--bronze); color: var(--paper); font-size: 13px; font-weight: 500; }
.hotspot__lb { font-size: 13px; font-weight: 500; color: var(--ink); letter-spacing: .02em; }
.hotspot--infra .hotspot__ic { background: var(--green); color: var(--paper); }
.hotspot--pulse::after { content:''; position:absolute; inset:-6px; border-radius:30px; border:1px solid var(--bronze); opacity:0; animation: pulse 2.6s infinite; }
@keyframes pulse { 0%{opacity:.5; transform:scale(.92)} 70%{opacity:0; transform:scale(1.22)} 100%{opacity:0} }

/* Бейдж комнаты в туре */
.scene-badge {
  position: absolute; left: 26px; bottom: 24px; z-index: 16;
  background: rgba(244,240,232,0.92); border: 1px solid var(--line);
  border-radius: var(--r); padding: 13px 20px; box-shadow: var(--shadow);
}
.scene-badge__t { font-family: var(--serif); font-size: 21px; font-weight: 600; }
.scene-badge__s { font-size: 11px; color: var(--ink-2); margin-top: 2px; letter-spacing: .04em; }

.scene-hint { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); z-index: 16; font-size: 11px; color: var(--ink-2); background: rgba(244,240,232,0.9); padding: 8px 18px; border-radius: 30px; border: 1px solid var(--line); letter-spacing: .06em; text-transform: uppercase; }

.height-switch { position: absolute; right: 26px; bottom: 24px; z-index: 16; display: flex; flex-direction: column; gap: 8px; background: rgba(244,240,232,0.92); border: 1px solid var(--line); border-radius: var(--r); padding: 13px; }
.height-switch label { font-size: 11px; color: var(--ink-2); letter-spacing: .1em; text-transform: uppercase; }

/* Титры источников (CC-BY кухни) — ненавязчиво, bottom-right тура */
.scene-credit { position: absolute; right: 26px; bottom: 24px; z-index: 16; }
.scene-credit__btn { font-family: var(--font); font-size: 10px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); background: rgba(244,240,232,0.9); border: 1px solid var(--line); border-radius: 30px; padding: 7px 14px; cursor: pointer; transition: .15s; }
.scene-credit__btn:hover { color: var(--ink); border-color: var(--ink-3); }
.scene-credit__pop { position: absolute; right: 0; bottom: calc(100% + 8px); width: 266px; background: rgba(244,240,232,0.97); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px 16px; }
.scene-credit__pop[hidden] { display: none; }
.scene-credit__h { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 9px; }
.scene-credit__row { font-size: 11.5px; color: var(--ink-2); line-height: 1.5; padding: 6px 0; border-top: 1px solid var(--line); }
.scene-credit__row b { color: var(--ink); font-weight: 500; }
.scene-credit__lic { color: var(--bronze-d); letter-spacing: .02em; }

/* ===================== ЛОАДЕР ===================== */
.loader { position: absolute; inset: 0; z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: var(--paper); color: var(--ink-3); transition: opacity .4s; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; }
.loader[hidden] { display: none; }
.loader__ring { width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--bronze); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.fade-in { animation: fade .45s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* тост-подтверждение */
.toast {
  position: absolute; left: 50%; bottom: 70px; transform: translate(-50%, 18px);
  background: var(--green); color: var(--paper);
  font-weight: 500; font-size: 14px; letter-spacing: .02em; padding: 14px 26px; border-radius: var(--r);
  box-shadow: var(--shadow); z-index: 50; opacity: 0; pointer-events: none;
  transition: opacity .3s, transform .3s; max-width: 80%; text-align: center;
}
.toast--show { opacity: 1; transform: translate(-50%, 0); }

/* ===================== ЗАЯВКА В CRM (модалка) ===================== */
.modal {
  position: absolute; inset: 0; z-index: 60; display: none;
  align-items: center; justify-content: center; padding: 20px;
  background: rgba(33,28,18,0.42); backdrop-filter: blur(2px);
}
.modal.is-open { display: flex; animation: fade .25s ease; }
.modal__card {
  position: relative; width: 100%; max-width: 430px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r); padding: 30px 28px 22px;
  box-shadow: var(--shadow); max-height: 92%; overflow-y: auto;
}
.modal__x { position: absolute; right: 16px; top: 16px; width: 34px; height: 34px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: transparent; color: var(--ink); font-size: 17px; cursor: pointer; }
.modal__x:hover { background: var(--surface-2); }
.modal__h { font-family: var(--serif); font-size: 26px; font-weight: 600; line-height: 1; }
.modal__sub { font-size: 12px; color: var(--ink-2); margin-top: 8px; margin-bottom: 22px; letter-spacing: .03em; }
.fld { display: block; margin-bottom: 14px; }
.fld > span { display: block; font-size: 11px; color: var(--ink-3); margin-bottom: 7px; letter-spacing: .1em; text-transform: uppercase; }
.fld > span i { color: var(--ink-3); font-style: normal; text-transform: none; letter-spacing: 0; }
.fld input, .fld textarea {
  width: 100%; box-sizing: border-box; background: var(--paper); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 12px 14px; font-size: 16px; font-family: inherit;
}
.fld input:focus, .fld textarea:focus { outline: none; border-color: var(--green); }
.fld textarea { resize: vertical; }
.fld-err { color: #A33; font-size: 13px; margin: 2px 0 12px; }
.fld-err[hidden] { display: none; }
.modal__note { font-size: 11px; color: var(--ink-3); text-align: center; margin-top: 14px; letter-spacing: .02em; }

/* кнопка фуллскрина (киоск) */
.fs-btn {
  position: fixed; right: 16px; bottom: 16px; z-index: 45; width: 38px; height: 38px;
  border-radius: var(--r-sm); border: 1px solid var(--line); background: rgba(244,240,232,0.85);
  color: var(--ink-2); font-size: 17px; cursor: pointer;
}
.fs-btn:hover { color: var(--ink); border-color: var(--ink); }
:fullscreen .fs-btn { opacity: .35; }

@media (max-width: 920px) {
  .legend { display: none; }
  .apt-panel { width: 100%; }
  .modal__card { max-width: 100%; }
}
