/* главная: сцена с отъездом камеры, карточки номеров (общее — в base.css) */
/* главная — одна сцена без прокрутки: скролл переключает состояния (см. hero.js) */
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body { background: var(--canvas); }

/* ---------- сцена: камера отъезжает, первый экран становится карточкой ---------- */
.hero { position: relative; height: 100vh; height: 100svh; }
.hero__stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: var(--canvas); }

/* сенсорные устройства: адресная строка браузера прячется только при настоящей прокрутке.
   Даём странице небольшой запас прокрутки (--spare): первый свайп прокручивает её — строка уезжает,
   а hero.js в этот момент переключает сцену. Сцена — по живой высоте экрана (dvh), освободившееся место занимает она. */
@media (pointer: coarse) {
  html { height: auto; overflow-x: hidden; overflow-y: auto; }   /* прокручивается корень = сам экран */
  body { height: auto; overflow: visible; }                         /* иначе sticky прилипнет к body, а не к экрану */
  .hero { --spare: 72px; height: calc(100vh + var(--spare)); height: calc(100dvh + var(--spare)); }
  .hero__stage { height: 100vh; height: 100dvh; }
}

.screen {
  position: absolute; left: 0; top: 0;
  width: 100%; height: 100%;
  background: var(--ice); overflow: hidden;
  transform-origin: 0 0; will-change: transform;
}
.screen.is-tile { cursor: pointer; }



.lede {
  position: absolute; left: 0; right: 0; bottom: clamp(88px, 13vh, 132px);
  display: grid; justify-items: center; gap: 14px;
  text-align: center; padding: 0 var(--gut);
}
.lede p { margin: 0; font-size: clamp(14px, 1.05vw, 16px); font-weight: 500; }
.price {
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  padding-bottom: 5px; border-bottom: 1px solid var(--night);
}
.price:hover { border-bottom-color: transparent; }

.screen .corner { position: absolute; z-index: 7; bottom: var(--gut); margin: 0; font-size: 12px; }   /* только уголок внутри первого экрана; кнопки .corner--r закреплены (base.css) */
.corner--l { left: var(--gut); color: var(--slate); }
/* «листайте»: на компьютере — мышь, колёсико уходит вниз; на сенсоре — палец ведёт вверх по короткой дорожке */
.scroll-hint {
  position: absolute; left: 50%; bottom: var(--gut); transform: translateX(-50%); margin: 0;
  display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--slate); transition: opacity .4s ease;
}
.scroll-hint__touch, .scroll-hint__swipe { display: none; }
.scroll-hint__mouse { position: relative; width: 14px; height: 22px; border: 1.5px solid currentColor; border-radius: 8px; opacity: .85; }
.scroll-hint__mouse::after {
  content: ""; position: absolute; left: 50%; top: 4px; width: 2px; height: 5px; margin-left: -1px;
  border-radius: 1px; background: currentColor; animation: wheel 1.8s cubic-bezier(.45, 0, .2, 1) infinite;
}
@keyframes wheel { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } 70% { transform: translateY(8px); opacity: 0; } 100% { transform: translateY(8px); opacity: 0; } }
.scroll-hint__swipe { position: relative; width: 14px; height: 30px; }
.scroll-hint__swipe::before { /* дорожка и уголок «вверх» */
  content: ""; position: absolute; left: 50%; top: 2px; bottom: 2px; width: 1px; margin-left: -.5px;
  background: linear-gradient(to top, transparent, currentColor 70%); opacity: .45;
}
.scroll-hint__swipe::after { /* палец: точка с ореолом едет снизу вверх и тает */
  content: ""; position: absolute; left: 50%; bottom: 0; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%;
  background: currentColor; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 22%, transparent);
  animation: swipe 1.9s cubic-bezier(.5, 0, .2, 1) infinite;
}
@keyframes swipe { 0% { transform: translateY(0) scale(.6); opacity: 0; } 18% { transform: translateY(0) scale(1); opacity: 1; } 75% { transform: translateY(-20px) scale(.9); opacity: 0; } 100% { transform: translateY(-20px); opacity: 0; } }
@media (hover: none) and (pointer: coarse) {
  .scroll-hint__mouse, .scroll-hint__pc { display: none; }
  .scroll-hint__swipe, .scroll-hint__touch { display: block; }
}
@media (prefers-reduced-motion: reduce) { .scroll-hint__mouse::after, .scroll-hint__swipe::after { animation: none; opacity: 1; } }
.is-rooms .scroll-hint { opacity: 0; }
.screen.is-tile .bar a, .screen.is-tile .lede a { pointer-events: none; } /* в карточке весь экран — одна кнопка «назад» */


