/* ==========================================================================
   MOOREZY -- Premium Continuous Animated Border System
   --------------------------------------------------------------------------
   Motion-only visual polish layer. No layout, content, or color changes
   live here -- this file only adds decorative, pointer-events:none overlay
   effects on top of the existing sections/cards. Loaded last so nothing
   here needs !important to win.

   Technique: a small bright arc of a conic-gradient is masked down to a
   1-2px ring that traces the element's own border-radius, then rotated
   with an animated custom property (registered via @property so the
   angle interpolates smoothly instead of snapping). The result reads as
   a small light travelling around the perimeter -- never a full glowing
   outline, never a color-flashing border.
   ========================================================================== */

@property --mz-border-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

@keyframes mz-border-rotate {
  to { --mz-border-angle: 360deg; }
}

@keyframes mz-border-rotate-reverse {
  from { --mz-border-angle: 360deg; }
  to { --mz-border-angle: 0deg; }
}

/* ---- Base: continuous outer border (sections / panels / mockups) ---- */

.mz-anim-border {
  position: relative;
}
.mz-anim-border::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(
    from var(--mz-border-angle, 0deg),
    transparent 0%,
    transparent 80%,
    var(--mz-border-glow-soft, rgba(3, 148, 252, 0.35)) 87%,
    var(--mz-border-glow, var(--mz-cyan-400)) 91%,
    var(--mz-border-glow-soft, rgba(3, 148, 252, 0.35)) 95%,
    transparent 100%
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: var(--mz-border-opacity, 0.8);
  animation: mz-border-rotate var(--mz-border-duration, 13s) linear infinite;
}

/* Strong tier only: a soft blurred duplicate of the same arc, slightly
   larger than the ring itself, for an ambient glow that still only lives
   at one small point on the perimeter rather than lighting the whole
   edge. */
.mz-anim-border--strong::after {
  content: "";
  position: absolute;
  inset: -8px;
  z-index: 1;
  border-radius: inherit;
  background: conic-gradient(
    from var(--mz-border-angle, 0deg),
    transparent 0%,
    transparent 80%,
    var(--mz-border-glow, var(--mz-cyan-400)) 91%,
    transparent 100%
  );
  filter: blur(16px);
  opacity: 0.45;
  pointer-events: none;
  animation: mz-border-rotate var(--mz-border-duration, 13s) linear infinite;
}

/* ---- Intensity hierarchy ---- */

.mz-anim-border--strong {
  --mz-border-duration: 11s;
  --mz-border-opacity: 0.95;
}
.mz-anim-border--medium {
  --mz-border-duration: 13s;
  --mz-border-opacity: 0.65;
}
.mz-anim-border--subtle {
  --mz-border-duration: 18s;
  --mz-border-opacity: 0.4;
}

/* On dark navy sections the default cyan-on-cyan glow needs a touch more
   contrast to read as "light" rather than disappearing into the section's
   own ambient glow blobs. Covers both "the section itself is the bordered
   element" and "the bordered element sits inside a dark section". */
.mz-section--dark.mz-anim-border,
.mz-section--dark .mz-anim-border {
  --mz-border-glow: var(--mz-cyan-300);
  --mz-border-glow-soft: rgba(76, 178, 250, 0.4);
}

/* ---- Hover-only ring for interactive cards (Features / Solutions /
   Additional Features / Billing) -- no markup changes: this attaches to
   the same .card-mz-interactive class every one of those cards already
   carries. Fully inert until :hover, so nothing here runs continuously
   for 30-odd cards at once. ---- */

.card-mz-interactive::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(
    from 0deg,
    transparent 0%,
    transparent 78%,
    var(--mz-cyan-400) 90%,
    transparent 100%
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--mz-duration-base) ease;
}
.card-mz-interactive:hover::before {
  opacity: 1;
  animation: mz-border-rotate 3.2s linear infinite;
}

/* ---- Plan & Usage: subtle shimmer sweeping across the progress bars ---- */

@keyframes mz-bar-shimmer {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(220%); }
}
.usage-mockup__bar {
  position: relative;
  overflow: hidden;
}
.usage-mockup__bar::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  animation: mz-bar-shimmer 3.5s ease-in-out infinite;
  animation-delay: 1s;
  pointer-events: none;
}

/* ---- Apps: real-time sync signal between the two device mockups ---- */

