:root {
  --ink: #14110f;
  --oat: #ece5d8;
  --greige: #ddd3c6;
  --taupe: #bcad9b;
  --oxblood: #6e2233;
  --white: #fff;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-card: cubic-bezier(0.16, 1, 0.3, 1);
  --active-width: 75vw;
  --inactive-shift: 50vw;
  --veil: #f7f3ec;
  /* animation milestones (ms):
     0–1180  panel slides
     640+    cards enter from left
     920+    text fades in  */
  --t-panel: 1180ms;
  --t-card: 860ms;
  --t-text: 680ms;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  overflow: hidden;
  background: #f2eee7;
  --transition-bg: #f2eee7;
  color: var(--ink);
  font-family: "Hanken Grotesk", Arial, sans-serif;
}

body.is-page-entering > :not(.page-veil):not(.nav-layer):not(script),
body.is-page-leaving > :not(.page-veil):not(.nav-layer):not(script) {
  opacity: 0;
  transform: translate3d(0, 10px, 0) scale(1.008);
}

body.is-page-ready > :not(.page-veil):not(.nav-layer):not(script) {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  transition:
    opacity 620ms var(--ease),
    transform 820ms var(--ease);
}

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

button {
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.shell-top {
  position: fixed;
  z-index: 50;
  top: 0;
  left: 0;
  right: 0;
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  pointer-events: none;
}

.brand,
.menu-trigger {
  pointer-events: auto;
}

.menu-trigger {
  margin-left: auto;
}

.brand {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  width: 98px;
  height: 42px;
  align-items: center;
  transition: left 1180ms var(--ease), opacity 640ms var(--ease);
}

/* SZKOLENIA активна: лого центрируем в 25vw полосе.
   12.5vw - 98px/2 = 12.5vw - 49px */
body[data-active="training"] .brand {
  left: max(4px, calc(12.5vw - 49px));
}

.brand__logo {
  position: absolute;
  left: 0;
  width: 100%;
  height: auto;
  transition: opacity 640ms var(--ease);
}

.brand__logo--white {
  opacity: 0;
}

body[data-active="training"] .brand__logo--ink {
  opacity: 0;
}

body[data-active="training"] .brand__logo--white {
  opacity: 1;
}

.menu-trigger {
  height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--oat);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-size: 0.68rem;
  font-weight: 400;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.36);
  transition: color 320ms var(--ease), opacity 320ms var(--ease);
}

body[data-active="services"] .menu-trigger {
  color: rgba(236, 229, 216, 0.82);
}

.menu-trigger:hover,
.menu-trigger:focus-visible {
  color: var(--white);
  outline: none;
}

.menu-trigger i {
  width: 18px;
  height: 12px;
  display: inline-block;
  border-top: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
}

.home-gate {
  position: relative;
  height: 100dvh;
  min-height: 560px;
  overflow: hidden;
  isolation: isolate;
}

.gate-panel {
  position: absolute;
  z-index: 10;
  top: 0;
  bottom: 0;
  width: var(--active-width);
  overflow: hidden;
  color: var(--ink);
  outline: none;
  transition:
    transform 1180ms var(--ease),
    filter 1180ms var(--ease),
    box-shadow 1180ms var(--ease);
  will-change: transform, filter;
}

.gate-panel img,
.gate-panel__wash {
  position: absolute;
  inset: 0;
}

.gate-panel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1320ms var(--ease);
}

.gate-panel__wash {
  z-index: 1;
  pointer-events: none;
}

.gate-panel__copy {
  position: absolute;
  z-index: 3;
  left: 20px;
  bottom: clamp(48px, 10vh, 96px);
  width: min(248px, calc(100% - 38px));
  display: grid;
  gap: 11px;
}

.gate-panel__copy::before,
.gate-panel__copy::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(-110px, 0, 0);
  transition:
    opacity 640ms var(--ease-card),
    transform var(--t-card) var(--ease-card);
}

.gate-panel__copy::before {
  inset: -22px -18px -18px -18px;
}

.gate-panel__copy::after {
  left: -20px;
  right: 18px;
  bottom: -25px;
  height: 34px;
  transform: translate3d(-140px, 0, 0);
  transition-delay: 80ms;
}

