/* ============================================================
   pilotarbuza.com — Authentic Lusion Architecture & Layout
   Styled in Anemos Aircraft Brandbook Palette:
     - Night Ground:        #0C1517
     - Night Surface:       #14232A
     - Deep Petrol:         #1F3A45
     - Breeze Teal:         #0B7A85 (Day) / #4FC7C4 (Night Luminous)
     - Mist Ice:            #BFE6E4
     - Garnet Flame Accent: #E8492A / #FF6A4A
     - Milk Ground:         #FFF8F0
   Fonts:
     - Unbounded, Manrope, JetBrains Mono, Doto
   ============================================================ */

:root {
  --anemos-night: #0C1517;
  --anemos-surface: #14232A;
  --anemos-deep: #1F3A45;
  --anemos-breeze: #0B7A85;
  --anemos-breeze-light: #4FC7C4;
  --anemos-mist: #BFE6E4;
  --anemos-garnet: #E8492A;
  --anemos-garnet-light: #FF6A4A;
  --anemos-ground: #FFF8F0;
  
  --anemos-font-display: "Unbounded", "Manrope", system-ui, sans-serif;
  --anemos-font-text: "Manrope", system-ui, sans-serif;
  --anemos-font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* Lusion Base Spacings */
  --base-padding-x: max(5vw, 40px);
  --base-padding-y: clamp(26px, 3.5vw, 46px);
}

/* Prevent horizontal scrolling and overflow across entire document */
html, body {
  overflow-x: clip !important;
  max-width: 100vw !important;
  width: 100% !important;
}
html {
  touch-action: pan-x pan-y pinch-zoom;
}
/* clip, not hidden: hidden turns these into scroll containers and breaks position: sticky in #route */
main, section, header, footer {
  max-width: 100vw !important;
  overflow-x: clip !important;
}
/* Ленты листаются пальцем только на телефоне; на десктопе это сетка, прокрутка ей не нужна.
   Полосы прокрутки скрыты везде: иначе Windows рисует их поверх карточек. */
.rail__track, .map-wrap, .cards__stage { scrollbar-width: none; }
.rail__track::-webkit-scrollbar, .map-wrap::-webkit-scrollbar, .cards__stage::-webkit-scrollbar { display: none; }
@media (max-width: 900px) {
  .rail { overflow: hidden !important; max-width: 100% !important; }
  /* The rail clips its overflow, so the track can't bleed into the gutter:
     without this the first card snaps under the rail's left edge and loses its text. */
  .rail__track { overflow-x: auto !important; overflow-y: hidden !important; max-width: 100% !important; margin: 0 !important; padding-left: 0 !important; padding-right: 0 !important; -webkit-overflow-scrolling: touch; }
}
.route, .route__sticky {
  overflow: clip !important;
  max-width: 100vw !important;
}
@media (max-width: 900px) {
  .map-wrap { overflow-x: auto !important; overflow-y: hidden !important; max-width: 100vw !important; -webkit-overflow-scrolling: touch; }
}

/* ============================================================
   01 · HERO SECTION
   ============================================================ */
#hero {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: 420px;
  background: #07090b;
  overflow: hidden;
  isolation: isolate;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  color: #f8f9fa;
}

/* The wordmark stays above the scene, clear of the separate bottom controls. */
.hero-bg-letters {
  position: absolute;
  bottom: calc(58px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  display: flex;
  margin: 0;
  font-family: "Manrope", Arial, Helvetica, sans-serif;
  font-size: 15.2vw;
  font-weight: 500;
  letter-spacing: -0.065em;
  color: #f8f9fa;
  white-space: nowrap;
  user-select: none;
  pointer-events: none;
  z-index: 4;
  line-height: 0.9;
  text-transform: uppercase;
  text-align: center;
}
.hero-bg-letters > span:last-child {
  padding-right: .065em;
}

/* Horizontal Crosshairs (+ + + + +) */
.hero-crosshairs {
  position: absolute;
  top: 53%;
  left: 0;
  width: 100%;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 3;
  padding: 0 var(--base-padding-x);
  box-sizing: border-box;
}
.hero-crosshair {
  position: relative;
  width: 17px;
  height: 17px;
  color: transparent;
  opacity: 0.55;
  font-size: 0;
  flex-shrink: 0;
  user-select: none;
}
.hero-crosshair::before,
.hero-crosshair::after {
  content: "";
  position: absolute;
  background: #e7eded;
}
.hero-crosshair::before { width: 17px; height: 1px; top: 8px; left: 0; }
.hero-crosshair::after { width: 1px; height: 17px; left: 8px; top: 0; }

/* The canvas never captures native touch scrolling or pinch gestures. */
#hero-balloons-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: block;
  cursor: default;
  touch-action: pan-y pinch-zoom;
}
.hero-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
}
.hero-static .hero-fallback {
  opacity: 1;
}
.hero-static #hero-balloons-canvas {
  visibility: hidden;
}
.hero-footer {
  position: absolute;
  bottom: calc(12px + env(safe-area-inset-bottom));
  left: var(--base-padding-x);
  right: var(--base-padding-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  z-index: 5;
}
.hero-scroll-explore,
.hero-motion-toggle {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 8px 0;
  border: 0;
  background: none;
  color: #d2d7da;
  font-family: var(--anemos-font-text);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .07em;
  line-height: 1.3;
  text-decoration: none;
  user-select: none;
  cursor: pointer;
}
.hero-scroll-explore {
  margin-left: auto;
  text-transform: uppercase;
}
.hero-scroll-explore > span:last-child {
  font-size: 21px;
  line-height: 1;
}
.hero-motion-toggle[hidden] {
  display: none;
}
.hero-scroll-explore:hover,
.hero-motion-toggle:hover {
  color: #fff;
}
.hero-scroll-explore:focus-visible,
.hero-motion-toggle:focus-visible {
  outline: 1px solid #f8f9fa;
  outline-offset: 5px;
}

/* ============================================================
   02 · HEADER & ACTIONS (Pixel-Perfect Lusion Layout)
   ============================================================ */
.lusion-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100vw;
  max-width: 100vw;
  padding: var(--base-padding-y) var(--base-padding-x);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  pointer-events: none;
  box-sizing: border-box;
  background: transparent;
  transition: padding 0.3s ease;
}

