/* ============================================
   Style Of Vabis — Cinematic Motion System
   ============================================ */

:root {
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --glow-gold: 0 0 40px rgba(226, 61, 61, 0.35);
  --glow-gold-soft: 0 0 80px rgba(226, 61, 61, 0.18);
}

/* Page enter */
body {
  animation: pageEnter 0.8s var(--ease-out-expo) both;
}

@keyframes pageEnter {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Custom cursor glow (desktop) */
.cursor-glow {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(circle, rgba(226, 61, 61, 0.12) 0%, transparent 68%);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.4s ease;
  mix-blend-mode: screen;
}

.cursor-glow.is-on {
  opacity: 1;
}

/* Reveal engine */
[data-reveal] {
  opacity: 0;
  transform: translateY(48px) scale(0.98);
  filter: blur(8px);
  transition:
    opacity 0.9s var(--ease-out-expo),
    transform 0.9s var(--ease-out-expo),
    filter 0.9s var(--ease-out-expo);
  transition-delay: var(--reveal-delay, 0s);
  will-change: opacity, transform, filter;
}

[data-reveal].is-in {
  opacity: 1;
  transform: none;
  filter: none;
}

[data-reveal="left"] {
  transform: translateX(-56px) scale(0.98);
}

[data-reveal="right"] {
  transform: translateX(56px) scale(0.98);
}

[data-reveal="scale"] {
  transform: scale(0.88);
}

[data-reveal="fade"] {
  transform: none;
  filter: blur(12px);
}

/* Stagger children */
[data-stagger] > * {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.7s var(--ease-out-expo),
    transform 0.7s var(--ease-out-expo);
}

[data-stagger].is-in > *:nth-child(1) { transition-delay: 0.05s; }
[data-stagger].is-in > *:nth-child(2) { transition-delay: 0.12s; }
[data-stagger].is-in > *:nth-child(3) { transition-delay: 0.19s; }
[data-stagger].is-in > *:nth-child(4) { transition-delay: 0.26s; }
[data-stagger].is-in > *:nth-child(5) { transition-delay: 0.33s; }
[data-stagger].is-in > *:nth-child(6) { transition-delay: 0.4s; }
[data-stagger].is-in > *:nth-child(7) { transition-delay: 0.47s; }
[data-stagger].is-in > *:nth-child(8) { transition-delay: 0.54s; }
[data-stagger].is-in > *:nth-child(9) { transition-delay: 0.6s; }
[data-stagger].is-in > *:nth-child(10) { transition-delay: 0.66s; }
[data-stagger].is-in > *:nth-child(11) { transition-delay: 0.72s; }
[data-stagger].is-in > *:nth-child(12) { transition-delay: 0.78s; }
[data-stagger].is-in > *:nth-child(13) { transition-delay: 0.84s; }
[data-stagger].is-in > *:nth-child(14) { transition-delay: 0.9s; }
[data-stagger].is-in > *:nth-child(15) { transition-delay: 0.96s; }
[data-stagger].is-in > *:nth-child(16) { transition-delay: 1.02s; }

[data-stagger].is-in > * {
  opacity: 1;
  transform: none;
}

/* Hero cinematic layers */
.hero__aurora {
  position: absolute;
  inset: -20%;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 40% 30% at 20% 40%, rgba(226, 61, 61, 0.22), transparent 60%),
    radial-gradient(ellipse 35% 35% at 80% 20%, rgba(120, 160, 255, 0.08), transparent 55%),
    radial-gradient(ellipse 50% 40% at 60% 90%, rgba(226, 61, 61, 0.1), transparent 60%);
  animation: auroraDrift 14s ease-in-out infinite alternate;
  mix-blend-mode: screen;
}

@keyframes auroraDrift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to { transform: translate3d(3%, 2%, 0) scale(1.08); }
}

.hero__grain {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.18;
  background-image: var(--noise);
  mix-blend-mode: overlay;
  animation: grainShift 0.5s steps(2) infinite;
}

@keyframes grainShift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-1%, 1%); }
  50% { transform: translate(1%, -1%); }
  75% { transform: translate(-1%, -2%); }
  100% { transform: translate(0, 0); }
}

