/*
 * AVIEW ACCOUNTING — SCROLL MOTION ENHANCEMENT
 * Visual effects only: no changes to client copy, palette, form, links or layout.
 * Elements are visible by default; motion is activated only after JS is ready.
 */

/* Graceful no-JavaScript fallback for the original site's reveal classes. */
html:not(.motion-ready) .reveal,
html:not(.motion-ready) .reveal-left,
html:not(.motion-ready) .reveal-right {
  opacity: 1;
  transform: none;
}

/* Slim cyan scroll position indicator: no change to page height or layout. */
.scroll-progress {
  position: fixed;
  z-index: 2500;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  pointer-events: none;
  overflow: hidden;
}
.scroll-progress__bar {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(var(--scroll-progress, 0));
  transform-origin: left center;
  background: linear-gradient(90deg, #62BECE, #8FD3E0 48%, #2EC4B6);
  box-shadow: 0 0 14px rgba(98, 190, 206, .55);
  will-change: transform;
}

/* Unified, GPU-friendly entry transitions. Varied direction per content block. */
html.motion-ready .motion-item {
  --motion-x: 0px;
  --motion-y: 33px;
  --motion-scale: 1;
  opacity: 0;
  transform: translate3d(var(--motion-x), var(--motion-y), 0) scale(var(--motion-scale));
  filter: blur(5px);
  transition-property: opacity, transform, filter;
  transition-duration: .86s, .96s, .86s;
  transition-timing-function: ease-out, cubic-bezier(.16, 1, .3, 1), ease-out;
  transition-delay: var(--motion-delay, 0ms);
}
html.motion-ready .motion-item.motion-left { --motion-x: -38px; --motion-y: 11px; }
html.motion-ready .motion-item.motion-right { --motion-x: 38px; --motion-y: 11px; }
html.motion-ready .motion-item.motion-card { --motion-y: 41px; --motion-scale: .965; }
html.motion-ready .motion-item.motion-soft { --motion-y: 18px; }
html.motion-ready .motion-item.is-inview {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  filter: blur(0);
}

/* Preserve the site's existing interactive lift/hover effects after reveals. */
html.motion-ready .mv-card.motion-item.is-inview:hover { transform: translateY(-5px); }
html.motion-ready .value-card.motion-item.is-inview:hover { transform: translateY(-8px); }
html.motion-ready .service-card.motion-item.is-inview:hover { transform: translateY(-7px); }

/* Brand-accent line draws from left when each section title comes into view. */
html.motion-ready .section-label::before {
  transform: scaleX(.12);
  transform-origin: left center;
  opacity: .45;
  transition: transform .78s cubic-bezier(.16,1,.3,1), opacity .6s ease;
}
html.motion-ready .section-label.is-inview::before {
  transform: scaleX(1);
  opacity: 1;
}
html.motion-ready .gold-line {
  transform-origin: left center;
}

/* Hero's individual service rows arrive gently after the panel. */
html.motion-ready .hero-right .hero-service-item { opacity: 0; }
html.motion-ready .hero-right.is-inview .hero-service-item {
  opacity: 1;
  animation: aview-row-enter .7s cubic-bezier(.16,1,.3,1) backwards;
}
html.motion-ready .hero-right.is-inview .hero-service-item:nth-child(1) { animation-delay: .24s; }
html.motion-ready .hero-right.is-inview .hero-service-item:nth-child(2) { animation-delay: .32s; }
html.motion-ready .hero-right.is-inview .hero-service-item:nth-child(3) { animation-delay: .40s; }
html.motion-ready .hero-right.is-inview .hero-service-item:nth-child(4) { animation-delay: .48s; }
@keyframes aview-row-enter {
  from { opacity: 0; transform: translate3d(18px, 0, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* Icons and cyan service-top accents get a discreet second beat. */
html.motion-ready .value-card.is-inview .value-icon-wrap,
html.motion-ready .mv-card.is-inview .mv-icon {
  animation: aview-icon-settle .7s cubic-bezier(.16,1,.3,1) both;
  animation-delay: calc(var(--motion-delay, 0ms) + 260ms);
}
@keyframes aview-icon-settle {
  from { opacity: .5; transform: translateY(10px) scale(.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
html.motion-ready .service-card .service-card-accent {
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .95s cubic-bezier(.16,1,.3,1);
}
html.motion-ready .service-card.is-inview .service-card-accent {
  transform: scaleX(1);
  transition-delay: calc(var(--motion-delay, 0ms) + 190ms);
}

/* Gentle list cascade without causing content reflow. */
html.motion-ready .service-card.is-inview .service-feature {
  animation: aview-feature-enter .46s ease-out both;
  animation-delay: calc(var(--motion-delay, 0ms) + var(--feature-delay, 0ms) + 210ms);
}
@keyframes aview-feature-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Very subtle, continuous ambient hero movement during scrolling. */
@media (min-width: 901px) {
  html.motion-ready #home .hero-grid {
    transform: translate3d(0, var(--hero-parallax, 0px), 0);
    will-change: transform;
  }
}
html.motion-ready #home .hero-pattern {
  animation: aview-glow-breathe 11s ease-in-out infinite alternate;
  transform-origin: 75% 42%;
}
@keyframes aview-glow-breathe {
  from { opacity: .83; transform: scale(1); }
  to { opacity: 1; transform: scale(1.045); }
}

/* Keep animations smooth and gentle on touch devices. */
@media (max-width: 640px) {
  .scroll-progress { height: 2px; }
  html.motion-ready .motion-item {
    --motion-y: 21px;
    --motion-x: 0px;
    filter: none;
    transition-duration: .62s, .72s, .62s;
  }
  html.motion-ready .motion-item.motion-card { --motion-y: 27px; --motion-scale: .985; }
}

/* Respect motion sensitivities and never conceal content. */
@media (prefers-reduced-motion: reduce) {
  .scroll-progress__bar { will-change: auto; }
  html.motion-ready .motion-item,
  html.motion-ready .motion-item.is-inview,
  html.motion-ready .hero-right .hero-service-item,
  html.motion-ready .service-card .service-card-accent,
  html.motion-ready .section-label::before {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    animation: none !important;
    transition: none !important;
  }
  html.motion-ready .hero-pattern { animation: none !important; }
  html.motion-ready .service-card.is-inview .service-feature,
  html.motion-ready .value-card.is-inview .value-icon-wrap,
  html.motion-ready .mv-card.is-inview .mv-icon {
    animation: none !important;
  }
}

/* Side reveals switch to vertical entry on narrower screens to prevent
   transient horizontal overflow while cards are still offscreen. */
@media (max-width: 900px) {
  html.motion-ready .motion-item.motion-left,
  html.motion-ready .motion-item.motion-right {
    --motion-x: 0px;
    --motion-y: 26px;
  }
}
@media (max-width: 640px) {
  html.motion-ready .motion-item.motion-left,
  html.motion-ready .motion-item.motion-right { --motion-y: 21px; }
}
