@keyframes marquee{to{transform:translateX(-50%)}}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}.marquee-track{animation:none}.marquee{overflow-x:auto}.marquee-group:nth-child(2){display:none}*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}

/* Layered scroll: the next section rises over the previous one. Long sections
   remain scrollable to the end before they stick; normal flow is the fallback. */
@media (prefers-reduced-motion: no-preference){
  html.motion-ready:not(.keyboard-navigation) main>section{position:sticky;top:var(--stack-top,0px);isolation:isolate;box-shadow:0 -12px 35px rgba(0,0,0,.18)}
  html.motion-ready:not(.keyboard-navigation) main>section:nth-of-type(1){z-index:1;background:#08090e}
  html.motion-ready:not(.keyboard-navigation) main>section:nth-of-type(2){z-index:2;background:#08090e}
  html.motion-ready:not(.keyboard-navigation) main>section:nth-of-type(3){z-index:3;background:#0b0b12}
  html.motion-ready:not(.keyboard-navigation) main>section:nth-of-type(4){z-index:4;background:#0b0c12}
  html.motion-ready:not(.keyboard-navigation) main>section:nth-of-type(5){z-index:5;background:#08090e}
  html.motion-ready:not(.keyboard-navigation) main>section:nth-of-type(6){z-index:6;background:#0c0d13}
  html.motion-ready:not(.keyboard-navigation) main>section:nth-of-type(7){z-index:7;background:#08090e}
  html.motion-ready:not(.keyboard-navigation) main>section:nth-of-type(8){z-index:8}
  html.motion-ready:not(.keyboard-navigation) main>section:not(:first-child){border-radius:clamp(12px,2vw,24px) clamp(12px,2vw,24px) 0 0}
  /* Services scrolls away normally. The ticker rests below the header and
     the next section rises over it, restarting the layered effect there. */
  html.motion-ready:not(.keyboard-navigation) main>section.services{position:relative;top:auto}
  html.motion-ready:not(.keyboard-navigation) main>section.industries{border-radius:0;box-shadow:none}
  html.motion-ready .motion-card{opacity:0;transform:translateY(24px);transition:opacity 1s cubic-bezier(.22,.61,.36,1) var(--card-delay,0ms),transform 1.1s cubic-bezier(.22,.61,.36,1) var(--card-delay,0ms)}
  html.motion-ready .motion-card.motion-card-visible,html.motion-ready .motion-card:focus-within{opacity:1;transform:none}
}

/* Do not let an overlapping section obscure keyboard focus. */
html.keyboard-navigation{scroll-behavior:auto}

/* Scroll position is informative but decorative and never covers content. */
.reading-progress{position:absolute;top:0;left:0;right:0;height:2px;background:#c7b8ff;transform:scaleX(0);transform-origin:left;pointer-events:none;z-index:1}
/* Without JavaScript the ticker remains static and can be scrolled. */
html:not(.moving-text-ready) .marquee-track{animation:none}
html:not(.moving-text-ready) .marquee{overflow-x:auto}
html:not(.moving-text-ready) .marquee-group:nth-child(2){display:none}

@media (prefers-reduced-motion:no-preference){
  /* Subtle hover and focus feedback. */
  .button span:last-child,.text-link span,.card-arrow,.service-icon,.tool-icon,.step-toggle{transition:transform .24s cubic-bezier(.2,.7,.2,1)}
  .button:hover span:last-child,.button:focus-visible span:last-child,.text-link:hover span,.text-link:focus-visible span{transform:translate(3px,-3px)}
  .service-card:hover .card-arrow{transform:translate(3px,-3px)}
  .service-card:hover .service-icon,.tool-card:hover .tool-icon{transform:translateY(-3px)}
  .process-step summary:hover .step-toggle,.process-step summary:focus-visible .step-toggle{transform:scale(1.08)}
  .filter{transition:background-color .2s ease,border-color .2s ease,color .2s ease,transform .2s ease}
  .filter:hover,.filter:focus-visible{transform:translateY(-2px)}
  .field input,.field select,.field textarea{transition:border-color .2s ease}
  .field input:focus,.field select:focus,.field textarea:focus{border-bottom-color:#c6b8fb}
}
@media (prefers-reduced-motion:reduce){.reading-progress{display:none}}

/* All eight cards follow one smoothed scroll position together. */
@media (prefers-reduced-motion: no-preference) {
  .services.service-flight-clip, .skills.skills-flight-clip { overflow: hidden; overflow: clip; }
  .service-flight-ready .service-card, .skills-flight-ready .tool-card {
    opacity: var(--flight-opacity, 1);
    translate: var(--flight-x, 0px) var(--flight-y, 0px);
    transition: transform .3s, border-color .3s, background .3s;
  }
  html.keyboard-navigation .service-flight-ready .service-card,
  .service-flight-ready .service-card:focus-within,
  html.keyboard-navigation .skills-flight-ready .tool-card,
  .skills-flight-ready .tool-card:focus-within { opacity: 1; translate: 0 0; }
}


/* A single once-only fade for content; no movement of layout or controls. */
@media (prefers-reduced-motion: no-preference) and (forced-colors: none) {
  html.content-fade-ready .content-fade-item {
    opacity: 0;
  }
  html.content-fade-ready .content-fade-item.content-fade-visible {
    opacity: 1;
    transition: opacity 1s cubic-bezier(.22,.61,.36,1) var(--content-fade-delay, 120ms);
  }
  html.content-fade-ready.keyboard-navigation .content-fade-item,
  html.content-fade-ready .content-fade-item:focus-within { opacity: 1; transition: none; }
}