.hero__beams {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.hero__beam {
  position: absolute;
  top: -20%;
  width: 2px;
  height: 140%;
  background: linear-gradient(to bottom, transparent, rgba(226, 61, 61, 0.55), transparent);
  filter: blur(1px);
  animation: beamFall linear infinite;
  opacity: 0.35;
}

.hero__beam:nth-child(1) { left: 12%; animation-duration: 7s; animation-delay: 0s; }
.hero__beam:nth-child(2) { left: 28%; animation-duration: 9s; animation-delay: 1.2s; width: 1px; }
.hero__beam:nth-child(3) { left: 55%; animation-duration: 6.5s; animation-delay: 0.6s; }
.hero__beam:nth-child(4) { left: 72%; animation-duration: 8s; animation-delay: 2s; width: 1px; }
.hero__beam:nth-child(5) { left: 88%; animation-duration: 10s; animation-delay: 0.3s; }

@keyframes beamFall {
  0% { transform: translateY(-30%) rotate(12deg); opacity: 0; }
  20% { opacity: 0.5; }
  100% { transform: translateY(30%) rotate(12deg); opacity: 0; }
}

.hero__brand {
  background: linear-gradient(120deg, #fff 0%, #ffc9c4 35%, #e23d3d 55%, #fff 75%, #e23d3d 100%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: brandShimmer 5s linear infinite;
  filter: drop-shadow(0 8px 32px rgba(226, 61, 61, 0.25));
}

@keyframes brandShimmer {
  to { background-position: 220% center; }
}

.hero__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  pointer-events: none;
  z-index: 1;
  animation: orbFloat 8s ease-in-out infinite;
}

.hero__orb--1 {
  width: 280px;
  height: 280px;
  background: rgba(226, 61, 61, 0.2);
  top: 18%;
  right: 12%;
}

.hero__orb--2 {
  width: 180px;
  height: 180px;
  background: rgba(100, 140, 255, 0.12);
  bottom: 22%;
  left: 8%;
  animation-delay: -3s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, -28px) scale(1.12); }
}

/* Road light streaks */
.hero__streaks {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.hero__streaks span {
  position: absolute;
  left: 0;
  height: 1px;
  width: 22vw;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.75), var(--color-accent), transparent);
  opacity: 0.28;
  filter: blur(0.4px);
  animation: roadStreak linear infinite;
}

.hero__streaks span:nth-child(1) { top: 22%; width: 16vw; animation-duration: 9s; animation-delay: 0s; }
.hero__streaks span:nth-child(2) { top: 41%; width: 28vw; animation-duration: 7.5s; animation-delay: -2s; opacity: 0.18; }
.hero__streaks span:nth-child(3) { top: 63%; width: 18vw; animation-duration: 11s; animation-delay: -4s; }
.hero__streaks span:nth-child(4) { top: 78%; width: 34vw; animation-duration: 6.5s; animation-delay: -1s; opacity: 0.4; }
.hero__streaks span:nth-child(5) { top: 88%; width: 14vw; animation-duration: 8s; animation-delay: -3.5s; opacity: 0.22; }

@keyframes roadStreak {
  from { transform: translateX(-40vw); }
  to { transform: translateX(130vw); }
}

/* Traveling border on the stats bar */
@property --border-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

.stats-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from var(--border-angle), transparent 0 72%, rgba(226, 61, 61, 0.15) 80%, #fff 88%, var(--color-accent) 92%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: borderTravel 7s linear infinite;
  pointer-events: none;
}

@keyframes borderTravel {
  to { --border-angle: 360deg; }
}

/* Title rule draws in */
.section__header .section__title::after,
.page-hero .section__title::after,
.page-hero h1.section__title::after {
  content: '';
  display: block;
  width: 4.5rem;
  height: 2px;
  margin: 0.9rem auto 0;
  background: linear-gradient(90deg, var(--color-accent), transparent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.9s var(--ease-out-expo) 0.12s;
}

.page-hero .section__title::after,
.page-hero h1.section__title::after {
  margin-left: 0;
  margin-right: auto;
  transform-origin: left center;
}

.section__header.is-in .section__title::after,
.page-hero .section__title::after,
.page-hero h1.section__title::after {
  transform: scaleX(1);
}

/* Photo sheen */
.about__figure::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.16) 50%, transparent 62%);
  transform: translateX(-130%);
  animation: photoSheen 8s ease-in-out infinite;
  pointer-events: none;
}

.about__caption {
  z-index: 2;
}

@keyframes photoSheen {
  0%, 55% { transform: translateX(-130%); }
  80%, 100% { transform: translateX(130%); }
}

::selection {
  background: rgba(226, 61, 61, 0.85);
  color: #fff;
}