.lusion-header * {
  pointer-events: auto;
}

/* Brand on Left */
.lusion-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  user-select: none;
  cursor: pointer;
}
.lusion-brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  transition: transform 0.25s ease;
}
.lusion-brand:hover .lusion-brand-logo {
  transform: scale(1.06);
}
.lusion-brand-name {
  font-family: var(--anemos-font-display);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--anemos-ground);
  text-transform: lowercase;
}

/* Actions on Right */
.lusion-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Sound Button (Circle with minus / waveform) */
.lusion-btn-sound {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--anemos-ground);
  color: var(--anemos-night);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  outline: none;
  transition: transform 0.25s ease, background-color 0.25s ease;
  flex-shrink: 0;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
}
.lusion-btn-sound:hover {
  transform: scale(1.06);
}
.lusion-btn-sound-bar {
  width: 14px;
  height: 2.5px;
  background: var(--anemos-night);
  border-radius: 2px;
  transition: transform 0.25s ease, width 0.25s ease;
}
.lusion-btn-sound.playing .lusion-btn-sound-bar {
  background: var(--anemos-breeze);
  animation: soundPulse 0.75s ease-in-out infinite alternate;
}
@keyframes soundPulse {
  0%   { transform: scaleY(0.7); width: 10px; }
  100% { transform: scaleY(2.2); width: 15px; }
}

/* Capsule Buttons */
.lusion-capsule {
  height: 44px;
  padding: 0 22px;
  border-radius: 9999px;
  background: var(--anemos-deep);
  color: var(--anemos-ground);
  font-family: var(--anemos-font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-decoration: none;
  outline: none;
  white-space: nowrap;
  border: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: background-color 0.25s ease, transform 0.25s ease, color 0.25s ease;
}
.lusion-capsule:hover {
  background: var(--anemos-surface);
  transform: scale(1.03);
}

/* Dot on LET'S TALK */
.lusion-dot-garnet {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--anemos-garnet-light);
  box-shadow: 0 0 8px rgba(255, 106, 74, 0.8);
  flex-shrink: 0;
}

/* White Pill for MENU Button */
.lusion-capsule--white {
  background: var(--anemos-ground);
  color: var(--anemos-night);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
}
.lusion-capsule--white:hover {
  background: #f4eee5;
}

/* Two Dots (••) inside Menu Button */
.lusion-menu-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.1, 1);
}
.lusion-menu-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: var(--anemos-night);
}

/* ============================================================
   04 · ФИНАЛ «Let's work together!»: устроен как у lusion.co.
   Секция выше экрана, сцена внутри липкая; поле фигур — жидкость (end-shapes.js);
   слова в окнах с обрезкой, у каждой буквы копия ниже с зазором.
   ============================================================ */
