/* ==========================================================================
   DEVNOVA SOLUTIONS LTD — animations.css
   Motion system. Every rule degrades to a static state.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Keyframes
   -------------------------------------------------------------------------- */

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

@keyframes nova-pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(1);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.06);
  }
}

@keyframes nova-orbit {
  to {
    stroke-dashoffset: -1000;
  }
}

@keyframes nova-draw {
  to {
    stroke-dashoffset: 0;
  }
}

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

@keyframes nova-loader-out {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes nova-mark-breathe {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.85;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

/* --------------------------------------------------------------------------
   Branded loading transition
   -------------------------------------------------------------------------- */

.site-loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  gap: var(--space-m);
  background: var(--ink);
  color: var(--mint);
}

.site-loader__mark {
  width: 62px;
  height: 62px;
  animation: nova-mark-breathe 1.5s var(--ease-in-out) infinite;
}

.site-loader__bar {
  width: min(220px, 44vw);
  height: 2px;
  background: var(--ink-line-strong);
  overflow: hidden;
  border-radius: 2px;
}

.site-loader__bar span {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--mint), var(--blue));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 620ms var(--ease-out);
}

.site-loader.is-primed .site-loader__bar span {
  transform: scaleX(1);
}

.site-loader.is-done {
  animation: nova-loader-out 420ms var(--ease-out) forwards;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Page entry
   -------------------------------------------------------------------------- */

.page-enter > main {
  animation: nova-fade-up 620ms var(--ease-out) both;
}

/* --------------------------------------------------------------------------
   Scroll reveals
   -------------------------------------------------------------------------- */

.js-enabled [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

.js-enabled [data-reveal="left"] {
  transform: translateX(-24px);
}

.js-enabled [data-reveal="right"] {
  transform: translateX(24px);
}

.js-enabled [data-reveal="scale"] {
  transform: scale(0.965);
}

.js-enabled [data-reveal].is-visible {
  opacity: 1;
  transform: none;
  will-change: auto;
}

/* Staggered children */

.js-enabled [data-stagger] > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 620ms var(--ease-out), transform 620ms var(--ease-out);
}

.js-enabled [data-stagger].is-visible > * {
  opacity: 1;
  transform: none;
}

.js-enabled [data-stagger].is-visible > *:nth-child(1) {
  transition-delay: 40ms;
}
.js-enabled [data-stagger].is-visible > *:nth-child(2) {
  transition-delay: 110ms;
}
.js-enabled [data-stagger].is-visible > *:nth-child(3) {
  transition-delay: 180ms;
}
.js-enabled [data-stagger].is-visible > *:nth-child(4) {
  transition-delay: 250ms;
}
.js-enabled [data-stagger].is-visible > *:nth-child(5) {
  transition-delay: 320ms;
}
.js-enabled [data-stagger].is-visible > *:nth-child(6) {
  transition-delay: 390ms;
}
.js-enabled [data-stagger].is-visible > *:nth-child(7) {
  transition-delay: 460ms;
}
.js-enabled [data-stagger].is-visible > *:nth-child(8) {
  transition-delay: 530ms;
}

/* --------------------------------------------------------------------------
   Animated section dividers
   -------------------------------------------------------------------------- */

.rule-anim {
  position: relative;
  height: 1px;
  background: var(--paper-line);
  overflow: hidden;
}

.section--ink .rule-anim,
.section--graphite .rule-anim {
  background: var(--ink-line);
}

.rule-anim::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--mint), var(--blue));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 1s var(--ease-out);
}

.rule-anim.is-visible::after {
  transform: scaleX(1);
}

/* --------------------------------------------------------------------------
   Constellation motion
   -------------------------------------------------------------------------- */

.constellation__svg .orbit {
  fill: none;
  stroke: rgba(244, 241, 232, 0.13);
  stroke-width: 1;
}

.constellation__svg .orbit--dashed {
  stroke-dasharray: 3 7;
  animation: nova-orbit 42s linear infinite;
}

