/* Motion-only hooks for src/js/main.js (homepage). Loaded after styles.css.
   Every rule here only applies to classes/elements that main.js adds, except the reduced-motion
   hero gate, which has a failsafe that shows the hero by itself if the script never runs. */

/* Reduced motion: the hero still fades in (opacity only, ~0.45 s from main.js), so it starts
   hidden until main.js adds .hero-go. The failsafe below shows it by itself after 2.5 s
   if the script never runs. */
@media (scripting:enabled) and (prefers-reduced-motion:reduce){
  html:not(.hero-go) :is(.hero .hero-title,.hero .fade){opacity:0;animation:motion-failsafe .45s ease-out 2.5s forwards !important}
}
@keyframes motion-failsafe{to{opacity:1}}

/* Split project headings: room for descenders/accents inside the line masks */
.project h3 .line-mask{padding:.08em 0 .1em;margin:-.08em 0 -.1em}

/* Security: the aqua top line of each point is drawn by a span (scaleX from the left) */
.sec-list li.has-line{position:relative;border-top-color:transparent}
.sec-line{position:absolute;left:0;right:0;top:-2px;height:2px;background:var(--aqua);transform-origin:0 50%;pointer-events:none}

/* Process: progress line along the steps (pseudo-elements: nothing for screen readers),
   filled by main.js through --steps-p (0..1) with scaleX, never width */
.steps.has-progress{position:relative}
.steps.has-progress::before,.steps.has-progress::after{content:"";position:absolute;left:0;right:0;top:-30px;height:3px;border-radius:3px;pointer-events:none}
.steps.has-progress::before{background:rgba(11,122,113,.16)}
.steps.has-progress::after{background:var(--lagoon);transform-origin:0 50%;transform:scaleX(var(--steps-p,0))}
/* one column of steps (phones): the line runs down the left edge instead */
@media (max-width:575px){
  .steps.has-progress::before,.steps.has-progress::after{left:-14px;right:auto;top:0;bottom:0;width:3px;height:auto}
  .steps.has-progress::after{transform-origin:50% 0;transform:scaleY(var(--steps-p,0))}
}

/* Services drawings: shapes scale around their own box (bars grow from their own bottom) */
.svc-art *{transform-box:fill-box}

/* Cards: tilt/press are set by main.js; no grey tap flash, no double-tap zoom delay */
.svc,.project{-webkit-tap-highlight-color:transparent;touch-action:manipulation}

/* Phones: sticky WhatsApp button hidden while the hero's own buttons are on screen (html.wa-on is
   toggled by src/js/ui-shared.js with an IntersectionObserver; no JS = always shown). 180 ms fade,
   instant with reduced motion; never a running animation. */
.wa-sticky{transition:scale 140ms cubic-bezier(.23,1,.32,1),opacity 180ms cubic-bezier(.16,1,.3,1),visibility 0s linear 0s}
@media (max-width:560px){
  html.wa-js:not(.wa-on) .wa-sticky{opacity:0;visibility:hidden;pointer-events:none;transition:scale 140ms cubic-bezier(.23,1,.32,1),opacity 180ms cubic-bezier(.16,1,.3,1),visibility 0s linear 180ms}
}
@media (prefers-reduced-motion:reduce){.wa-sticky{transition:opacity 180ms ease,visibility 0s linear 0s}html.wa-js:not(.wa-on) .wa-sticky{transition:opacity 180ms ease,visibility 0s linear 180ms}}
