/* ============================================================
   Sofftsolutation — Premium Animations
   DO NOT modify existing CSS files. All animation styles live here.
   ============================================================ */

/* ---- HIDE DEFAULT OS CURSOR ---- */
* { cursor: none !important; }
input, textarea, select { cursor: text !important; }

/* ---- CUSTOM CURSOR ---- */
.cursor-dot {
  position: fixed;
  width: 8px;
  height: 8px;
  background: #818cf8;
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  transform: translate(-50%, -50%);
  transition: transform 0.12s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.4s ease;
  opacity: 0;
  box-shadow: 0 0 8px 2px rgba(129, 140, 248, 0.7),
              0 0 16px 4px rgba(99, 102, 241, 0.4);
}

.cursor-ring {
  position: fixed;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 99998;
  transform: translate(-50%, -50%);
  will-change: transform;
  opacity: 0;
  transition: width 0.25s cubic-bezier(0.23, 1, 0.32, 1),
              height 0.25s cubic-bezier(0.23, 1, 0.32, 1),
              border-radius 0.25s ease,
              opacity 0.4s ease;
  /* gradient ring via background + mask */
  background: conic-gradient(
    from 0deg,
    #818cf8 0deg,
    #a78bfa 90deg,
    #6366f1 180deg,
    #818cf8 270deg,
    #a78bfa 360deg
  );
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 1.5px), #fff calc(100% - 1.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 1.5px), #fff calc(100% - 1.5px));
  animation: cursor-ring-spin 4s linear infinite;
  filter: drop-shadow(0 0 6px rgba(129, 140, 248, 0.5));
}

@keyframes cursor-ring-spin {
  0%   { --ring-angle: 0deg; }
  100% { --ring-angle: 360deg; }
}

/* Cursor hover state — links & buttons */
.cursor-dot.cursor-hover {
  transform: translate(-50%, -50%) scale(1.6);
  box-shadow: 0 0 12px 4px rgba(129, 140, 248, 0.9),
              0 0 24px 8px rgba(99, 102, 241, 0.5);
}
.cursor-ring.cursor-hover {
  width: 52px;
  height: 52px;
  opacity: 0.8;
  filter: drop-shadow(0 0 10px rgba(129, 140, 248, 0.7));
}

/* Cursor media state — images & cards */
.cursor-ring.cursor-media {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  filter: drop-shadow(0 0 8px rgba(167, 139, 250, 0.6));
}

/* Cursor click state */
.cursor-dot.cursor-click {
  transform: translate(-50%, -50%) scale(0.4);
  box-shadow: 0 0 20px 8px rgba(129, 140, 248, 1),
              0 0 40px 12px rgba(99, 102, 241, 0.6);
}
.cursor-ring.cursor-click {
  width: 44px;
  height: 44px;
  opacity: 1;
  filter: drop-shadow(0 0 14px rgba(129, 140, 248, 0.9));
}

/* Cursor visible after load */
.cursor-dot.cursor-visible { opacity: 1; }
.cursor-ring.cursor-visible { opacity: 0.9; }

/* ---- CURSOR TRAIL SPARKS ---- */
.cursor-spark {
  position: fixed;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #818cf8;
  pointer-events: none;
  z-index: 99990;
  transform: translate(-50%, -50%);
  animation: spark-fade 0.6s ease-out forwards;
}

@keyframes spark-fade {
  0%   { opacity: 0.8; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0;   transform: translate(-50%, calc(-50% - 20px)) scale(0); }
}

/* ---- SCROLL REVEAL BASE ---- */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.reveal-group > *:nth-child(1) { transition-delay: 0s; }
.reveal-group > *:nth-child(2) { transition-delay: 0.1s; }
.reveal-group > *:nth-child(3) { transition-delay: 0.2s; }
.reveal-group > *:nth-child(4) { transition-delay: 0.3s; }
.reveal-group > *:nth-child(5) { transition-delay: 0.4s; }
.reveal-group > *:nth-child(6) { transition-delay: 0.5s; }
.reveal-group > *:nth-child(7) { transition-delay: 0.55s; }
.reveal-group > *:nth-child(8) { transition-delay: 0.6s; }
.reveal-group > *:nth-child(9) { transition-delay: 0.65s; }
.reveal-group > *:nth-child(10) { transition-delay: 0.7s; }

/* Directional variants */
.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.reveal-left.visible,
.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}
.reveal-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* ---- HERO PARTICLE CANVAS ---- */
#particle-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}

