/* ==========================================================================
   LAYOUT — фон, меню, боковая шкала, полноэкранные экраны
   ========================================================================== */

/* ---------- Общий фон ---------- */

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% 0%, #0f0b0a 0%, transparent 60%),
    var(--bg);
  pointer-events: none;
}

.bg__lines {
  position: absolute;
  inset: -6%;
  width: 112%;
  height: 112%;
  max-width: none;
  opacity: .8;
  transition: transform 1.8s var(--ease), opacity 1.6s;
}

/* подвижное оранжевое свечение — меняет позицию на каждом экране */
.bg__glow {
  position: absolute;
  left: 0;
  top: 0;
  width: 90vmax;
  height: 90vmax;
  margin: -45vmax 0 0 -45vmax;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 107, 26, .2) 0%, rgba(194, 65, 12, .09) 32%, transparent 62%);
  transform: translate(72vw, 82vh);
  transition: transform 1.9s var(--ease);
  will-change: transform;
}

/* еле заметное свечение за курсором */
.bg__cursor {
  position: absolute;
  left: 0;
  top: 0;
  width: 520px;
  height: 520px;
  margin: -260px 0 0 -260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 122, 46, .09) 0%, rgba(255, 107, 26, .035) 38%, transparent 68%);
  opacity: 0;
  transition: opacity .8s;
  will-change: transform;
}
.bg__cursor.is-on { opacity: 1; }

.bg__sparks {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.bg__vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(130% 100% at 50% 50%, transparent 55%, rgba(0, 0, 0, .65) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, .35), transparent 18%, transparent 82%, rgba(0, 0, 0, .45));
}

/* ---------- Шапка и меню ---------- */

.site-header {
  position: fixed;
  top: 22px;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  pointer-events: none;
  transition: opacity 1s var(--ease-out) .5s, transform 1s var(--ease-out) .5s;
}
.site-header > * { pointer-events: auto; }

.menu .pill__btn { padding: 11px 24px; }

.burger {
  display: none;
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(14, 10, 9, .5);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: inset 0 0 0 1px rgba(255, 107, 26, .35), 0 0 30px -10px rgba(255, 107, 26, .5);
}
.burger span {
  position: absolute;
  left: 16px;
  right: 16px;
  height: 1px;
  background: var(--text);
  transition: transform .5s var(--ease), background .3s;
}
.burger span:first-child { top: 22px; }
.burger span:last-child  { top: 29px; right: 22px; }
.mnav-open .burger span { background: var(--accent); }
.mnav-open .burger span:first-child { transform: translateY(3.5px) rotate(45deg); }
.mnav-open .burger span:last-child  { transform: translateY(-3.5px) rotate(-45deg); right: 16px; }

/* ---------- Мобильная шторка ---------- */

.mnav {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 100px 32px 48px;
  background:
    radial-gradient(90% 60% at 50% 110%, rgba(255, 107, 26, .22), transparent 70%),
    rgba(7, 5, 5, .96);
  clip-path: circle(0% at 50% 48px);
  visibility: hidden;
  transition: clip-path .8s var(--ease), visibility 0s linear .8s;
}
.mnav-open .mnav {
  clip-path: circle(150% at 50% 48px);
  visibility: visible;
  transition: clip-path .8s var(--ease), visibility 0s;
}
.mnav__list { display: flex; flex-direction: column; gap: 6px; }
.mnav__list a,
.mnav__social {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .4s, transform .4s var(--ease-out);
}
.mnav-open .mnav__list a,
.mnav-open .mnav__social {
  opacity: 1;
  transform: none;
  transition: opacity .7s var(--ease-out) calc(.25s + var(--i) * .08s), transform .7s var(--ease-out) calc(.25s + var(--i) * .08s);
}
.mnav__list a {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 10px 0;
  font-size: clamp(2rem, 9vw, 2.8rem);
  font-weight: 200;
  letter-spacing: -.02em;
  border-bottom: 1px solid var(--line);
}
.mnav__list a span {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .2em;
  color: var(--accent);
}
.mnav__social { display: flex; gap: 12px; margin-top: 40px; }

/* ---------- Боковая шкала 01–05 ---------- */

.sidenav {
  position: fixed;
  right: clamp(14px, 2vw, 34px);
  top: 50%;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transform: translateY(-50%);
  transition: opacity 1s var(--ease-out) .7s;
}
.sidenav a {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 6px 0;
  color: var(--dim);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .12em;
  transition: color .4s;
}
.sidenav a i {
  display: block;
  width: 14px;
  height: 1px;
  background: currentColor;
  transition: width .6s var(--ease), background .4s, box-shadow .4s;
}
.sidenav a:hover { color: var(--text); }
.sidenav a.is-active { color: var(--accent); }
.sidenav a.is-active i {
  width: 34px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(255, 107, 26, .8);
}

/* ---------- Экраны ---------- */

/* overflow-x: боковые карточки карусели не должны расширять страницу на телефоне */
.stage { position: relative; z-index: 1; overflow-x: hidden; }

.screen {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--header-h) var(--gutter) 66px;
}

.screen__inner {
  position: relative;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
}

/* ===== Полноэкранный режим (включается JS на ≥768px) ===== */

.fp,
.fp body { height: 100%; overflow: hidden; }

.fp .stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.fp .screen {
  position: absolute;
  inset: 0;
  height: 100%;
  min-height: 0;
  transition:
    transform 1.05s var(--ease),
    opacity 1.05s var(--ease),
    filter 1.05s var(--ease);
}
.fp .screen.is-next { transform: translate3d(0, 100%, 0); }
.fp .screen.is-past {
  transform: scale(.92);
  opacity: 0;
  filter: blur(5px) brightness(.5);
}
.lite.fp .screen.is-past { filter: none; }
.fp .screen.no-tr { transition: none !important; }

/* тонкая оранжевая линия на стыке экранов во время перехода */
.fp .screen::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 107, 26, .9) 30%, #FFB27A 50%, rgba(255, 107, 26, .9) 70%, transparent);
  box-shadow: 0 0 18px 2px rgba(255, 107, 26, .6);
  opacity: 0;
  transition: opacity .5s;
  pointer-events: none;
}
.fp .stage.is-moving .screen::before { opacity: 1; }

/* масштабирование контента под низкие экраны */
.fp .screen__inner {
  transform: scale(var(--fit, 1));
  transform-origin: 50% 50%;
}
/* на экране «Услуги» вместо transform используем zoom: текст в стеклянных
   карточках пересчитывается заново и остаётся чётким, а не растягивается как картинка */
@supports (zoom: 1) {
  .fp #services .screen__inner,
  .fp #faq .screen__inner,
  .fp #contacts .screen__inner {
    transform: none;
    zoom: var(--fit, 1);
  }
}

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

@media (max-width: 1023px) {
  .menu .pill__btn { padding: 10px 16px; }
}

@media (max-width: 767px) {
  :root { --header-h: 96px; }
  .menu { display: none; }
  .burger { display: block; }
  .sidenav { display: none; }
  .site-header { top: 16px; }
  .screen { padding-bottom: 72px; }
  .bg__glow { width: 130vmax; height: 130vmax; margin: -65vmax 0 0 -65vmax; }
  .bg__shard { display: none; }
}
