/* ===== База и единый скроллер (тёмная тема) ===== */
*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; overflow: hidden; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell,
    "Noto Sans", "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: #ff7900;
  background: #000;
  line-height: 1.5;
}

:root {
  --page-padding: clamp(16px, 5vw, 48px);
  --max-page-width: 1200px;
  --vh: 1vh;
  --accent: #ff7900;

  --R: clamp(240px, 34vmin, 560px);
  --R-link-x: clamp(220px, 30vmin, 500px);
  --R-link-y: clamp(175px, 24vmin, 400px);

  /* ===== Быстрая настройка масштаба =====
     Поменяй числа ниже, чтобы быстро увеличить/уменьшить
     картинки и текст на страницах 1/2/4/5 (страницу 3 не трогаем).
  */
  --img-scale-global: 1;
  --text-scale-global: 1;

  /* дефолтные "базовые" размеры картинок (до масштабов выше) */
  --img-max-default: 2200px;

}

/* ===== Индивидуальная настройка по страницам =====
   Здесь можно ПРЯМО руками менять масштабы/ограничения по страницам.
   Если хочешь увеличить конкретную страницу — меняй её --img-scale / --text-scale.
*/
#page1 { --img-scale: 1; --text-scale: 1; --img-max: 2200px; --text-max: 60ch; }
#page2 { --img-scale: 1; --text-scale: 1; --img-max: 2200px; --text-max: 60ch; }
#page4 { --img-scale: 1; --text-scale: 1; --img-max: 2200px; --text-max: 62ch; }
#page5 { --img-scale: 1; --text-scale: 1; --img-max: 2200px; --text-max: 60ch; }
#page3 { --img-scale: 1; --text-scale: 1; } /* оставляем как было */



/* ===== Прелоадер ===== */
#preloader {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 1000;
  display: grid;
  place-items: center;
  transition: opacity 300ms ease, visibility 300ms ease;
}
#preloader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.preloader-center {
  position: relative;
  width: min(46vmin, 360px);
  aspect-ratio: 1/1;
  display: grid;
  place-items: center;
}
#preloader-rotor {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: center center;
  animation: preloader-spin 1.5s linear infinite;
}
#preloader-logo {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -20%);
  width: 115%;
  height: auto;
  pointer-events: none;
}
@keyframes preloader-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ===== Кнопка меню (крутится gear, поверх logo как на прелоадере) ===== */
.menu-toggle{
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 950;

  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  line-height: 0;
  -webkit-tap-highlight-color: transparent;

  width: 60px;   /* увеличено x1.5 */
  height: 60px;
  display: grid;
  place-items: center;

  transition: transform 150ms ease;
}
.menu-toggle:hover,
.menu-toggle:focus-visible{
  outline: none;
  transform: scale(1.06);
}

.menu-gear{
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  transform-origin: 50% 50%;
}

.menu-logo{
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -20%); /* как на прелоадере */
  width: 115%;                      /* как на прелоадере (gear=100%) */
  height: auto;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* ===== Верхняя панель-меню ===== */
.top-menu {
  position: fixed;
  inset: 0 0 auto 0;
  height: 84px;
  z-index: 940;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,0.92);
  border-bottom: 1px solid rgba(255,121,0,0.35);
  transform: translateY(-105%);
  transition: transform 220ms ease;
}
.top-menu.is-open { transform: translateY(0); }

.top-menu-list {
  display: flex;
  gap: clamp(10px, 2.6vw, 26px);
  list-style: none;
  margin: 0;
  padding: 0 var(--page-padding);
  align-items: center;
  justify-content: center;
  padding-right: calc(14px + 60px + 14px);
}
.top-menu-list a {
  color: #ff7900;
  text-decoration: none;
  font-weight: 800;
  font-size: clamp(13px, 2.4vw, 16px);
  letter-spacing: .02em;
  padding: 6px 10px;
  border-radius: 10px;

  display: inline-block;
  transform: scale(1);
  transition: transform 140ms ease;
}
.top-menu-list a:hover,
.top-menu-list a:focus-visible {
  outline: none;
  transform: scale(1.08);
}

/* ===== Единственный скроллер ===== */
#app {
  height: 100dvh;
  height: calc(var(--vh, 1vh) * 100);
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  background: #000;
  scrollbar-width: none;
}
#app::-webkit-scrollbar { width: 0; height: 0; }

/* ===== Секции ровно на экран ===== */
.page {
  block-size: 100dvh;
  min-block-size: calc(var(--vh, 1vh) * 100);
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--page-padding);
  background: #000;
}

.page > .content {
  width: 100%;
  max-width: var(--max-page-width);
  position: relative;
}

