/* ============================================================
   Nexon Project — глобальная тема (2026): неон, стекло, motion
   ============================================================ */

:root {
  --bg-deep: #020617;
  --bg: #030712;
  --bg-soft: #0b1220;
  --bg-elevated: #0f172a;
  --panel: rgba(255, 255, 255, 0.04);
  --panel-strong: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --border-glow: rgba(96, 165, 250, 0.22);
  --text: #f8fafc;
  --text-soft: #cbd5e1;
  --text-muted: #94a3b8;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-soft: rgba(59, 130, 246, 0.22);
  --accent-violet: #a855f7;
  --accent-cyan: #22d3ee;
  --success-soft: rgba(34, 197, 94, 0.16);
  --danger-soft: rgba(239, 68, 68, 0.16);
  --radius: 24px;
  --radius-sm: 16px;
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 60px rgba(59, 130, 246, 0.12);
  --container: 1280px;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Global selection lock (UX request). */
html,
body,
body * {
  -webkit-user-select: none;
  user-select: none;
}

/* Keep forms and technical text copy-friendly. */
input,
textarea,
select,
[contenteditable="true"],
pre,
code {
  -webkit-user-select: text;
  user-select: text;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
}

body.site-body {
  min-width: 320px;
  font-family: var(--font-sans);
  line-height: 1.55;
  color: var(--text);
  background-color: var(--bg-deep);
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -30%, rgba(59, 130, 246, 0.18), transparent 52%),
    radial-gradient(ellipse 80% 50% at 100% 50%, rgba(168, 85, 247, 0.06), transparent 45%),
    radial-gradient(ellipse 60% 40% at 0% 80%, rgba(34, 211, 238, 0.05), transparent 40%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg) 38%, #0a0f1c 100%);
  -webkit-font-smoothing: antialiased;
}

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

img {
  max-width: 100%;
}

button,
input,
textarea,
select {
  font: inherit;
}

.container {
  width: min(var(--container), calc(100% - 32px));
  margin: 0 auto;
}

/* ---------- Animated background ---------- */

.site-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  --shift-x: 0px;
  --shift-y: 0px;
}

/* Anime Minecraft illustration layer + readability veils */
.site-bg__art-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

/* Wrapper carries Ken Burns — avoid animating <picture> (inconsistent across engines). */
.site-bg__art {
  position: absolute;
  inset: -10%;
  margin: 0;
  overflow: hidden;
  transform: scale(1.08);
  animation: site-bg-art-ken 52s ease-in-out infinite alternate;
  will-change: transform;
}

.site-bg__art-picture {
  position: absolute;
  inset: 0;
  display: block;
  margin: 0;
}

.site-bg__art-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  display: block;
  pointer-events: none;
}

.site-bg__art-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(2, 6, 23, 0.78) 0%, rgba(2, 6, 23, 0.18) 42%, rgba(3, 7, 18, 0.5) 78%, rgba(2, 6, 23, 0.88) 100%),
    radial-gradient(ellipse 95% 65% at 50% 110%, rgba(59, 130, 246, 0.12), transparent 52%);
  pointer-events: none;
}

.site-bg__art-sparkles {
  position: absolute;
  inset: -15%;
  opacity: 0.55;
  background:
    radial-gradient(ellipse 40% 30% at 18% 22%, rgba(196, 181, 253, 0.35) 0%, transparent 55%),
    radial-gradient(ellipse 35% 28% at 82% 18%, rgba(34, 211, 238, 0.22) 0%, transparent 50%),
    radial-gradient(ellipse 45% 35% at 70% 85%, rgba(250, 204, 21, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse 30% 25% at 40% 60%, rgba(96, 165, 250, 0.18) 0%, transparent 50%);
  mix-blend-mode: screen;
  pointer-events: none;
  animation: site-bg-sparkle-drift 22s ease-in-out infinite alternate;
}

@keyframes site-bg-art-ken {
  0% {
    transform: scale(1.05) translate(0%, 0%);
  }
  100% {
    transform: scale(1.32) translate(-4.5%, 3.2%);
  }
}

@keyframes site-bg-sparkle-drift {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 0.45;
  }
  100% {
    transform: translate(-3%, 2%) scale(1.06);
    opacity: 0.75;
  }
}

.site-bg__track {
  position: absolute;
  inset: -8%;
  transform: translate3d(var(--shift-x), var(--shift-y), 0);
  will-change: transform;
  transition: transform 0.35s var(--ease-out-expo);
}

.site-bg__mesh {
  position: absolute;
  inset: 0;
  opacity: 0.55;
  transform-origin: 50% 50%;
  background:
    conic-gradient(
      from 220deg at 50% 45%,
      rgba(59, 130, 246, 0) 0deg,
      rgba(59, 130, 246, 0.14) 60deg,
      rgba(168, 85, 247, 0.12) 130deg,
      rgba(34, 211, 238, 0.08) 200deg,
      rgba(59, 130, 246, 0) 360deg
    );
  animation: site-mesh-spin 42s linear infinite;
}