.mz-apps-row {
  position: relative;
}
.mz-apps-sync {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3rem;
  height: 1.5rem;
  transform: translate(-50%, -50%);
  z-index: 5;
  pointer-events: none;
  display: none;
}
@media (min-width: 992px) {
  .mz-apps-sync { display: block; }
}
.mz-apps-sync::before,
.mz-apps-sync::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--mz-cyan-400);
  box-shadow: 0 0 8px 2px rgba(3, 148, 252, 0.55);
  transform: translateY(-50%);
}
.mz-apps-sync::before {
  animation: mz-apps-sync-forward 2.6s ease-in-out infinite;
}
.mz-apps-sync::after {
  background: var(--mz-brand-green);
  box-shadow: 0 0 8px 2px rgba(6, 165, 91, 0.5);
  animation: mz-apps-sync-back 2.6s ease-in-out infinite;
  animation-delay: 1.3s;
}
@keyframes mz-apps-sync-forward {
  0% { left: 0%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}
@keyframes mz-apps-sync-back {
  0% { left: 100%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { left: 0%; opacity: 0; }
}

/* ---- Feature-storytelling flow connector (Phase 2 refinement) ----
   A vertical reuse of the same "data flowing between two points" idea
   as .mz-apps-sync above (same cyan dot, same glow, same 2.6s
   ease-in-out timing) -- just reoriented top-to-bottom to link the
   stacked POS -> Order Management -> Customer Management sections.
   negative margin-block cancels out the extra flex `gap` its own box
   would otherwise add, so it decorates the existing spacing between
   sections instead of enlarging it. Used sparingly: only between the
   three Phase 2 sections, not the rest of the feature list. */
.feature-flow-connector {
  position: relative;
  align-self: center;
  width: 1px;
  height: 3.5rem;
  z-index: 1;
  pointer-events: none;
}
/* Dashed rather than solid -- reads as a data line/wire (the "· | · |"
   pattern) instead of a plain divider rule, without needing a second
   background layer. */
.feature-flow-connector__line {
  position: absolute;
  inset: 0;
  left: 50%;
  border-left: 1.5px dashed var(--mz-slate-300);
  transform: translateX(-50%);
}
.feature-flow-connector__dot {
  position: absolute;
  left: 50%;
  top: 0;
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: var(--mz-cyan-400);
  box-shadow: 0 0 7px 2px rgba(3, 148, 252, 0.4);
  transform: translate(-50%, -50%);
  /* Slow, gentle travel -- communicates "data moving through the
     platform" rather than drawing attention to itself. 3.5s is the top
     of the site's existing small-pulse/progress-fill band (see
     MOOREZY-DESIGN-SYSTEM.md sec. 17: 1.4-3.5s), reused rather than
     inventing a new timing. */
  animation: mz-flow-connector-travel 3.5s ease-in-out infinite;
}
@keyframes mz-flow-connector-travel {
  0% { top: 0%; opacity: 0; }
  20% { opacity: 0.9; }
  80% { opacity: 0.9; }
  100% { top: 100%; opacity: 0; }
}
/* ---- Ecosystem: continuous data-flow pulse travelling along each
   connection line (see index.html's .ecosystem-pulse circles, animated
   with native SVG <animateMotion> so no JS/rAF loop is needed). ---- */

.ecosystem-pulse {
  filter: drop-shadow(0 0 3px rgba(3, 148, 252, 0.8));
}

/* ---- Order Journey: gentle continuous breathing on the connector line,
   independent of the one-time reveal draw and the is-active spotlight
   cycle already driven by journey.js. ---- */

@keyframes mz-journey-line-pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.85; }
}
.journey-stage.is-visible:not(:last-child)::after {
  animation: mz-journey-line-pulse 2.6s ease-in-out infinite;
  animation-delay: calc(var(--mz-stagger-index, 0) * 150ms);
}

/* ---- Reduced motion: kill every continuous loop above, keep a static
   subtle ring so the border system doesn't just vanish. ---- */

@media (prefers-reduced-motion: reduce) {
  .mz-anim-border::before,
  .mz-anim-border--strong::after,
  .card-mz-interactive:hover::before {
    animation: none;
    opacity: 0.3;
  }
  .usage-mockup__bar::after,
  .mz-apps-sync::before,
  .mz-apps-sync::after,
  .journey-stage.is-visible:not(:last-child)::after,
  .feature-flow-connector__dot {
    animation: none;
  }
  .feature-flow-connector__dot {
    top: 50%;
    opacity: 0.6;
  }
  .ecosystem-pulse {
    display: none;
  }
}

/* ---- Responsive: lighter footprint on smaller screens ---- */

@media (max-width: 991.98px) {
  .mz-anim-border::before { opacity: calc(var(--mz-border-opacity, 0.8) * 0.75); }
  .mz-anim-border--strong::after { opacity: 0.3; }
}
@media (max-width: 575.98px) {
  .mz-anim-border--strong::after { display: none; }
  .mz-apps-sync { display: none; }
}
