/* AnimeVPN — minimal landing & error pages */

:root {
  --font-display: "Outfit", system-ui, sans-serif;
  --font-body: "Noto Sans", system-ui, sans-serif;
  --color-text: #f4f8ff;
  --color-muted: rgba(244, 248, 255, 0.72);
  --accent-cyan: #5ee7ff;
  --accent-pink: #ff8ec8;
  --glass-bg: rgba(12, 18, 32, 0.45);
  --glass-border: rgba(255, 255, 255, 0.12);
  --overlay: linear-gradient(
    160deg,
    rgba(8, 12, 28, 0.72) 0%,
    rgba(20, 40, 80, 0.55) 45%,
    rgba(40, 20, 50, 0.6) 100%
  );
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --footer-h: 5rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--color-text);
  background: #0a0e1a;
  overflow-x: hidden;
}

/* Preloader (main page) */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0e1a;
  transition:
    opacity 0.65s var(--ease-out),
    visibility 0.65s var(--ease-out);
}

.preloader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 6.5rem;
  height: 6.5rem;
}

.preloader__logo {
  width: 4.5rem;
  height: auto;
  animation: preloaderPulse 1.6s var(--ease-out) infinite;
}

.preloader__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--accent-cyan);
  border-right-color: var(--accent-pink);
  animation: preloaderSpin 1s linear infinite;
}

@keyframes preloaderSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes preloaderPulse {
  0%,
  100% {
    opacity: 0.85;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.04);
  }
}

.page-home.is-ready .bg {
  animation: bgReveal 0.9s var(--ease-out) both;
}

.page-home.is-ready .hero,
.page-home.is-ready .footer {
  animation: fadeIn 0.8s var(--ease-out) 0.15s both;
}

.page-home.is-loading .hero__card,
.page-home.is-loading .hero__logo,
.page-home.is-loading .hero__title {
  animation: none;
}

.page-home.is-ready .hero__card {
  animation: fadeInUp 1s var(--ease-out) 0.2s both;
}

.page-home.is-ready .hero__logo {
  animation: fadeIn 0.9s var(--ease-out) 0.35s both;
}

.page-home.is-ready .hero__title {
  animation: fadeIn 0.9s var(--ease-out) 0.5s both;
}

@keyframes bgReveal {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Background layers */
.bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
}

.bg__video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: center center;
}

.bg--image {
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  filter: brightness(0.78);
  animation: kenBurns 22s var(--ease-out) infinite alternate;
  will-change: transform;
}

.bg__overlay {
  position: absolute;
  inset: 0;
  background: var(--overlay);
  z-index: 1;
}

.page-error--404 .bg--image,
.page-error--50x .bg--image {
  background-image: url("/img/fon1.jpg");
}

.page-error--403 .bg--image {
  background-image: url("/img/fon403.jpg");
}

@keyframes kenBurns {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.06);
  }
}

/* Hero (main page) */
.page-home {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem calc(var(--footer-h) + 1rem);
  text-align: center;
}

.hero__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  max-width: 28rem;
  width: 100%;
  padding: 2.5rem 2rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 1.25rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(94, 231, 255, 0.06) inset;
}

.hero__logo {
  width: 7rem;
  height: auto;
  filter: drop-shadow(0 4px 20px rgba(94, 231, 255, 0.25));
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 2.75rem);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-shadow: 0 0 40px rgba(94, 231, 255, 0.35);
  background: linear-gradient(135deg, var(--color-text) 0%, var(--accent-cyan) 50%, var(--accent-pink) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Error pages */
.page-error {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.error {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  max-width: 28rem;
  margin: 0;
  margin-left: max(1.25rem, 5%);
  padding: 2rem 1.25rem calc(var(--footer-h) + 1.5rem) 0;
}

.error__card {
  width: 100%;
  max-width: 28rem;
  padding: 2.25rem 2rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 1.25rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  animation: fadeInUp 1s var(--ease-out) both;
}

.error__logo {
  width: 4.5rem;
  height: auto;
  margin-bottom: 1.5rem;
  opacity: 0.9;
  filter: drop-shadow(0 2px 12px rgba(94, 231, 255, 0.2));
}

.error__code {
  font-family: var(--font-display);
  font-size: clamp(3.25rem, 12vmin, 5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
  color: var(--color-text);
  text-shadow:
    0 0 60px rgba(94, 231, 255, 0.4),
    0 0 20px rgba(255, 142, 200, 0.2);
}

.error__title {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3.5vmin, 1.5rem);
  font-weight: 600;
  margin-bottom: 0.75rem;
  letter-spacing: 0.04em;
}

.error__text {
  color: var(--color-muted);
  font-size: 0.9375rem;
  line-height: 1.55;
  margin-bottom: 1.75rem;
}

/* Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.75rem 2rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #fff;
  text-decoration: none;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #2a9fd6 0%, var(--accent-cyan) 40%, var(--accent-pink) 100%);
  box-shadow: 0 4px 24px rgba(94, 231, 255, 0.25);
  cursor: pointer;
  transition:
    transform 0.35s var(--ease-out),
    box-shadow 0.35s var(--ease-out);
}

.btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    0 8px 32px rgba(94, 231, 255, 0.4),
    0 0 20px rgba(255, 142, 200, 0.25);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 3px;
}

/* Footer */
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 1.25rem 1.5rem;
  padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
  text-align: center;
  font-size: 0.8125rem;
  color: var(--color-muted);
  background: linear-gradient(to top, rgba(8, 12, 28, 0.85), transparent);
}

.footer__credit {
  margin-bottom: 0.25rem;
}

.footer__copy {
  opacity: 0.85;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .error {
    max-width: none;
    margin-left: 0;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .error__card {
    padding: 1.75rem 1.5rem;
  }

  .hero__card {
    padding: 2rem 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .bg--image {
    animation: none;
  }

  .preloader__ring,
  .preloader__logo {
    animation: none;
  }
}
