/* style.css — пиксель-точная репродукция Figma-кадра 1440×847 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  background: #191818;
  overflow: hidden;
  cursor: none; /* системный курсор скрыт — его заменяет круг NEXT */
}

/* Центрируем кадр и масштабируем его под вьюпорт (см. app.js) */
.viewport {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1440px;
  height: 847px;
  background: #191818;
  overflow: hidden;
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center center;
  font-family: "Schoolbell", cursive;
}

/* ---------- Слой 1: фоновое фото ---------- */
.bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 1;
}

.bg-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  /* Фото заполняет кадр целиком, без сильного увеличения */
  object-fit: cover;
  object-position: center 18%;
  /* Кинематографический грейдинг под Figma: сильное обесцвечивание
     (sat 0.33 -> 0.12) и лёгкое затемнение. Значения выведены замером
     зоны прожектора в Figma-референсе vs исходное фото. */
  -webkit-filter: saturate(0.28) brightness(0.82) contrast(0.9);
  filter: saturate(0.28) brightness(0.82) contrast(0.9);
  /* Кроссфейд между цитатами (раздел 2: фото 1000–1400ms) */
  opacity: 0;
  transition: opacity 1.2s ease;
}

.bg-photo.is-active {
  opacity: 1;
}

.bg-tint {
  position: absolute;
  inset: 0;
  background: rgba(25, 24, 24, 0.32);
}

/* ---------- Слой 2: тёмный оверлей-прожектор, следует за курсором ----------
   Мягкое атмосферное «окно» в тёмном слое #191818. Центр задаётся через
   --mx / --my (координаты в системе кадра), плавно двигается в app.js. */
.spotlight {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  --mx: 1179px;
  --my: 498px;
  /* Компактнее на ~25% и мягче по краям, чем прежде (фокус — цитата).
     Лёгкая вуаль уже в центре, чтобы фото читалось как атмосфера. */
  background: radial-gradient(
    circle at var(--mx) var(--my),
    rgba(25, 24, 24, 0.08) 0px,
    rgba(25, 24, 24, 0.12) 70px,
    rgba(25, 24, 24, 0.32) 140px,
    rgba(25, 24, 24, 0.64) 205px,
    rgba(25, 24, 24, 0.9) 260px,
    #191818 315px
  );
}

/* ---------- Слой 3: цитата ---------- */
.content {
  position: absolute;
  left: 120px;
  top: 100px; /* ниже навигации */
  bottom: 100px; /* выше пейджера */
  width: 1200px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 32px;
  z-index: 3;
  /* Вертикальное центрирование + невидимый скролл для длинных цитат.
     auto-поля центрируют блок, а при переполнении схлопываются — контейнер
     прокручивается с самого верха (без клиппинга, как у justify-content). */
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* старый Edge */
}
.content::-webkit-scrollbar {
  width: 0;
  height: 0;
}
.content > :first-child {
  margin-top: auto;
}
.content > :last-child {
  margin-bottom: auto;
}

/* Декоративные кавычки — зафиксированы сверху, не зависят от текста цитаты */
.quote-marks {
  position: absolute;
  top: 96.73px;
  left: 120px;
  width: 112px;
  height: 105.538px;
  display: block;
  z-index: 3;
  pointer-events: none;
}

