/* ============================================================
   AFRAME.SUNRISE — стили
   Палитра из фотографий дома:
   смола  — тёмный фасад ночью
   доска  — светлая сосновая вагонка внутри
   янтарь — гирлянды и закатное солнце
   шалфей — чайник и подушки
   ============================================================ */

:root {
  --smola:      #191C15;
  --smola-2:    #232720;
  --doska:      #F1EBDE;
  --doska-2:    #E9E1CF;
  --chernila:   #2A2C22;
  --dym:        #71705F;
  --dym-dark:   #A7A796;
  --yantar:     #E0A45C;
  --yantar-2:   #C98D45;
  --shalfey:    #7E8A6F;

  --font-display: "Prata", "Georgia", serif;
  --font-body: "Onest", "Helvetica Neue", Arial, sans-serif;

  --wrap: 1120px;
  --wrap-narrow: 720px;
  --pad: clamp(1.25rem, 4vw, 2.5rem);
  --sect: clamp(4.5rem, 12vw, 8.5rem);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--chernila);
  background: var(--smola);
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

h1, h2, h3 { margin: 0; font-weight: 400; }
p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: inherit; text-decoration: none; }

[hidden] { display: none !important; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--pad);
}
.wrap--narrow { max-width: var(--wrap-narrow); }

/* ---------- типографика ---------- */

.eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--yantar-2);
  margin-bottom: 1.1rem;
}

.section__title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 6.4vw, 3.1rem);
  line-height: 1.14;
  letter-spacing: 0.005em;
  margin-bottom: 1.4rem;
}

.section__lead {
  font-size: clamp(1rem, 2.6vw, 1.125rem);
  max-width: 56ch;
  color: var(--dym);
  margin-bottom: 2.2rem;
}
.scene--dark .section__lead { color: var(--dym-dark); }

/* ---------- сцены (день / ночь) ---------- */

.scene--light { background: var(--doska); color: var(--chernila); }
.scene--dark  { background: var(--smola); color: var(--doska); }
.section { position: relative; padding-block: var(--sect); }
.section--tint { background: var(--doska-2); }

/* ---------- кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0.9rem 1.8rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }

.btn--amber { background: var(--yantar); color: #1E2015; }
.btn--amber:hover { background: #E9B06B; }

.btn--ghost {
  border: 1px solid rgba(241, 235, 222, 0.45);
  color: var(--doska);
}
.btn--ghost:hover { border-color: var(--doska); }

.btn--ghost-dark {
  border: 1px solid rgba(42, 44, 34, 0.35);
  color: var(--chernila);
}
.btn--ghost-dark:hover { border-color: var(--chernila); }

.btn--big { min-height: 58px; padding-inline: 2.4rem; }

.btn:focus-visible,
a:focus-visible,
summary:focus-visible,
button:focus-visible {
  outline: 2px solid var(--yantar);
  outline-offset: 3px;
  border-radius: 4px;
}
.btn:focus-visible { border-radius: 999px; }

/* ---------- шапка ---------- */

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem var(--pad);
  color: var(--doska);
  transition: background-color 0.3s ease, backdrop-filter 0.3s ease;
}
.topbar.is-scrolled {
  background: rgba(25, 28, 21, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.brand__mark { width: 26px; height: 26px; color: var(--yantar); }
.brand__name {
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.burger {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--doska);
  padding: 0;
}
.burger span {
  grid-area: 1 / 1;
  display: block;
  width: 26px;
  height: 2px;
  background: currentColor;
  transition: transform 0.3s ease;
}
.burger span:nth-child(1) { transform: translateY(-4.5px); }
.burger span:nth-child(2) { transform: translateY(4.5px); }
body.menu-open .burger span:nth-child(1) { transform: rotate(45deg); }
body.menu-open .burger span:nth-child(2) { transform: rotate(-45deg); }

/* ---------- боковое меню ---------- */

.menu {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: min(420px, 100vw);
  z-index: 40;
  background: var(--smola-2);
  color: var(--doska);
  transform: translateX(102%);
  transition: transform 0.5s cubic-bezier(0.65, 0, 0.35, 1);
  visibility: hidden;
}
body.menu-open .menu { transform: translateX(0); visibility: visible; }

.menu__inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6rem var(--pad) 2.5rem;
  overflow-y: auto;
}

.menu__list li {
  overflow: hidden;
}
.menu__list a {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 6vw, 2.2rem);
  line-height: 1.5;
  padding-block: 0.25rem;
  transform: translateY(110%);
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), color 0.2s ease;
}
.menu__list a:hover { color: var(--yantar); }
body.menu-open .menu__list a { transform: translateY(0); }
body.menu-open .menu__list li:nth-child(1) a { transition-delay: 0.10s; }
body.menu-open .menu__list li:nth-child(2) a { transition-delay: 0.16s; }
body.menu-open .menu__list li:nth-child(3) a { transition-delay: 0.22s; }
body.menu-open .menu__list li:nth-child(4) a { transition-delay: 0.28s; }
body.menu-open .menu__list li:nth-child(5) a { transition-delay: 0.34s; }
body.menu-open .menu__list li:nth-child(6) a { transition-delay: 0.40s; }

