.from-internal .body,
.from-internal .preloader {
  background-color: #000000;
}

.from-internal .loader-wrap-load {
  opacity: 0;
  display: none;
}

:root {
  --size-unit: 16;
  --size-container-ideal: 1440;
  --size-container-min: 991px;
  --size-container-max: 1920px;
  --size-container: clamp(var(--size-container-min), 100vw, var(--size-container-max));
  --size-font: calc(var(--size-container) / (var(--size-container-ideal) / var(--size-unit)));
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: var(--size-font);
}

body {
  overflow-x: hidden;
}

/* Tablet (Portrait & Landscape) */
@media screen and (max-width: 991px) and (orientation: portrait) {
  :root {
    --size-container-ideal: 834;
    --size-container-min: 768px;
    --size-container-max: 991px;
  }
}

/* Mobile Landscape */
@media screen and (max-width: 991px) and (orientation: landscape) {
  :root {
    --size-container-ideal: 667;
    --size-container-min: 480px;
    --size-container-max: 991px;
  }
}

/* Mobile Portrait */
@media screen and (max-width: 479px) and (orientation: portrait) {
  :root {
    --size-container-ideal: 390;
    --size-container-min: 320px;
    --size-container-max: 479px;
  }
}

[text-split] {
  opacity: 0;
}

html.w-editor [text-split] {
  opacity: 1;
}

.word {
  overflow: hidden;
  padding-bottom: 0.1em;
  margin-bottom: -0.1em;
  transform-origin: bottom;
}

/* Стили для slide-in-bottom.f работают на ВСЕХ устройствах */
.slide-in-bottom.f {
  overflow: hidden;
  display: inline-block;
}

.slide-in-bottom.f div {
  position: relative;
  display: inline-block;
  transition: transform 0.3s;
}

.slide-in-bottom.f div::before {
  position: absolute;
  top: 100%;
  content: attr(data-hover);
  font-weight: 900;
  transform: translate3d(0, 0, 0);
  display: block;
}

.slide-in-bottom.f:hover div,
.slide-in-bottom.f:focus div {
  transform: translateY(-100%);
}


.outline {
  color: transparent;
}

/* Стили только для десктопа (1024px+) */
@media (min-width: 1024px) {

  /* Обычный slide-in-bottom только на ПК */
  .slide-in-bottom {
    overflow: hidden;
    display: inline-block;
  }

  .slide-in-bottom div {
    position: relative;
    display: inline-block;
    transition: transform 0.3s;
  }

  .slide-in-bottom div::before {
    position: absolute;
    top: 100%;
    content: attr(data-hover);
    font-weight: 900;
    transform: translate3d(0, 0, 0);
    display: block;
  }

  .slide-in-bottom:hover div,
  .slide-in-bottom:focus div {
    transform: translateY(-100%);
  }

  .nav-link {
    position: relative;
    text-decoration: none;
  }

  .nav-link::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 0.5px;
    background: white;
    transform: scaleX(0);
    transition: transform 0.3s;
    transform-origin: right;
  }

  .nav-link:hover::after {
    transform: scaleX(1);
    transform-origin: left;
  }
}

.mouse-cursor-container,
.sticky-camera {
  pointer-events: none;
}

.image-container {
  pointer-events: auto;
}

/* Устанавливаем ширину скроллбара */
::-webkit-scrollbar {
  width: 2px;
}

/* Трек - фон скроллбара */
::-webkit-scrollbar-track {
  background: #191a21;
}

/* Ползунок - сам скроллбар */
::-webkit-scrollbar-thumb {
  background: white;
  border-radius: 6px;
}

[js-line-animation] {
  visibility: hidden;
}

.w--editor [js-line-animation] {
  visibility: visible;
}

[js-line-animation] .line {
  overflow: hidden;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: clip;
}

.lenis.lenis-smooth iframe {
  pointer-events: none;
}



/* FIX для letters-slide-up */
[letters-slide-up],
[letters-slide-up-t] {
  overflow: hidden;
  line-height: 1;
}

[letters-slide-up] .char,
[letters-slide-up-t] .char {
  vertical-align: bottom;
  line-height: inherit;
}

.grid-spacer {
  height: calc(100vh + 3800px);
}

.grid_myworks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 100%;
}

/* ========== WebGL Canvas - FIXED (фон ПОД sticky) ==========*/
#webgl-canvas {
  position: fixed !important;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2;
  pointer-events: none;
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-perspective: 1000px;
  perspective: 1000px;
  -webkit-font-smoothing: subpixel-antialiased;
  -moz-osx-font-smoothing: auto;
  isolation: isolate;
  margin: 0;
  padding: 0;
  border: 0;
}

/* iOS Safari специфичные правила */
@supports (-webkit-touch-callout: none) {
  #webgl-canvas {
    -webkit-transform: translate3d(0, 0, 0) scale(1);
    transform: translate3d(0, 0, 0) scale(1);
    contain: layout style paint;
    content-visibility: auto;
  }
}

#webgl-canvas canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  position: absolute;
  top: 0;
  left: 0;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

/* ========== Plane wrapper ==========*/
.plane-wrapper-webgl {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}

.plane-wrapper-webgl img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  visibility: hidden;
  opacity: 0;
}

.rotate-overlay.show {
  display: flex;
  opacity: 1;
}

.menu-button {
  display: none;
}


@media screen and (max-width: 991px) {
  .menu-button {
    position: relative;
    z-index: 100;
    display: flex;
    width: 75px;
    height: 30px;
    padding: 8px 24px;
    flex-flow: column;
    justify-content: center;
    align-items: flex-start;
    gap: 0.35rem;
    border-radius: 20rem;
    background-color: var(--white);
    transition-property: all;
    transition-duration: 777ms;
    transition-timing-function: ease;
    cursor: pointer;
  }
}

@media screen and (max-width: 991px) {
  .menu-button.open {

    width: 60px;
    height: 60px;
    padding: 0px;
    justify-content: center;
    align-items: center;
    gap: 0rem;
    border-style: solid;
    border-width: 1px;
    border-color: rgba(0, 0, 0, 0.6);
    border-radius: 100%;
  }
}

.phone-icon {
  animation: rotatePhoneFull 2s ease-in-out infinite;
}



/* Альтернативная анимация - полный поворот на 90 градусов */
@keyframes rotatePhoneFull {
  0% {
    transform: rotate(90deg);
  }

  50% {
    transform: rotate(45deg);
  }

  100% {
    transform: rotate(0deg);
  }
}


@media (min-width: 1141px) {
  .section-404 {
    cursor: none !important;
  }

  .section-404 * {
    cursor: none !important;
  }

  /* Hide cursor on scrollbar when over section-404 */
  .section-404::-webkit-scrollbar {
    cursor: none !important;
  }

  .section-404::-webkit-scrollbar-thumb {
    cursor: none !important;
  }

  .section-404::-webkit-scrollbar-track {
    cursor: none !important;
  }
}

#fluid-canvas {
  display: block;
  position: absolute;
  top: -100px;
  left: -100px;
  width: calc(100% + 200px);
  height: calc(100% + 200px);
  pointer-events: none;
  z-index: 10;
  filter: url('#goo');
  mix-blend-mode: difference;
}

/* fluid-canvas visible on all screen sizes for touch cursor effect */

.svg-filters {
  position: absolute;
  visibility: hidden;
  width: 0;
  height: 0;
}

.section-404 {
  position: relative;
  overflow: hidden;
}