#end-section {
  position: relative;
  width: 100%;
  height: 180vh;
  height: 180svh;
  background: var(--anemos-breeze);
  color: var(--anemos-ground);
  margin: 0;
  font-size: clamp(.875rem, 1vw, 2rem);
}
.end-stage { position: sticky; top: 0; height: 100vh; height: 100svh; min-height: 560px; overflow: clip; isolation: isolate; touch-action: pan-y; }
#end-shapes-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; display: block; }
.end-content {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: calc(50% - 3em);
  transform: translate(-50%, -50%);
  width: 100%;
  text-align: center;
  pointer-events: none;
}
.end-crosses { position: absolute; width: 60vw; left: 20vw; top: 0; height: calc(100% + 10vh); --cs: 14px; }
.end-crosses i { position: absolute; width: var(--cs); height: var(--cs); transform: scale(0); }
.end-crosses i::before, .end-crosses i::after { content: ""; position: absolute; left: 0; top: calc(.4375 * var(--cs)); width: var(--cs); height: calc(.125 * var(--cs)); background: var(--anemos-ground); }
.end-crosses i::after { transform: rotate(90deg); }
.end-crosses i:nth-child(1) { left: 0; top: 0; }
.end-crosses i:nth-child(2) { right: 0; top: 0; }
.end-crosses i:nth-child(3) { left: 0; bottom: 0; }
.end-crosses i:nth-child(4) { left: calc(50% - var(--cs) / 2); bottom: 0; }
.end-crosses i:nth-child(5) { right: 0; bottom: 0; }
.end-subtitle { margin: 0; font: 500 1em/1.4 var(--anemos-font-text); text-transform: uppercase; letter-spacing: .01em; }
.end-subtitle__clip { display: inline-block; overflow: hidden; vertical-align: top; }
.end-subtitle .sw { display: inline-block; transform: translate3d(0, 200%, 0) rotate(30deg); transform-origin: left top; }
.end-title {
  --fs: 10vw;
  position: relative;
  margin: .4em auto 0;
  width: fit-content;
  font-family: var(--anemos-font-text);
  font-size: var(--fs);
  font-weight: 400;
  letter-spacing: -.035em;
  line-height: 1;
  pointer-events: none;
}
@media (min-aspect-ratio: 21 / 9) { .end-title { --fs: 6.7vw; } }
.end-title__link { color: inherit; text-decoration: none; display: block; cursor: pointer; }
.end-title__link:focus-visible { outline: 2px solid var(--anemos-ground); outline-offset: .1em; }
.end-title__line { position: relative; display: block; white-space: nowrap; height: 1em; }
.end-title .w { display: inline-block; overflow: hidden; height: 1.06em; vertical-align: top; }
.end-title .cw { display: inline-block; position: relative; top: -.08em; vertical-align: top; will-change: transform; }
.end-title .c { display: block; height: 1em; line-height: 1; will-change: transform; }
.end-title .c:first-child { transform: translate3d(0, 115%, 0); }
.end-title .c + .c { margin-top: .2em; }
.end-deco { position: absolute; height: .06em; background: var(--anemos-ground); transform: scaleX(0); transform-origin: left center; }
.end-deco--top { left: .05em; right: 0; top: .83em; }
.end-deco--bl, .end-deco--br { bottom: .02em; }

@media (max-width: 560px) {
  #end-section { height: 140svh; }
  .end-content { top: 40%; }
  .end-crosses { width: calc(100% - 2 * var(--base-padding-x)); left: var(--base-padding-x); }
  .end-subtitle { font-size: 1.05em; width: 60%; margin: auto; }
  .end-title { --fs: 19vw; }
}
@media (prefers-reduced-motion: reduce) {
  .end-title .c:first-child, .end-subtitle .sw, .end-crosses i { transform: none !important; }
}

/* ============================================================
   05 · MOBILE RESPONSIVENESS (Exact Match to Image 1)
   ============================================================ */
@media (max-width: 812px) {
  :root {
    --base-padding-x: 25px;
    --base-padding-y: 25px;
  }

  .lusion-header {
    width: 100vw !important;
    max-width: 100vw !important;
    left: 0 !important;
    right: 0 !important;
    padding: var(--base-padding-y) var(--base-padding-x) !important;
    box-sizing: border-box !important;
    position: fixed !important;
  }

  .lusion-brand {
    position: fixed !important;
    top: var(--base-padding-y) !important;
    left: var(--base-padding-x) !important;
    z-index: 101 !important;
  }

  .lusion-actions {
    position: fixed !important;
    top: var(--base-padding-y) !important;
    right: var(--base-padding-x) !important;
    z-index: 101 !important;
  }

  .lusion-brand-logo {
    width: 34px;
    height: 34px;
  }
  .lusion-brand-name {
    font-size: 1.15rem;
  }

  /* HIDE sound button on mobile (matches Image 1) */
  .lusion-btn-sound {
    display: none !important;
  }

  /* HIDE let's talk button on mobile (matches Image 1) */
  .lusion-capsule:not(.lusion-menu-btn) {
    display: none !important;
  }

  /* TRANSFORM menu button into a sleek white circle with two dots (matches Image 1) */
  .lusion-menu-btn {
    width: 44px !important;
    height: 44px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #ffffff !important;
    color: #000000 !important;
    border: none !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35) !important;
    cursor: pointer !important;
  }
  #lusion-menu-btn-text {
    display: none !important;
  }
  .lusion-menu-dots {
    gap: 4px !important;
  }
  .lusion-menu-dot {
    width: 4.5px !important;
    height: 4.5px !important;
    background: #000000 !important;
  }

  /* Two lines keep the wordmark monumental without cropping the brand. */
  .hero-bg-letters {
    display: block;
    font-size: 23vw;
    line-height: .88;
    letter-spacing: -.065em;
    bottom: calc(74px + env(safe-area-inset-bottom));
    text-align: left;
  }
  .hero-bg-letters > span {
    display: block;
  }
  .hero-bg-letters > span:first-child {
    font-size: 1.245em;
  }
  .hero-crosshairs {
    top: 45%;
  }
  .hero-crosshair:nth-child(even) {
    visibility: hidden;
  }
  .hero-fallback {
    width: 160%;
    max-width: none;
    left: -30%;
    top: -10%;
  }

  .hero-footer {
    gap: 16px;
    bottom: calc(14px + env(safe-area-inset-bottom));
  }
  .hero-motion-toggle,
  .hero-scroll-explore {
    font-size: 10px;
    letter-spacing: .025em;
    gap: 10px;
  }


}