/* ---------- карточки номеров ---------- */
.rooms { position: absolute; inset: 0; pointer-events: none; }
.room {
  position: absolute; left: 0; top: 0;
  width: var(--cw, 300px); height: var(--ch, 460px);
  color: var(--snow);
  transform-origin: 0 0; will-change: transform;
  container-type: inline-size;
  perspective: calc(var(--cw, 300px) * 3.2);    /* перспектива от ширины — одинаковый «угол» на любом экране */
  pointer-events: auto;
}

/* комната за дверью: тёплый свет — единственный тёплый акцент, как окно в снегопад */
.room__inside { position: absolute; inset: 0; overflow: hidden; background: #1b130c; }
.room__inside img {
  width: 100%; height: 100%; object-fit: cover;
  filter: sepia(.3) saturate(1.15) brightness(.95);
  transform: scale(1.12); transition: transform 1.2s cubic-bezier(.2, .7, .2, 1);
}
.room__inside::after { /* тень от двери слева, свет из щели справа */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to right, rgba(14, 9, 5, .82) 0%, rgba(14, 9, 5, .55) 55%, rgba(255, 186, 112, .18) 88%, rgba(255, 206, 150, .38) 100%);
}
.room__peek {
  position: absolute; z-index: 1; right: 3.6cqw; bottom: 8cqw; margin: 0;
  writing-mode: vertical-rl; transform: rotate(180deg);
  font: 500 3.5cqw/1 "Onest", sans-serif; letter-spacing: .16em; text-transform: uppercase;
  color: #f6dcb4; opacity: 0; transition: opacity .3s ease;
}

/* дверь: петли слева */
.room__door {
  position: absolute; inset: 0;
  display: grid; grid-template-rows: 1fr 31%;
  background: var(--c);
  transform-origin: left center;
  backface-visibility: hidden;
  transition: transform .75s cubic-bezier(.45, 0, .2, 1);
}
.room__door::after { /* дверь уходит от света — темнеет к свободному краю */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to right, rgba(8, 10, 20, 0) 20%, rgba(8, 10, 20, .38));
  opacity: 0; transition: opacity .75s ease;
}

.room__body { position: relative; padding: 8cqw; }
/* слой 1 — цена: полоса-ценник на всю ширину двери — пастельный тон цвета карточки (не белый: белого на сайте много),
   цифры — тёмный тон того же цвета; не сливается ни с тёмным корешком справа, ни с полосой фактов */
