/* === GLOBAL STYLES === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: sans-serif, Arial;
  user-select: none;             /* запрет выделения текста */
  -webkit-user-select: none;     /* для Safari / iOS */
  -moz-user-select: none;        /* для Firefox */
  -ms-user-select: none;         /* для старых IE/Edge */
}

html {
  scroll-behavior: smooth;
}

:root {
  --index: calc(1vw + 1vh);
  --gutter: 30px;
  --side-small: 26;
  --side-big: 36;
  --side-small_video: 22;
  --side-big_video: 36;
  --depth: 5400px;
  --transition: 0.75s cubic-bezier(0.075, 0.5, 0, 1);
  --move-x: 0deg;
  --move-y: 0deg;
  --color-form: #F4B400;
  --color-email: #F4B400;
  --color-twitter: #1DA1F2;
  --color-artstation: #13AFF0;
  --color-youtube: #FF0000;
  --color-discord: #5865F2;
  --color-telegram: #0088CC;
  --color-whatsapp: #25D366;
  --glitch-bg-color: #000;
}

body {
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  background-color: #000;
  color: #fff;
  font-size: calc(var(--index) * 0.8);
  font-family: sans-serif, Arial;
  height: var(--depth);
  font-weight: 300;
}

body::-webkit-scrollbar {
  display: none;
}

body.no-scroll {
  overflow: hidden;
}

/* === CONTAINER === */
.container {
  width: 100%;
  height: 100%;
  position: fixed;
  perspective: 1500px;
}

.gallery {
  transform-style: preserve-3d;
  height: 100%;
  transform: rotateX(var(--move-y)) rotateY(var(--move-x));
  will-change: transform;
  transition: transform var(--transition);
}

/* === FRAME === */
.frame {
  width: 100%;
  height: 100%;
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition), opacity 0.75s ease;
  will-change: transform;
  transform-style: preserve-3d;
  pointer-events: none;
}

h1, h2, h3, h4 {
  font-weight: 100;
  text-transform: uppercase;
  width: min-content;
  line-height: 1;
  user-select: none;
  pointer-events: none;
}

.frame h1 {
  text-align: center;
  font-size: calc(var(--index) * 3.3);
}

.frame-media {
  position: relative;
  width: calc(var(--index) * var(--side-small));
  height: calc(var(--index) * var(--side-big));
  background-position: center;
  background-size: cover;
  pointer-events: auto;
  z-index: 100;
  cursor: pointer;
  transition: transform 0.3s ease, opacity 0.5s ease;
  image-rendering: optimizeQuality;
  filter: blur(0.5px);
  transform: scale(1.01) translateZ(0.1px);
  backface-visibility: hidden;
}

.media-link {
  display: block;
  text-decoration: none;
}
/* УВЕЛИЧЕНИЕ ОБЛОЖЕК ПРИ НАВЕДЕНИИ */
.frame-media:hover {
  transform: scale(1.25) translateZ(1px);
}

.frame-media.transition {
  transform: scale(2) translateZ(200px);
  opacity: 0;
}

.frame-media_left {
  right: calc(var(--side-small) / 2 * var(--index) + var(--gutter));
}

.frame-media_right {
  left: calc(var(--side-small) / 2 * var(--index) + var(--gutter));
}

.frame_bg {
  background-color: rgb(0 0 0 / 0.87);
}

video.frame-media {
  width: calc(var(--index) * var(--side-big_video));
  height: calc(var(--index) * var(--side-small_video));
  object-fit: cover;
  position: relative;
  image-rendering: optimizeQuality;
  filter: blur(0.5px);
  transform: scale(1.01) translateZ(0.1px);
  backface-visibility: hidden;
}

video.frame-media_right {
  left: calc(var(--side-big) / 2 * var(--index) + var(--gutter));
}

video.frame-media_left {
  right: calc(var(--side-big) / 2 * var(--index) + var(--gutter));
}

/* === TEXT === */
.text-center {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    max-width: 20vw;
    margin: 0 auto;
}

