/* ICE PALACE — общее для всех страниц: палитра (снята с кадров героя), шапка, бегущая строка, кнопки, меню */
:root {
  --ice: #edf1f6;
  --canvas: #dae0e9;
  --night: #19233f;
  --slate: #5d6b88;
  --snow: #f7f9fc;

  --w0: min(17vw, 30vh);
  --h0: calc(var(--w0) * .88);
  --cy: 44%;
  --gut: clamp(16px, 2.2vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ice);
  color: var(--night);
  font: 400 15px/1.45 "Onest", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- верхняя строка: тихая, только текст ---------- */
.bar {
  position: absolute; inset: 0 0 auto 0; z-index: 8;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: start;
  padding: 22px var(--gut) 0;
  font-size: 13px;
}
.bar__link { justify-self: start; padding-top: 3px; }
.bar__link--r { justify-self: end; font-variant-numeric: tabular-nums; }
.bar__link:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.mark { display: grid; justify-items: center; gap: 4px; }
.mark__word { font: 500 17px/1 "Unbounded", sans-serif; letter-spacing: .18em; margin-right: -.18em; }
.mark__sub { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--slate); }
.tel-short { display: none; }

/* ---------- бегущая строка и окно ---------- */
.marquee {
  position: absolute; left: 0; right: 0; top: var(--cy);
  transform: translateY(-50%);
  white-space: nowrap; pointer-events: none;
}
.marquee__track {
  display: inline-flex; align-items: center;
  animation: run 38s linear infinite;
  font: 500 calc(var(--h0) * 1.08)/1 "Onest", sans-serif;
  letter-spacing: -.035em;
}
.marquee__track span { padding: 0 .12em; }
.marquee__track i { /* разделитель — горизонтальная линия, как отметка высоты */
  display: inline-block; width: .55em; height: .045em; background: currentColor; margin: 0 .22em; transform: translateY(.05em);
}
@keyframes run { to { transform: translateX(-50%); } }

.window {
  position: absolute; z-index: 5; margin: 0;
  left: 50%; top: var(--cy);
  width: var(--w0); height: var(--h0);
  transform: translate(-50%, -50%);
  overflow: hidden; background: var(--night);
}
.window img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.window img.is-on { opacity: 1; }
/* кадр «после паузы» (отель) — слой поверх Эльбруса, проявляется вместе с отъездом камеры (hero.js) */
.window [data-next] { position: absolute; inset: 0; z-index: 1; overflow: hidden; opacity: 0; }
.window [data-next].is-shown { opacity: 1; }

/* отель: «камера» — панорама «маленькая планета» в K = 3.024 раза больше окна; фасад лежит на ней ровно там,
   где отель (координаты сняты по крыше, трубе и углу пристройки), и сам по размеру равен окну.
   Конечный кадр — масштаб 1: фасад рисуется в полном разрешении, без растягивания. Отъезд — масштаб 1/K. Анимацию ведёт hero.js. */
.window:has(.hz) { container-type: size; }
.hz__cam {
  position: absolute; left: 50%; top: 50%;
  width: calc(max(100cqw, 100cqh) * 3.024); aspect-ratio: 1;
  translate: -49.38% -48.58%;                 /* центр фасада — в центр окна */
  transform-origin: 49.38% 48.58%;
}
.window .hz img { position: absolute; opacity: 1; display: block; object-fit: cover; }
.window .hz .hz__far { inset: 0; width: 100%; height: 100%; }
.window .hz .hz__near { left: 32.85%; top: 32.05%; width: 33.07%; height: 33.07%; }