/* Premium buttons */
.btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition:
    transform 0.45s var(--ease-out-expo),
    box-shadow 0.45s var(--ease-out-expo),
    background 0.35s ease,
    border-color 0.35s ease,
    color 0.35s ease;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.35) 50%, transparent 80%);
  transform: translateX(-120%);
  transition: transform 0.7s var(--ease-out-expo);
  z-index: -1;
}

.btn:hover::before {
  transform: translateX(120%);
}

.btn--primary {
  box-shadow: 0 10px 30px rgba(226, 61, 61, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn--primary:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 18px 40px rgba(226, 61, 61, 0.4), var(--glow-gold);
}

.btn--outline:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(226, 61, 61, 0.35);
}

/* Magnetic press */
.btn:active {
  transform: translateY(-1px) scale(0.98);
}

/* Cards lift */
.announcement-card,
.mod-card,
.team-card,
.integration-card,
.forum-category-card,
.forum-topic-row,
.partners-grid__card,
.admin-card,
.admin-stat-card,
.notification-item,
.profile-stat,
.signature-card {
  transition:
    transform 0.55s var(--ease-out-expo),
    box-shadow 0.55s var(--ease-out-expo),
    border-color 0.4s ease,
    background 0.4s ease;
}

.announcement-card:hover,
.mod-card:hover,
.team-card:hover,
.integration-card:hover,
.forum-category-card:hover,
.partners-grid__card:hover,
.notification-item:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow:
    0 24px 50px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(226, 61, 61, 0.28),
    var(--glow-gold-soft);
  border-color: rgba(226, 61, 61, 0.45);
}

a.forum-topic-row:hover {
  transform: translateX(8px);
  box-shadow: -4px 0 0 var(--color-accent), 0 16px 32px rgba(0, 0, 0, 0.3);
}

/* Gallery cinematic */
.gallery__item {
  transition: transform 0.7s var(--ease-out-expo), box-shadow 0.7s ease;
}

.gallery__item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.65));
  opacity: 0;
  transition: opacity 0.5s ease;
}

.gallery__item:hover {
  transform: scale(1.03);
  z-index: 2;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55), var(--glow-gold-soft);
}

.gallery__item:hover::after {
  opacity: 1;
}

.gallery__item img {
  transition: transform 1.1s var(--ease-out-expo);
}

.gallery__item:hover img {
  transform: scale(1.12);
}

/* Stats pulse */
.stat__number {
  transition: text-shadow 0.4s ease, color 0.4s ease;
}

.stats-bar.is-in .stat__number,
.stat.is-live .stat__number {
  text-shadow: 0 0 24px rgba(226, 61, 61, 0.45);
}

/* Section divider light */
.section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: min(240px, 40%);
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(226, 61, 61, 0.55), transparent);
  opacity: 0.7;
}

.section--dark::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 60% 40% at 50% 0%, rgba(226, 61, 61, 0.06), transparent 70%);
}

/* Header glass elevate */
.header.scrolled .header__bar {
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

.nav__link {
  position: relative;
}

.nav__link::after {
  content: '';
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.3rem;
  height: 2px;
  border-radius: 2px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease-out-expo);
}

.nav__link:hover::after,
.nav__link.active::after {
  transform: scaleX(1);
}

.nav__link--cta::after,
.nav__dropdown-toggle::after {
  display: none;
}

/* Tilt cards (JS driven) */
[data-tilt] {
  transform-style: preserve-3d;
  transform: perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  transition: transform 0.2s ease-out;
}

[data-tilt] > * {
  transform: translateZ(24px);
}

/* Counter shimmer */
@keyframes countGlow {
  0%, 100% { text-shadow: 0 0 12px rgba(226, 61, 61, 0.2); }
  50% { text-shadow: 0 0 28px rgba(226, 61, 61, 0.55); }
}

.stat__number.is-counting {
  animation: countGlow 0.8s ease;
}

/* Scroll progress */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  z-index: 2000;
  background: linear-gradient(90deg, var(--color-accent-dark), var(--color-accent-light), #fff);
  box-shadow: 0 0 16px rgba(226, 61, 61, 0.65);
  transform-origin: left;
  pointer-events: none;
}

/* Floating CTA ripple */
@keyframes softPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(226, 61, 61, 0.45); }
  70% { box-shadow: 0 0 0 16px rgba(226, 61, 61, 0); }
}

.btn--primary.btn--pulse {
  animation: softPulse 2.4s ease-out infinite;
}