@media (max-height: 500px) and (orientation: landscape) {
  #hero {
    min-height: 320px;
  }
  .hero-bg-letters {
    display: flex;
    bottom: 52px;
    font-size: 15.2vw;
    line-height: .9;
  }
  .hero-bg-letters > span:first-child {
    font-size: inherit;
  }
  .hero-footer {
    bottom: 4px;
  }
}

@media (max-width: 400px) {
  :root {
    --base-padding-x: 16px;
    --base-padding-y: 18px;
  }
}


/* Header on light sections: main.js adds .top--light once the hero is scrolled away */
.lusion-header.top--light .lusion-brand-name { color: var(--anemos-deep); }
.lusion-btn-sound:focus-visible,
.lusion-capsule:focus-visible,
.lusion-nav-link:focus-visible,
.lusion-card:focus-visible { outline: 2px solid var(--anemos-breeze-light); outline-offset: 3px; }

/* ============================================================
   06b · Карты «С чем работаю»
   ============================================================ */
.cards {
  position: relative;
  background: var(--anemos-breeze);
  color: var(--anemos-ground);
  --cw: min(21vw, 45vh, 420px);
}
.cards--scroll { height: 420vh; }
.cards__sticky { position: relative; min-height: 100svh; overflow: clip; }
.cards--scroll .cards__sticky { position: sticky; top: 0; height: 100vh; height: 100svh; display: grid; place-items: center; }
.cards__h {
  position: absolute;
  z-index: 0;
  top: clamp(120px, 15vh, 170px);
  left: var(--base-padding-x);
  right: var(--base-padding-x);
  margin: 0;
  font: 500 clamp(3.4rem, 10.4vw, 12rem)/.9 var(--anemos-font-text);
  letter-spacing: -.035em;
  text-transform: uppercase;
  color: var(--anemos-ground);
  pointer-events: none;
  will-change: transform, opacity;
}
.cards__h1, .cards__h2 { display: block; white-space: nowrap; }
.cards__h2 { text-align: right; padding-right: 6vw; }
.cards__ribbon { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; overflow: visible; }
.cards__ribbon .rb { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.cards__ribbon-g { will-change: transform; filter: drop-shadow(0 22px 26px rgba(8, 40, 44, .28)); }
.cards__stage {
  position: relative;
  z-index: 1;
  width: 100%;
  height: calc(var(--cw) * 1.4);
  perspective: 2200px;
  perspective-origin: 50% 45%;
}
.cards--scroll .cards__stage { margin-top: 6vh; }
.pc {
  position: absolute;
  left: 50%;
  top: 0;
  width: var(--cw);
  height: calc(var(--cw) * 1.4);
  margin-left: calc(var(--cw) / -2);
  transform-style: preserve-3d;
  will-change: transform;
}
.pc__inner {
  all: unset;
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  will-change: transform;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
}
.pc__face {
  position: absolute;
  inset: 0;
  border-radius: calc(var(--cw) * .05);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  box-shadow: 0 30px 60px -12px rgba(8, 40, 44, .45), 0 2px 6px rgba(8, 40, 44, .2);
  transform: translateZ(.5px);
}
.pc__back { background: var(--anemos-breeze); border: calc(var(--cw) * .016) solid var(--anemos-ground); }
.pc__back svg { width: 100%; height: 100%; display: block; }
.pc__front {
  transform: rotateY(180deg) translateZ(.5px);
  background: #FFFDF9;
  color: #14232A;
  display: flex;
  flex-direction: column;
  padding: calc(var(--cw) * .12) calc(var(--cw) * .115) calc(var(--cw) * .1);
  font-family: var(--anemos-font-text);
}
.pc__head, .pc__foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pc__title {
  font-size: calc(var(--cw) * .088);
  font-weight: 500;
  letter-spacing: -.01em;
  line-height: 1;
  text-transform: uppercase;
}
.pc__glyph { width: calc(var(--cw) * .1); height: calc(var(--cw) * .1); flex: 0 0 auto; fill: #14232A; shape-rendering: crispEdges; }
.pc__list {
  margin: calc(var(--cw) * .085) 0 auto;
  padding: 0;
  list-style: none;
  font-size: calc(var(--cw) * .05);
  font-weight: 500;
  color: #1F3A45;
}
.pc__list li {
  padding: calc(var(--cw) * .038) 0;
  background: radial-gradient(circle, rgba(11, 122, 133, .38) 1px, transparent 1.5px) 0 100% / 8px 3px repeat-x;
}
.pc__list li:last-child { background: none; }
.pc__foot { transform: rotate(180deg); }

/* Без сцены по скроллу (телефон, reduced motion): заголовок сверху, карты лентой, переворот классом */
.cards:not(.cards--scroll) .cards__sticky { padding: 96px 0 64px; }
.cards:not(.cards--scroll) .cards__h { position: relative; top: auto; left: auto; right: auto; padding: 0 var(--base-padding-x); margin-bottom: 28px; font-size: clamp(2.6rem, 13vw, 5rem); }
.cards:not(.cards--scroll) .cards__h2 { padding-right: 0; }
.cards:not(.cards--scroll) .cards__stage {
  height: auto;
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 20px max(24px, calc(50vw - var(--cw) / 2)) 28px;
}
.cards:not(.cards--scroll) .pc { position: relative; left: auto; margin: 0; flex: 0 0 var(--cw); scroll-snap-align: center; }
.cards:not(.cards--scroll) .pc__inner { cursor: pointer; transition: transform .9s cubic-bezier(.65, 0, .25, 1); }
.cards:not(.cards--scroll) .pc.is-flipped .pc__inner { transform: rotateY(180deg); }
.cards:not(.cards--scroll) .pc__inner:focus-visible .pc__face { outline: 3px solid var(--anemos-ground); outline-offset: 3px; }
.cards__hint { display: none; }
@media (max-width: 900px) {
  .cards { --cw: min(70vw, 320px); }
  .cards__hint { display: block; position: relative; z-index: 1; width: fit-content; margin: 4px auto 0; padding: 6px 12px; border-radius: 999px; background: var(--anemos-breeze); text-align: center; font-size: 12px; letter-spacing: .08em; }
}
@media (prefers-reduced-motion: reduce) { .cards:not(.cards--scroll) .pc__inner { transition: none; } }


/* ============================================================
   03 · МЕНЮ, как на lusion.co
   Карточки выезжают по очереди: снизу, с поворотом, с задержкой index/50 s
   при открытии и (count-index)/50 s при закрытии. У ссылки текст
   прокручивается вверх, под ним всплывает плашка, справа стрелка.
   ============================================================ */
.lusion-backdrop {
  position: fixed; top: 0; right: 0; bottom: 0; width: 50vw;
  z-index: 90; pointer-events: none; opacity: 0;
  background: linear-gradient(270deg, rgba(12, 21, 23, .5), rgba(12, 21, 23, 0));
  transition: opacity .4s .4s;
}
.lusion-backdrop.open { opacity: .45; transition-delay: 0s; }

.lusion-menu {
  --mease: cubic-bezier(.4, 0, .1, 1);
  position: fixed;
  top: calc(var(--base-padding-y) + 48px + 10px);
  right: var(--base-padding-x);
  width: 19.4em; max-width: calc(100vw - 2 * var(--base-padding-x));
  font-size: 16px;
  z-index: 95;
  display: flex; flex-direction: column; gap: .625em;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0s linear .7s;
}
.lusion-menu.open { visibility: visible; pointer-events: auto; transition-delay: 0s; }

.lusion-card {
  position: relative; display: block; box-sizing: border-box;
  border-radius: .625em; text-decoration: none;
  opacity: 0;
  transform: translate3d(0, 7.75em, 0) rotate(-3.5deg);
  transform-origin: 0 0;
  transition: transform .5s var(--mease) var(--close-delay, 0s), opacity .5s var(--mease) var(--close-delay, 0s);
  will-change: transform, opacity;
}
.lusion-card--nav { transform: translate3d(0, 5.5em, 0) rotate(3.5deg); transform-origin: 100% 0; }
.lusion-menu.open .lusion-card {
  opacity: 1; transform: none;
  transition-delay: var(--open-delay, 0s);
}

/* карточка ссылок */
.lusion-card--nav {
  background: var(--anemos-ground); color: var(--anemos-night);
  padding: 1em .3125em;
  box-shadow: 0 1.5em 3.5em -1.5em rgba(12, 21, 23, .45);
}
.lusion-nav-links { display: flex; flex-direction: column; }
.lusion-nav-link {
  --c: var(--anemos-deep);
  position: relative; display: flex; align-items: center;
  padding: .72em 1.625em;
  color: var(--anemos-night); text-decoration: none;
  font-family: var(--anemos-font-text); font-weight: 500;
  text-transform: uppercase; letter-spacing: -.01em;
}
.lnl-bg {
  position: absolute; inset: 0; border-radius: 6.25em;
  background: var(--c); opacity: 0; transform: scale(.85);
  transition: transform .4s var(--mease), opacity .4s var(--mease);
}
.lnl-txt { position: relative; display: block; overflow: hidden; height: 1.1em; line-height: 1.1; }
.lusion-nav-link .lnl-txt { font-size: 1.5em; }
.lnl-t { display: block; transition: transform .4s var(--mease); }
.lnl-t--c { position: absolute; left: 0; top: 100%; }
.lnl-arrow {
  position: absolute; right: 1.6em; top: 50%; width: 1.1em; height: 1.1em; margin-top: -.55em;
  transform: scale(0); transition: transform .3s var(--mease);
}
/* точка у текущего раздела */
.lusion-nav-link::before {
  content: ""; position: absolute; right: 1.9em; top: 50%; width: .5em; height: .5em; margin-top: -.25em;
  border-radius: 50%; background: var(--anemos-garnet);
  transform: scale(0); transition: transform .3s var(--mease);
}
.lusion-nav-link.active::before { transform: scale(1); }
@media (hover: hover) {
  .lusion-nav-link:hover .lnl-bg { opacity: .08; transform: scale(1); }
  .lusion-nav-link:hover .lnl-t, .lusion-card--talk:hover .lnl-t, .lusion-card--github:hover .lnl-t { transform: translateY(-100%); }
  .lusion-nav-link:hover .lnl-arrow { transform: scale(1); transition-delay: .2s; }
  .lusion-nav-link.active:hover::before { transform: scale(0); }
}

/* «давай поговорим» */
.lusion-card--talk {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.15em 1.9em;
  background: var(--anemos-deep); color: var(--anemos-ground);
  font-family: var(--anemos-font-text); font-weight: 600; letter-spacing: .02em;
  box-shadow: 0 1.5em 3.5em -1.5em rgba(12, 21, 23, .5);
}
.lusion-card--talk .lusion-dot-garnet { width: .55em; height: .55em; transition: transform .4s var(--mease); }
.lusion-card--talk:hover .lusion-dot-garnet { transform: scale(1.6); }

/* GitHub: чёрная карточка, стрелка улетает вправо-вверх, на её место прилетает вторая */
.lusion-card--github {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.15em 1.9em;
  background: var(--anemos-night); color: var(--anemos-ground);
  font-family: var(--anemos-font-text); font-weight: 600; letter-spacing: .04em;
  box-shadow: 0 1.5em 3.5em -1.5em rgba(12, 21, 23, .6);
}
.github-left { display: flex; align-items: center; gap: .75em; }
.github-icon-svg { width: 1.3em; height: 1.3em; color: var(--anemos-ground); }
.gh-arrows { position: relative; width: 1.1em; height: 1.1em; overflow: hidden; color: var(--anemos-breeze-light); }
.gh-arrows svg { position: absolute; inset: 0; width: 100%; height: 100%; transition: transform .45s var(--mease); }
.gh-arrows svg + svg { transform: translate(-110%, 110%); }
.lusion-card--github:hover .gh-arrows svg:first-child { transform: translate(110%, -110%); }
.lusion-card--github:hover .gh-arrows svg + svg { transform: none; }

/* кнопка MENU / CLOSE */
.mbt { position: relative; display: inline-grid; overflow: hidden; height: 1.2em; line-height: 1.2; }
.mbt__a, .mbt__b { grid-area: 1 / 1; display: block; transition: transform .3s var(--mease, cubic-bezier(.4,0,.1,1)); }
.mbt__b { transform: translateY(100%); }
.lusion-menu-btn[aria-expanded="true"] .mbt__a { transform: translateY(-100%); }
.lusion-menu-btn[aria-expanded="true"] .mbt__b { transform: none; }
.lusion-menu-dots { transition: transform .4s cubic-bezier(.4, 0, .1, 1); }
@media (hover: hover) { .lusion-menu-btn:hover .lusion-menu-dots { transform: rotate(90deg); } }
.lusion-menu-btn[aria-expanded="true"] .lusion-menu-dots { transform: rotate(90deg); }

/* кнопки шапки въезжают снизу по очереди */
.lusion-header .lusion-brand, .lusion-actions > * { animation: hdrIn .9s cubic-bezier(.35, 0, 0, 1) both; }
.lusion-actions > :nth-child(1) { animation-delay: .1s; }
.lusion-actions > :nth-child(2) { animation-delay: .16s; }
.lusion-actions > :nth-child(3) { animation-delay: .22s; }
@keyframes hdrIn { from { transform: translateY(4em); opacity: 0; } }

@media (max-width: 768px) {
  .lusion-backdrop { width: 100vw; }
  .lusion-backdrop.open { opacity: 1; }
  .lusion-menu { left: var(--base-padding-x); width: auto; top: calc(var(--base-padding-y) + 44px + 10px); }
  .lusion-nav-link { padding: .62em 1.4em; }
}
@media (max-height: 640px) {
  .lusion-menu { max-height: calc(100svh - var(--base-padding-y) - 64px); overflow-y: auto; scrollbar-width: none; }
  .lusion-menu::-webkit-scrollbar { display: none; }
  .lusion-nav-link { padding-block: .45em; }
}
@media (prefers-reduced-motion: reduce) {
  .lusion-card, .lnl-t, .lnl-bg { transition-duration: .01s !important; }
  .lusion-header .lusion-brand, .lusion-actions > * { animation: none; }
}

/* ============================================================
   06 · ПРОЕКТЫ, витрина как на lusion.co/projects
   Огромный заголовок с номером и стрелкой, сетка 2 колонки с обложками.
   Обложка открывается снизу вверх, на наведении сжимается к центру
   и чуть приближается, название сдвигается вправо и выпускает стрелку.
   ============================================================ */
.projects { --el: cubic-bezier(.35, 0, 0, 1); }
.wk-head { position: relative; display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; margin: 2vw 0 clamp(36px, 5vw, 72px); }
.wk-title {
  position: relative; margin: 0; width: fit-content;
  font-family: var(--anemos-font-text); font-weight: 500; text-transform: uppercase;
  font-size: min(15vw, 210px); line-height: .9; letter-spacing: -.055em; color: var(--anemos-night);
  padding-right: .62em;
}
.wk-title__mask { display: block; overflow: hidden; padding-bottom: .04em; }
.wk-title__in { display: block; transform: translateY(105%); transition: transform 1.4s var(--el); }
.wk-title__num { position: absolute; right: 0; top: .02em; font-size: .2em; letter-spacing: 0; overflow: hidden; line-height: 1; }
.wk-title__num > span { display: block; transform: translateY(100%); transition: transform 1s var(--el) .35s; }
.wk-title__arrow { position: absolute; right: .02em; bottom: .1em; width: .2em; height: .2em; transform: scale(0) rotate(-90deg); transition: transform 1s var(--el) .5s; }
.wk-head.is-in .wk-title__in, .wk-head.is-in .wk-title__num > span { transform: none; }
.wk-head.is-in .wk-title__arrow { transform: none; }
.wk-lead { max-width: 360px; font-size: 17px; line-height: 1.55; color: var(--ink-2); margin: 0 0 1.4em; opacity: 0; transform: translateY(1em); transition: opacity .9s, transform 1s var(--el); transition-delay: .4s; }
.wk-head.is-in .wk-lead { opacity: 1; transform: none; }

.wk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(16px, 2.2vw, 32px); row-gap: clamp(56px, 6vw, 96px); }
.wk { position: relative; display: block; color: inherit; text-decoration: none; cursor: pointer; --px: 0px; --py: 0px; }
.wk--feat { grid-column: 1 / -1; }
.wk__main { position: relative; padding-top: 65%; }
.wk--feat .wk__main { padding-top: 43.75%; }
.wk__img {
  position: absolute; inset: 0; overflow: hidden; border-radius: 15px; background: var(--anemos-surface);
  clip-path: inset(100% 0 0 0 round 15px);
  transition: clip-path 1.3s var(--el);
}
.wk.is-in .wk__img { clip-path: inset(0 0 0 0 round 15px); }
.wk__svg {
  display: block; width: 100%; height: 100%;
  translate: var(--px) var(--py); scale: var(--s, 1.25);
  transition: scale 1.6s var(--el);
}
.wk.is-in .wk__svg { --s: 1.02; }
.wk__pill {
  position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: .5em;
  height: 2em; padding: 0 .9em; border-radius: 1em;
  background: var(--anemos-ground); color: var(--anemos-night);
  font-family: var(--anemos-font-mono); font-weight: 500; font-size: 13px; text-transform: uppercase;
  opacity: 0; transform: scale(.6); transition: opacity .5s, transform .7s var(--el); transition-delay: .7s;
}
.wk__pill .lnl-txt { height: 1.2em; line-height: 1.2; }
.wk__ext { width: 1em; height: 1em; }
.wk.is-in .wk__pill { opacity: 1; transform: none; }
.wk__tags {
  margin: 1.5em 0 .9em; font-family: var(--anemos-font-mono); font-size: 12px; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted);
}
.wk__name {
  position: relative; margin: 0; overflow: hidden;
  font-family: var(--anemos-font-text); font-weight: 500; font-size: clamp(24px, 2.6vw, 42px); line-height: 1.12; letter-spacing: -.03em;
  color: var(--anemos-night);
}
.wk__name-in { display: block; margin-left: -1.05em; padding: 0 1.05em 0 1.05em; transition: transform .6s var(--el); }
.wk__arrow { position: absolute; width: .72em; height: .72em; margin: .22em 0 0 -1.05em; }
.wk__desc { max-width: 52ch; margin: .9em 0 0; font-size: 16px; line-height: 1.55; color: var(--ink-2); }
.wk__foot > * { opacity: 0; transform: translateY(1.2em); transition: opacity .8s, transform 1s var(--el); }
.wk__foot > :nth-child(2) { transition-delay: .08s; } .wk__foot > :nth-child(3) { transition-delay: .16s; }
.wk.is-in .wk__foot > * { opacity: 1; transform: none; }
.wk.is-in .wk__foot > :first-child { transition-delay: .35s; } .wk.is-in .wk__foot > :nth-child(2) { transition-delay: .43s; } .wk.is-in .wk__foot > :nth-child(3) { transition-delay: .51s; }