.two-col > .content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(16px, 3vw, 40px);
  align-items: center;
}

.text-col {
  font-size: calc(1rem * var(--text-scale-global) * var(--text-scale, 1));
}
.text-col h1, .text-col h2 { margin: 0 0 0.6em; }
.text-col p { margin: 0; max-width: var(--text-max, 60ch); }

.image-col img {
  display: block;
  width: 100%;
  height: auto;
  /* max можно быстро править через --img-max / --img-scale */
  max-width: min(100%, calc(var(--img-max, var(--img-max-default)) * var(--img-scale-global) * var(--img-scale, 1)));
  user-select: none; -webkit-user-drag: none;
}

/* ===== Page 3 ===== */
.link-field { position: relative; inline-size: 100%; block-size: 100%; cursor: pointer; }

.gear-center {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  pointer-events: none;

  width: min(62vmin, 540px);
  aspect-ratio: 1 / 1;
}
.gear-center img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: center center;
  will-change: transform;
  opacity: 1;
}
.gear-center .gear-overlay { pointer-events: none; }

.link-field.is-ready .gear-center { cursor: pointer; }

.link {
  position: absolute;
  text-decoration: none;
  color: inherit;

  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: opacity 220ms ease;
}

.link.is-ready {
  opacity: 0.72;
  pointer-events: auto;
}

.link[data-link="0"] {
  left: calc(50% - var(--R-link-x));
  top:  calc(50% - var(--R-link-y));
  transform: translate(-100%, -100%);
  text-align: right;
}
.link[data-link="1"] {
  left: calc(50% + var(--R-link-x));
  top:  calc(50% - var(--R-link-y));
  transform: translate(0, -100%);
  text-align: left;
}
.link[data-link="3"] {
  left: calc(50% + var(--R-link-x));
  top:  calc(50% + var(--R-link-y));
  transform: translate(0, 0);
  text-align: left;
}
.link[data-link="2"] {
  left: calc(50% - var(--R-link-x));
  top:  calc(50% + var(--R-link-y));
  transform: translate(-100%, 0);
  text-align: right;
}

.link-inline {
  display: inline-flex;
  align-items: baseline;
  gap: .45em;
  font-weight: 900;
  font-size: clamp(26px, 4.4vw, 52px);
  letter-spacing: 0.01em;
  transform: scale(1);
  transition: transform 220ms cubic-bezier(.22,.61,.36,1), opacity 180ms ease;
}

.link.is-ready.active { opacity: 1; }
.link.is-ready.active .link-inline { transform: scale(1.20); }

.link.is-ready:hover .link-inline,
.link.is-ready:focus-visible .link-inline,
.link.is-ready.hovered .link-inline {
  outline: none;
  transform: scale(1.12);
}

.link.is-ready.active:hover .link-inline,
.link.is-ready.active:focus-visible .link-inline,
.link.is-ready.active.hovered .link-inline {
  transform: scale(1.30);
}

.icon-inline{
  height: 1em;
  width: auto;
  vertical-align: -0.15em;
  display: inline-block;
}

/* ===== Page 4 (Контакты) ===== */
.contacts { max-width: 62ch; }

.contact-list{
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.contact-item{
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,121,0,0.25);
  background: rgba(255,121,0,0.05);
}

.contact-item dt{
  font-weight: 900;
  letter-spacing: 0.02em;
  font-size: calc(14px * var(--text-scale-global) * var(--text-scale, 1));
  opacity: 0.95;
}

.contact-item dd{
  margin: 0;
  font-weight: 800;
  font-size: calc(clamp(16px, 2.2vw, 20px) * var(--text-scale-global) * var(--text-scale, 1));
}

.contact-link{
  color: #ff7900;
  text-decoration: none;
  display: inline-block;
  transform: scale(1);
  transition: transform 140ms ease, opacity 140ms ease;
}
.contact-link:hover,
.contact-link:focus-visible{
  outline: none;
  transform: scale(1.05);
  opacity: 0.95;
}

.legal{
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,121,0,0.25);
}
.legal p{ margin: 0 0 6px; }
.legal-note{ opacity: 0.75; font-size: calc(13px * var(--text-scale-global) * var(--text-scale, 1)); }

/* ===== Page 5 (форма + картинка) ===== */
.page5-title{
  margin: 0 0 10px;
  font-size: calc(clamp(22px, 3.2vw, 32px) * var(--text-scale-global) * var(--text-scale, 1));
  letter-spacing: 0.01em;
}
.page5-subtitle{
  margin: 0 0 18px;
  opacity: 0.9;
  max-width: 55ch;
}