.gate-panel__copy > span {
  opacity: 0;
  transform: translate3d(0, 8px, 0);
  transition:
    opacity var(--t-text) var(--ease),
    transform var(--t-text) var(--ease);
  transition-delay: 0ms;
}

body[data-active="services"] .gate-panel--services .gate-panel__copy::before,
body[data-active="services"] .gate-panel--services .gate-panel__copy::after,
body[data-active="training"] .gate-panel--training .gate-panel__copy::before,
body[data-active="training"] .gate-panel--training .gate-panel__copy::after {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  /* cards enter after panel has mostly landed (~640ms) */
  transition-delay: 640ms;
}

body[data-active="services"] .gate-panel--services .gate-panel__copy::after,
body[data-active="training"] .gate-panel--training .gate-panel__copy::after {
  transition-delay: 700ms;
}

/* text enters after cards are visible */
body[data-active="services"] .gate-panel--services .gate-panel__copy > span,
body[data-active="training"] .gate-panel--training .gate-panel__copy > span {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition-delay: 920ms;
}

body[data-active="services"] .gate-panel--services .gate-panel__number,
body[data-active="training"] .gate-panel--training .gate-panel__number {
  transition-delay: 920ms;
}

body[data-active="services"] .gate-panel--services .gate-panel__title,
body[data-active="training"] .gate-panel--training .gate-panel__title {
  transition-delay: 970ms;
}

body[data-active="services"] .gate-panel--services .gate-panel__text,
body[data-active="training"] .gate-panel--training .gate-panel__text {
  transition-delay: 1030ms;
}

body[data-active="services"] .gate-panel--services .gate-panel__button,
body[data-active="training"] .gate-panel--training .gate-panel__button {
  transition-delay: 1100ms;
}

.gate-panel__number {
  font-size: 0.72rem;
  opacity: 0.62;
}

.gate-panel__title,
.gate-panel__side-label {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 360;
  font-variation-settings: "SOFT" 70, "WONK" 0;
  letter-spacing: 0;
}

.gate-panel__title {
  font-size: clamp(2.15rem, 10.4vw, 3.55rem);
  line-height: 1.02;
}

.gate-panel__text {
  max-width: 230px;
  font-size: 0.72rem;
  line-height: 1.62;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  opacity: 0.8;
}

.gate-panel__button {
  width: max-content;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border: 1px solid currentColor;
  border-radius: 0;
  padding: 0 14px;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.gate-panel__side-label,
.gate-panel__hint {
  position: absolute;
  z-index: 4;
  pointer-events: none;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  transition: opacity 620ms var(--ease), transform 820ms var(--ease);
}

.gate-panel__side-label {
  top: 55%;
  bottom: auto;
  transform: rotate(180deg) translateY(50%);
  font-size: clamp(1.55rem, 8vw, 2.75rem);
  line-height: 1;
  opacity: 0;
}

.gate-panel__hint {
  top: 32%;
  font-size: 0.58rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0;
}

.gate-panel--services {
  left: 0;
  z-index: 30;
  color: var(--ink);
  box-shadow: 18px 0 42px rgba(20, 17, 15, 0.24);
}

.gate-panel--services img {
  object-position: 58% 48%;
}

.gate-panel--services .gate-panel__wash {
  background: linear-gradient(180deg, transparent 0%, transparent 68%, rgba(236, 229, 216, 0.18) 100%);
}

.gate-panel--services .gate-panel__copy::before {
  background: rgba(228, 220, 207, 0.82);
  border-left: 2px solid rgba(255,255,255,0.40);
}

.gate-panel--services .gate-panel__copy::after {
  background: rgba(188, 173, 155, 0.18);
}

.gate-panel--training {
  right: 0;
  z-index: 20;
  color: var(--oat);
  transform: translate3d(var(--inactive-shift), 0, 0) scale(0.992);
  filter: saturate(0.82) brightness(0.58);
  box-shadow: -18px 0 42px rgba(0, 0, 0, 0.48);
}

.gate-panel--training img {
  object-position: 50% 44%;
}

.gate-panel--training .gate-panel__wash {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.06) 0%, transparent 50%, rgba(0, 0, 0, 0.22) 100%);
}

