@font-face {
  font-family: "Onder";
  src:
    url("Fonts/onder-regular.woff2?v=3") format("woff2"),
    url("Fonts/ONDER-REGULAR.TTF?v=3") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --u: 0.078125vw;
  --green: #00cf00;
  --green-hover: #00b300;
  /* Размер шрифта меню уменьшен на 30% */
  --font-size-menu: clamp(16px, 2.4vw, 35px);
  --font-size-sub: clamp(13px, 2.0vw, 28px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: #ffffff;
  color: #000000;
  font-family: "Onder", "Arial Narrow", Arial, sans-serif;
  font-synthesis: none;
  overflow-x: hidden;
}

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

/*
  Общая подложка для всех экранов сайта: прозрачность 70% (видимость 30%).

  Полотно background.svg вертикальное (21718.51 x 29874.06), поэтому оно повёрнуто,
  как в макете, и длинная сторона ложится на горизонталь экрана.

  --bg-long — длинная сторона до поворота, она же горизонтальный габарит после него.
  Короткая считается от неё по исходной пропорции 0.727004, поэтому рисунок никогда
  не растягивается. max() гарантирует перекрытие и по ширине, и по высоте на любом
  экране: от узкого телефона до широкого монитора.
*/
.site-bg {
  position: fixed;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.7;
}

.site-bg__art {
  --bg-long: calc(1.03 * max(100vw, 137.5508vh));

  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(var(--bg-long) * 0.727004);
  height: var(--bg-long);
  background: url("Background/background.svg?v=6") center / 100% 100% no-repeat;
  transform: translate(-50%, -50%) rotate(-90.4deg);
  transform-origin: 50% 50%;
}

/* 
  Типографическая заставка Originkit Appear Text
  Размер шрифта также уменьшен на 30%
*/
.intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  overflow: hidden;
  opacity: 1;
  cursor: pointer;
  transition: opacity 400ms cubic-bezier(0.4, 0, 0.2, 1);
  animation: intro-fallback 500ms ease-out 21s forwards;
}

.intro--finished {
  opacity: 0 !important;
  pointer-events: none !important;
  animation: none !important;
}

.appear-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 1.2vh, 14px);
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  will-change: transform;
  user-select: none;
}

.appear-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2vw, 28px);
  white-space: nowrap;
  will-change: transform;
}

.appear-word {
  display: inline-block;
  color: var(--green);
  font-family: "Onder", "Arial Narrow", Arial, sans-serif;
  font-size: clamp(17px, 2.7vw, 39px);
  font-weight: 700;
  line-height: 1.4;
  padding: 0.15em 0.05em;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  will-change: clip-path;
}

[hidden] {
  display: none !important;
}

/* 
  Главная страница после анимации
*/
.landing {
  position: relative;
  width: 100vw;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: transparent;
  opacity: 0;
  transition: opacity 600ms cubic-bezier(0.4, 0, 0.2, 1);
  animation: landing-fallback 600ms ease-out 21.1s forwards;
}

.landing--active {
  opacity: 1 !important;
  animation: none !important;
}

@keyframes intro-fallback {
  to {
    opacity: 0;
    pointer-events: none;
  }
}

@keyframes landing-fallback {
  to {
    opacity: 1;
  }
}

/* 
  Шапка: Логотип в левом верхнем углу (уменьшен на 70%)
*/
.landing__header {
  position: absolute;
  top: clamp(18px, 3.2vw, 42px);
  left: clamp(18px, 3.5vw, 48px);
  z-index: 10;
}

.landing__logo-link {
  display: block;
  width: clamp(120px, 13.5vw, 175px);
  height: auto;
  aspect-ratio: 666.056 / 140.119;
  transition: transform 160ms ease, opacity 160ms ease;
}

.landing__logo-link:hover {
  transform: scale(1.03);
  opacity: 0.9;
}

.landing__logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 
  Центральная область с меню (размер шрифта уменьшен на 30%)
*/
.landing__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(80px, 10vh, 110px) 20px clamp(35px, 5vh, 50px);
  text-align: center;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

/* 
  Главное меню в центре
*/
.center-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 2.8vh, 34px);
  width: 100%;
}

.center-nav__item {
  display: inline-block;
  font-family: "Onder", "Arial Narrow", Arial, sans-serif;
  font-size: var(--font-size-menu);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #000000;
  cursor: pointer;
  transition: color 180ms ease, transform 180ms ease;
  user-select: none;
}

.center-nav__item:hover {
  color: var(--green);
  transform: scale(1.03);
}

.center-nav__item:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 4px;
  color: var(--green);
}