.room__price {
  display: flex; align-items: baseline; gap: .4em;
  margin: -8cqw -8cqw 0; padding: 7cqw 8cqw 5.6cqw;
  background: color-mix(in srgb, var(--c) 42%, var(--snow)); color: color-mix(in srgb, var(--c) 82%, #000);
  font: 500 7cqw/1 "Onest", sans-serif; letter-spacing: -.01em; font-variant-numeric: tabular-nums;
}
.room__price span { font-size: .5em; font-weight: 400; letter-spacing: .02em; opacity: .6; }
/* что внутри номера: два факта и строка удобств — тихо, в левой колонке под ценой */
.room__facts {
  /* слой 2 — что внутри: светлая полоса на всю ширину двери прямо под полосой цены.
     Три тона ступенькой: цена темнее, факты светлее, дальше — цвет карточки.
     Доходит ровно до «корешка» с названием справа */
  list-style: none; margin: 0 calc(var(--spine, 24cqw) - 8cqw) 0 -8cqw; padding: 4.2cqw 5cqw 4.4cqw 8cqw;   /* до корешка с названием */
  background: color-mix(in srgb, var(--c) 86%, #fff);
  display: grid; gap: 2.6cqw;
  font: 400 max(12.5px, 3.9cqw)/1.3 "Onest", sans-serif;
}
.room__facts li { display: flex; align-items: flex-start; gap: .6em; }
.room__facts .ic { width: 1.3em; height: 1.3em; margin-top: -.08em; opacity: .8; }
/* слой 4 — удобства: на фото, поверх затемнения снизу */
.room__photo { position: relative; }
.room__photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(10, 14, 28, .72), rgba(10, 14, 28, 0) 58%); pointer-events: none; }
.room__amen {
  position: absolute; z-index: 1; left: 8cqw; right: 8cqw; bottom: 5cqw; margin: 0;
  display: flex; flex-wrap: wrap; gap: .5em 1em;
  font: 500 max(11px, 3.3cqw)/1 "Onest", sans-serif; letter-spacing: .02em; color: var(--snow);
}
.room__amen span { display: inline-flex; align-items: center; gap: .4em; }
.room__amen .ic { width: 1.35em; height: 1.35em; }
/* «корешок»: тёмная вертикальная полоса справа — от полосы цены до фото; в ней название номера.
   Вместе с полосой цены — уголок-рамка; ширину и отступы считает hero.js по толщине названия */
.room__body::before {
  content: ""; position: absolute; top: var(--band, 0px); right: 0; bottom: 0; width: var(--spine, 24cqw);
  background: color-mix(in srgb, var(--c) 76%, #000); pointer-events: none;
}
.room__title {
  position: absolute; z-index: 1; right: var(--spine-pad, 6.5cqw); bottom: 7cqw; margin: 0;
  writing-mode: vertical-rl; transform: rotate(180deg);
  font: 500 14.5cqw/.9 "Onest", sans-serif; letter-spacing: -.035em;
}
/* низ карточки: номера комнат и строка-описание, прижаты к низу слева от вертикального названия */
.room__foot { position: absolute; left: 8cqw; right: calc(var(--spine, 24cqw) + 4cqw); bottom: 7cqw; display: grid; gap: 5cqw; }   /* справа — до вертикального названия */
.room__sub { margin: 0; max-width: 54cqw; font: 500 4.1cqw/1.3 "Onest", sans-serif; }
.room__nums {
  margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: .3em;
  font: 500 max(12px, 4.2cqw)/1.15 "Onest", sans-serif; font-variant-numeric: tabular-nums; letter-spacing: .01em;
}
/* слой 3 — номера комнат как дверные таблички: светлая плашка, цифры в цвет карточки */
.room__nums b {
  display: inline-block; padding: .3em .42em .24em; border-radius: 2px;
  background: var(--snow); color: color-mix(in srgb, var(--c) 82%, #000);
  font-weight: 600; letter-spacing: .03em; line-height: 1;
}
.room__nums span {                               /* подпись — как «На территории»: мелко, разрядкой */
  flex-basis: 100%; margin-bottom: .55em;
  font-size: max(9.5px, 2.7cqw); font-weight: 400; letter-spacing: .16em; text-transform: uppercase; opacity: .55;
}
.rooms.is-tight .room__nums { display: none; }   /* невысокий экран: места под номера нет — hero.js */
.room__photo { overflow: hidden; }
.room__photo img { display: block; width: 100%; height: 100%; object-fit: cover; filter: saturate(.82); }
.room:focus-visible { outline: 2px solid var(--night); outline-offset: 4px; }

/* приоткрыть дверь — только там, где есть наведение мышью */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .room:hover .room__door, .room:focus-visible .room__door {
    transform: rotateY(24deg);
    transition: transform 1s cubic-bezier(.2, .85, .25, 1.06);   /* открывается с лёгким «доходом» петли */
  }
  .room:hover .room__door::after, .room:focus-visible .room__door::after { opacity: 1; transition-duration: 1s; }
  .room:hover .room__inside img, .room:focus-visible .room__inside img { transform: scale(1); }
  .room:hover .room__peek, .room:focus-visible .room__peek { opacity: 1; transition: opacity .5s ease .35s; }
}

/* «На территории» — появляется вместе с номерами, стоит в сером поле слева от экрана-карточки */
.grounds {
  position: absolute; left: 0; top: 0; z-index: 2; margin: 0;
  width: var(--gw, 260px); color: var(--night);
  opacity: 0; visibility: hidden; transition: opacity .6s ease, visibility 0s .6s;
}
.is-rooms .grounds { opacity: 1; visibility: visible; transition: opacity .8s ease .9s, visibility 0s; }
.grounds__label { margin: 0 0 12px; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--slate); }
.grounds__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; font-size: 14px; font-weight: 500; }
.grounds__list li a { display: inline-flex; align-items: center; gap: 10px; }
.grounds__list li a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.grounds__list li a:hover .ic { color: var(--night); }
.grounds__list .ic { transition: color .25s ease; }
.grounds__list .ic { width: 18px; height: 18px; color: var(--slate); }