.gate-panel--training .gate-panel__copy {
  opacity: 0;
  pointer-events: none;
  transform: translate3d(0, 16px, 0);
}

.gate-panel--training .gate-panel__copy::before {
  background: rgba(10, 8, 6, 0.72);
  border-left: 2px solid rgba(236, 229, 216, 0.18);
  /* карточка едет справа налево */
  transform: translate3d(110px, 0, 0);
}

.gate-panel--training .gate-panel__copy::after {
  background: rgba(236, 229, 216, 0.05);
  /* акцент едет чуть дальше справа */
  transform: translate3d(140px, 0, 0);
}

/* текст тоже справа */
.gate-panel--training .gate-panel__copy > span {
  transform: translate3d(10px, 8px, 0);
}

body[data-active="services"] .gate-panel--training .gate-panel__side-label {
  left: calc(12.5vw - 17px);
  color: #fff;
  opacity: 1;
  text-shadow: 0 2px 18px rgba(0,0,0,0.55), 0 0 32px rgba(0,0,0,0.35);
  font-size: clamp(1.4rem, 6.5vw, 2.4rem);
}

body[data-active="services"] .gate-panel--training .gate-panel__hint {
  left: calc(12.5vw - 7px);
  color: rgba(255, 255, 255, 0.82);
  opacity: 1;
  text-shadow: 0 1px 8px rgba(0,0,0,0.5);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
}

body[data-active="training"] .gate-panel--training {
  z-index: 32;
  transform: translate3d(0, 0, 0) scale(1);
  filter: saturate(1.04) brightness(1.08);
  box-shadow: -22px 0 52px rgba(0, 0, 0, 0.6);
}

body[data-active="training"] .gate-panel--training .gate-panel__wash {
  background: linear-gradient(180deg, transparent 0%, transparent 58%, rgba(0, 0, 0, 0.16) 100%);
}

body[data-active="training"] .gate-panel--training .gate-panel__copy {
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(0, 0, 0);
}

body[data-active="training"] .gate-panel--services {
  z-index: 18;
  transform: translate3d(calc(var(--inactive-shift) * -1), 0, 0) scale(0.992);
  filter: saturate(0.72) brightness(0.54);
}

body[data-active="training"] .gate-panel--services .gate-panel__copy {
  opacity: 0;
  pointer-events: none;
  transform: translate3d(0, 16px, 0);
}

body[data-active="training"] .gate-panel--services .gate-panel__side-label {
  right: calc(12.5vw - 17px);
  color: #fff;
  opacity: 1;
  text-shadow: 0 2px 18px rgba(0,0,0,0.45), 0 0 28px rgba(0,0,0,0.3);
  font-size: clamp(1.4rem, 6.5vw, 2.4rem);
}

body[data-active="training"] .gate-panel--services .gate-panel__hint {
  right: calc(12.5vw - 7px);
  color: rgba(255, 255, 255, 0.78);
  opacity: 1;
  text-shadow: 0 1px 8px rgba(0,0,0,0.45);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
}

.gate-panel:hover img,
.gate-panel.is-pressing img {
  transform: scale(1.025);
}

.route-note {
  position: fixed;
  opacity: 0;
  pointer-events: none;
}

.nav-layer {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 28px;
  padding: 22px 22px 32px;
  background: rgba(236, 229, 216, 0.94);
  opacity: 0;
  pointer-events: none;
  transition: opacity 360ms var(--ease);
}

.nav-layer.is-open {
  opacity: 1;
  pointer-events: auto;
}

.nav-layer__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-layer__bar img {
  width: 104px;
  height: auto;
}

.nav-layer__close {
  width: 38px;
  height: 38px;
  border: 0;
  background: transparent;
  position: relative;
  cursor: pointer;
}

.nav-layer__close::before,
.nav-layer__close::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 19px;
  height: 1px;
  background: var(--ink);
}

.nav-layer__close::before {
  transform: rotate(45deg);
}

.nav-layer__close::after {
  transform: rotate(-45deg);
}

.nav-layer__links {
  align-self: center;
  display: grid;
  gap: 8px;
}

.nav-layer__links a {
  padding: 11px 0 14px;
  border-bottom: 1px solid rgba(20, 17, 15, 0.14);
  font-size: clamp(1.42rem, 7vw, 2.35rem);
  font-weight: 300;
  line-height: 1.24;
  letter-spacing: 0.02em;
  transition: color 240ms var(--ease), padding-left 300ms var(--ease);
}

