:root {
  --experience-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --experience-fast: 180ms;
  --experience-base: 320ms;
  --experience-slow: 520ms;
  --experience-surface: rgba(255, 255, 255, 0.82);
  --experience-surface-strong: rgba(255, 255, 255, 0.94);
  --experience-border: rgba(14, 65, 133, 0.14);
  --experience-shadow: 0 18px 50px rgba(7, 32, 102, 0.08);
  --experience-shadow-hover: 0 28px 80px rgba(7, 32, 102, 0.16);
  --experience-highlight: linear-gradient(135deg, rgba(30, 136, 229, 0.12), rgba(7, 32, 102, 0.04));
}

html {
  scroll-padding-top: 92px;
}

body {
  text-rendering: optimizeLegibility;
}

@media (max-width: 1024px) {
  .body-1,
  .body-2,
  .body-3 {
    background-attachment: scroll !important;
  }
}

body::selection {
  background: rgba(30, 136, 229, 0.18);
}

a,
button,
input,
textarea,
select,
.article-item,
.geo-news-item,
.submit-button,
.scroll-to-top,
.theme-toggle-btn {
  transition:
    transform var(--experience-base) var(--experience-ease),
    box-shadow var(--experience-base) var(--experience-ease),
    border-color var(--experience-fast) ease,
    background-color var(--experience-fast) ease,
    color var(--experience-fast) ease,
    opacity var(--experience-fast) ease;
}

:focus-visible {
  outline: 2px solid rgba(30, 136, 229, 0.35);
  outline-offset: 3px;
}

img {
  content-visibility: auto;
}

.header,
.page-header,
.editor-container,
.articles-management,
.article-item,
.geo-news-item {
  backface-visibility: hidden;
  transform: translateZ(0);
}

body.experience-home .hero,
body.experience-article .page-header {
  position: relative;
}

body.experience-article .page-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top left, rgba(100, 181, 246, 0.16), transparent 36%),
    radial-gradient(circle at bottom right, rgba(3, 169, 244, 0.1), transparent 34%);
  pointer-events: none;
}

body.experience-home .hero-info,
body.experience-article .page-header-content,
body.experience-editor .editor-header {
  animation: rise-in var(--experience-slow) var(--experience-ease) both;
}

body.experience-home .home-character {
  filter: drop-shadow(0 18px 38px rgba(7, 32, 102, 0.18));
  animation: hero-float 7s ease-in-out infinite;
  will-change: transform;
}

body.experience-home .geo-news-item,
body.experience-article .article-item {
  border: 1px solid rgba(30, 136, 229, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.92));
  box-shadow: var(--experience-shadow);
  overflow: hidden;
}

body.experience-home .geo-news-item::after,
body.experience-article .article-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.38), transparent);
  transform: translateX(-120%);
  transition: transform 680ms var(--experience-ease);
  pointer-events: none;
}

body.experience-home .geo-news-item:hover,
body.experience-article .article-item:hover {
  transform: translateY(-8px);
  border-color: rgba(30, 136, 229, 0.18);
  box-shadow: var(--experience-shadow-hover);
}

body.experience-home .geo-news-item:hover::after,
body.experience-article .article-item:hover::after {
  transform: translateX(120%);
}

body.experience-home .geo-news-item .geo-news-title,
body.experience-article .article-title {
  letter-spacing: -0.02em;
}

body.experience-home .theme-toggle-btn,
body.experience-article .theme-toggle-btn,
body.experience-home .scroll-to-top,
body.experience-article .scroll-to-top {
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.24);
}

body.experience-editor {
  background:
    radial-gradient(circle at top left, rgba(100, 181, 246, 0.2), transparent 28%),
    linear-gradient(180deg, #f4f8fd 0%, #eef4fb 100%);
}

body.experience-editor .editor-container,
body.experience-editor .articles-management,
body.experience-editor .modal-content,
body.experience-editor .login-container {
  background: var(--experience-surface-strong);
  border: 1px solid var(--experience-border);
  box-shadow: var(--experience-shadow);
  backdrop-filter: blur(16px);
}

body.experience-editor .editor-container,
body.experience-editor .articles-management {
  border-radius: 24px;
}

body.experience-editor .form-group input,
body.experience-editor .login-container input,
body.experience-editor .register-form input,
body.experience-editor .ql-toolbar,
body.experience-editor .ql-container {
  border-color: rgba(30, 136, 229, 0.16) !important;
  transition:
    border-color var(--experience-fast) ease,
    box-shadow var(--experience-fast) ease,
    background-color var(--experience-fast) ease;
}

body.experience-editor .form-group input:focus,
body.experience-editor .login-container input:focus,
body.experience-editor .register-form input:focus,
body.experience-editor .ql-container:focus-within {
  border-color: rgba(30, 136, 229, 0.4) !important;
  box-shadow: 0 0 0 4px rgba(30, 136, 229, 0.08);
}

body.experience-editor .submit-button,
body.experience-editor .toolbar button,
body.experience-editor .file-upload label {
  border-radius: 14px !important;
  box-shadow: 0 10px 24px rgba(30, 136, 229, 0.14);
}

body.experience-editor .submit-button:hover,
body.experience-editor .toolbar button:hover,
body.experience-editor .file-upload label:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(30, 136, 229, 0.18);
}

body.experience-editor .message {
  position: sticky;
  top: 18px;
  z-index: 20;
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(7, 32, 102, 0.12);
  animation: toast-in 360ms var(--experience-ease);
}

body.experience-editor #articles-list table {
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border-radius: 16px;
}

body.experience-editor #articles-list tbody tr {
  transition: background-color var(--experience-fast) ease, transform var(--experience-fast) ease;
}

body.experience-editor #articles-list tbody tr:hover {
  background: rgba(30, 136, 229, 0.04);
}

body.experience-editor .modal {
  backdrop-filter: blur(12px);
}

body.experience-home .page-loader,
body.experience-article .page-loader {
  backdrop-filter: blur(12px);
}

@keyframes hero-float {
  0%, 100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -10px, 0);
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translate3d(0, 18px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate3d(0, -10px, 0) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@media (max-width: 768px) {
  body.experience-editor .editor-container,
  body.experience-editor .articles-management {
    border-radius: 18px;
  }

  body.experience-home .geo-news-item:hover,
  body.experience-article .article-item:hover,
  body.experience-editor .submit-button:hover,
  body.experience-editor .toolbar button:hover,
  body.experience-editor .file-upload label:hover {
    transform: none;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  body.experience-home .hero::before,
  body.experience-article .page-header::before {
    display: none;
  }
}