.menu__contacts {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease 0.45s, transform 0.5s ease 0.45s;
}
body.menu-open .menu__contacts { opacity: 1; transform: translateY(0); }
.menu__ig-handle {
  font-size: 0.9rem;
  color: var(--dym-dark);
  text-align: center;
}
.menu__ig-handle:hover { color: var(--yantar); }

.menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(12, 14, 10, 0.55);
  opacity: 0;
  transition: opacity 0.4s ease;
}
body.menu-open .menu-backdrop { opacity: 1; }

/* ---------- хиро ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  color: var(--doska);
}

/* Пока грузится фирменный шрифт, хиро и шапка скрыты (класс .js ставит
   скрипт в <head>, снимает js/main.js) — иначе заголовок сначала
   рисуется запасным шрифтом и «перескакивает» по строкам. */
.js .topbar,
.js .hero__content > * { opacity: 0; }

.hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(25, 28, 21, 0.42) 0%, rgba(25, 28, 21, 0.05) 32%, rgba(25, 28, 21, 0.5) 78%, rgba(25, 28, 21, 0.58) 100%);
}

.hero__content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 0 var(--pad) clamp(4rem, 10vh, 6.5rem);
}

.hero__eyebrow { color: var(--yantar); }

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 10.5vw, 5.4rem);
  line-height: 1.08;
  margin-bottom: 1.1rem;
}

/* Строки заголовка хиро — готовые блоки-маски: анимация не пересчитывает
   переносы, поэтому число строк не меняется по ходу появления. */
.hero__line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.12em;
  margin-bottom: -0.12em;
}
.hero__line > span { display: block; }

.hero__sub {
  max-width: 46ch;
  font-size: clamp(1rem, 2.8vw, 1.15rem);
  color: rgba(241, 235, 222, 0.86);
  margin-bottom: 1.8rem;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 1.6rem;
}

.hero__meta {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  color: rgba(241, 235, 222, 0.6);
}
.hero__meta span { white-space: nowrap; }

/* ---------- манифест ---------- */

.intro { padding-block: var(--sect) calc(var(--sect) * 0.55); }
.intro__text {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 4.6vw, 2.1rem);
  line-height: 1.42;
}

/* ---------- галерея ---------- */

.gallery {
  display: flex;
  gap: 0.9rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-inline: var(--pad);
  scrollbar-width: none;
}
.gallery::-webkit-scrollbar { display: none; }

.gallery__item {
  flex: 0 0 min(78vw, 420px);
  scroll-snap-align: center;
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: var(--doska-2);
}
.gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Пока настоящее фото едет с сервера, на его месте видна размытая
   мини-копия, вшитая прямо в страницу (инлайн-стиль на каждом img). */
.gallery__item img,
.card__img {
  background-size: cover;
  background-position: center;
}
.gallery__item figcaption {
  position: absolute;
  left: 0.9rem;
  bottom: 0.7rem;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: rgba(241, 235, 222, 0.9);
  background: rgba(25, 28, 21, 0.5);
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

.gallery__item--ph .ph {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  color: var(--dym);
  border: 1px dashed rgba(113, 112, 95, 0.4);
  border-radius: 14px;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
}
.gallery__item--ph .ph svg { width: 44px; height: 44px; opacity: 0.55; }
.gallery__item--ph figcaption { display: none; }

.gallery__hint {
  margin-top: -1rem;
  margin-bottom: 1.2rem;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--dym);
}

/* ---------- карточки территории ---------- */

.cards {
  display: grid;
  gap: 1rem;
  margin-top: 0.6rem;
}

.card {
  background: var(--smola-2);
  border: 1px solid rgba(241, 235, 222, 0.08);
  border-radius: 16px;
  overflow: hidden;
}
.card__img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.card__body { padding: 1.4rem 1.5rem 1.6rem; }
.card__title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin-bottom: 0.7rem;
  color: var(--yantar);
}
.card p { color: var(--dym-dark); font-size: 0.98rem; }

/* ---------- удобства ---------- */

.amen {
  display: grid;
  gap: 2.2rem;
  margin-top: 1rem;
}

.amen__title {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-bottom: 0.9rem;
}
.amen__title svg {
  width: 26px;
  height: 26px;
  color: var(--shalfey);
  flex-shrink: 0;
}

.amen__group ul { display: grid; gap: 0.45rem; }
.amen__group li {
  position: relative;
  padding-left: 1.3rem;
  color: var(--dym);
  font-size: 0.97rem;
}
.amen__group li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.52em;
  width: 8px;
  height: 8px;
  background: currentColor;
  opacity: 0.55;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

/* ---------- цены ---------- */