.nav-layer__links a:hover,
.nav-layer__links a:focus-visible {
  color: var(--oxblood);
  padding-left: 12px;
  outline: none;
}

.nav-layer__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.nav-layer__actions a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid rgba(20, 17, 15, 0.26);
  border-radius: 0;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@media (min-width: 821px) {
  :root {
    --active-width: 62vw;
    --inactive-shift: 38vw;
  }

  .shell-top {
    height: 92px;
    padding: 0 42px;
  }

  .brand {
    width: 136px;
  }

  .gate-panel__copy {
    left: clamp(46px, 5vw, 84px);
    bottom: clamp(54px, 8vh, 92px);
    width: min(410px, calc(100% - 72px));
  }

  .gate-panel__title {
    font-size: clamp(4.2rem, 7vw, 8.1rem);
  }

  .gate-panel__text {
    font-size: 1rem;
  }

  .gate-panel--training .gate-panel__copy {
    left: clamp(42px, 4.4vw, 76px);
  }

  .nav-layer {
    padding: 28px 46px 42px;
  }

  .nav-layer__links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 54px;
  }

  .nav-layer__links a {
    font-size: clamp(1.45rem, 2.5vw, 2.45rem);
  }
}

/* ── Page transition veil ── */
@media (min-width: 1100px) {
  :root {
    --active-width: 50vw;
    --inactive-shift: 0vw;
  }

  body {
    background: #f2eee7;
  }

  .home-gate::before {
    content: "";
    position: absolute;
    z-index: 4;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: rgba(236,229,216,0.32);
    pointer-events: none;
  }

  .gate-panel {
    width: 50vw;
    background: #e8e0d5;
  }

  .gate-panel--training {
    background: #14100e;
  }

  .gate-panel img {
    inset: auto;
    top: clamp(110px, 14vh, 132px);
    bottom: clamp(50px, 6vh, 72px);
    width: min(52%, 430px);
    height: auto;
    object-fit: cover;
    box-shadow: 0 26px 72px rgba(20,17,15,0.28);
  }

  .gate-panel--services img {
    right: clamp(72px, 6vw, 104px);
    left: auto;
    object-position: 55% 48%;
  }

  .gate-panel--training img {
    left: clamp(72px, 6vw, 104px);
    right: auto;
    object-position: 50% 44%;
  }

  .gate-panel__wash {
    background: rgba(20,17,15,0.18) !important;
  }

  .gate-panel__copy {
    width: min(410px, calc(50vw - 136px));
    bottom: clamp(62px, 8vh, 86px);
  }

  .gate-panel--services .gate-panel__copy {
    left: clamp(66px, 6vw, 96px);
  }

  .gate-panel--training .gate-panel__copy {
    left: auto;
    right: clamp(66px, 6vw, 96px);
  }

  .gate-panel__title {
    font-size: clamp(3.25rem, 4vw, 4.55rem);
    max-width: 100%;
  }

  .gate-panel__text {
    max-width: 330px;
    font-size: 0.92rem;
  }

  .gate-panel__copy::before {
    inset: -20px -18px -18px -18px;
  }

  .gate-panel__copy::after {
    left: -18px;
    right: 18px;
    bottom: -26px;
  }

  body[data-active="services"] .gate-panel--training .gate-panel__side-label,
  body[data-active="services"] .gate-panel--training .gate-panel__hint {
    left: 24px;
  }

  body[data-active="training"] .gate-panel--services .gate-panel__side-label,
  body[data-active="training"] .gate-panel--services .gate-panel__hint {
    right: 24px;
  }

  .gate-panel__hint,
  body[data-active="services"] .gate-panel--training .gate-panel__hint,
  body[data-active="training"] .gate-panel--services .gate-panel__hint {
    display: none;
  }
}

.page-veil {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--transition-bg, var(--veil));
  opacity: 0;
  pointer-events: none;
  transition: opacity 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.is-page-entering .page-veil {
  opacity: 1;
  pointer-events: auto;
}

.page-veil.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.page-veil.is-hidden {
  opacity: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
  }
}
