/* ==========================================================================
   DEVIUM — MOTION & ANIMATION SYSTEM
   Ultra-Smooth, High-Performance Microinteractions & Progressive Scroll Reveal
   ========================================================================== */

/* Keyframe Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes smoothFadeUp {
  0% {
    opacity: 0;
    transform: translateY(16px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes smoothFadeDown {
  0% {
    opacity: 0;
    transform: translateY(-12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pageEnter {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulseGlow {
  0%, 100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.08);
  }
}

@keyframes textShimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes meshFloat {
  0% { transform: translate(-50%, 0) scale(1); opacity: 0.5; }
  50% { transform: translate(-46%, -18px) scale(1.1); opacity: 0.85; }
  100% { transform: translate(-50%, 0) scale(1); opacity: 0.5; }
}

@keyframes meshFloatSecondary {
  0% { transform: translate(15%, 10px) scale(0.95); opacity: 0.35; }
  50% { transform: translate(22%, -15px) scale(1.1); opacity: 0.7; }
  100% { transform: translate(15%, 10px) scale(0.95); opacity: 0.35; }
}

@keyframes livePulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7); }
  70% { transform: scale(1.15); box-shadow: 0 0 0 8px rgba(37, 99, 235, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

@keyframes cardSelectedPop {
  0% { transform: scale(0.97); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}


/* Hero Isotype 3-Bar Cascading Motion Keyframes */
@keyframes heroBarEntrance {
  0% {
    transform: scaleX(0);
    opacity: 0;
  }
  100% {
    transform: scaleX(1);
    opacity: 1;
  }
}

@keyframes heroBarMiddlePulse {
  0% {
    transform: scaleX(0);
    opacity: 0;
    filter: drop-shadow(0 0 0 rgba(37, 99, 235, 0));
  }
  60% {
    transform: scaleX(1);
    opacity: 1;
    filter: drop-shadow(0 0 12px rgba(124, 58, 237, 0.7));
  }
  100% {
    transform: scaleX(1);
    opacity: 1;
    filter: drop-shadow(0 0 4px rgba(37, 99, 235, 0.3));
  }
}

/* Global Top Scroll Progress Bar */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--brand-gradient);
  z-index: calc(var(--z-header, 100) + 15);
  width: 0%;
  transition: width 0.08s linear;
  box-shadow: 0 0 10px var(--brand-blue-glow), 0 0 18px var(--brand-purple-glow);
  pointer-events: none;
}

/* Text Shimmer Headline Accent */
.text-shimmer {
  background: linear-gradient(90deg, #ffffff 0%, #60a5fa 35%, #c084fc 65%, #ffffff 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: textShimmer 4s ease infinite;
  display: inline-block;
}

[data-theme="light"] .text-shimmer {
  background: linear-gradient(90deg, #09090b 0%, #2563eb 35%, #7c3aed 65%, #09090b 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: textShimmer 4s ease infinite;
}

/* Eyebrow Live Indicator */
.eyebrow-live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3b82f6;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.7);
  animation: livePulse 2.5s infinite ease-in-out;
  margin-right: 7px;
  vertical-align: middle;
}

/* Page Entrance Master Animation — Smooth Luxury Curve */
#main-content {
  animation: pageEnter 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
  will-change: opacity, transform;
}

/* Smooth Page Header & Hero Staggered Sequences for All 5 Pages */
.hero-center-symbol,
#main-content > section:first-of-type .hero-symbol-icon,
.about-hero .hero-symbol-icon,
#main-content > section:first-of-type .eyebrow {
  animation: smoothFadeDown 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.04s both;
}

.hero-title,
#main-content > section:first-of-type .heading-1,
#main-content > section:first-of-type h1 {
  animation: smoothFadeUp 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

.hero-lead,
#main-content > section:first-of-type .lead,
#main-content > section:first-of-type p.lead {
  animation: smoothFadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.14s both;
}

.hero-actions,
.filter-group,
.wizard-container,
.contact-sidebar {
  animation: smoothFadeUp 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.20s both;
}

/* Smooth Page Exit on Navigation */
body.page-exiting #main-content {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.14s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.14s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base state: Elements are naturally visible with smooth transition */
.reveal,
.reveal-left,
.reveal-right,
.reveal-scale {
  opacity: 1;
  transform: translate(0) scale(1) rotate(0deg);
  filter: blur(0px);
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.75s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform, filter;
}