.center-nav__item--disabled {
  cursor: default;
  color: #888888;
}

.center-nav__item--disabled:hover {
  transform: none;
  color: #888888;
}

/* Короткая заставка перед переходом по любому пункту меню. */
.menu-transition {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.82);
  opacity: 0;
  animation: menu-transition-in 160ms ease-out forwards;
  pointer-events: all;
}

.menu-transition--out {
  opacity: 0;
  animation: none;
  transition: opacity 180ms ease-in;
}

.menu-transition__grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.4vh, 18px);
  will-change: transform;
}

.menu-transition__row {
  display: flex;
  gap: clamp(12px, 2vw, 28px);
  white-space: nowrap;
  color: var(--green);
  font-size: clamp(17px, 2.7vw, 39px);
  font-weight: 700;
  line-height: 1.4;
  text-transform: uppercase;
  will-change: transform, clip-path;
}

.menu-transition__row:nth-child(odd) {
  transform: translateX(5vw);
}

.menu-transition__row:nth-child(even) {
  transform: translateX(-5vw);
}

.menu-transition__word {
  display: inline-block;
  padding: 0.12em 0.04em;
  clip-path: inset(-30% 100% -30% 0);
  animation: menu-word-reveal 720ms cubic-bezier(0.42, 0, 0.58, 1) both;
}

.menu-transition__row:nth-child(2) .menu-transition__word {
  animation-delay: 45ms;
}

.menu-transition__row:nth-child(3) .menu-transition__word {
  animation-delay: 90ms;
}

.menu-transition__row:nth-child(4) .menu-transition__word {
  animation-delay: 135ms;
}

.menu-transition__row:nth-child(5) .menu-transition__word {
  animation-delay: 180ms;
}

@keyframes menu-transition-in {
  to {
    opacity: 1;
  }
}

@keyframes menu-word-reveal {
  0% {
    clip-path: inset(-30% 100% -30% 0);
    transform: translateX(-18px) scale(1.12);
  }
  45%,
  72% {
    clip-path: inset(-30% 0 -30% 0);
    transform: translateX(0) scale(1);
  }
  100% {
    clip-path: inset(-30% 0 -30% 100%);
    transform: translateX(18px) scale(0.96);
  }
}

/* 
  Страница УСЛУГИ (список услуг)
*/
.services-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  animation: view-fade-in 260ms ease-out both;
}

.services-view__header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: clamp(14px, 2vh, 26px);
  position: relative;
  width: 100%;
}

.services-view__back {
  position: absolute;
  left: 0;
  background: none;
  border: none;
  font-family: "Onder", "Arial Narrow", Arial, sans-serif;
  font-size: clamp(12px, 1.4vw, 20px);
  font-weight: 700;
  color: #000000;
  cursor: pointer;
  letter-spacing: 0.02em;
  padding: 6px 10px;
  transition: color 160ms ease, transform 160ms ease;
}

.services-view__back:hover {
  color: var(--green);
  transform: translateX(-4px);
}

.services-view__title {
  margin: 0;
  font-family: "Onder", "Arial Narrow", Arial, sans-serif;
  font-size: var(--font-size-menu);
  font-weight: 700;
  color: var(--green);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.services-view__list {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 2.2vh, 26px);
  width: 100%;
}

.services-view__item {
  display: inline-block;
  font-family: "Onder", "Arial Narrow", Arial, sans-serif;
  font-size: var(--font-size-sub);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #000000;
  transition: color 160ms ease, transform 160ms ease;
}

.services-view__item:hover {
  color: var(--green);
  transform: scale(1.03);
}

.services-view__item:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 4px;
  color: var(--green);
}

@keyframes view-fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Мобильная адаптация */
@media (max-width: 768px) {
  .landing__header {
    top: 16px;
    left: 16px;
  }

  .landing__logo-link {
    width: 105px;
  }

  .landing__content {
    padding-top: 70px;
  }

  .appear-word {
    font-size: clamp(14px, 3.2vw, 24px);
  }

  .appear-row {
    gap: clamp(8px, 2vw, 16px);
  }

  .appear-grid {
    gap: clamp(4px, 1vh, 10px);
  }

  /* На узких экранах длинные пункты переносятся, поэтому строкам нужен запас по высоте */
  .center-nav__item,
  .services-view__item {
    line-height: 1.45;
  }

  .services-view__header {
    flex-direction: column;
    gap: 8px;
  }

  .services-view__back {
    position: static;
    margin-bottom: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .intro {
    display: none;
  }

  .landing {
    opacity: 1;
    animation: none;
  }

  .menu-transition,
  .menu-transition__word {
    animation: none;
  }
}
