/*
Theme Name: RUPACS
Theme URI: https://rupacs.ru/
Author: Nazar
Description: Анимированная тема WordPress для RUPACS на основе фирменного логотипа и стартовой HTML-страницы.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.1
Text Domain: rupacs
*/

:root {
  --rupacs-bg-1: #020812;
  --rupacs-bg-2: #061528;
  --rupacs-bg-3: #0c3d5f;
  --rupacs-accent: #33cfff;
  --rupacs-text: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: #020812;
}

body.rupacs-landing-body,
body.rupacs-content-body {
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  margin: 0;
  font-family: Roboto, Arial, Helvetica, sans-serif;
  color: var(--rupacs-text);
  background:
    radial-gradient(circle at 50% 42%, rgba(67, 210, 255, 0.24), transparent 34%),
    radial-gradient(circle at 18% 20%, rgba(39, 99, 180, 0.42), transparent 32%),
    radial-gradient(circle at 82% 78%, rgba(0, 205, 255, 0.20), transparent 34%),
    linear-gradient(135deg, var(--rupacs-bg-1) 0%, var(--rupacs-bg-2) 48%, var(--rupacs-bg-3) 100%);
  background-size: 120% 120%, 130% 130%, 140% 140%, 100% 100%;
  background-repeat: no-repeat;
  animation: rupacs-bg-breath 14s ease-in-out infinite;
}

body.rupacs-landing-body {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

body.rupacs-content-body {
  overflow-x: hidden;
}

body.rupacs-landing-body::before,
body.rupacs-content-body::before {
  content: "";
  position: fixed;
  inset: -35%;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  transform: perspective(700px) rotateX(62deg) translateY(-8%);
  transform-origin: center;
  opacity: 0.45;
  mask-image: radial-gradient(circle at center, #000 0%, transparent 68%);
  -webkit-mask-image: radial-gradient(circle at center, #000 0%, transparent 68%);
  animation: rupacs-grid-drift 18s linear infinite;
}

body.rupacs-landing-body::after,
body.rupacs-content-body::after {
  content: "";
  position: fixed;
  inset: -2px;
  pointer-events: none;
  background:
    radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.30) 82%),
    linear-gradient(115deg, transparent 0%, rgba(51, 207, 255, 0.05) 45%, transparent 62%);
  animation: rupacs-vignette-shift 10s ease-in-out infinite;
}

.rupacs-page {
  --page-scale: 1;

  position: relative;
  z-index: 1;
  width: min(860px, calc(100vw - 40px));
  display: grid;
  place-items: center;
  text-align: center;
  opacity: 0;
  transform: translateY(14px) scale(var(--page-scale));
  transform-origin: center center;
  animation: rupacs-page-fade-in 900ms ease-out forwards;
  will-change: transform, opacity, filter;
}

.rupacs-logo-wrap {
  position: relative;
  width: min(680px, 92vw);
  padding: clamp(22px, 4vw, 42px);
  border: 1px solid rgba(120, 220, 255, 0.22);
  border-radius: 34px;
  background: rgba(2, 12, 25, 0.30);
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.42),
    0 0 80px rgba(51, 207, 255, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
  transition:
    transform 260ms ease,
    border-color 260ms ease,
    background 260ms ease,
    box-shadow 260ms ease;
  animation: rupacs-glow-pulse 4.5s ease-in-out infinite;
}

.rupacs-logo-wrap::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(120deg, transparent, rgba(51, 207, 255, 0.34), transparent);
  opacity: 0.65;
  filter: blur(18px);
  z-index: -1;
}

.rupacs-logo-wrap::after {
  content: "";
  position: absolute;
  top: -80%;
  left: -35%;
  width: 32%;
  height: 260%;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.08),
    rgba(98, 226, 255, 0.34),
    rgba(255, 255, 255, 0.08),
    transparent
  );
  transform: rotate(18deg);
  animation: rupacs-light-sweep 7s ease-in-out infinite;
}

.rupacs-logo {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 28px rgba(51, 207, 255, 0.28));
  user-select: none;
  transition: filter 260ms ease;
  animation: rupacs-logo-focus 5s ease-in-out infinite;
}

.rupacs-status {
  position: relative;
  margin: 28px 0 0;
  font-size: clamp(14px, 1.8vw, 17px);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(224, 247, 255, 0.78);
  text-shadow: 0 0 18px rgba(51, 207, 255, 0.18);
  opacity: 0;
  animation:
    rupacs-status-in 900ms ease-out 350ms forwards,
    rupacs-status-fade 3.6s ease-in-out 1.2s infinite;
}

.rupacs-status::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 12px;
  border-radius: 50%;
  background: var(--rupacs-accent);
  box-shadow: 0 0 16px rgba(51, 207, 255, 0.9);
  vertical-align: 1px;
  animation: rupacs-dot-pulse 1.8s ease-in-out infinite;
}