.text-left {
  position: relative;
  right: 20vw;
  user-select: none;
  pointer-events: none;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.text-right {
  position: relative;
  left: 20vw;
  user-select: none;
  pointer-events: none;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.text-right h3,
.text-left h3 {
  font-size: calc(var(--index) * 3);
}

.text-right p,
.text-left p {
  max-width: 30vw;
  margin-top: 3vh;
  user-select: none;
  pointer-events: none;
  text-align: inherit;
}

/* === SOCIAL ICONS === */
.social-icons {
  position: fixed;
  top: 2vh;
  right: 2vw;
  display: flex;
  gap: 1vw;
  z-index: 200;
  pointer-events: auto;
  transition: opacity 0.3s ease;
}

.social-icons.hidden {
  opacity: 0;
  pointer-events: none;
}

.social-icons a {
  font-size: calc(var(--index) * 1);
  color: #fff;
  text-decoration: none;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.4s ease;
  will-change: transform, color;
  position: relative;
}

.social-icons a:hover {
  transform: scale(1.15) translateY(-2px);
}

.social-icons a:nth-child(1):hover { color: var(--color-twitter); }
.social-icons a:nth-child(2):hover { color: var(--color-artstation); }
.social-icons a:nth-child(3):hover { color: var(--color-youtube); }
.social-icons a:nth-child(4):hover { color: var(--color-discord); }
.social-icons a:nth-child(5):hover { color: var(--color-telegram); }
.social-icons a:nth-child(6):hover { color: var(--color-whatsapp); }
.social-icons a:nth-child(7):hover { color: var(--color-email); }
.social-icons a:nth-child(8):hover { color: var(--color-form); }

/* === NAVIGATION LINKS === */
.nav-links {
  position: fixed;
  top: 2vh;
  left: 2vw;
  display: flex;
  gap: 1vw;
  z-index: 200;
  font-weight: 100;
  text-transform: uppercase;
  font-family: sans-serif, Arial;
  cursor: pointer;
  font-size: calc((1vw + 1vh) * 0.7);
}

.nav-links a {
  color: rgba(99, 99, 99, 0.95);
  text-decoration: none;
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: white;
}

/* === PRELOADER === */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: black;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.5s ease;
  overflow: hidden;
}

.preloader.hidden {
  opacity: 0;
  pointer-events: none;
}

.preloader video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* === FOOTER === */
.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1vh;
  text-align: center;
  font-size: calc(var(--index) * 0.8);
  user-select: none;
  pointer-events: none;
}

.logo-video {
  cursor: default;
}

.logo-video:hover {
  transform: none;
}

/* === WORK TOGETHER === */
.work-together {
  position: fixed;
  top: 45%;
  left: 50%;
  transform: translateX(-50%);
  font-size: calc(var(--index));
  color: #ffffff;
  z-index: 300;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
  user-select: none;
  text-align: center;
  width: 100%;
  text-transform: uppercase;
  font-weight: 100;
  font-family: sans-serif, Arial;
  white-space: nowrap;
}

.work-together a {
  color: rgba(255, 255, 255, 0.95);
  text-decoration: none;
  display: inline-block;
  transition: color 0.3s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), text-shadow 0.3s ease;
  will-change: transform, text-shadow;
  position: relative;
  pointer-events: none;
  cursor: pointer;
}

.work-together.visible {
  opacity: 1;
}

.work-together.enabled a {
  pointer-events: auto;
}

.work-together .glitch {
  position: relative;
  margin: 0 auto;
  background: var(--glitch-bg-color);
  display: inline-block;
  white-space: nowrap;
}

.work-together .glitch::before,
.work-together .glitch::after {
  animation-timing-function: linear;
  animation-direction: alternate-reverse;
  overflow: hidden;
  position: absolute;
  top: 0;
  clip: rect(0, 900px, 0, 0);
  content: attr(data-text);
}

.work-together .glitch::after {
  animation: none;
  left: 4px;
  text-shadow: -1px 0 #ffa800;
  background: var(--glitch-bg-color);
}

.work-together .glitch::before {
  animation: none;
  left: -4px;
  text-shadow: 1px 0 #00d8ff;
  background: var(--glitch-bg-color);
}

.work-together .glitch.active::after {
  animation: glitch-animation 1s linear forwards;
}

.work-together .glitch.active::before {
  animation: glitch-animation-2 1s linear forwards;
}

/* === COPYRIGHT === */
.copyright {
  position: fixed;
  top: 45%;
  left: 50%;
  transform: translateX(-50%);
  font-size: calc(var(--index));
  color: #fff;
  z-index: 300;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
  user-select: none;
  text-align: center;
  width: 100%;
  text-transform: uppercase;
  font-weight: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5vh;
}