/* Блок цитаты с fade-переходом (раздел 2: текст 450ms) */
.quote-block {
  width: 100%;
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.quote-block.q-out {
  opacity: 0;
  transform: translateY(-10px);
}

.quote-block.q-in {
  opacity: 0;
  transform: translateY(10px);
  transition: none;
}

.quote {
  width: 100%;
  font-family: "DM Serif Display", Georgia, serif;
  font-weight: 400;
  font-size: 58px;
  line-height: 0.9;
  letter-spacing: -0.58px;
  text-align: center;
  color: #e8e7e7;
}

/* ---------- Верхняя навигация ---------- */
.nav {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 1199px;
  padding: 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 5;
}

/* На десктопе обёртки «растворяются» — brand/menu/social остаются прямыми
   флекс-детьми .nav (как было), а бургер скрыт. Мобайл переопределяет это. */
.nav-bar,
.nav-panel {
  display: contents;
}

.nav-toggle {
  display: none;
  width: 46px;
  height: 46px;
  border-radius: 56px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

/* Гамбургер → крестик */
.burger,
.burger::before,
.burger::after {
  content: "";
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: #fff;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.burger {
  position: relative;
}
.burger::before {
  position: absolute;
  left: 0;
  top: -7px;
}
.burger::after {
  position: absolute;
  left: 0;
  top: 7px;
}
.nav.open .burger {
  background: transparent;
}
.nav.open .burger::before {
  transform: translateY(7px) rotate(45deg);
}
.nav.open .burger::after {
  transform: translateY(-7px) rotate(-45deg);
}

.brand {
  font-size: 16px;
  letter-spacing: -0.064px;
  text-transform: uppercase;
  color: #fff;
  white-space: nowrap;
}

.menu {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px;
  border-radius: 56px;
  background: rgba(0, 0, 0, 0.4); /* как у остальных контролов */
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.menu-item {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 16px 32px;
  border-radius: 32px;
  font-size: 14px;
  letter-spacing: -0.056px;
  text-transform: uppercase;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}

.menu-item.active {
  background: #fff;
  color: #000;
}

.social {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sm-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 36px;
}

.sm-btn img {
  display: block;
}

/* ---------- Кнопка next ---------- */
/* Круг NEXT теперь — кастомный курсор: следует за указателем (позиция
   задаётся в app.js), клики проходят сквозь него на сцену. */
.next {
  position: absolute;
  left: 0;
  top: 0;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.92);
  /* «Стеклянный» вид: матирование, мягкий блик и тень для глубины */
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 0 18px rgba(255, 255, 255, 0.05),
    0 8px 24px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  z-index: 9999; /* поверх всего — это курсор */
  pointer-events: none; /* клики идут на сцену под ним */
  font-family: "Schoolbell", cursive;
  color: #fff;
  font-size: 14px;
  letter-spacing: 0.28px;
  text-transform: uppercase;
  /* transform (позиция) выставляется покадрово в app.js — без перехода,
     чтобы курсор не отставал. Анимируем только нажатие/появление. */
  transition: width 0.13s ease, height 0.13s ease, background 0.13s ease,
    opacity 0.2s ease;
  will-change: transform;
}

/* Нажатие: лёгкое сжатие (как у курсора-кнопки) */
.next.down {
  width: 96px;
  height: 96px;
  background: rgba(0, 0, 0, 0.55);
}

/* Курсор ушёл за пределы окна */
.next.hidden {
  opacity: 0;
}

/* Над контролами круг-курсор скрыт, показываем системный курсор */
.next.over-ui {
  opacity: 0;
}

.nav,
.volume,
.pager {
  cursor: default;
}

.menu-item,
.sm-btn,
.sound-btn,
.pager-btn,
.eq {
  cursor: pointer;
}

/* ---------- Hover-состояния контролов (Figma «states») ----------
   Язык дизайна: на наведении появляется мягкая полупрозрачная подложка
   rgba(255,255,255,~0.06). Активный пункт меню (белый) не меняется. */
.menu-item {
  transition: background-color 0.2s ease, color 0.2s ease;
}

.sm-btn,
.sound-btn,
.pager-btn {
  border: 1px solid transparent; /* чтобы hover не сдвигал layout */
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

/* Пункты меню (неактивные) → мягкая тёмная пилюля */
.menu-item:not(.active):hover {
  background: rgba(255, 255, 255, 0.06);
}

/* Круглые кнопки (соцсети, звук, стрелки пейджера) → подложка-кружок */
.sm-btn:hover,
.sound-btn:hover,
.pager-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
}

/* Громкость: при наведении приглушённые деления чуть ярче */
.volume:hover .eq-dim {
  background-image: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.2) 0 1px,
    transparent 1px 3px
  );
}

/* ---------- Шеврон (из diamond.svg) ---------- */
.chevron {
  display: inline-block;
  width: 11.3px;
  height: 11.3px;
  background: center / contain no-repeat url("assets/diamond.svg");
}

.chevron.right {
  transform: rotate(45deg);
}

.chevron.left {
  transform: rotate(225deg);
}

/* ---------- Правый вертикальный регулятор громкости ---------- */
.volume {
  position: absolute;
  right: 42px;
  bottom: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 16px 2px 2px;
  border-radius: 60px;
  background: rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  z-index: 5;
}

/* Слайдер громкости: фиксированная дорожка 198px, белая заливка снизу
   (высота = уровень, задаётся в app.js). 1px линии с шагом 3px. */
.eq {
  position: relative;
  width: 16px;
  height: 198px;
}

.eq-dim,
.eq-on {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background-repeat: repeat-y;
  background-size: 100% 3px;
  background-position: left bottom;
}

.eq-dim {
  top: 0;
  background-image: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.1) 0 1px,
    transparent 1px 3px
  );
}