.site-bg--anime .site-bg__mesh {
  opacity: 0.4;
}

.site-bg--anime .site-bg__aurora {
  opacity: 0.55;
}

.site-bg--anime .site-bg__orb {
  opacity: 0.26;
}

.site-bg__aurora {
  position: absolute;
  inset: -15% -20%;
  transform-origin: 50% 40%;
  background:
    radial-gradient(ellipse 55% 35% at 20% 20%, rgba(59, 130, 246, 0.2), transparent 55%),
    radial-gradient(ellipse 45% 30% at 85% 15%, rgba(168, 85, 247, 0.16), transparent 50%),
    radial-gradient(ellipse 50% 40% at 70% 90%, rgba(34, 211, 238, 0.08), transparent 55%);
  animation: site-aurora-pulse 14s ease-in-out infinite alternate;
  filter: blur(2px);
}

.site-bg__rings {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 120%, transparent 35%, rgba(59, 130, 246, 0.04) 36%, transparent 37%),
    radial-gradient(circle at 50% 120%, transparent 48%, rgba(168, 85, 247, 0.03) 49%, transparent 50%);
  opacity: 0.9;
}

.site-bg__orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(88px);
  mix-blend-mode: screen;
  opacity: 0.42;
}

.site-bg__orb--one {
  top: -8%;
  left: -5%;
  width: min(420px, 55vw);
  height: min(420px, 55vw);
  background: radial-gradient(circle, rgba(59, 130, 246, 0.55) 0%, transparent 68%);
  animation: site-orb-float-a 18s ease-in-out infinite;
}

.site-bg__orb--two {
  top: 8%;
  right: -12%;
  width: min(380px, 50vw);
  height: min(380px, 50vw);
  background: radial-gradient(circle, rgba(168, 85, 247, 0.45) 0%, transparent 70%);
  animation: site-orb-float-b 22s ease-in-out infinite;
}

.site-bg__orb--three {
  bottom: -18%;
  left: 25%;
  width: min(480px, 70vw);
  height: min(320px, 45vw);
  background: radial-gradient(circle, rgba(34, 211, 238, 0.22) 0%, transparent 72%);
  animation: site-orb-float-c 26s ease-in-out infinite;
}

.site-bg__grid {
  position: absolute;
  inset: 0;
  opacity: 0.45;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, transparent 88%);
  animation: site-grid-drift 48s linear infinite;
}

/* Particles: drawn on canvas (see app.js initSiteBackgroundParticles) */
.site-bg__particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 14;
}

.site-bg__particles-canvas {
  display: block;
  width: 100%;
  height: 100%;
  vertical-align: top;
  opacity: 1;
}

.site-bg__scan {
  z-index: 12;
  position: absolute;
  left: 0;
  right: 0;
  height: 120px;
  top: -20%;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(59, 130, 246, 0.04) 40%,
    rgba(255, 255, 255, 0.02) 50%,
    transparent
  );
  animation: site-scan 11s ease-in-out infinite;
  opacity: 0.5;
  pointer-events: none;
}

.site-bg__vignette {
  z-index: 13;
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 85% 75% at 50% 45%, transparent 30%, rgba(0, 0, 0, 0.55) 100%);
  pointer-events: none;
}

.site-bg__noise {
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  pointer-events: none;
}

@keyframes site-mesh-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes site-aurora-pulse {
  0% {
    opacity: 0.55;
    transform: scale(1) translateY(0);
  }
  100% {
    opacity: 0.85;
    transform: scale(1.04) translateY(-1.5%);
  }
}

@keyframes site-orb-float-a {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(4%, 6%) scale(1.06);
  }
}

@keyframes site-orb-float-b {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(-5%, 4%) scale(1.05);
  }
}

@keyframes site-orb-float-c {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(3%, -5%) scale(1.04);
  }
}

@keyframes site-grid-drift {
  0% {
    background-position: 0 0, 0 0;
  }
  100% {
    background-position: 56px 56px, -56px 56px;
  }
}

@keyframes site-scan {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.15;
  }
  45% {
    opacity: 0.45;
  }
  50% {
    transform: translateY(120vh);
    opacity: 0.35;
  }
}

@keyframes site-enter-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .site-bg__particles {
    display: none;
  }

  .site-bg__mesh,
  .site-bg__aurora,
  .site-bg__orb,
  .site-bg__grid,
  .site-bg__scan,
  .site-bg__art,
  .site-bg__art-sparkles {
    animation: none !important;
  }

  .site-bg__track {
    transition: none;
  }

  .site-header__inner,
  .site-main,
  .site-footer > .container,
  .cabinet-shell {
    animation: none !important;
  }
}