.copyright.visible {
  opacity: 1;
}

/* === FORM OVERLAY === */
.form-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgb(0, 0, 0);
  cursor: default;
  align-items: center;
  justify-content: center;
  z-index: 400;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.form-overlay.open {
  display: flex;
  opacity: 1;
}

.form-container {
  width: min(80vw, 800px);
  height: min(80vh, 600px);
  background-color: white;
  overflow: hidden;
  transform: scale(0.7);
  transition: transform 0.5s ease;
}

.form-overlay.open .form-container {
  transform: scale(1);
}

.form-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  background-color: white;
}

.close-button {
  position: absolute;
  top: 0px;
  right: 30px;
  font-size: 40px;
  color: white;
  cursor: pointer;
  z-index: 410;
  transition: color 0.3s ease;
  pointer-events: auto;
}

/* === MAIL TEXT === */
.mail-text {
  text-decoration: none; /* убираем подчеркивание */
  position: fixed;
  bottom: 4vh;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(99, 99, 99, 0.95);
  text-transform: lowercase;
  font-weight: 100;
  font-family: sans-serif, Arial;
  cursor: pointer;
  z-index: 20;
  font-size: calc((1vw + 1vh) * 0.8);
  transition: color 0.3s ease, opacity 0.8s ease, text-transform 0.3s ease;
  opacity: 1;
  user-select: none;
}

.mail-text.copied {
  text-transform: uppercase;
}

/* === SCROLL REMINDER === */
.scroll-reminder {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.96);
  z-index: 9999;
  font-size: 8vh;
  text-transform: uppercase;
  color: #fff;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  transition: opacity 1s ease, visibility 1s ease;
}

.scroll-reminder.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.scroll-reminder__text {
  line-height: 1;
  display: inline-block;
  color: #fff;
  z-index: 2;
  letter-spacing: 5px;
}

.scroll-reminder__layer {
  position: relative;
}

.scroll-reminder__layer::before,
.scroll-reminder__layer::after {
  content: attr(data-text);
  position: absolute;
  width: 110%;
  z-index: -1;
}

.scroll-reminder__layer::before {
  top: 10px;
  left: 15px;
  color: #e80c73;
}

.scroll-reminder__glitch span {
  animation: scroll-glitch-paths 5s step-end infinite;
}

.scroll-reminder__glitch::before {
  animation: scroll-glitch-paths 5s step-end infinite, scroll-glitch-opacity 5s step-end infinite, scroll-glitch-font 8s step-end infinite, scroll-glitch-movement 10s step-end infinite;
}

.scroll-reminder__glitch::after {
  animation: scroll-glitch-paths 5s step-end infinite, scroll-glitch-opacity 5s step-end infinite, scroll-glitch-font 7s step-end infinite, scroll-glitch-movement 8s step-end infinite;
}

/* === ANIMATIONS === */
@keyframes wiggle {
  0% { transform: skewX(24deg); }
  10% { transform: skewX(-8deg); }
  20% { transform: skewX(55deg); }
  30% { transform: skewX(-90deg); }
  40% { transform: skewX(29deg); }
  50% { transform: skewX(-90deg); }
  60% { transform: skewX(3deg); }
  70% { transform: skewX(-2deg); }
  80% { transform: skewX(1deg); }
  90% { transform: skewX(10deg); }
  100% { transform: skewX(0deg); }
}

@keyframes glitch-animation {
  0% { clip: rect(42px, 9999px, 44px, 0); }
  10% { clip: rect(12px, 9999px, 59px, 0); }
  20% { clip: rect(48px, 9999px, 29px, 0); }
  30% { clip: rect(42px, 9999px, 73px, 0); }
  40% { clip: rect(63px, 9999px, 27px, 0); }
  50% { clip: rect(34px, 9999px, 55px, 0); }
  60% { clip: rect(86px, 9999px, 73px, 0); }
  70% { clip: rect(20px, 9999px, 20px, 0); }
  80% { clip: rect(26px, 9999px, 60px, 0); }
  90% { clip: rect(25px, 9999px, 66px, 0); }
  100% { clip: rect(57px, 9999px, 98px, 0); }
}