.constellation__svg .link {
  stroke: rgba(244, 241, 232, 0.18);
  stroke-width: 1;
  stroke-dasharray: 240;
  stroke-dashoffset: 240;
  transition: stroke-dashoffset 1.1s var(--ease-out),
    stroke var(--dur-base) var(--ease-out);
}

.constellation.is-visible .constellation__svg .link {
  stroke-dashoffset: 0;
}

.constellation__svg .link.is-lit {
  stroke: var(--mint);
}

.constellation__svg .link--consult.is-lit {
  stroke: var(--blue);
}

.constellation__svg .pip {
  fill: var(--mint);
  opacity: 0.55;
}

.constellation__stage .halo {
  fill: none;
  stroke: rgba(66, 232, 180, 0.28);
  transform-origin: center;
  animation: nova-pulse 5.5s var(--ease-in-out) infinite;
}

/* --------------------------------------------------------------------------
   Journey path drawing
   -------------------------------------------------------------------------- */

.path-draw {
  stroke-dasharray: var(--path-len, 1200);
  stroke-dashoffset: var(--path-len, 1200);
}

.is-visible .path-draw {
  animation: nova-draw 1.6s var(--ease-out) forwards;
}

/* --------------------------------------------------------------------------
   Pointer-responsive card depth
   -------------------------------------------------------------------------- */

.tilt {
  transform: perspective(900px) rotateX(var(--tilt-x, 0deg))
    rotateY(var(--tilt-y, 0deg)) translateZ(0);
  transition: transform 380ms var(--ease-out);
}

/* Button attraction glow */

.btn--primary::before {
  content: "";
  position: absolute;
  inset: -40%;
  z-index: -1;
  background: radial-gradient(
    circle at var(--pointer-x, 50%) var(--pointer-y, 50%),
    rgba(255, 255, 255, 0.5) 0%,
    transparent 55%
  );
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out);
}

.btn--primary:hover::before {
  opacity: 1;
}

/* Accordion smooth panel */

.accordion__panel {
  will-change: height;
}

/* Mobile menu entry */

.mobile-nav.is-open .mobile-nav__item {
  animation: nova-fade-up 380ms var(--ease-out) both;
}

.mobile-nav.is-open .mobile-nav__item:nth-child(1) {
  animation-delay: 40ms;
}
.mobile-nav.is-open .mobile-nav__item:nth-child(2) {
  animation-delay: 80ms;
}
.mobile-nav.is-open .mobile-nav__item:nth-child(3) {
  animation-delay: 120ms;
}
.mobile-nav.is-open .mobile-nav__item:nth-child(4) {
  animation-delay: 160ms;
}
.mobile-nav.is-open .mobile-nav__item:nth-child(5) {
  animation-delay: 200ms;
}
.mobile-nav.is-open .mobile-nav__item:nth-child(6) {
  animation-delay: 240ms;
}
.mobile-nav.is-open .mobile-nav__item:nth-child(7) {
  animation-delay: 280ms;
}

/* Service card filter transition */

.service-card {
  animation: nova-fade-up 420ms var(--ease-out) both;
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */

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

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

  .js-enabled [data-reveal],
  .js-enabled [data-stagger] > * {
    opacity: 1 !important;
    transform: none !important;
  }

  .rule-anim::after,
  .journey__line::after {
    transform: scaleX(1) !important;
  }

  .constellation__svg .link {
    stroke-dashoffset: 0 !important;
  }

  .path-draw {
    stroke-dashoffset: 0 !important;
  }

  .tilt {
    transform: none !important;
  }

  .site-loader {
    display: none !important;
  }

  .page-transition {
    display: none !important;
  }

  .hero-canvas {
    opacity: 1;
  }

  .btn:hover,
  .btn:focus-visible,
  .card:hover,
  .svc-feature:hover,
  .service-card:hover,
  .related-card:hover {
    transform: none;
  }

  /* Service imagery stays completely still. */
  .svc-media img,
  .service-card:hover .svc-media img,
  .svc-feature:hover .svc-media img,
  .card:hover .svc-media img {
    transform: none !important;
    transition: none !important;
    will-change: auto;
  }

  .svc-media::after {
    transform: scaleX(1) !important;
    transition: none !important;
  }
}