.rupacs-content-shell {
  position: relative;
  z-index: 1;
  width: min(920px, calc(100vw - 32px));
  margin: clamp(28px, 6vw, 72px) auto;
  padding: clamp(22px, 4vw, 42px);
  border: 1px solid rgba(120, 220, 255, 0.22);
  border-radius: 28px;
  background: rgba(2, 12, 25, 0.52);
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.42),
    0 0 80px rgba(51, 207, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.rupacs-content-logo-link {
  display: inline-flex;
  width: min(260px, 70vw);
  margin-bottom: 28px;
}

.rupacs-content-logo-link img {
  display: block;
  width: 100%;
  height: auto;
}

.rupacs-content-shell a {
  color: #6fe3ff;
}

.rupacs-content-shell h1,
.rupacs-content-shell h2,
.rupacs-content-shell h3 {
  color: #fff;
  line-height: 1.15;
}

.rupacs-content-shell p,
.rupacs-content-shell li {
  color: rgba(235, 250, 255, 0.86);
  line-height: 1.7;
}

.rupacs-not-found {
  text-align: center;
}

@media (hover: hover) and (pointer: fine) {
  .rupacs-logo-wrap:hover {
    transform: translateY(-3px) scale(1.015);
    border-color: rgba(120, 220, 255, 0.42);
    background: rgba(3, 18, 35, 0.42);
    box-shadow:
      0 36px 120px rgba(0, 0, 0, 0.52),
      0 0 130px rgba(51, 207, 255, 0.34),
      inset 0 1px 0 rgba(255, 255, 255, 0.18);
  }

  .rupacs-logo-wrap:hover::after {
    animation-duration: 3.2s;
  }

  .rupacs-logo-wrap:hover .rupacs-logo {
    filter: drop-shadow(0 0 46px rgba(51, 207, 255, 0.48));
  }
}

@keyframes rupacs-page-fade-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(var(--page-scale));
    filter: blur(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(var(--page-scale));
    filter: blur(0);
  }
}

@keyframes rupacs-status-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 0.72;
    transform: translateY(0);
  }
}

@keyframes rupacs-bg-breath {
  0%,
  100% {
    background-position: 50% 42%, 18% 20%, 82% 78%, center;
  }

  50% {
    background-position: 52% 45%, 21% 24%, 78% 74%, center;
  }
}

@keyframes rupacs-grid-drift {
  0% {
    background-position: 0 0, 0 0;
  }

  100% {
    background-position: 56px 56px, 56px 56px;
  }
}

@keyframes rupacs-vignette-shift {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.82;
  }
}

@keyframes rupacs-glow-pulse {
  0%,
  100% {
    box-shadow:
      0 30px 90px rgba(0, 0, 0, 0.42),
      0 0 80px rgba(51, 207, 255, 0.16),
      inset 0 1px 0 rgba(255, 255, 255, 0.12);
  }

  50% {
    box-shadow:
      0 36px 110px rgba(0, 0, 0, 0.50),
      0 0 110px rgba(51, 207, 255, 0.28),
      inset 0 1px 0 rgba(255, 255, 255, 0.18);
  }
}

@keyframes rupacs-light-sweep {
  0%,
  24% {
    left: -45%;
    opacity: 0;
  }

  36% {
    opacity: 1;
  }

  58% {
    left: 118%;
    opacity: 0;
  }

  100% {
    left: 118%;
    opacity: 0;
  }
}

@keyframes rupacs-logo-focus {
  0%,
  100% {
    filter: drop-shadow(0 0 28px rgba(51, 207, 255, 0.28));
  }

  50% {
    filter: drop-shadow(0 0 42px rgba(51, 207, 255, 0.42));
  }
}

@keyframes rupacs-status-fade {
  0%,
  100% {
    opacity: 0.72;
  }

  50% {
    opacity: 1;
  }
}

@keyframes rupacs-dot-pulse {
  0%,
  100% {
    transform: scale(0.9);
    opacity: 0.62;
  }

  50% {
    transform: scale(1.25);
    opacity: 1;
  }
}

@media (max-width: 782px) {
  body.admin-bar.rupacs-landing-body {
    min-height: calc(100vh - 46px);
  }
}

@media (max-width: 520px) {
  .rupacs-page {
    width: min(100%, calc(100vw - 28px));
  }

  .rupacs-logo-wrap {
    width: 100%;
    border-radius: 24px;
    padding: 18px;
  }

  .rupacs-status {
    margin-top: 20px;
    letter-spacing: 0.12em;
    line-height: 1.5;
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  .rupacs-page {
    width: min(780px, calc(100vw - 32px));
  }

  .rupacs-logo-wrap {
    width: min(620px, 86vw);
    padding: clamp(12px, 3vh, 24px);
    border-radius: 24px;
  }

  .rupacs-status {
    margin-top: clamp(10px, 3vh, 18px);
    font-size: clamp(11px, 3vh, 14px);
    line-height: 1.35;
  }
}

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