@media (hover: hover) {
  .wk.is-in:hover .wk__img { clip-path: inset(1.6% 1.2% round 34px); transition-duration: .8s; }
  .wk.is-in:hover .wk__svg { --s: 1.09; transition-duration: 1.1s; }
  .wk:hover .wk__name-in { transform: translateX(1.05em); }
  .wk:hover .wk__pill .lnl-t { transform: translateY(-100%); }
}
.wk:focus-visible { outline: none; }
.wk:focus-visible .wk__img { outline: 3px solid var(--accent); outline-offset: 4px; }

/* живые обложки: анимации идут, пока карточка на экране */
.wk-draw path, .wk-draw circle { stroke-dasharray: 2400; stroke-dashoffset: 2400; transition: stroke-dashoffset 2.6s var(--el) .4s; }
.wk.is-in .wk-draw path, .wk.is-in .wk-draw circle { stroke-dashoffset: 0; }
.wk-flow path { animation: wkFlow 2.4s linear infinite paused; }
.wk-vortex { animation: wkSpin 24s linear infinite paused; }
.wk-plies { transform-origin: 560px 325px; animation: wkSpin 60s linear infinite paused; }
.wk-cone { animation: wkCone 3.2s ease-in-out infinite paused; }
.wk-plane { animation: wkFloat 5s ease-in-out infinite paused; }
.wk-arrow { animation: wkLift 2.4s ease-in-out infinite paused; }
.wk.is-live :is(.wk-flow path, .wk-vortex, .wk-plies, .wk-cone, .wk-plane, .wk-arrow) { animation-play-state: running; }
@keyframes wkFlow { to { stroke-dashoffset: -88; } }
@keyframes wkSpin { to { transform: rotate(-360deg); } }
@keyframes wkCone { 50% { transform: translateX(-24px); opacity: .6; } }
@keyframes wkFloat { 50% { transform: translate(-10px, -6px); } }
@keyframes wkLift { 50% { transform: translateY(-14px); } }