/* Below-the-fold scroll elements when JS observer is active — Dramatic Silk Reveal */
body.js-loaded .reveal:not(.is-visible) {
  opacity: 0;
  transform: translateY(38px) scale(0.97);
  filter: blur(4px);
}

body.js-loaded .reveal-left:not(.is-visible) {
  opacity: 0;
  transform: translateX(-42px) rotate(-1.5deg);
  filter: blur(4px);
}

body.js-loaded .reveal-right:not(.is-visible) {
  opacity: 0;
  transform: translateX(42px) rotate(1.5deg);
  filter: blur(4px);
}

body.js-loaded .reveal-scale:not(.is-visible) {
  opacity: 0;
  transform: scale(0.92);
  filter: blur(4px);
}

body.js-loaded .reveal.is-visible,
body.js-loaded .reveal-left.is-visible,
body.js-loaded .reveal-right.is-visible,
body.js-loaded .reveal-scale.is-visible {
  opacity: 1;
  transform: translate(0) scale(1) rotate(0deg);
  filter: blur(0px);
}

/* Stagger Delays for Grid Elements — Cascading Wave */
.stagger-1 { transition-delay: 80ms; }
.stagger-2 { transition-delay: 160ms; }
.stagger-3 { transition-delay: 240ms; }
.stagger-4 { transition-delay: 320ms; }
.stagger-5 { transition-delay: 400ms; }
.stagger-6 { transition-delay: 480ms; }

/* Hero Visual Accents — Multi-layer Atmospheric Mesh */
.hero-glow-sphere {
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  width: clamp(600px, 75vw, 950px);
  height: 420px;
  background: radial-gradient(ellipse at center, rgba(124, 58, 237, 0.16) 0%, rgba(37, 99, 235, 0.10) 40%, transparent 70%);
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
  animation: pulseGlow 10s infinite ease-in-out;
}

.hero-glow-sphere-secondary {
  position: absolute;
  top: 25%;
  right: 10%;
  width: min(500px, 60vw);
  height: 350px;
  background: radial-gradient(ellipse at center, rgba(37, 99, 235, 0.18) 0%, rgba(124, 58, 237, 0.12) 40%, transparent 70%);
  filter: blur(55px);
  pointer-events: none;
  z-index: 0;
  animation: meshFloatSecondary 12s infinite ease-in-out;
}

[data-theme="light"] .hero-glow-sphere {
  background: radial-gradient(ellipse at center, rgba(124, 58, 237, 0.05) 0%, rgba(37, 99, 235, 0.04) 40%, transparent 70%);
  filter: blur(100px);
  opacity: 0.04;
}

[data-theme="light"] .hero-glow-sphere-secondary {
  background: radial-gradient(ellipse at center, rgba(37, 99, 235, 0.08) 0%, rgba(124, 58, 237, 0.04) 40%, transparent 70%);
  filter: blur(90px);
  opacity: 0.03;
}

/* Hero Isotype 3-Bar Cascading Motion */
.hero-symbol-svg {
  width: 48px;
  height: 48px;
  display: block;
  overflow: visible;
  color: var(--text-primary);
}

.hero-bar {
  transform-box: fill-box;
  transform-origin: left center;
  animation-duration: 450ms;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  animation-fill-mode: both;
}

.hero-bar-top {
  animation-name: heroBarEntrance;
  animation-delay: 0ms;
  fill: currentColor;
}

.hero-bar-middle {
  animation-name: heroBarMiddlePulse;
  animation-delay: 120ms;
  fill: url(#heroIsotipoGrad);
}

.hero-bar-bottom {
  animation-name: heroBarEntrance;
  animation-delay: 240ms;
  fill: currentColor;
}

/* ==========================================================================
   DEVIUM CUSTOM ANIMATED CURSOR (Luxury Tech Microinteraction)
   Precision dot + Fluid physics follower ring with reactive element framing
   ========================================================================== */
.devium-cursor-dot,
.devium-cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 999999;
  opacity: 0;
  will-change: transform, opacity;
}

/* Precision Center Dot */
.devium-cursor-dot {
  width: 6px;
  height: 6px;
  margin-top: -3px;
  margin-left: -3px;
  background-color: #ffffff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
  transition: opacity 0.2s ease,
              width 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              height 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              margin 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.2s ease;
}