.price {
  background: var(--doska);
  border: 1px solid rgba(42, 44, 34, 0.1);
  border-radius: 18px;
  padding: 1.8rem 1.5rem;
  max-width: 560px;
}

.price__rows { display: grid; gap: 0.4rem; }
.price__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.price__days { color: var(--dym); font-size: 0.95rem; }
.price__value {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 6vw, 2.4rem);
  color: var(--chernila);
  white-space: nowrap;
}
.price__value small {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--dym);
}

.price__note {
  font-size: 0.85rem;
  color: var(--dym);
  margin-top: 0.5rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid rgba(42, 44, 34, 0.12);
}

.price__extras { display: grid; gap: 0.55rem; padding-block: 1.1rem; }
.price__extras li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.95rem;
  color: var(--dym);
}
.price__extras b { color: var(--chernila); font-weight: 600; white-space: nowrap; }

.price__small { font-size: 0.82rem; color: var(--dym); }

.booking { margin-top: 2.4rem; max-width: 560px; }
.booking__title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin-bottom: 1.1rem;
}
.booking__steps {
  counter-reset: step;
  display: grid;
  gap: 0.9rem;
  margin-bottom: 1.4rem;
}
.booking__steps li {
  counter-increment: step;
  position: relative;
  padding-left: 2.6rem;
  color: var(--dym);
}
.booking__steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.05em;
  width: 1.8rem;
  height: 1.8rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--yantar);
  color: #1E2015;
  font-weight: 600;
  font-size: 0.9rem;
}

/* ---------- аккордеоны ---------- */

.folds { display: grid; gap: 0.6rem; }

.fold {
  background: var(--doska);
  border: 1px solid rgba(42, 44, 34, 0.1);
  border-radius: 12px;
}
.section--tint .fold { background: var(--doska); }

.fold summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  min-height: 52px;
  font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.fold summary::-webkit-details-marker { display: none; }
.fold summary::after {
  content: "";
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: var(--yantar-2);
  transition: transform 0.3s ease;
  transform: rotate(180deg);
}
.fold[open] summary::after { transform: rotate(0deg); }
.fold p {
  padding: 0 1.2rem 1.1rem;
  color: var(--dym);
  font-size: 0.95rem;
}

/* ---------- дорога ---------- */

.map {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(42, 44, 34, 0.12);
  margin-bottom: 1.2rem;
  background: var(--doska);
}
.map__frame {
  display: block;
  width: 100%;
  height: clamp(260px, 55vw, 400px);
  border: 0;
  filter: saturate(0.82);
}

.route {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

/* ---------- финал ---------- */

.final {
  position: relative;
  background: var(--smola);
  color: var(--doska);
  padding-block: var(--sect);
  text-align: center;
  overflow: hidden;
}
.final::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -30%;
  width: 130vw;
  height: 80%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 100%, rgba(224, 164, 92, 0.22) 0%, rgba(224, 164, 92, 0) 65%);
  pointer-events: none;
}

.final__inner { position: relative; }
.final__mark { width: 40px; height: 40px; color: var(--yantar); margin-bottom: 1.4rem; }
.final__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 7.5vw, 3.4rem);
  line-height: 1.14;
  margin-bottom: 1rem;
}
.final__text {
  color: var(--dym-dark);
  max-width: 44ch;
  margin-inline: auto;
  margin-bottom: 2rem;
}
.final__cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem;
}

/* ---------- треугольник-«крыша» на входе в тёмные секции ---------- */
/* Пик вырезан из самой секции через clip-path: один элемент,
   без SVG-вставки — значит, без тонкого шва на стыке. */

#territoriya,
.final {
  --peak: 26px;
  margin-top: calc(var(--peak) * -1);
  padding-top: calc(var(--sect) + var(--peak));
  clip-path: polygon(0 var(--peak), 50% 0, 100% var(--peak), 100% 100%, 0 100%);
}

@media (min-width: 768px) {
  #territoriya,
  .final { --peak: 52px; }
}

/* ---------- подвал ---------- */

.footer {
  background: var(--smola);
  color: var(--dym-dark);
  border-top: 1px solid rgba(241, 235, 222, 0.08);
  padding-block: 1.6rem;
  font-size: 0.85rem;
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: space-between;
}
.footer a:hover { color: var(--yantar); }

.footer__legal {
  margin-top: 0.9rem;
  font-size: 0.75rem;
  color: rgba(167, 167, 150, 0.65);
  letter-spacing: 0.02em;
}

/* ---------- десктоп ---------- */

@media (min-width: 768px) {
  .cards { grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
  .amen { grid-template-columns: repeat(3, 1fr); gap: 2rem; }
  .gallery {
    padding-inline: max(var(--pad), calc((100vw - var(--wrap)) / 2 + var(--pad)));
  }
  .gallery__item { flex-basis: 380px; }
  .hero__content { padding-bottom: clamp(5rem, 12vh, 8rem); }
}

@media (min-width: 1024px) {
  .menu { width: 460px; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
  }
}