.wk-also { margin-top: clamp(80px, 9vw, 140px); }
.wk-also .h3 { font-family: var(--anemos-font-text); font-weight: 500; font-size: clamp(26px, 3vw, 40px); letter-spacing: -.03em; margin: 0; }

@media (max-width: 812px) {
  .wk-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .wk-title { font-size: 17vw; }
  .wk-lead { margin: 0; }
  .wk-grid { grid-template-columns: 1fr; row-gap: 48px; }
  .wk__name { font-size: 6.4vw; }
  .wk__tags { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .wk-title__in, .wk-title__num > span, .wk-title__arrow, .wk-lead, .wk__foot > *, .wk__pill { transform: none !important; opacity: 1 !important; transition: none !important; }
  .wk__img { clip-path: none !important; transition: none !important; }
  .wk__svg { scale: 1 !important; transition: none !important; }
  .wk-draw path, .wk-draw circle { stroke-dashoffset: 0 !important; transition: none; }
  .wk.is-live :is(.wk-flow path, .wk-vortex, .wk-plies, .wk-cone, .wk-plane, .wk-arrow) { animation-play-state: paused; }
}

/* Фон секции с глобусом: контуры названий городов (city-bg.js) */
.city-bg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; display: block; }

/* Шапка без подложки и размытия, как у lusion.co: кнопки висят прямо над страницей */
.lusion-header, .lusion-header.top--light { background: none !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; border-bottom: 0 !important; box-shadow: none !important; }

/* Полоса прокрутки как у lusion.co: своя короткая дорожка справа по центру,
   видна во время прокрутки и при наведении, на тёмных секциях светлая */
html { scrollbar-width: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; }
.sbar {
  position: fixed; z-index: 80; right: 16px; top: 40vh; width: 6px; height: 20vh;
  border-radius: 3px; background: rgba(12, 21, 23, .1);
  opacity: 0; transition: opacity .5s, background-color .3s; touch-action: none; cursor: grab;
}
.sbar::before { content: ""; position: absolute; inset: -8px -10px; }
.sbar.is-on, .sbar:hover, .sbar.is-drag { opacity: 1; transition-duration: .2s; }
.sbar.is-drag { cursor: grabbing; }
.sbar__bar { position: absolute; left: 0; top: 0; width: 100%; border-radius: 3px; background: var(--anemos-night); transition: background-color .3s; will-change: transform; }
.sbar.is-dark { background: rgba(255, 248, 240, .14); }
.sbar.is-dark .sbar__bar { background: var(--anemos-ground); }
@media (max-width: 812px) { .sbar { width: 2px; right: 6px; border-radius: 1px; } .sbar__bar { border-radius: 1px; } }
