/* Motion for SPOS Solutions. CSS only. Durations and curves are the tokens in site.css (Carbon's values).
   Productive motion answers an action (hover, press). Expressive motion tells the story (hero, scroll).
   Only opacity, translate and stroke-dashoffset animate. Nothing here hides content when animation is off. */

/* Page-to-page: the header stays still while the page cross-fades. Unsupported browsers load normally. */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: var(--duration-slow); animation-timing-function: var(--ease-expressive); }
::view-transition-group(site-head) { animation-duration: 0s; }

/* Hero: the pieces arrive in order. */
@keyframes rise { from { opacity: 0; translate: 0 28px; } to { opacity: 1; translate: 0 0; } }
.hero .eyebrow, .hero h1, .hero .lede, .hero .ctas, .hero .art { animation: rise var(--duration-slower) var(--ease-entrance) both; }
.hero .eyebrow { animation-delay: .05s; }
.hero h1 { animation-delay: .18s; }
.hero .lede { animation-delay: .34s; }
.hero .ctas { animation-delay: .48s; }
.hero .art { animation-delay: .3s; }

/* Hero artwork: the three pillars (be found, convert, respond) draw themselves, left to right. */
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes settle { from { opacity: 0; } }
.art .draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.8s var(--ease-expressive) forwards; animation-delay: calc(.5s + var(--i, 0) * .25s); }
.art .wash, .art .dot { animation: settle 1.2s var(--ease-expressive) both; animation-delay: 1.9s; }

/* Scroll: sections reveal as they enter, and a thin line tracks reading progress.
   Browsers without scroll-driven animation show everything in place. */
@supports (animation-timeline: view()) {
  /* Slides in without fading: text keeps full contrast the whole time, so audits that capture the page at load pass. */
  @keyframes enter { from { translate: 0 36px; } to { opacity: 1; translate: 0 0; } }
  .section h2, .section .lede, .section .eyebrow, .card, .steps li, details, .crumbs, .service-head > * {
    animation: enter linear both; animation-timeline: view(); animation-range: entry 0% entry 38%;
  }
  .card:nth-child(2) { animation-range: entry 6% entry 44%; }
  .card:nth-child(3) { animation-range: entry 12% entry 50%; }

  @keyframes progress { from { scale: 0 1; } to { scale: 1 1; } }
  body::after { content: ""; position: fixed; top: 0; left: 0; right: 0; height: 2px; background: var(--accent); transform-origin: 0 50%; z-index: 60; animation: progress linear both; animation-timeline: scroll(root); }
}

/* Buttons: a press response. The lean toward the pointer is added in app.js. */
md-filled-button, md-outlined-button { transition: translate var(--duration-moderate) var(--ease-productive); }
md-filled-button:active, md-outlined-button:active { scale: .98; }

/* Reduced motion: everything is in place at once, with no movement. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0s !important; scroll-behavior: auto !important; }
  .art .draw { stroke-dashoffset: 0; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