.contacts {
  position: fixed; z-index: 35; right: var(--gut); bottom: calc(var(--gut) + 46px + 12px + 20px + 16px); /* над «Как добраться» и кнопкой */
  display: grid; justify-items: end; gap: 1px; margin: 0; line-height: 1.25;
  font-style: normal; text-align: right;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .5s ease, transform .5s ease, visibility 0s .5s;
}
.is-rooms .contacts { opacity: 1; visibility: visible; transform: none; transition: opacity .8s ease .9s, transform .8s ease .9s, visibility 0s; }
.contacts a:first-child { font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -.005em; }
.contacts a:nth-child(2) { font-size: 13px; color: var(--slate); }
.contacts a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
body.menu-open .contacts { visibility: hidden; }


/* ---------- первый показ ----------
   1) на пустом экране только окно, кадры в нём мелькают — это и есть загрузка;
   2) загрузилось — окно замирает на главном кадре;
   3) строка раскрывается из-за кадра в обе стороны, следом проявляется остальное. */
/* заставка: слева от окна — высота, растущая с загрузкой; справа — заголовок и тонкая линия-прогресс.
   Стоит на той же линии, где потом раскроется бегущая строка, и уходит в стороны, когда она открывается. */
.loader { display: none; }
.js .loader { display: block; position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.loader__alt, .loader__text { position: absolute; top: var(--cy); margin: 0; transform: translateY(-50%); transition: opacity .5s ease .3s, transform .8s cubic-bezier(.65, 0, .15, 1) .3s; }   /* короткая пауза — цифры успевают встать на 5 642 */
.loader__alt {
  right: calc(50% + var(--w0) / 2 + 3.2vw);
  display: flex; align-items: baseline; gap: .12em;
  font: 500 calc(var(--h0) * .58)/.9 "Onest", sans-serif; letter-spacing: -.045em; font-variant-numeric: tabular-nums;
}
.loader__unit { font-size: .34em; letter-spacing: 0; color: var(--slate); }
.loader__text { left: calc(50% + var(--w0) / 2 + 3.2vw); display: grid; gap: 14px; }
.loader__kicker { margin: 0; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--slate); }
.loader__title { margin: 0; font: 500 clamp(24px, 2.5vw, 40px)/1.02 "Onest", sans-serif; letter-spacing: -.025em; }
.loader__line { display: block; width: min(12vw, 180px); height: 1px; margin-top: 6px; background: rgba(25, 35, 63, .16); overflow: hidden; }
.loader__line b { display: block; height: 100%; background: var(--night); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }
/* загрузилось: высота уезжает влево, текст вправо — освобождают место строке */
.is-ready .loader__alt { opacity: 0; transform: translate(-6vw, -50%); }
.is-ready .loader__text { opacity: 0; transform: translate(6vw, -50%); }
.is-ready .loader { visibility: hidden; transition: visibility 0s 1.2s; }
@media (max-width: 700px) {
  /* телефон: заголовок над окном, высота — под ним */
  .loader__text { left: 50%; top: calc(var(--cy) - var(--h0) / 2 - 26px); transform: translate(-50%, -100%); justify-items: center; text-align: center; gap: 10px; }
  .loader__line { order: 3; width: 34vw; margin-top: 4px; }
  .loader__alt { right: auto; left: 50%; top: calc(var(--cy) + var(--h0) / 2 + 22px); transform: translateX(-50%); font-size: 15vw; }
  .loader__title { font-size: 26px; }
  .is-ready .loader__alt { transform: translate(-50%, 4vh); }
  .is-ready .loader__text { transform: translate(-50%, calc(-100% - 4vh)); }
}
@media (prefers-reduced-motion: reduce) { .loader__alt, .loader__text { transition: opacity .3s ease; } }
/* заставка страницы номера: на тёмном первом экране — светлым */
.loader--room { color: var(--snow); }
.loader--room .loader__kicker { color: rgba(247, 249, 252, .62); }
.loader--room .loader__line { background: rgba(247, 249, 252, .2); }
.loader--room .loader__line b { background: var(--snow); }
.loader--room .loader__num { display: inline-block; }
.js .marquee { clip-path: inset(0 50% 0 50%); }
.js .ui, .js .corner--r, .js .bar { opacity: 0; }
.is-ready .marquee { clip-path: inset(0 0 0 0); transition: clip-path 1.5s cubic-bezier(.65, 0, .15, 1) .35s; }
.is-ready .ui, .is-ready .corner--r, .is-ready .bar { opacity: 1; transition: opacity .9s ease 1.4s; }
.window.is-settled img.is-on { animation: settle 1.2s cubic-bezier(.2, .7, .2, 1); }
@keyframes settle { from { transform: scale(1.12); } }