/* окно раскрывается в большой кадр под отель (только на первом экране); в свёрнутом виде — вертикальный маленький */
.window { transition: height 1.5s cubic-bezier(.65, 0, .25, 1), width 1.5s cubic-bezier(.65, 0, .25, 1); }
.window.is-big { width: min(var(--wb), var(--wb-max, 100vw)); height: min(var(--hb), var(--hb-max, 100vh)); }   /* предел — hero.js: воздух до подписи внизу */
html.is-rooms .window.is-big { width: var(--w0); height: calc(var(--w0) * var(--tall, 1.2)); }   /* в свёрнутом виде — снова маленький кадр */
:root { --wb: min(52vw, 80vh); --hb: min(60vh, 40vw); }
@media (prefers-reduced-motion: reduce) { .window { transition: none; } }

/* кнопки справа внизу — одни на весь сайт */
.corner--r { position: fixed; z-index: 35; right: var(--gut); bottom: var(--gut); display: flex; align-items: center; gap: 22px; color: var(--night); }
.book { /* главное действие сайта — единственная залитая кнопка */
  display: inline-flex; align-items: center; gap: 14px;
  height: 46px; padding: 0 20px 0 22px;
  background: var(--night); color: var(--snow);
  font-size: 14px; font-weight: 500; letter-spacing: .01em;
  transition: background .3s ease, color .3s ease;
}
.book svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; transition: transform .35s cubic-bezier(.2, .7, .2, 1); }
.book:hover { background: #26335c; }
.book:hover svg { transform: translateX(4px); }
.book:focus-visible { outline: 2px solid var(--night); outline-offset: 3px; }
.burger {
  width: 46px; height: 46px; display: grid; place-content: center; gap: 6px;
  background: var(--night); color: var(--snow);
  transition: background .4s ease, color .4s ease;
}
.burger i { display: block; width: 16px; height: 1.5px; background: currentColor; transition: transform .3s ease, width .3s ease; }
.burger i:last-child { width: 10px; }
@media (min-width: 701px) { .burger { display: none; } } /* на ПК меню не нужно: разделы и так под рукой */
/* «домик»: на телефоне в него сворачивается первый экран (hero.js); видна только в режиме блоков */
.go-home { display: none; }
@media (max-width: 700px) {
  .go-home {
    display: grid; place-content: center; width: 46px; height: 46px;
    background: var(--night); color: var(--snow);
    opacity: 0; pointer-events: none; transition: opacity .25s ease;
  }
  .go-home svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
  html.is-rooms .go-home { opacity: 1; pointer-events: auto; transition: opacity .35s ease 1.05s; }   /* проступает, когда экран почти сжался */
  body.menu-open .go-home { opacity: 0; pointer-events: none; }
}
/* «Как добраться» — текстовая ссылка прямо над «Забронировать» (не кнопка) */
.go-map {
  display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 0; background: none; border: 0; color: inherit;
  font-size: 14px; font-weight: 500;
}
.go-map svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
@media (min-width: 701px) { .go-map svg { display: none; } }   /* на ПК — только текст; метка нужна лишь на телефоне, где подписи нет */
.go-map span::after { content: " →"; display: inline-block; transition: transform .3s ease; }
.go-map:hover span { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
@media (min-width: 701px) {
  /* «Как добраться» строкой сверху, под ней — домик и «Забронировать» */
  .corner--r { display: grid; grid-template-columns: auto auto; gap: 12px 8px; justify-items: end; align-items: center; }
  .go-map { grid-column: 1 / -1; }
  .go-home {                                       /* на ПК — тихая квадратная кнопка в контур: залитой остаётся только бронь */
    display: grid; place-content: center; grid-row: 2; grid-column: 1; width: 46px; height: 46px;
    background: var(--snow); color: var(--night); box-shadow: inset 0 0 0 1px rgba(25, 35, 63, .14);   /* сплошная светлая: видна на любом фоне, но тише залитой брони */
    transition: background .3s ease, color .3s ease, box-shadow .3s ease, opacity .3s ease;
  }
  .go-home svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
  .go-home:hover { background: #e6ebf3; box-shadow: inset 0 0 0 1px rgba(25, 35, 63, .3); }
  .go-home:focus-visible { outline: 2px solid var(--night); outline-offset: 3px; }
  .corner--r .book { grid-row: 2; grid-column: 2; }
  /* на главной домик нужен только в режиме блоков: место за ним держим, чтобы «Забронировать» не прыгала */
  button.go-home { opacity: 0; pointer-events: none; }
  html.is-rooms button.go-home { opacity: 1; pointer-events: auto; transition-delay: .6s; }
}

/* иконки: тонкая линия, цвет от текста */
.ic { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.ic circle { fill: currentColor; stroke: none; }

/* ---------- меню ---------- */
.menu {
  position: fixed; inset: 0; z-index: 40;
  background: var(--night); color: var(--snow);
  display: grid; align-content: center; padding: 96px var(--gut) var(--gut);
}
.menu[hidden] { display: none; }
.menu__list { list-style: none; margin: 0; padding: 0; counter-reset: m; }
.menu__list li { counter-increment: m; border-top: 1px solid rgba(247, 249, 252, .14); }
.menu__list li:last-child { border-bottom: 1px solid rgba(247, 249, 252, .14); }
.menu__list a {
  display: flex; align-items: baseline; gap: 18px;
  font: 500 clamp(34px, 6.2vw, 92px)/1.12 "Onest", sans-serif; letter-spacing: -.035em;
  padding: .06em 0;
}
.menu__list a::before { content: "0" counter(m); font-size: 12px; letter-spacing: .1em; color: rgba(247, 249, 252, .45); min-width: 2.2em; }
.menu__list a:hover { color: #b9c9e4; }
.menu__foot { margin: 32px 0 0; font-size: 13px; color: rgba(247, 249, 252, .6); }
.menu__map { justify-self: start; margin-top: 14px; font-size: 15px; font-weight: 500; color: var(--snow); }
.menu__map:hover { text-decoration: underline; text-underline-offset: 4px; }
body.menu-open { overflow: hidden; }
body.menu-open .corner--r { z-index: 45; color: var(--snow); }
body.menu-open .burger, body.menu-open .book { background: var(--snow); color: var(--night); }
body.menu-open .go-map { color: var(--snow); }
@media (max-width: 700px) { body.menu-open .go-map { background: #35506d; } }
body.menu-open .burger i:first-child { transform: translateY(3.75px) rotate(45deg); }
body.menu-open .burger i:last-child { width: 16px; transform: translateY(-3.75px) rotate(-45deg); }

/* ---------- окно «Как добраться» (js/map.js) ---------- */
.sheet { position: fixed; inset: 0; z-index: 60; display: grid; grid-template-rows: auto 1fr auto; background: var(--night); color: var(--snow); opacity: 0; transition: opacity .35s ease; }
.sheet.is-open { opacity: 1; }
.sheet[hidden] { display: none; }
.sheet__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px var(--gut); }
.sheet__title { margin: 0; font-size: 14px; font-weight: 500; }
.sheet__title span { font-weight: 400; color: rgba(247, 249, 252, .6); }
.sheet__close { font-size: 14px; display: inline-flex; gap: 8px; align-items: center; padding: 8px 0; }
.sheet__close span { font-size: 22px; line-height: 1; }
.sheet__close:hover { text-decoration: underline; text-underline-offset: 4px; }
.sheet__map { background: #0f1528; }
.sheet__map iframe { width: 100%; height: 100%; border: 0; display: block; }
.sheet__go { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; padding: 16px var(--gut) calc(16px + env(safe-area-inset-bottom)); }
.sheet__links { display: flex; flex-wrap: wrap; gap: 8px; }
.sheet__btn {
  display: inline-flex; align-items: center; height: 44px; padding: 0 18px;
  border: 1px solid rgba(247, 249, 252, .35); font-size: 14px; font-weight: 500;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.sheet__btn:hover { border-color: var(--snow); }
.sheet__btn.is-main { background: var(--snow); color: var(--night); border-color: var(--snow); }
.sheet__btn.is-main:hover { background: #dfe6f1; }
.sheet__copy { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--snow); }
.sheet__copy span { color: rgba(247, 249, 252, .55); }
.sheet__copy:hover span { color: var(--snow); }
body.modal-open { overflow: hidden; }
@media (max-width: 700px) {
  .sheet__title span { display: none; }
  .sheet__links { width: 100%; }
  .sheet__btn { flex: 1 1 calc(50% - 4px); justify-content: center; padding: 0 10px; }
}

/* ---------- телефон ---------- */
@media (max-width: 700px) {
  :root { --w0: 40vw; --h0: calc(var(--w0) * 1.12); --cy: 42%; --tall: 1.32; --wb: 84vw; --hb: min(54vh, 100vw); }
  .bar { grid-template-columns: auto 1fr; padding-top: 16px; font-size: 12px; }
  .bar__link:first-child { display: none; }
  .mark { justify-items: start; }
  .mark__word { font-size: 14px; }
  .tel-full { display: none; }
  .tel-short { display: inline; }
  .marquee__track { font-size: calc(var(--h0) * .7); }
  .corner--r { left: var(--gut); justify-content: flex-start; gap: 8px; }
  .corner--r { pointer-events: none; }            /* ряд растянут на всю ширину — между кнопками нажатия проходят к кнопке-экрану */
  .corner--r > * { pointer-events: auto; }
  .corner--r .book { order: 0; margin-right: auto; }
  .go-home { order: 1; }
  .go-map {                                          /* на телефоне — цветная квадратная кнопка с меткой рядом с меню */
    order: 2; width: 46px; height: 46px; justify-content: center;
    background: #35506d; color: var(--snow);
  }
  .go-map svg { width: 22px; height: 22px; stroke-width: 1.6; }
  .go-map span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .burger { order: 3; }
}

@media (prefers-reduced-motion: reduce) {
  .marquee__track { animation: none; transform: translateX(-12%); }
}

/* ---------- переходы между страницами (js/nav.js) ----------
   Новая страница поднимается снизу дугой — как вода в панелях номера; старая отъезжает вглубь и темнеет.
   Назад по истории — наоборот: текущая уходит вниз той же дугой, прежняя выезжает из глубины. */
@view-transition { navigation: auto; }
::view-transition-group(root) { animation-duration: .95s; }
::view-transition-old(root) { animation: vt-sink .95s cubic-bezier(.65, 0, .25, 1) both; }
::view-transition-new(root) { animation: vt-rise .95s cubic-bezier(.65, 0, .25, 1) both; }
@keyframes vt-sink { to { transform: scale(.93); filter: brightness(.5); } }
@keyframes vt-rise {
  from { clip-path: ellipse(130% 0% at 50% 100%); transform: translateY(6%); }
  to   { clip-path: ellipse(130% 175% at 50% 100%); transform: none; }
}
html:active-view-transition-type(back)::view-transition-old(root) { z-index: 2; animation: vt-drop .9s cubic-bezier(.65, 0, .25, 1) both; }
html:active-view-transition-type(back)::view-transition-new(root) { z-index: 1; animation: vt-surface .9s cubic-bezier(.65, 0, .25, 1) both; }
@keyframes vt-drop {
  from { clip-path: ellipse(130% 175% at 50% 100%); transform: none; }
  to   { clip-path: ellipse(130% 0% at 50% 100%); transform: translateY(6%); }
}
@keyframes vt-surface { from { transform: scale(.93); filter: brightness(.5); } }

/* фото из карточки номера летит в окно первого экрана страницы номера */
::view-transition-group(room-photo) { animation-duration: .95s; animation-timing-function: cubic-bezier(.65, 0, .25, 1); z-index: 3; }
::view-transition-old(room-photo), ::view-transition-new(room-photo) { height: 100%; object-fit: cover; animation-duration: .95s; }
::view-transition-image-pair(room-photo) { overflow: hidden; }

@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
