/* Герой с глубиной: фото, вордмарк, вырезанный дом, интерфейс.
   Основа — шаблон Altura (HorizonX), адаптирован под «Спектр». */

:root {
  --page: #0d0f12;
  --panel: #14171b;
  --inset: clamp(6px, 0.85vw, 14px);
  --radius: clamp(14px, 1.25vw, 22px);
  --ink: #ffffff;
  --ink-dim: rgba(255, 255, 255, 0.82);
  --ink-mute: rgba(255, 255, 255, 0.6);
  --accent: #e2b467;          /* тёплое золото — акценты, подсветка комнат */
  --accent-soft: rgba(226, 180, 103, 0.22);
  --line: rgba(255, 255, 255, 0.16);
  /* Прозрачное стекло: навигация, чипы. glass.js добавляет преломление в Chromium. */
  --clear-glass: rgba(255, 255, 255, 0.2);
  --clear-glass-hover: rgba(255, 255, 255, 0.3);
  --clear-glass-blur: blur(2px);
  --clear-glass-text-shadow: 0 1px 2px rgba(8, 18, 30, 0.45), 0 0 10px rgba(8, 18, 30, 0.3);
  /* Тёмное матовое стекло: карточки. */
  --dark-glass: rgba(0, 0, 0, 0.22);
  --dark-glass-hover: rgba(0, 0, 0, 0.3);
  --dark-glass-blur: blur(16px);
  --glass-ink: #0c1826;
  --pad-x: clamp(16px, 2.4vw, 40px);
  --pad-top: clamp(14px, 1.7vw, 28px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.22, 0.61, 0.36, 1);
  --font-ui: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Montserrat", "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Геометрия фото, её пишет hero.js. */
  --sw: 100%;
  --sh: 115%;
  --sx: 0px;
  --sy: -12%;
}

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

html,
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  /* Свайп вбок листает фото, а не страницы истории браузера. */
  overscroll-behavior-x: none;
}

/* Двойное касание не увеличивает страницу (листание экранов — в pager.js); щипок работает. */
html { touch-action: manipulation; }

html.is-locked { overflow: hidden; }

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; margin: 0; padding: 0; }
p, h1, h2, h3, figure { margin: 0; }
button { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }

.page {
  display: grid;
  gap: var(--inset);
  padding: var(--inset);
  /* Телефон боком: вырез экрана не закрывает края. */
  padding-left: max(var(--inset), env(safe-area-inset-left));
  padding-right: max(var(--inset), env(safe-area-inset-right));
}

.hero {
  position: relative;
  isolation: isolate;
  height: calc(100svh - 2 * var(--inset));
  min-height: 520px;
  border-radius: var(--radius);
  overflow: hidden;
  background: #1f5aa6;
}

/* ---------- Слои фото (одна коробка, чтобы совпадали пиксель в пиксель) ---------- */

.stage {
  position: absolute;
  left: var(--sx);
  top: var(--sy);
  width: var(--sw);
  height: var(--sh);
  transform-origin: 57% 45%;
  pointer-events: none;
  will-change: transform;
}

.stage__img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  user-select: none;
  -webkit-user-drag: none;
}

.stage--bg { z-index: 0; }
.stage--fg { z-index: 2; }

/* ---------- Вордмарк (между слоями фото) ---------- */

.wordmark {
  position: absolute;
  z-index: 1;
  left: 0;
  top: 0;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--wm-size, 26vw);
  line-height: 1;
  letter-spacing: -0.035em;
  color: var(--ink);
  white-space: nowrap;
  transform: translate(var(--wm-x, 6vw), var(--wm-y, 12vh));
  pointer-events: none;
  user-select: none;
  text-shadow: 0 6px 40px rgba(10, 40, 90, 0.18);
}

.wordmark__line { display: block; }

.wordmark__char {
  display: inline-block;
  will-change: transform, opacity;
}

/* ---------- Затемнение для читаемости ---------- */

