* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  font-family: Arial, Helvetica, sans-serif;
  color: #07070b;
  background: #f8fbff;
}

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

img {
  display: block;
  max-width: 100%;
  user-select: none;
  pointer-events: none;
}

.mode-page {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: #f8fbff;
}

.mode-page::before,
.mode-page::after {
  content: "";
  position: fixed;
  inset: -34vmax;
  z-index: 0;
  pointer-events: none;
  will-change: transform, opacity;
}

.mode-page::before {
  background:
    radial-gradient(circle at 18% 18%, rgba(105, 224, 246, 0.88) 0, rgba(105, 224, 246, 0.42) 20%, rgba(255, 255, 255, 0) 46%),
    radial-gradient(circle at 78% 18%, rgba(184, 83, 239, 0.72) 0, rgba(184, 83, 239, 0.36) 22%, rgba(255, 255, 255, 0) 49%),
    radial-gradient(circle at 52% 73%, rgba(255, 255, 255, 0.92) 0, rgba(255, 255, 255, 0.56) 22%, rgba(255, 255, 255, 0) 55%);
  filter: blur(28px);
  opacity: 0.95;
  transform: translate3d(0, 0, 0) scale(1.06);
  animation: background-drift 12s ease-in-out infinite alternate;
}

.mode-page::after {
  background:
    radial-gradient(ellipse at 22% 68%, rgba(140, 236, 255, 0.46) 0, rgba(140, 236, 255, 0.20) 28%, rgba(255, 255, 255, 0) 60%),
    radial-gradient(ellipse at 82% 52%, rgba(222, 168, 255, 0.54) 0, rgba(222, 168, 255, 0.24) 27%, rgba(255, 255, 255, 0) 58%);
  filter: blur(36px);
  opacity: 0.78;
  mix-blend-mode: multiply;
  transform: translate3d(0, 0, 0) scale(1.12);
  animation: background-drift-secondary 16s ease-in-out infinite alternate;
}

.mode-select {
  position: relative;
  z-index: 1;
}

.mode-select {
  width: min(100%, 1510px);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(62px, 9.15vh, 98px) 48px 72px;
}

.mode-select__title {
  margin: 0;
  text-align: center;
  font-size: clamp(40px, 3.6vw, 62px);
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.015em;
  text-transform: uppercase;
}

.mode-select__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(66px, 8vw, 142px);
  margin-top: clamp(74px, 8.7vh, 94px);
}