/* ---- MAGNETIC BUTTON ---- */
.btn-magnetic {
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

/* ---- GLITCH TEXT (scoped: pseudo layers sit behind headline, no clip-path) ---- */
.glitch {
  position: relative;
  max-width: 100%;
  overflow: visible;
  isolation: isolate;
}
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: auto;
  min-height: 100%;
  white-space: pre-wrap;
  pointer-events: none;
  opacity: 0;
  z-index: -1;
  line-height: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: inherit;
  font-weight: inherit;
}
.glitch:hover::before {
  opacity: 0.35;
  animation: glitch-top 0.35s ease-out;
  color: #22d3ee;
  text-shadow: 0 0 18px rgba(34, 211, 238, 0.45);
}
.glitch:hover::after {
  opacity: 0.3;
  animation: glitch-bottom 0.35s ease-out;
  color: #c084fc;
  text-shadow: 0 0 18px rgba(192, 132, 252, 0.4);
}
@keyframes glitch-top {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-2px, 1px); }
  50%  { transform: translate(2px, -1px); }
  75%  { transform: translate(-1px, 0); }
  100% { transform: translate(0, 0); }
}
@keyframes glitch-bottom {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(2px, -1px); }
  50%  { transform: translate(-2px, 1px); }
  75%  { transform: translate(1px, 0); }
  100% { transform: translate(0, 0); }
}

/* ---- HERO SCROLL CTA ---- */
.hero-scroll-cta.is-scrolling .hero-scroll-icon {
  animation: hero-scroll-burst 0.9s cubic-bezier(0.33, 1, 0.68, 1) forwards;
}
.hero-scroll-cta.is-scrolling .hero-scroll-label {
  animation: hero-scroll-label 0.9s ease forwards;
}
@keyframes hero-scroll-burst {
  0%   { transform: translateY(0) scale(1); opacity: 1; }
  40%  { transform: translateY(10px) scale(1.15); opacity: 0.85; }
  100% { transform: translateY(28px) scale(0.9); opacity: 0; }
}
@keyframes hero-scroll-label {
  0%, 100% { opacity: 1; letter-spacing: 0.2em; }
  50%      { opacity: 0.5; letter-spacing: 0.35em; }
}

@media (prefers-reduced-motion: reduce) {
  .glitch:hover::before,
  .glitch:hover::after {
    animation: none !important;
    opacity: 0 !important;
  }
  .hero-scroll-cta.is-scrolling .hero-scroll-icon,
  .hero-scroll-cta.is-scrolling .hero-scroll-label {
    animation: none !important;
  }
}

/* ---- TYPING CURSOR ---- */
/* Only the inline span gets the cursor — NOT the parent h1 */
span.typewriter::after {
  content: '|';
  animation: blink 0.75s step-end infinite;
  margin-left: 3px;
  color: #818cf8;
  font-weight: 300;
  opacity: 1;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ---- CARD HOVER TILT ---- */
.tilt-card {
  transform-style: preserve-3d;
  transition: transform 0.1s ease, box-shadow 0.3s ease;
  will-change: transform;
}
.tilt-card:hover {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

/* ---- COUNTER ANIMATION ---- */
.count-up {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

/* ---- ANIMATED LINK UNDERLINE ---- */
.link-underline {
  position: relative;
  text-decoration: none;
}
.link-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0%;
  height: 1.5px;
  background: currentColor;
  transition: width 0.3s ease;
}
.link-underline:hover::after {
  width: 100%;
}

/* ---- HERO GRADIENT MESH ANIMATION ---- */
@keyframes mesh-drift {
  0%   { transform: translate(0%, 0%) rotate(0deg); }
  33%  { transform: translate(2%, 3%) rotate(1deg); }
  66%  { transform: translate(-2%, 1%) rotate(-1deg); }
  100% { transform: translate(0%, 0%) rotate(0deg); }
}
.mesh-bg {
  animation: mesh-drift 12s ease-in-out infinite;
}

/* ---- NAVBAR SCROLL SHRINK ---- */
nav.navbar-scrolled {
  padding-top: 0.25rem !important;
  padding-bottom: 0.25rem !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

/* ---- SMOOTH PAGE LOADER ---- */
#page-loader {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0d0d14;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
#page-loader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader-bar {
  width: 180px;
  height: 2px;
  background: rgba(128, 128, 128, 0.2);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.loader-bar::after {
  content: '';
  position: absolute;
  left: -50%;
  width: 50%;
  height: 100%;
  background: #6366f1;
  animation: loader-sweep 0.9s ease-in-out forwards;
}
@keyframes loader-sweep {
  0%   { left: -50%; }
  100% { left: 110%; }
}

/* ---- FORM INPUT ANIMATED ---- */
.form-input-animated {
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}
.form-input-animated:focus {
  transform: scale(1.01);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25) !important;
  outline: none !important;
}

/* ---- ACTIVE NAV LINK ---- */
nav a.active {
  color: #818cf8 !important;
}

/* ---- REDUCE MOTION SUPPORT ---- */
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-left, .reveal-right, .reveal-scale,
  .tilt-card, .btn-magnetic, .cursor-ring, .cursor-dot,
  .cursor-spark, .glitch::before, .glitch::after {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
  #page-loader { display: none !important; }
}