.hero__shade {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(8, 24, 48, 0.22) 0%, rgba(8, 24, 48, 0.08) 10%, rgba(8, 24, 48, 0) 16%),
    linear-gradient(0deg, rgba(14, 20, 28, 0.66) 0%, rgba(14, 20, 28, 0.3) 20%, rgba(14, 20, 28, 0) 40%),
    radial-gradient(60% 40% at 100% 100%, rgba(14, 20, 28, 0.46) 0%, rgba(14, 20, 28, 0) 100%),
    radial-gradient(45% 45% at 0% 100%, rgba(14, 20, 28, 0.42) 0%, rgba(14, 20, 28, 0) 100%);
}

/* ---------- Фокус ---------- */

.brand:focus-visible,
.nav__link:focus-visible,
.cta:focus-visible,
.menu-btn:focus-visible,
.index__row:focus-visible,
.feature:focus-visible,
.lede__link:focus-visible,
.mobile-menu a:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
  box-shadow: 0 0 0 6px #0b1622;
}

:is(.menu-btn, .index__row, .feature).is-refractive:focus-visible {
  outline-width: 3px;
  outline-offset: 3px;
  box-shadow: none;
}

/* ---------- Навигация ---------- */

.nav {
  position: absolute;
  z-index: 5;
  top: var(--pad-top);
  left: var(--pad-x);
  right: var(--pad-x);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}

.brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: clamp(8px, 0.6vw, 11px);
  min-height: 44px;
  border-radius: 10px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(20px, 1.6vw, 27px);
  letter-spacing: -0.03em;
  line-height: 1;
  text-shadow: 0 1px 10px rgba(8, 18, 30, 0.3);
}

.brand__mark {
  width: 1.12em;
  height: 1.12em;
  flex: none;
  filter: drop-shadow(0 1px 3px rgba(8, 18, 30, 0.3));
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  color: #ffffff;
  text-shadow: var(--clear-glass-text-shadow);
  background: var(--clear-glass);
  -webkit-backdrop-filter: var(--clear-glass-blur);
  backdrop-filter: var(--clear-glass-blur);
}

.nav__link {
  display: inline-flex;
  align-items: center;
  height: clamp(34px, 2.5vw, 40px);
  padding: 0 clamp(13px, 1.1vw, 19px);
  border-radius: 999px;
  font-size: clamp(14px, 0.95vw, 15px);
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: background-color 0.25s var(--ease-soft), color 0.25s var(--ease-soft);
}

.nav__link:hover { background: var(--clear-glass-hover); }

.nav__link.is-active {
  background: #000000;
  color: #ffffff;
  text-shadow: none;
}

.cta {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  height: calc(clamp(34px, 2.5vw, 40px) + 10px);
  padding: 0 5px 0 clamp(16px, 1.3vw, 22px);
  border-radius: 999px;
  background: #ffffff;
  color: #101418;
  font-size: clamp(14px, 0.95vw, 15px);
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  box-shadow: 0 6px 24px rgba(8, 18, 30, 0.18);
  transition: background-color 0.25s var(--ease-soft);
}