.mode-card {
  position: relative;
  display: block;
  isolation: isolate;
  transform: translateY(22px) scale(0.985);
  opacity: 0;
  outline: none;
  animation: card-in 720ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.mode-card--dark {
  animation-delay: 110ms;
}

.mode-card__image-wrap,
.mode-card__label {
  display: block;
  transition:
    top 620ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 620ms cubic-bezier(0.22, 1, 0.36, 1),
    filter 620ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 620ms cubic-bezier(0.22, 1, 0.36, 1);
}

.mode-card__image-wrap {
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.mode-card__image--base,
.mode-card__image--hover {
  width: 100%;
  transition: opacity 620ms cubic-bezier(0.22, 1, 0.36, 1);
}

.mode-card__image--hover {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
}

.mode-card:hover .mode-card__image--hover,
.mode-card:focus-visible .mode-card__image--hover {
  opacity: 1;
}

.mode-card__label {
  position: absolute;
  z-index: 3;
  left: 50%;
  width: min(108%, 736px);
  filter: drop-shadow(0 10px 0 rgba(110, 213, 239, 0.22));
}

.mode-card__label img {
  width: 100%;
}

.mode-card--wifi {
  justify-self: end;
  width: min(100%, 581px);
  --hover-shift-x: 32px;
}

.mode-card--dark {
  justify-self: start;
  width: min(100%, 603px);
  margin-left: clamp(24px, 2.1vw, 34px);
  --hover-shift-x: 0px;
}

.mode-card__label--wifi {
  top: 58%;
  width: 109%;
  transform: translateX(-50%) rotate(-1.5deg);
}

.mode-card__label--dark {
  top: 20%;
  width: 122%;
  transform: translateX(-50%) rotate(-1.4deg);
  filter: drop-shadow(0 9px 0 rgba(185, 83, 245, 0.24));
}

.mode-card__image--mobile {
  display: none;
}

.mode-card:hover,
.mode-card:focus-visible {
  z-index: 4;
}

.mode-card:hover .mode-card__image-wrap,
.mode-card:focus-visible .mode-card__image-wrap {
  transform: translateX(var(--hover-shift-x, 0)) translateY(-12px) scale(1.035);
  filter: drop-shadow(0 22px 14px rgba(91, 55, 160, 0.18));
}

.mode-card:hover .mode-card__label--wifi,
.mode-card:focus-visible .mode-card__label--wifi {
  top: 50%;
  transform: translateX(calc(-50% + var(--hover-shift-x, 0))) translateY(-50%) rotate(-1.5deg) scale(1.055);
  filter: drop-shadow(0 12px 0 rgba(110, 213, 239, 0.30));
}

.mode-card:hover .mode-card__label--dark,
.mode-card:focus-visible .mode-card__label--dark {
  top: 50%;
  transform: translateX(-50%) translateY(-50%) rotate(-1.4deg) scale(1.045);
  filter: drop-shadow(0 11px 0 rgba(185, 83, 245, 0.38));
}

.mode-card:active .mode-card__image-wrap,
.mode-card:active .mode-card__label {
  transition-duration: 170ms;
}

.mode-card:active .mode-card__image-wrap {
  transform: translateX(calc(var(--hover-shift-x, 0) * 0.35)) translateY(-4px) scale(1.012);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@keyframes card-in {
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes background-drift {
  0% {
    transform: translate3d(-8vw, -5vh, 0) scale(1.05) rotate(-4deg);
  }

  32% {
    transform: translate3d(7vw, 4vh, 0) scale(1.16) rotate(3deg);
  }

  66% {
    transform: translate3d(-5vw, 8vh, 0) scale(1.12) rotate(-2deg);
  }

  100% {
    transform: translate3d(9vw, -6vh, 0) scale(1.19) rotate(4deg);
  }
}

@keyframes background-drift-secondary {
  0% {
    transform: translate3d(7vw, 7vh, 0) scale(1.16) rotate(5deg);
    opacity: 0.48;
  }

  45% {
    transform: translate3d(-8vw, -3vh, 0) scale(1.04) rotate(-4deg);
    opacity: 0.84;
  }

  100% {
    transform: translate3d(4vw, -8vh, 0) scale(1.22) rotate(3deg);
    opacity: 0.66;
  }
}

@media (max-width: 1100px) {
  .mode-select {
    padding-right: 28px;
    padding-left: 28px;
  }

  .mode-select__grid {
    gap: 44px;
  }
}

@media (max-width: 767px) {
  .mode-page::before,
  .mode-page::after {
    inset: -45vmax;
  }

  .mode-page::before {
    animation-duration: 13s;
  }

  .mode-page::after {
    animation-duration: 17s;
  }

  .mode-select {
    width: 100%;
    min-height: 100svh;
    padding: 37px 13px 42px;
  }

  .mode-select__title {
    font-size: clamp(32px, 9.6vw, 38px);
    line-height: 1.08;
    letter-spacing: 0;
  }

  .mode-select__grid {
    display: flex;
    flex-direction: column;
    gap: 59px;
    margin-top: 75px;
  }

  .mode-card--wifi,
  .mode-card--dark {
    justify-self: auto;
    width: 100%;
    margin-left: 0;
  }

  .mode-card--wifi {
    max-width: 350px;
    --hover-shift-x: 0px;
  }

  .mode-card--dark {
    max-width: 358px;
    --hover-shift-x: 0px;
  }

  .mode-card__image--desktop {
    display: none;
  }

  .mode-card__image--mobile {
    display: block;
    width: 100%;
  }

  .mode-card__label--wifi {
    top: 58%;
    width: 112%;
  }

  .mode-card__label--dark {
    top: 26%;
    width: 103%;
  }

  .mode-card:hover .mode-card__image-wrap,
  .mode-card:focus-visible .mode-card__image-wrap {
    transform: translateX(var(--hover-shift-x, 0)) translateY(-6px) scale(1.02);
  }

  .mode-card:hover .mode-card__label--wifi,
  .mode-card:focus-visible .mode-card__label--wifi {
    top: 50%;
    transform: translateX(calc(-50% + var(--hover-shift-x, 0))) translateY(-50%) rotate(-1.5deg) scale(1.025);
  }

  .mode-card:hover .mode-card__label--dark,
  .mode-card:focus-visible .mode-card__label--dark {
    top: 50%;
    transform: translateX(-50%) translateY(-50%) rotate(-1.4deg) scale(1.02);
  }
}

@media (max-width: 380px) {
  .mode-select__grid {
    margin-top: 74px;
    gap: 57px;
  }
}

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

  .mode-page::before,
  .mode-page::after {
    animation: none !important;
  }
}
