@font-face { font-family: 'Viaoda'; src: url('/assets/fonts/viaoda-libre-cyrillic-400-normal.woff2') format('woff2'); unicode-range: U+0400-04FF; font-display: swap; }
@font-face { font-family: 'Viaoda'; src: url('/assets/fonts/viaoda-libre-latin-400-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Inter'; font-weight: 400; src: url('/assets/fonts/inter-cyrillic-400-normal.woff2') format('woff2'); unicode-range: U+0400-04FF; font-display: swap; }
@font-face { font-family: 'Inter'; font-weight: 400; src: url('/assets/fonts/inter-latin-400-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Inter'; font-weight: 500; src: url('/assets/fonts/inter-cyrillic-500-normal.woff2') format('woff2'); unicode-range: U+0400-04FF; font-display: swap; }
@font-face { font-family: 'Inter'; font-weight: 500; src: url('/assets/fonts/inter-latin-500-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Inter'; font-weight: 600; src: url('/assets/fonts/inter-cyrillic-600-normal.woff2') format('woff2'); unicode-range: U+0400-04FF; font-display: swap; }
@font-face { font-family: 'Inter'; font-weight: 600; src: url('/assets/fonts/inter-latin-600-normal.woff2') format('woff2'); font-display: swap; }

:root {
  --navy: #182D3A;
  --navy-2: #203847;
  --cream: #F1ECE3;
  --amber: #FFB726;
  --sky: #7DB9C8;
  --glass: rgba(14, 27, 36, .55);
  --line: rgba(241, 236, 227, .16);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; background: var(--navy); color: var(--cream); overflow: hidden; overscroll-behavior: none; }
body { font-family: 'Inter', -apple-system, 'Helvetica Neue', Arial, sans-serif; font-weight: 400; -webkit-font-smoothing: antialiased; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* ---------- фон: размытое продолжение слайда вместо полос ---------- */
#bg { position: fixed; inset: -60px; background: var(--navy) center / cover no-repeat; filter: blur(36px) brightness(.55) saturate(1.1); transform: scale(1.08); transition: background-image .6s var(--ease); }

/* ---------- сцена 1080×1920, вписана в экран ---------- */
#stage { position: fixed; left: 50%; top: 50%; width: calc(1080px * var(--s, .35)); height: calc(1920px * var(--s, .35)); transform: translate(-50%, -50%); overflow: hidden; z-index: 3; pointer-events: none; }
.layer { position: absolute; inset: 0; opacity: 0; transition: opacity .55s var(--ease); will-change: opacity; }
.layer.on { opacity: 1; }
.layer img { width: 100%; height: 100%; display: block; object-fit: cover; transform: scale(1.025); transition: transform .9s var(--ease); }
.layer.on img { transform: scale(1); }
.layer.on.story img { transform: scale(1.06); transition: transform 11s linear; }
#stage::after { content: ''; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.2); }

/* ---------- тап-зоны ---------- */
#taps { position: fixed; inset: 0; z-index: 2; cursor: pointer; }

/* ---------- хотспоты поверх слайда ---------- */
#spots { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
#spots > * { position: absolute; pointer-events: auto; border-radius: 999px; }
.spot-house { width: 11.5%; aspect-ratio: 1; transform: translate(-50%, -50%); }
.spot-house::after { content: ''; position: absolute; inset: 30%; border-radius: 50%; border: 1.5px solid var(--amber); opacity: 0; animation: ping 2.6s var(--ease) infinite; animation-delay: var(--d, 0s); }
@keyframes ping { 0% { opacity: .9; transform: scale(.6); } 70%, 100% { opacity: 0; transform: scale(1.8); } }
.spot-card { border-radius: 18px; }
.spot-card:active, .spot-house:active { background: rgba(241,236,227,.08); }

/* ---------- прогресс по главам ---------- */
#top { position: fixed; top: 0; left: 0; right: 0; z-index: 5; padding: calc(var(--safe-top) + 8px) 12px 18px; pointer-events: none; background: linear-gradient(rgba(8,16,22,.45), rgba(8,16,22,0)); }
#progress { display: flex; gap: 4px; }
#progress .seg { flex: 1; height: 2.5px; border-radius: 2px; background: rgba(241,236,227,.22); overflow: hidden; }
#progress .seg i { display: block; height: 100%; width: 0; background: var(--cream); transition: width .6s var(--ease); }
#progress .seg.cur i { background: var(--amber); }

/* ---------- нижняя панель ---------- */
#bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 18px 14px calc(var(--safe-bottom) + 14px); pointer-events: none; background: linear-gradient(rgba(8,16,22,0), rgba(8,16,22,.5)); transition: opacity .3s; }
#bar > * { pointer-events: auto; }
.glass { background: var(--glass); -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2); border: 1px solid var(--line); }
.icon-btn { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.pager { height: 46px; border-radius: 999px; display: flex; align-items: center; gap: 4px; padding: 0 6px; }
.pager button { width: 38px; height: 38px; display: grid; place-items: center; opacity: .75; }
.pager .count { font-size: 12px; font-weight: 500; letter-spacing: .14em; min-width: 64px; text-align: center; opacity: .8; font-variant-numeric: tabular-nums; }
.btn { height: 50px; border-radius: 999px; padding: 0 26px; font-size: 15px; font-weight: 600; letter-spacing: .01em; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; transition: transform .15s; }
.btn:active { transform: scale(.97); }
.btn-amber { background: var(--amber); color: var(--navy); }
.btn-ghost { color: var(--cream); }
.btn-wide { flex: 1; max-width: 320px; }

.tabs { position: relative; height: 46px; border-radius: 999px; display: grid; grid-template-columns: repeat(3, 1fr); flex: 1; max-width: 320px; padding: 3px; }
.tabs .ind { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / 3); border-radius: 999px; background: var(--cream); transition: transform .4s var(--ease); }
.tabs button { position: relative; z-index: 1; font-size: 13px; font-weight: 600; transition: color .3s; }
.tabs button.on { color: var(--navy); }

/* ---------- меню ---------- */
#menu { position: fixed; inset: 0; z-index: 10; background: rgba(18,34,45,.97); display: flex; flex-direction: column; padding: calc(var(--safe-top) + 18px) 24px calc(var(--safe-bottom) + 20px); opacity: 0; visibility: hidden; transform: translateY(-12px); transition: opacity .35s var(--ease), transform .35s var(--ease), visibility .35s; }
#menu.open { opacity: 1; visibility: visible; transform: none; }
.menu-head { display: flex; align-items: center; justify-content: space-between; }
.eyebrow { font-size: 11px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; opacity: .7; }
.menu-title { font-family: 'Viaoda', serif; font-weight: 400; font-size: 40px; line-height: 1; margin: 14px 0 12px; }
#menu-list { list-style: none; flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; margin: 0 -24px; padding: 0 24px; }
#menu-list li button { width: 100%; display: flex; align-items: baseline; justify-content: space-between; text-align: left; padding: 9px 0; border-bottom: 1px solid rgba(241,236,227,.07); }
#menu-list .ch { font-family: 'Viaoda', serif; font-size: 23px; text-transform: uppercase; letter-spacing: .02em; }
#menu-list .tm { font-family: 'Viaoda', serif; font-size: 18px; color: var(--amber); }
#menu-list .sub button { padding-left: 22px; font-size: 14px; opacity: .72; }
#menu-list .plain button { font-size: 15px; }
#menu-list li.cur button { color: var(--amber); opacity: 1; }
.menu-cta { margin-top: 14px; width: 100%; }

/* ---------- карточка дома ---------- */
#sheet { position: fixed; inset: 0; z-index: 12; visibility: hidden; }
#sheet.open { visibility: visible; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(5,12,17,.55); opacity: 0; transition: opacity .35s; }
#sheet.open .sheet-backdrop { opacity: 1; }
.sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; max-width: 520px; margin: 0 auto; background: var(--navy-2); border-radius: 26px 26px 0 0; padding: 12px 22px calc(var(--safe-bottom) + 20px); transform: translateY(100%); transition: transform .45s var(--ease); }
#sheet.open .sheet-panel { transform: none; }
.sheet-handle { width: 40px; height: 4px; border-radius: 2px; background: rgba(241,236,227,.3); margin: 0 auto 14px; }
.house-head { display: flex; align-items: flex-end; gap: 16px; }
.house-num { font-family: 'Viaoda', serif; font-size: 76px; line-height: .8; }
.chip { display: inline-block; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.house-area { font-size: 15px; opacity: .9; }
.house-note { font-size: 13px; opacity: .65; margin: 14px 0 12px; }
.floors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.floors span { display: block; font-size: 10px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; opacity: .55; margin-bottom: 4px; }
.floors b { font-family: 'Viaoda', serif; font-weight: 400; font-size: 22px; }
.plot { font-size: 12px; opacity: .5; margin-bottom: 16px; }
.sheet-panel .btn { width: 100%; }

/* ---------- подсказка ---------- */
#hint { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 6; display: flex; gap: 90px; font-size: 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; pointer-events: none; opacity: 0; transition: opacity .6s; }
#hint span { white-space: nowrap; padding: 10px 14px; border-radius: 999px; background: var(--glass); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
#hint.show { opacity: 1; }

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