/* ---------- Layout chrome ---------- */

.site-header,
.site-main,
.site-footer,
.cabinet-shell {
  position: relative;
  z-index: 1;
}

.site-header {
  padding: 18px 0 0;
}

.site-header__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
  min-height: 88px;
  padding: 14px 20px;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 42%, transparent 65%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.82) 0%, rgba(8, 12, 24, 0.78) 100%);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px) saturate(1.35);
  -webkit-backdrop-filter: blur(20px) saturate(1.35);
  box-shadow:
    var(--shadow),
    var(--shadow-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  position: relative;
  overflow: hidden;
  animation: site-enter-up 0.68s var(--ease-out-expo) both;
}

.site-header__inner::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(96, 165, 250, 0.35),
    rgba(168, 85, 247, 0.15) 40%,
    rgba(34, 211, 238, 0.12) 70%,
    transparent
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.65;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.site-logo__img {
  display: block;
  width: clamp(180px, 15vw, 232px);
  height: auto;
  max-width: 78vw;
  flex-shrink: 0;
  filter:
    drop-shadow(0 10px 26px rgba(37, 99, 235, 0.35))
    drop-shadow(0 0 20px rgba(96, 165, 250, 0.22));
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.site-nav__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 14px;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 700;
  position: relative;
  transition:
    background 0.22s var(--ease-out-expo),
    color 0.22s ease,
    transform 0.22s var(--ease-out-expo),
    box-shadow 0.22s ease;
}

.site-nav__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: inherit;
}

.site-nav__svg {
  width: 17px;
  height: 17px;
  display: block;
}

.site-nav__svg--btn {
  width: 16px;
  height: 16px;
}

.site-nav__link::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 8px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent-violet));
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.28s var(--ease-out-expo);
  opacity: 0.9;
}

.site-nav__link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  transform: translateY(-1px);
}

.site-nav__link:hover::after {
  transform: scaleX(1);
}

.site-nav__link--active {
  background: rgba(59, 130, 246, 0.18);
  color: #e0f2fe;
  box-shadow: 0 0 24px rgba(59, 130, 246, 0.12);
}

.site-nav__link--active::after {
  transform: scaleX(1);
}

.site-header__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.site-header__logout-form {
  margin: 0;
}

.site-main {
  padding: 22px 0 48px;
  animation: site-enter-up 0.78s var(--ease-out-expo) 0.05s both;
}

.site-footer {
  padding: 20px 0 32px;
}

.site-footer > .container {
  animation: site-enter-up 0.82s var(--ease-out-expo) 0.1s both;
}

.section-title {
  margin: 0;
  font-family: var(--font-display);
  color: #ffffff;
  font-size: clamp(1.75rem, 3.2vw, 2.35rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
  font-weight: 700;
  background: linear-gradient(120deg, #fff 0%, #dbeafe 45%, #93c5fd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@supports not (background-clip: text) {
  .section-title {
    color: #ffffff;
    background: none;
  }
}

.muted {
  color: var(--text-muted);
  line-height: 1.75;
}

.cabinet-shell {
  animation: site-enter-up 0.72s var(--ease-out-expo) 0.04s both;
}

/* ---------- Maintenance ---------- */

.site-maintenance-banner {
  position: relative;
  z-index: 5;
  border-bottom: 1px solid rgba(251, 191, 36, 0.35);
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.18), rgba(248, 113, 113, 0.12));
}

.site-maintenance-banner__inner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
}

.site-maintenance-banner__dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-top: 6px;
  background: #fbbf24;
  box-shadow: 0 0 0 6px rgba(251, 191, 36, 0.18);
}

.site-maintenance-banner__text {
  margin: 0;
  color: #fef9c3;
  font-weight: 600;
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .site-header__inner {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .site-logo {
    justify-content: center;
  }

  .site-nav {
    justify-content: center;
  }

  .site-header__actions {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .container {
    width: min(var(--container), calc(100% - 20px));
  }

  .site-header {
    padding-top: 12px;
  }

  .site-header__inner {
    padding: 14px 16px;
    gap: 14px;
    min-height: auto;
  }

  .site-logo__img {
    max-width: min(260px, 88vw);
  }

  .site-nav {
    gap: 4px;
  }

  .site-nav__link {
    min-height: 40px;
    padding: 8px 12px;
    font-size: 13px;
  }

  .site-main {
    padding: 16px 0 40px;
  }

  .section-title {
    font-size: 1.65rem;
  }

  .site-bg__noise {
    opacity: 0.025;
  }

  .site-bg__art {
    animation-duration: 72s;
  }

  .site-bg__art-sparkles {
    animation-duration: 28s;
    opacity: 0.4;
  }

  .site-bg__particles-canvas {
    opacity: 0.95;
  }

  .site-bg--anime .site-bg__particles-canvas {
    opacity: 1;
  }
}
