/*
  WebCraft KZ motion layer — visual effects only.
  HOW TO DISABLE: remove this stylesheet link from a page.
  SCROLL REVEAL: remove .motion-reveal rules below or the data selector in motion.js.
  HERO FLOAT/TILT: remove .motion-hero-float / .motion-hero-tilt rules.
  CARD TILT/GLARE: remove .motion-tilt / .motion-glare rules.
  BUTTON MOTION: remove .motion-button rules.
  PROCESS: remove .motion-process rules.
  ORBS: remove .motion-orb rules.
  All effects are transform/opacity only and are gated by prefers-reduced-motion.
*/

@media (prefers-reduced-motion: no-preference) {
  /* JavaScript adds .js; without JS every element remains fully visible. */
  html.js .motion-reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .65s cubic-bezier(.22,1,.36,1), transform .65s cubic-bezier(.22,1,.36,1);
  }
  html.js .motion-reveal.motion-visible {
    opacity: 1;
    transform: translateY(0);
  }

  /* Small stagger, capped so long grids never feel delayed. */
  html.js .motion-stagger-1 { transition-delay: 0ms; }
  html.js .motion-stagger-2 { transition-delay: 80ms; }
  html.js .motion-stagger-3 { transition-delay: 160ms; }
  html.js .motion-stagger-4 { transition-delay: 240ms; }
  html.js .motion-stagger-5 { transition-delay: 320ms; }
  html.js .motion-stagger-6 { transition-delay: 400ms; }

  /* Hero entrance: no layout movement, only visual transform/opacity. */
  html.js .motion-hero-text > * {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .6s cubic-bezier(.22,1,.36,1), transform .6s cubic-bezier(.22,1,.36,1);
  }
  html.js .motion-hero-text.motion-loaded > * { opacity: 1; transform: translateY(0); }
  html.js .motion-hero-text.motion-loaded > *:nth-child(1) { transition-delay: 40ms; }
  html.js .motion-hero-text.motion-loaded > *:nth-child(2) { transition-delay: 100ms; }
  html.js .motion-hero-text.motion-loaded > *:nth-child(3) { transition-delay: 160ms; }
  html.js .motion-hero-text.motion-loaded > *:nth-child(4) { transition-delay: 220ms; }
  html.js .motion-hero-text.motion-loaded > *:nth-child(5) { transition-delay: 280ms; }

  /* Hero browser: gentle 6s float. JS pauses it when off-screen. */
  .motion-hero-float {
    transform-origin: 50% 50%;
    animation: wcHeroFloat 6s ease-in-out infinite;
    will-change: transform;
  }
  .motion-hero-float.motion-paused { animation-play-state: paused; }
  @keyframes wcHeroFloat {
    0%,100% { transform: translateY(-8px) rotateX(1deg) rotateY(-2deg); }
    50% { transform: translateY(8px) rotateX(-1deg) rotateY(2deg); }
  }
  .motion-hero-tilt { transform-style: preserve-3d; transition: transform .45s cubic-bezier(.22,1,.36,1); }

  /* Cards: desktop pointer tilt only. Glare is a transformed pseudo-element. */
  .motion-tilt {
    position: relative;
    transform-style: preserve-3d;
    transition: transform .55s cubic-bezier(.22,1,.36,1);
  }
  .motion-tilt::after {
    content: "";
    position: absolute;
    inset: -40%;
    pointer-events: none;
    border-radius: inherit;
    background: linear-gradient(115deg, transparent 38%, rgba(255,255,255,.10) 50%, transparent 62%);
    opacity: 0;
    transform: translate3d(-28%,0,0) rotate(8deg);
    transition: opacity .5s cubic-bezier(.22,1,.36,1), transform .65s cubic-bezier(.22,1,.36,1);
  }
  .motion-tilt.motion-glare-active::after {
    opacity: .55;
    transform: translate3d(28%,0,0) rotate(8deg);
  }
  .motion-tilt.motion-tilt-active {
    transition: transform .16s linear;
    box-shadow: 0 18px 42px rgba(0,0,0,.18);
  }

  /* Featured Business card: slow, subtle glow using opacity only. */
  .motion-featured-glow {
    position: relative;
  }
  .motion-featured-glow::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    border: 1px solid rgba(37,99,235,.7);
    opacity: .25;
    pointer-events: none;
    animation: wcFeaturedGlow 3.2s ease-in-out infinite;
  }
  @keyframes wcFeaturedGlow {
    0%,100% { opacity: .2; }
    50% { opacity: .75; }
  }
  .motion-featured-glow.motion-paused::before { animation-play-state: paused; }

  /* Buttons: visual lift only. */
  .motion-button {
    position: relative;
    overflow: hidden;
    transform: translateY(0);
    transition: transform .45s cubic-bezier(.22,1,.36,1);
  }
  .motion-button::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -65%;
    width: 45%;
    pointer-events: none;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,.18), transparent);
    opacity: 0;
    transform: translate3d(0,0,0) skewX(-18deg);
    transition: opacity .35s ease, transform .65s cubic-bezier(.22,1,.36,1);
  }
  .motion-button:hover,
  .motion-button:focus-visible { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0,0,0,.18); }
  .motion-button:hover::after,
  .motion-button:focus-visible::after { opacity: 1; transform: translate3d(280%,0,0) skewX(-18deg); }
  .motion-button:active { transform: scale(.98); }

  /* Header: sticky header gets depth after 20px; no hide-on-scroll behavior. */
  .wc-header.motion-scrolled {
    box-shadow: 0 12px 34px rgba(0,0,0,.18);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  .wc-links a:not(.wc-cta) { position: relative; }
  .wc-links a:not(.wc-cta)::after {
    content: "";
    position: absolute;
    left: 10%;
    right: 10%;
    bottom: 4px;
    height: 1px;
    background: var(--blue);
    opacity: 0;
    transform: scaleX(0);
    transform-origin: center;
    transition: opacity .4s cubic-bezier(.22,1,.36,1), transform .4s cubic-bezier(.22,1,.36,1);
  }
  .wc-links a:not(.wc-cta):hover::after,
  .wc-links a:not(.wc-cta):focus-visible::after { opacity: 1; transform: scaleX(1); }

  /* Process sequence: each number appears in order; connector is decorative only. */
  html.js .motion-process .process-num,
  html.js .motion-process .process-item::after {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .55s cubic-bezier(.22,1,.36,1), transform .55s cubic-bezier(.22,1,.36,1);
  }
  html.js .motion-process.motion-visible .process-num,
  html.js .motion-process.motion-visible .process-item::after { opacity: 1; transform: translateY(0); }
  html.js .motion-process.motion-visible .process-item:nth-child(1) .process-num,
  html.js .motion-process.motion-visible .process-item:nth-child(1)::after { transition-delay: 0ms; }
  html.js .motion-process.motion-visible .process-item:nth-child(2) .process-num,
  html.js .motion-process.motion-visible .process-item:nth-child(2)::after { transition-delay: 100ms; }
  html.js .motion-process.motion-visible .process-item:nth-child(3) .process-num,
  html.js .motion-process.motion-visible .process-item:nth-child(3)::after { transition-delay: 200ms; }
  html.js .motion-process.motion-visible .process-item:nth-child(4) .process-num,
  html.js .motion-process.motion-visible .process-item:nth-child(4)::after { transition-delay: 300ms; }
  html.js .motion-process.motion-visible .process-item:nth-child(5) .process-num,
  html.js .motion-process.motion-visible .process-item:nth-child(5)::after { transition-delay: 400ms; }
  .motion-process .process-item { position: relative; }
  .motion-process .process-item:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 34px;
    bottom: -24px;
    width: 1px;
    height: 24px;
    background: rgba(37,99,235,.45);
    pointer-events: none;
  }

  /* Hero background orbs. Existing layout remains untouched. */
  .motion-orbs { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
  .motion-orb {
    position: absolute;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    filter: blur(45px);
    opacity: .10;
    transform: translate3d(0,0,0);
    animation: wcOrbDrift 10s ease-in-out infinite;
    will-change: transform;
  }
  .motion-orb:nth-child(1) { left: 8%; top: 20%; background: #2563EB; }
  .motion-orb:nth-child(2) { right: 10%; top: 38%; background: #60A5FA; animation-delay: -3.5s; }
  .motion-orb:nth-child(3) { right: 34%; bottom: 4%; background: #1D4ED8; animation-delay: -7s; }
  @keyframes wcOrbDrift {
    0%,100% { transform: translate3d(0,0,0); }
    50% { transform: translate3d(20px,-14px,0); }
  }
  .motion-orbs.motion-paused .motion-orb { animation-play-state: paused; }
}

@media (prefers-reduced-motion: reduce) {
  .motion-hero-float,
  .motion-featured-glow::before,
  .motion-orb { animation: none !important; }
  .motion-button::after,
  .motion-tilt::after { display: none; }
}

/* Touch/mobile: no tilt, parallax, floating 3D, glare, or animated orbs. */
@media (max-width: 767px), (pointer: coarse) {
  .motion-hero-float,
  .motion-hero-tilt,
  .motion-tilt,
  .motion-featured-glow::before,
  .motion-orbs { animation: none !important; transform: none !important; }
  .motion-tilt::after { display: none; }
  .motion-button:hover,
  .motion-button:focus-visible,
  .motion-button:active { transform: none; box-shadow: none; }
  .motion-button::after { display: none; }
}