.contact-form{
  width: 100%;
  max-width: 520px;
  display: grid;
  gap: 14px;
}

.form-row{
  display: grid;
  gap: 8px;
}

.form-row label{
  font-weight: 800;
  letter-spacing: 0.01em;
  font-size: calc(14px * var(--text-scale-global) * var(--text-scale, 1));
  opacity: 0.95;
}

.form-row input,
.form-row textarea{
  width: 100%;
  font: inherit;
  color: #ff7900;
  background: rgba(255,121,0,0.06);
  border: 1px solid rgba(255,121,0,0.35);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
  transition: transform 120ms ease, border-color 120ms ease, background-color 120ms ease;
  resize: none;
}

.form-row textarea{
  resize: none;
  min-height: 140px;
}

.form-row input::placeholder,
.form-row textarea::placeholder{
  color: rgba(255,121,0,0.55);
}

.form-row input:focus-visible,
.form-row textarea:focus-visible{
  border-color: rgba(255,121,0,0.9);
  background: rgba(255,121,0,0.09);
}

.form-btn{
  justify-self: start;
  border: 1px solid rgba(255,121,0,0.8);
  background: transparent;
  color: #ff7900;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 900;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 140ms ease, background-color 140ms ease;
}
.form-btn:hover,
.form-btn:focus-visible{
  outline: none;
  transform: scale(1.04);
  background: rgba(255,121,0,0.10);
}

.form-note{
  margin: 0;
  font-size: calc(13px * var(--text-scale-global) * var(--text-scale, 1));
  opacity: 0.75;
  max-width: var(--text-max, 60ch);
}

.page5-right{
  display: grid;
  place-items: center;
}
.page5-illustration{
  height: auto;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  opacity: 0.95;
}

/* Адаптив */
@media (max-width: 1600px), (max-height: 980px) {
  :root {
    --R-link-x: clamp(215px, 32vmin, 460px);
    --R-link-y: clamp(160px, 23vmin, 360px);
  }
  .link { max-inline-size: min(34vw, 400px); }
  .link-inline { font-size: clamp(24px, 4vw, 44px); }
}

@media (max-width: 1366px), (max-height: 860px) {
  :root {
    --R-link-x: clamp(200px, 30vmin, 400px);
    --R-link-y: clamp(145px, 21vmin, 300px);
  }
  .link { max-inline-size: min(32vw, 340px); }
  .link-inline { font-size: clamp(22px, 3.5vw, 38px); }
}

@media (max-width: 900px) {
  .two-col > .content { grid-template-columns: 1fr; }
  :root {
    --R: clamp(200px, 32vmin, 460px);
    --R-link-x: clamp(150px, 24vmin, 300px);
    --R-link-y: clamp(125px, 20vmin, 250px);
  }
  .gear-center img { width: min(70vmin, 540px); }
  .link { max-inline-size: min(42vw, 260px); }
  .link-inline { font-size: clamp(18px, 3.2vw, 30px); }

  .top-menu { height: auto; padding: 10px 0; }
  .top-menu-list { flex-wrap: wrap; row-gap: 8px; }
}

::selection { background: rgba(255,121,0,0.25); color: #ff7900; }

/* ===== Правый индикатор (5 точек) ===== */
.pager {
  position: fixed; right: clamp(10px, 2.2vw, 18px); top: 50%;
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 12px;
  z-index: 50; pointer-events: auto;
}
.pager-dot {
  inline-size: 10px; block-size: 10px; border-radius: 50%;
  border: 1px solid rgba(255,121,0,0.6);
  background: rgba(255,121,0,0.12);
  cursor: pointer; padding: 0;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, opacity 160ms ease;
  opacity: 0.85;
}
.pager-dot:hover, .pager-dot:focus-visible {
  outline: none; transform: scale(1.15);
  border-color: #ff7900; background: rgba(255,121,0,0.22); opacity: 1;
}
.pager-dot.is-active { transform: scale(1.45); border-color: #ff7900; background: #ff7900; opacity: 1; }
@media (max-width: 480px) { .pager { right: 10px; gap: 10px; } }


/* ===== Производительность страниц 4 и 5 ===== */
#page4,
#page5 {
  contain: layout paint;
}

#page4 > .content,
#page5 > .content {
  contain: layout paint;
  transform: translateZ(0);
  backface-visibility: hidden;
}

#page4 .image-col,
#page4 .text-col,
#page5 .image-col,
#page5 .text-col {
  contain: layout paint;
}

#page4 img,
#page5 img,
#page4 .contact-form,
#page5 .contact-form {
  transform: translateZ(0);
  backface-visibility: hidden;
}