/* ---------- телефон ---------- */
@media (max-width: 700px) {
  .lede { bottom: 84px; }
  .lede p br { display: none; }
  .corner--l { display: none; }
  /* на телефоне внизу ряд кнопок — подсказка встаёт над подписью (--lede-top считает hero.js) */
  .scroll-hint { bottom: auto; top: calc(var(--lede-top, 70vh) - 46px); }
  .room__foot { gap: 4cqw; }
  .room__sub { max-width: 62cqw; font-size: 5.6cqw; }
  .room__nums { font-size: max(11px, 5cqw); gap: .3em .3em; }
  .room__title { font-size: 12.5cqw; }
  .grounds { display: flex; justify-content: center; }
  .grounds__label { display: none; } /* в одну строку подпись не влезает — пункты говорят сами за себя */
  .grounds__list { display: flex; gap: 16px; font-size: 12px; white-space: nowrap; }
  .grounds__list li a { gap: 5px; }
  .grounds__list .ic { width: 15px; height: 15px; }
  .room__facts, .room__amen { display: none; } /* на телефоне карточки малы — только цена, название и строка */
  .contacts { display: none; } /* справа внизу на телефоне выглядывает экран-карточка; контакты есть в меню */
  .room__price { font-size: 8cqw; }
}

@media (prefers-reduced-motion: reduce) {
  .js .marquee, .is-ready .marquee { clip-path: none; transition: none; }
  .window.is-settled img.is-on { animation: none; }
}