[data-theme="light"] .devium-cursor-dot {
  background-color: #09090b;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.25);
}

/* Visibility controlled by body class */
body.has-custom-cursor .devium-cursor-dot,
body.has-custom-cursor .devium-cursor-ring {
  opacity: 1;
}

/* Smooth Physics Follower Ring */
.devium-cursor-ring {
  width: 36px;
  height: 36px;
  margin-top: -18px;
  margin-left: -18px;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  background: transparent;
  box-shadow: none;
  backdrop-filter: blur(1px);
  transition: opacity 0.3s ease,
              width 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              height 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              margin 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.25s ease,
              background-color 0.25s ease,
              box-shadow 0.25s ease;
}

[data-theme="light"] .devium-cursor-ring {
  border: 1.5px solid rgba(15, 23, 42, 0.35);
  background: transparent;
  box-shadow: none;
}

/* Hover Over Interactive Elements (Links, Buttons, Cards, Inputs) */
.devium-cursor-ring.cursor-hover {
  width: 54px;
  height: 54px;
  margin-top: -27px;
  margin-left: -27px;
  border-color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: none;
}

[data-theme="light"] .devium-cursor-ring.cursor-hover {
  border-color: rgba(15, 23, 42, 0.75);
  background: rgba(0, 0, 0, 0.03);
  box-shadow: none;
}

/* Center dot fades and collapses symmetrically IN PLACE at the mouse coordinate */
body.has-custom-cursor .devium-cursor-dot.cursor-hover {
  opacity: 0;
  width: 0;
  height: 0;
  margin-top: 0;
  margin-left: 0;
  box-shadow: none;
}

/* Mechanical Click / Press State */
.devium-cursor-ring.cursor-active {
  width: 28px;
  height: 28px;
  margin-top: -14px;
  margin-left: -14px;
  border-color: rgba(168, 85, 247, 0.95);
  background: rgba(124, 58, 237, 0.3);
  box-shadow: 0 0 25px rgba(124, 58, 237, 0.65);
}

/* Text Input Focus / Hover State */
.devium-cursor-ring.cursor-text {
  width: 4px;
  height: 26px;
  margin-top: -13px;
  margin-left: -2px;
  border-radius: 2px;
  border-color: rgba(96, 165, 250, 0.9);
  background: rgba(96, 165, 250, 0.85);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.6);
}

body.has-custom-cursor .devium-cursor-dot.cursor-text {
  opacity: 0;
  width: 0;
  height: 0;
  margin-top: 0;
  margin-left: 0;
  box-shadow: none;
}

/* Custom Cursor Rules (Active when pointer moves and body has has-custom-cursor class) */
body.has-custom-cursor,
body.has-custom-cursor a,
body.has-custom-cursor button,
body.has-custom-cursor .btn,
body.has-custom-cursor .option-card,
body.has-custom-cursor .accordion-trigger,
body.has-custom-cursor .currency-toggle-btn,
body.has-custom-cursor .theme-toggle-btn,
body.has-custom-cursor .filter-btn,
body.has-custom-cursor .wizard-step-node,
body.has-custom-cursor [role="button"],
body.has-custom-cursor input,
body.has-custom-cursor textarea,
body.has-custom-cursor select {
  cursor: none !important;
}

/* Disable custom cursor on mobile / touch / reduced motion */
@media (max-width: 1024px), (pointer: coarse), (prefers-reduced-motion: reduce) {
  .devium-cursor-dot,
  .devium-cursor-ring,
  #devium-cursor-dot,
  #devium-cursor-ring {
    display: none !important;
  }
  body.has-custom-cursor,
  body.has-custom-cursor * {
    cursor: auto !important;
  }
  #main-content,
  .hero-center-symbol,
  #main-content > section:first-of-type .eyebrow,
  .hero-title,
  #main-content > section:first-of-type .heading-1,
  #main-content > section:first-of-type h1,
  .hero-lead,
  #main-content > section:first-of-type .lead,
  #main-content > section:first-of-type p.lead,
  .hero-actions,
  .filter-group,
  .wizard-container,
  .contact-sidebar,
  .reveal,
  .reveal-left,
  .reveal-right,
  .reveal-scale,
  body.js-loaded .reveal,
  body.js-loaded .reveal-left,
  body.js-loaded .reveal-right,
  body.js-loaded .reveal-scale {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }
}