.eq-on {
  height: 54%; /* перекрывается inline-стилем из app.js */
  overflow: hidden;
  background-image: linear-gradient(to bottom, #fff 0 1px, transparent 1px 3px);
}

/* Состояние mute: «0» сверху, эквалайзер свёрнут в маленькую точку */
.volume.is-muted .vol-value {
  order: -1;
}
.volume.is-muted .eq {
  height: 6px;
  cursor: default;
}
.volume.is-muted .eq-dim,
.volume.is-muted .eq-on {
  display: none;
}
.volume.is-muted .eq::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3px;
  height: 3px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
}

.vol-value {
  font-size: 14px;
  letter-spacing: -0.056px;
  text-transform: uppercase;
  color: #fff;
}

.sound-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 36px;
  background: none;
  border: none;
  cursor: pointer;
}

.sound-btn img {
  display: block;
}

/* ---------- Нижний пейджер ---------- */
.pager {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 2px 4px;
  border-radius: 60px;
  background: rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  z-index: 5;
}

.pager-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 36px;
  background: none;
  border: none;
  cursor: pointer;
}

.pager-count {
  font-size: 14px;
  letter-spacing: -0.056px;
  text-transform: uppercase;
  color: #fff;
  white-space: nowrap;
}

/* ---------- Видимый фокус для клавиатуры ---------- */
.menu-item:focus-visible,
.sm-btn:focus-visible,
.pager-btn:focus-visible,
.sound-btn:focus-visible,
.eq:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 3px;
}

/* ============================================================
   Мобильный / портретный layout (≤768px)
   Кадр 1440×847 не масштабируется в полосу — сцена занимает весь
   экран, фон заполняет вьюпорт, цитата центрируется, курсор-
   прожектор отключается (на тач-устройствах его нет).
   ============================================================ */
@media (max-width: 768px) {
  .stage {
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    transform: none !important;
  }

  /* Фон заполняет экран */
  .bg-photo {
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
  }

  /* Статичная атмосферная виньетка вместо курсор-прожектора */
  .spotlight {
    background: radial-gradient(
      circle at 50% 42%,
      rgba(25, 24, 24, 0.3) 0%,
      rgba(25, 24, 24, 0.55) 55%,
      rgba(25, 24, 24, 0.82) 100%
    );
  }

  /* Отключаем десктоп-only механики */
  .next,
  .volume {
    display: none !important;
  }

  body {
    cursor: auto;
  }

  /* Верхняя панель: бренд + бургер; меню — выпадающий дропдаун */
  .nav {
    left: 0;
    right: 0;
    top: 0;
    width: auto;
    transform: none;
    padding: 0;
    flex-direction: column;
    align-items: stretch;
    border-bottom-left-radius: 32px;
    border-bottom-right-radius: 32px;
    transition: background-color 0.25s ease;
  }
  .nav.open {
    background: rgba(0, 0, 0, 0.4);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
  }

  /* Бар: бренд слева + бургер справа */
  .nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
  }
  .nav-toggle {
    display: flex;
  }
  .brand {
    font-size: 16px;
  }

  /* Дропдаун-панель */
  .nav-panel {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    padding: 0 16px;
    transition: max-height 0.3s ease, opacity 0.25s ease,
      visibility 0.25s ease, padding 0.3s ease;
  }
  .nav.open .nav-panel {
    max-height: 70vh;
    opacity: 1;
    visibility: visible;
    padding: 0 16px 28px;
  }

  /* Пункты меню — на всю ширину, столбиком */
  .menu {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    padding: 0;
    border-radius: 0;
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .menu-item {
    width: 100%;
  }

  /* Соцсети — ряд по краям */
  .social {
    justify-content: space-between;
    padding: 0 16px;
  }

  /* Цитата — по центру экрана, как в Figma-mob (DM Serif 36px) */
  .content {
    left: 0;
    top: 0;
    bottom: auto;
    width: 100%;
    height: 100%;
    padding: 84px 22px 96px;
    align-items: center;
    gap: 16px;
    /* центрирование — через auto-поля (см. базовые правила .content) */
  }
  .quote-marks {
    top: 84px;
    left: 50%;
    transform: translateX(-50%);
    width: 58px;
    height: auto;
  }
  .quote {
    font-size: clamp(24px, 9.2vw, 36px);
    line-height: 1.2;
    letter-spacing: -0.36px;
  }

  /* Пейджер — у нижнего края, стрелки по краям */
  .pager {
    bottom: 40px;
    width: calc(100% - 56px);
    max-width: 334px;
    justify-content: space-between;
  }
}