/* Lightbox premium */
.lightbox {
  backdrop-filter: blur(18px) saturate(1.2);
  transition: opacity 0.45s var(--ease-out-expo), visibility 0.45s;
}

.lightbox.active .lightbox__content {
  animation: lightboxPop 0.55s var(--ease-spring) both;
}

@keyframes lightboxPop {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to { opacity: 1; transform: none; }
}

/* Admin / inner page polish */
.admin-nav__link {
  position: relative;
  overflow: hidden;
}

.admin-nav__link.active {
  box-shadow: inset 3px 0 0 var(--color-accent), 0 8px 24px rgba(226, 61, 61, 0.08);
}

.admin-stat-card:hover {
  transform: translateY(-6px);
  border-color: rgba(226, 61, 61, 0.4);
  box-shadow: var(--glow-gold-soft);
}

.profile-hero {
  position: relative;
  overflow: hidden;
}

.profile-hero::before {
  content: '';
  position: absolute;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(226, 61, 61, 0.16), transparent 70%);
  top: -160px;
  right: -80px;
  animation: orbFloat 10s ease-in-out infinite;
  pointer-events: none;
}

.rank-card {
  transition: transform 0.55s var(--ease-out-expo), box-shadow 0.55s ease;
}

.rank-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 40px color-mix(in srgb, var(--rank-color) 25%, transparent);
}

/* Marquee partners boost */
.partners-marquee__track {
  animation-duration: 36s;
}

.page-hero .section__title,
.page-hero h1 {
  animation: titleRise 0.85s var(--ease-out-expo) both;
}

.page-hero .section__desc,
.page-hero .back-link {
  animation: titleRise 0.9s var(--ease-out-expo) 0.12s both;
}

@keyframes titleRise {
  from { opacity: 0; transform: translateY(22px); filter: blur(8px); }
  to { opacity: 1; transform: none; filter: none; }
}

/* Pointer spotlight on cards */
.announcement-card,
.mod-card,
.team-card,
.integration-card,
.partners-grid__card,
.forum-node,
.auth-card {
  position: relative;
  --spot-x: 50%;
  --spot-y: 40%;
}

.announcement-card::before,
.mod-card::before,
.team-card::before,
.integration-card::before,
.partners-grid__card::before,
.forum-node::before,
.auth-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(280px circle at var(--spot-x) var(--spot-y), rgba(226, 61, 61, 0.16), transparent 46%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 1;
}

.announcement-card:hover::before,
.mod-card:hover::before,
.team-card:hover::before,
.integration-card:hover::before,
.partners-grid__card:hover::before,
.forum-node:hover::before,
.auth-card:hover::before {
  opacity: 1;
}

.footer__links a {
  position: relative;
}

.footer__links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease-out-expo);
}

.footer__links a:hover::after {
  transform: scaleX(1);
}

/* Brand cursors (PNG — Chrome ignores SVG cursors). Skip on touch UIs. */
@media (hover: hover) and (pointer: fine) {
  html,
  body,
  body * {
    cursor: url("cursor.png") 2 1, auto;
  }

  a,
  button,
  [role="button"],
  .btn,
  label[for],
  summary,
  select,
  .admin-toggle,
  input[type="checkbox"],
  input[type="radio"],
  input[type="submit"],
  input[type="button"],
  input[type="file"],
  input[type="range"],
  .link-danger,
  .member-row,
  .forum-post__tools button,
  [onclick] {
    cursor: url("cursor-pointer.png") 8 1, pointer;
  }

  input[type="text"],
  input[type="search"],
  input[type="email"],
  input[type="password"],
  input[type="url"],
  input[type="number"],
  input:not([type]),
  textarea,
  [contenteditable="true"] {
    cursor: text;
  }

  .is-grab,
  [style*="cursor: grab"],
  .profile-cover.is-dragging {
    cursor: grab;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  [data-reveal],
  [data-stagger] > * {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }

  .cursor-glow,
  .hero__beams,
  .hero__streaks,
  .hero__aurora,
  .scroll-progress,
  .stats-bar::after,
  .about__figure::after {
    display: none !important;
  }

  .page-hero .section__title,
  .page-hero h1,
  .page-hero .section__desc,
  .page-hero .back-link {
    animation: none !important;
  }
}

@media (max-width: 768px) {
  .cursor-glow {
    display: none;
  }

  [data-reveal] {
    filter: none;
    transform: translateY(24px);
  }
}
