/* ═══════════════════════════════════════════════
   ANIMATIONS — SANTET V3
   Keyframes · Background layers · Utilities
   ═══════════════════════════════════════════════ */

/* ── KEYFRAMES ─────────────────────────────────────── */

@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slide-in-left {
  from { opacity: 0; transform: translateX(-14px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .5; transform: scale(1.4); }
}

@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 var(--r-bg); }
  70%  { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(24px) scale(.96); }
  to   { opacity: 1; transform: translateX(0)    scale(1); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateX(24px) scale(.96); }
}

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-4px); }
  75%      { transform: translateX(4px); }
}

@keyframes aurora-anim {
  0%   { transform: translate(0, 0) rotate(0deg); }
  50%  { transform: translate(-30px, 20px) rotate(2deg); }
  100% { transform: translate(20px, -30px) rotate(-2deg); }
}

@keyframes stars-anim {
  from { background-position: 0 0; }
  to   { background-position: 600px 600px; }
}

/* ════════════════════════════════════════════════════════
   BACKGROUND LAYERS
   5-layer ambient system (aurora + grid + stars + particles + cursor glow)
════════════════════════════════════════════════════════ */

.bg-aurora {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 50% at 15% 10%, rgba(157,78,221,.22), transparent 60%),
    radial-gradient(ellipse 50% 45% at 85% 20%, rgba(255,215,0,.10), transparent 60%),
    radial-gradient(ellipse 45% 40% at 50% 80%, rgba(0, 229, 255, .10), transparent 60%);
  filter: blur(40px);
  animation: aurora-anim 22s ease-in-out infinite alternate;
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at center, #000 35%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 35%, transparent 75%);
  opacity: .5;
}

.bg-stars {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 20% 30%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 60% 70%, var(--r3) 50%, transparent 51%),
    radial-gradient(1px 1px at 80% 20%, var(--purple) 50%, transparent 51%),
    radial-gradient(1px 1px at 30% 80%, rgba(0, 229, 255, .5) 50%, transparent 51%),
    radial-gradient(1px 1px at 90% 50%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 10% 60%, var(--r3) 50%, transparent 51%),
    radial-gradient(1px 1px at 45% 10%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 75% 85%, var(--purple) 50%, transparent 51%);
  background-size: 600px 600px;
  animation: stars-anim 120s linear infinite;
  opacity: .65;
}

.bg-particles {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: .4;
  will-change: transform;
}

.cursor-glow {
  position: fixed;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 215, 0, .14) 0%, rgba(157, 78, 221, .08) 40%, transparent 72%);
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: screen;
  will-change: transform;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity .4s ease-out;
}

.cursor-glow.active {
  opacity: 1;
}

/* ════════════════════════════════════════════════════════
   UNIVERSAL SCROLL-TRIGGER ANIMATIONS
   .fade-up / .reveal — activated via IntersectionObserver (.in class)
════════════════════════════════════════════════════════ */

.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .65s cubic-bezier(.22, .61, .36, 1), transform .65s cubic-bezier(.22, .61, .36, 1);
  will-change: opacity, transform;
}

.fade-up.in {
  opacity: 1;
  transform: none;
}

.reveal {
  opacity: 0;
  transform: translateY(12px) scale(.98);
  transition: opacity .7s ease, transform .7s ease;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* Staggered child delays via --i custom property */
.fade-up[style*="--i"],
.reveal[style*="--i"] {
  transition-delay: calc(var(--i, 0) * 60ms);
}

/* ════════════════════════════════════════════════════════
   UNIVERSAL NAVBAR
   Fixed top bar for landing / public pages
════════════════════════════════════════════════════════ */

.landing-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px clamp(20px, 4vw, 40px);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background .3s, border-color .3s, backdrop-filter .3s;
}

.landing-navbar.scrolled {
  background: rgba(8, 9, 13, .78);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid rgba(255, 215, 0, .12);
  box-shadow: 0 4px 24px rgba(0, 0, 0, .4), 0 1px 0 rgba(255, 215, 0, .06) inset;
}

.landing-navbar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: .16em;
  color: var(--tx);
  text-decoration: none;
}

.landing-navbar__brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--r3), var(--purple));
  color: var(--bg);
  font-weight: 900;
  box-shadow: 0 0 20px rgba(255, 215, 0, .35);
}

.landing-navbar__brand-text strong {
  color: var(--r3);
}

.landing-navbar__links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.landing-navbar__link {
  color: rgba(255, 255, 255, .7);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  position: relative;
  transition: color .2s;
}

.landing-navbar__link:hover {
  color: var(--tx);
}

.landing-navbar__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  background: linear-gradient(90deg, var(--r3), var(--purple));
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s;
}

.landing-navbar__link:hover::after {
  transform: scaleX(1);
}

.landing-navbar__link.active {
  color: var(--r3);
}

.landing-navbar__link.active::after {
  transform: scaleX(1);
}

.landing-navbar__cta {
  padding: 9px 18px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--r3), var(--r2));
  color: var(--bg);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: .04em;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 4px 18px rgba(255, 215, 0, .4);
}

.landing-navbar__cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(255, 215, 0, .6);
}

.landing-navbar__menu-btn {
  display: none;
  background: none;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  color: var(--tx);
  padding: 8px 12px;
  cursor: pointer;
  font-size: 16px;
}

/* ════════════════════════════════════════════════════════
   FOOTER
════════════════════════════════════════════════════════ */

.footer-section {
  padding: 60px 0 30px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .4));
  position: relative;
  z-index: 2;
}

.footer-section .container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 32px);
}

.footer-section .footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 40px;
}

.footer-section .footer-brand {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: .16em;
  margin-bottom: 14px;
  color: var(--tx);
}

.footer-section .footer-brand strong {
  color: var(--r3);
}

.footer-section .footer-tag {
  font-size: 13px;
  color: rgba(255, 255, 255, .55);
  line-height: 1.55;
  margin: 0;
}

.footer-section .footer-col h4 {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--r3);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin: 0 0 16px;
}

.footer-section .footer-col a {
  display: block;
  color: rgba(255, 255, 255, .7);
  text-decoration: none;
  font-size: 13px;
  padding: 6px 0;
  transition: color .2s, padding-left .2s;
}

.footer-section .footer-col a:hover {
  color: var(--tx);
  padding-left: 4px;
}

.footer-section .footer-bottom {
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.footer-section .footer-copy {
  font-size: 12px;
  color: rgba(255, 255, 255, .55);
  margin: 0;
}

/* ════════════════════════════════════════════════════════
   ACCESSIBILITY & Z-INDEX
════════════════════════════════════════════════════════ */

.dash-page-shell, .portal-page, .activity-page, .settings-page, .admin-page,
.toast-root, .footer-section {
  position: relative;
  z-index: 3;
}

.dash-page-shell, .portal-page, .settings-page, .activity-page, .admin-page {
  padding-top: 0;
}

@media (prefers-reduced-motion: reduce) {
  .fade-up,
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ════════════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════════════ */

@media (max-width: 720px) {
  /* Hide heavy effects on mobile */
  .cursor-glow { display: none; }
  .bg-particles { display: none; }

  /* Navbar mobile */
  .landing-navbar__links { display: none; }
  .landing-navbar__links.open {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(8, 9, 13, .95);
    backdrop-filter: blur(18px);
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
  }
  .landing-navbar__menu-btn { display: block; }

  /* Footer mobile */
  .footer-section .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  /* Auth page padding */
  .dash-page-shell, .portal-page, .settings-page, .activity-page, .admin-page {
    padding-top: 76px;
  }
}