.cta:hover { background: #eef2f6; }

.cta__icon {
  display: grid;
  place-items: center;
  width: clamp(34px, 2.5vw, 40px);
  height: clamp(34px, 2.5vw, 40px);
  border-radius: 50%;
  background: #101418;
  color: #ffffff;
  transition: transform 0.35s var(--ease-out);
}

.cta__icon svg { width: 15px; height: 15px; }
.cta:hover .cta__icon { transform: rotate(45deg); }

.menu-btn {
  display: none;
  justify-self: end;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 0;
  background: var(--clear-glass);
  -webkit-backdrop-filter: var(--clear-glass-blur);
  backdrop-filter: var(--clear-glass-blur);
  color: #ffffff;
  cursor: pointer;
  position: relative;
}

.menu-btn span {
  position: absolute;
  left: 14px;
  right: 14px;
  height: 1.6px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.3s var(--ease-out), top 0.3s var(--ease-out);
}

.menu-btn span:first-child { top: 18px; }
.menu-btn span:last-child { top: 24px; }
.menu-btn[aria-expanded="true"] span:first-child { top: 21px; transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { top: 21px; transform: rotate(-45deg); }

.mobile-menu {
  position: absolute;
  z-index: 6;
  top: calc(var(--pad-top) + 56px);
  left: var(--pad-x);
  right: var(--pad-x);
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 22px;
  color: #ffffff;
  text-shadow: var(--clear-glass-text-shadow);
  background: rgba(20, 30, 44, 0.32);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.25s var(--ease-soft), transform 0.3s var(--ease-out);
}

.mobile-menu[hidden] { display: none; }
.mobile-menu.is-open { opacity: 1; transform: none; }

.mobile-menu a {
  padding: 13px 14px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 500;
}

.mobile-menu a:hover { background: var(--clear-glass); }

.mobile-menu__cta {
  margin-top: 6px;
  text-align: center;
  background: #ffffff;
  color: #101418;
  font-weight: 600;
  text-shadow: none;
}

.mobile-menu a.mobile-menu__cta:hover { background: #eef2f6; }

/* ---------- Чипы с типами домов ---------- */

.index {
  position: absolute;
  z-index: 4;
  right: var(--pad-x);
  top: calc(var(--pad-top) + clamp(62px, 5.2vw, 84px));
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.index__row {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 10px 15px;
  border-radius: 999px;
  color: #ffffff;
  text-shadow: var(--clear-glass-text-shadow);
  background: var(--clear-glass);
  -webkit-backdrop-filter: var(--clear-glass-blur);
  backdrop-filter: var(--clear-glass-blur);
  transition: background-color 0.25s var(--ease-soft);
}

.index__row:hover { background: var(--clear-glass-hover); }

.index__num {
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.index__label {
  font-size: clamp(14px, 1vw, 16px);
  font-weight: 500;
  letter-spacing: -0.015em;
}

.index__count {
  font-size: 13px;
  font-weight: 400;
}

/* ---------- Нижний ряд: карточка проекта + лид ---------- */

.foot {
  position: absolute;
  z-index: 4;
  left: var(--pad-x);
  right: var(--pad-x);
  bottom: clamp(18px, 2.2vw, 38px);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.feature {
  display: grid;
  gap: 4px;
  width: clamp(280px, 21vw, 340px);
  padding: clamp(14px, 1.15vw, 20px);
  border-radius: 20px;
  color: #ffffff;
  background: var(--dark-glass);
  box-shadow: 0 10px 30px rgba(8, 24, 48, 0.14);
  -webkit-backdrop-filter: var(--dark-glass-blur);
  backdrop-filter: var(--dark-glass-blur);
  transition: background-color 0.3s var(--ease-soft), transform 0.35s var(--ease-out);
}

.feature:hover { background: var(--dark-glass-hover); }
.feature.is-refractive { box-shadow: none; }

.feature__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff1e2;
}

.feature__live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(226, 180, 103, 0.25);
  animation: live 2.4s var(--ease-soft) infinite;
}

@keyframes live {
  0%, 100% { box-shadow: 0 0 0 3px rgba(226, 180, 103, 0.25); }
  50% { box-shadow: 0 0 0 6px rgba(226, 180, 103, 0.08); }
}

.feature__name {
  font-family: var(--font-display);
  font-size: clamp(19px, 1.4vw, 24px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.feature__place {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
}

.feature__specs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.feature__specs span {
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.feature__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.24);
}

.feature__price {
  font-size: clamp(16px, 1.15vw, 19px);
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.feature__go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
}

.feature__go svg,
.lede__link svg {
  width: 15px;
  height: 15px;
  transition: transform 0.3s var(--ease-out);
}

.feature:hover .feature__go svg,
.lede__link:hover svg { transform: translateX(3px); }

.lede {
  display: grid;
  justify-items: end;
  gap: clamp(12px, 1vw, 16px);
  max-width: 21.5em;
  font-size: clamp(16px, 1.3vw, 22px);
  text-align: right;
}

.lede p {
  line-height: 1.32;
  font-weight: 500;
  letter-spacing: -0.015em;
  text-wrap: balance;
  text-shadow: 0 1px 14px rgba(8, 18, 30, 0.4);
}

.lede__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  border-radius: 6px;
  font-size: clamp(14px, 0.95vw, 16px);
  font-weight: 600;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  transition: background-size 0.35s var(--ease-out);
}

.lede__link:hover { background-size: 0% 1px; background-position: 100% 100%; }

/* ---------- Появление героя (~1.6 с) ---------- */

.js .stage { transform: scale(1.075); }
.js .wordmark__char { opacity: 0; transform: translateY(0.42em); }
.js .nav { opacity: 0; transform: translateY(-18px); }
.js [data-reveal]:not(.nav) { opacity: 0; transform: translateY(10px); filter: blur(8px); }
.js .lede { transform: translateY(14px); }

.is-ready .stage {
  transform: none;
  transition: transform 1.6s var(--ease-out);
}

.is-ready .wordmark__char {
  opacity: 1;
  transform: none;
  transition:
    transform 1.15s var(--ease-out) calc(0.32s + var(--i) * 0.07s),
    opacity 0.5s var(--ease-soft) calc(0.32s + var(--i) * 0.07s);
}

.is-ready .nav {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s var(--ease-soft) 0.15s, transform 0.9s var(--ease-out) 0.15s;
}

.is-ready [data-reveal]:not(.nav) {
  opacity: 1;
  transform: none;
  filter: none;
  transition:
    opacity 0.8s var(--ease-soft) 0.7s,
    transform 1s var(--ease-out) 0.7s,
    filter 0.9s var(--ease-soft) 0.7s;
}

.is-ready .feature { transition-delay: 0.8s, 0.8s, 0.8s; }
.is-ready .lede { transition-delay: 0.9s, 0.9s, 0.9s; }
.is-ready .feature:hover { transition: background-color 0.3s var(--ease-soft); }

.hero.is-menu-open .index {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s var(--ease-soft), visibility 0s linear 0.2s;
}

/* ---------- Адаптив ---------- */

@media (max-width: 1180px) {
  .nav__links .nav__link:nth-child(5) { display: none; }
}

@media (max-width: 960px) {
  .nav { grid-template-columns: 1fr auto; }
  .nav__links,
  .cta { display: none; }
  .menu-btn { display: block; }
  .index { top: calc(var(--pad-top) + 62px); }
}

@media (max-width: 600px) {
  /* Первый экран помещается в окно телефона целиком, включая iPhone SE и mini. */
  .hero { min-height: 500px; }

  .index {
    left: var(--pad-x);
    justify-content: flex-start;
  }
  .index__row { gap: 6px; padding: 9px 13px; }
  .index__count { display: none; }
  .index__label { font-size: 14px; }

  .foot {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .feature {
    width: auto;
    padding: 14px 16px;
  }
  .feature__eyebrow { margin-bottom: 2px; }
  .feature__name { font-size: 20px; }
  .feature__specs { display: none; }
  .feature__foot { margin-top: 8px; padding-top: 10px; }
  .lede {
    max-width: none;
    justify-items: start;
    text-align: left;
    font-size: 16px;
  }
}

/* Низкий экран телефона: лид сокращаем до ссылки, чтобы карточка не наезжала на дом. */
@media (max-width: 600px) and (max-height: 640px) {
  .lede p { display: none; }
  .feature__place { display: none; }
}

/* Телефон боком: оставляем вордмарк, дом и карточку проекта. */
@media (max-height: 500px) and (orientation: landscape) {
  .hero { min-height: 0; }
  .index,
  .lede p,
  .feature__place,
  .feature__specs { display: none; }
  .foot { bottom: 12px; }
  .feature { width: 270px; padding: 12px 14px; }
  .feature__foot { margin-top: 6px; padding-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .js .stage,
  .js .wordmark__char,
  .js .nav,
  .js [data-reveal]:not(.nav) {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none !important;
  }
  .feature__live { animation: none; }
  .mobile-menu,
  .menu-btn span,
  .cta__icon,
  .feature__go svg,
  .lede__link svg,
  .lede__link { transition: none; }
}