@keyframes glitch-animation-2 {
  0% { clip: rect(65px, 9999px, 100px, 0); }
  10% { clip: rect(52px, 9999px, 74px, 0); }
  20% { clip: rect(79px, 9999px, 85px, 0); }
  30% { clip: rect(75px, 9999px, 5px, 0); }
  40% { clip: rect(67px, 9999px, 61px, 0); }
  50% { clip: rect(14px, 9999px, 79px, 0); }
  60% { clip: rect(1px, 9999px, 66px, 0); }
  70% { clip: rect(86px, 9999px, 30px, 0); }
  80% { clip: rect(23px, 9999px, 98px, 0); }
  90% { clip: rect(85px, 9999px, 72px, 0); }
  100% { clip: rect(71px, 9999px, 75px, 0); }
}

@keyframes scroll-glitch-movement {
  0% { top: 0; left: -20px; }
  15% { top: 10px; left: 10px; }
  60% { top: 5px; left: -10px; }
  75% { top: -5px; left: 20px; }
  100% { top: 10px; left: 5px; }
}

@keyframes scroll-glitch-opacity {
  0% { opacity: 0.1; }
  5% { opacity: 0.7; }
  30% { opacity: 0.4; }
  45% { opacity: 0.6; }
  76% { opacity: 0.4; }
  90% { opacity: 0.8; }
  1%, 7%, 33%, 47%, 78%, 93% { opacity: 0; }
}

@keyframes scroll-glitch-paths {
  0%, 7%, 33%, 47%, 78%, 93% { clip-path: none; }
  5% { clip-path: inset(10% 0 20% 0); }
  30% { clip-path: inset(40% 0 20% 0); }
  45% { clip-path: inset(60% 0 15% 0); }
  76% { clip-path: inset(20% 0 40% 0); }
  90% { clip-path: inset(5% 0 60% 0); }
}

.not_a_link {
  cursor: default !important;
  pointer-events: none !important;
}
/* === COPYRIGHT === */

.bottom-info {
  position: fixed;
  bottom: 4vh;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  font-size: calc((1vw + 1vh) * 0.6);
  color: rgba(99, 99, 99, 0.95);
  opacity: 0;
  transition: opacity 1s ease;
  z-index: 50;
  pointer-events: none;
}

.bottom-info.visible {
  opacity: 1;
  pointer-events: auto;
}

.bottom-info a {
  color: #F4B400;
  text-decoration: none;
}

.bottom-info a:hover {
  text-decoration: underline;
}

/* === RESPONSIVE === */
@media (min-aspect-ratio: 21/9) {
  .container {
    perspective: 900px;
  }

  h3 {
    font-size: calc((var(--index) * 3) * 1.5) !important;
  }

  .text-left {
    right: 20vw;
  }

  .text-right {
    left: 20vw;
  }

  .frame_bg {
    height: 150%;
    top: -20vh;
  }
}

@media (min-width: 1025px) {
  .form-link_envelope {
    display: none;
  }
}

@media (max-width: 1024px) {
  .scroll-reminder__text {
    font-size: 4vh;
  }

  h3 {
    font-size: calc((var(--index) * 3) * 0.75) !important;
  }

  .mail-text {
    font-size: 2vh;
  }

  .text-left {
    right: 30vw;
    width: 55vw;
  }

  .text-right {
    left: 30vw;
    width: 55vw;
  }

  .text-left h3,
  .text-right h3 {
    font-size: calc(var(--index) * 2.5 * 1.3);
  }

  .text-left p,
  .text-right p {
    font-size: calc(var(--index) * 0.8 * 1.3);
    max-width: 40vw;
  }

  .work-together {
    font-size: calc(var(--index) * 1.5) !important;
  }

  .form-container {
    width: 90vw;
    height: 70vh;
  }

  .close-button {
    top: 20px;
    right: 30px;
  }

  .copyright {
    font-size: calc(var(--index) * 1.5) !important;
  }

  .social-icons {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    justify-content: center;
    padding: 1vh 0;
    background-color: rgba(0, 0, 0, 0.8);
  }

  .social-icons a {
    flex: 1;
    text-align: center;
    font-size: calc(var(--index) * 2);
  }

  .nav-links {
    display: none;
  }
  .bottom-info {
    font-size: calc((1vw + 1vh) * 1);
    width: 70vw;
  }
}

@media (max-width: 600px) {
  .container {
    perspective: 1000px;
  }
}

@media (max-width: 390px) {
  .text-left {
    right: 32vw;
    width: 55vw;
  }

  .text-right {
    left: 28vw;
    width: 55vw;
  }
}