/* SharpStep motion v10: dependency-free. Pairs with motion.js. Uses the live site's tokens (--c-*, --ease-*), with fallbacks.
   Rules: transform + opacity only · zero CLS · nothing hides the LCP element · reduced motion = static. */
:root {
  --ssm-expo: var(--ease-expo-out, cubic-bezier(.16,1,.3,1));
  --ssm-quart: var(--ease-quart-out, cubic-bezier(.25,1,.5,1));
  --ssm-quart-in: var(--ease-quart-in, cubic-bezier(.5,0,.75,0));
  --ssm-spring: var(--ease-logo-spring, cubic-bezier(.34,1.56,.64,1));
  --ssm-blue: var(--c-blue, #2563ff);
  --ssm-sky: var(--c-sky, #38bdf8);
  --ssm-ink: var(--c-ink, #0b1020);
}
.ss-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 1. HERO ENTRANCE (pure CSS, runs on first paint; no JS wait) ---------- */
/* Logo draw: [data-ss-logo-draw] wraps an inline Step Arrow SVG (paths need pathLength="1"; motion.js adds it if missing). */
[data-ss-logo-draw] [data-part^="mark-"],
[data-ss-logo-draw] > path { stroke: currentColor; stroke-width: .45; stroke-linejoin: round; }
/* Headline lines: H1 stays opacity 1 (LCP-safe), lines only rise. */
[data-ss-hero-line] { display: block; }
[data-ss-underline] { position: relative; display: inline-block; }
[data-ss-underline]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -.04em; height: clamp(4px,.08em,9px);
  border-radius: 999px; background: var(--ss-underline, var(--ssm-blue)); transform-origin: left; }
[data-ss-gradient-text] { background: var(--w-grad-text-light, linear-gradient(100deg,#1E40FF 0%,#2563FF 70%,#FF4FA3 120%)); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.dark-section [data-ss-gradient-text], .cta-band [data-ss-gradient-text] { background-image: var(--w-grad-text-dark, linear-gradient(100deg,#6E9BFF 0%,#38BDF8 65%,#FF4FA3 115%)); }

@media (prefers-reduced-motion: no-preference) {
  [data-ss-logo-draw] [data-part^="mark-"] { stroke-dasharray: 1; stroke-dashoffset: 1; fill-opacity: 0;
    animation: ssm-draw 520ms var(--ssm-quart) both, ssm-fill 260ms var(--ssm-quart) both; }
  [data-ss-logo-draw] [data-part="mark-step-1"] { animation-delay: 0ms, 380ms; }
  [data-ss-logo-draw] [data-part="mark-step-2"] { animation-delay: 80ms, 460ms; }
  [data-ss-logo-draw] [data-part="mark-step-3"] { animation-delay: 160ms, 540ms; }
  [data-ss-logo-draw] [data-part="mark-arrow"] { transform-box: fill-box; transform-origin: 0 100%;
    animation: ssm-draw 520ms var(--ssm-quart) 240ms both, ssm-fill 260ms var(--ssm-quart) 620ms both, ssm-arrow 520ms var(--ssm-spring) 600ms both; }

  [data-ss-hero-line] { animation: ssm-rise 900ms var(--ssm-expo) both; }
  [data-ss-hero-line]:nth-child(2) { animation-delay: 80ms; }
  [data-ss-hero-line]:nth-child(3) { animation-delay: 160ms; }
  [data-ss-underline]::after { animation: ssm-scalex 700ms var(--ssm-expo) 420ms both; }
  [data-ss-hero-fade] { animation: ssm-fade-up 700ms var(--ssm-expo) var(--d, 240ms) both; }

  /* Banner panel + chips: panel scales in, chips stagger 60ms (data-ss-chips on the parent). */
  [data-ss-panel] { animation: ssm-panel 900ms var(--ssm-expo) 200ms both; }
  [data-ss-chips] > * { animation: ssm-chip 600ms var(--ssm-spring) both; animation-delay: calc(560ms + var(--i, 0) * 60ms); }
  [data-ss-chips] > :nth-child(1) { --i: 0 } [data-ss-chips] > :nth-child(2) { --i: 1 } [data-ss-chips] > :nth-child(3) { --i: 2 }
  [data-ss-chips] > :nth-child(4) { --i: 3 } [data-ss-chips] > :nth-child(5) { --i: 4 } [data-ss-chips] > :nth-child(6) { --i: 5 }
  [data-ss-chips] > :nth-child(7) { --i: 6 } [data-ss-chips] > :nth-child(8) { --i: 7 }
}
@keyframes ssm-draw { to { stroke-dashoffset: 0; } }
@keyframes ssm-fill { to { fill-opacity: 1; } }
@keyframes ssm-arrow { from { transform: translate(-18%, 18%); } to { transform: none; } }
@keyframes ssm-rise { from { transform: translateY(.35em); } }
@keyframes ssm-scalex { from { transform: scaleX(0); } }
@keyframes ssm-fade-up { from { opacity: 0; transform: translateY(16px); } }
@keyframes ssm-panel { from { opacity: 0; transform: translateY(24px) scale(.98); } }
@keyframes ssm-chip { from { opacity: 0; transform: translateY(10px) scale(.92); } }

/* iOS hotfix: the H1 is the LCP, so its intro is TRANSFORM-ONLY (ssm-rise has no opacity key):
   it paints at full opacity on frame 1 (LCP unchanged) and then slides up. Do not set animation: none here. */

/* ---------- 2. TYPED LIVE AGENT DEMO ---------- */
[data-ss-demo-stage] { position: relative; height: auto; min-height: 0; overflow: visible; display: flex; flex-direction: column; justify-content: flex-start; align-self: start; gap: .6rem; z-index: 1; }
.ssm-msg { max-width: 82%; min-width: 0; padding: .7rem 1rem; border-radius: 1.1rem; line-height: 1.4; transform-origin: left bottom; white-space: normal; overflow-wrap: anywhere; }
.ssm-msg[data-from="customer"] { align-self: flex-start; background: #fff; color: #0B1020; border: 1px solid rgba(11,16,32,.08); border-bottom-left-radius: .35rem; }
.ssm-msg[data-from="agent"] { align-self: flex-end; background: var(--ssm-blue); color: #fff; border-bottom-right-radius: .35rem; transform-origin: right bottom; }
.ssm-who { display: block; font-size: .75rem; font-weight: 600; opacity: .75; margin-bottom: .15rem; }
.ssm-typing { align-self: flex-end; display: inline-flex; gap: 4px; padding: .8rem 1rem; border-radius: 1.1rem; background: var(--ssm-blue); }
.ssm-typing i { width: 6px; height: 6px; border-radius: 50%; background: #fff; opacity: .5; }
.ssm-chips { display: flex; flex-wrap: wrap; gap: .4rem; align-self: flex-end; }
.ssm-chip { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .7rem; border-radius: 999px; font-size: .8125rem; font-weight: 600;
  background: rgba(37,99,255,.1); color: var(--w-electric, #1e40ff); border: 1px solid rgba(37,99,255,.25); }
.ssm-chip::before { content: "✓"; font-weight: 700; } /* icon + text: never colour alone */
.ssm-caret { display: inline-block; width: 2px; height: 1em; margin-left: 1px; vertical-align: -.15em; background: currentColor; }
[data-ss-demo-tab][aria-selected="true"] { background: var(--w-electric-fill, #1e40ff); color: #fff; box-shadow: none; }
[data-ss-demo-progress] { transform-origin: left; transform: scaleX(0); }
@media (prefers-reduced-motion: no-preference) {
  .ssm-in { animation: ssm-pop 420ms var(--ssm-spring) both; }
  .ssm-out { animation: ssm-out 220ms var(--ssm-quart-in) both; }
  .ssm-typing i { animation: ssm-dot 1s ease-in-out infinite; }
  .ssm-typing i:nth-child(2) { animation-delay: .15s } .ssm-typing i:nth-child(3) { animation-delay: .3s }
  .ssm-caret { animation: ssm-blink 1s steps(1) infinite; }
}
@media (prefers-reduced-motion: reduce) { .ssm-caret, .ssm-typing { display: none; } }
@keyframes ssm-pop { from { opacity: 0; transform: translateY(10px) scale(.94); } }
@keyframes ssm-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes ssm-dot { 0%,100% { transform: translateY(0); opacity: .45 } 50% { transform: translateY(-4px); opacity: 1 } }
@keyframes ssm-blink { 50% { opacity: 0 } }

/* ---------- 3. SCROLL-DRIVEN BEFORE / AFTER (clip, not a sliding text layer) ---------- */
[data-ss-ba] { position: relative; overflow: hidden; isolation: isolate; touch-action: pan-y; --pos: 0%; --p: 0; container-type: inline-size; }
[data-ss-ba] > [data-ss-ba-before],
[data-ss-ba] > [data-ss-ba-after] { position: absolute; top: 0; bottom: 0; left: 0; overflow: hidden; }
[data-ss-ba] > [data-ss-ba-before] { right: 0; clip-path: inset(0 0 0 var(--pos, 0%)); }
[data-ss-ba] > [data-ss-ba-after] { width: var(--pos, 0%); clip-path: inset(0 0 0 0); }
[data-ss-ba] > [data-ss-ba-before],
[data-ss-ba-after] > [data-ss-ba-inner] { position: absolute; top: 0; bottom: 0; left: 0; width: 100cqi; max-width: none; }
[data-ss-ba] .glass-card-dark { background: #131d47; }
[data-ss-ba] .glass-card-dark p { max-width: 36rem; }
[data-ss-ba] .glass-card-dark:hover { transform: none; }
@media (prefers-reduced-motion: reduce) {
  [data-ss-ba] { --pos: 50%; --p: .5; }
}
[data-ss-ba-handle] { position: absolute; top: 0; bottom: 0; left: 0; width: 44px; margin-left: -22px; z-index: 3; cursor: ew-resize;
  transform: translateX(calc(var(--p, .5) * var(--ba-w, 0px))); display: grid; place-items: center; background: none; border: 0; padding: 0; }
[data-ss-ba-handle]::before { content: ""; position: absolute; top: 0; bottom: 0; left: 21px; width: 2px; background: linear-gradient(var(--ssm-sky), var(--ssm-blue)); box-shadow: 0 0 18px rgba(56,189,248,.8); }
[data-ss-ba-handle] > span { position: relative; width: 40px; height: 40px; border-radius: 50%; background: #fff; color: var(--ssm-ink); display: grid; place-items: center; font-weight: 700; box-shadow: 0 0 0 4px rgba(37,99,255,.35); }
[data-ss-ba-handle]:focus-visible > span { outline: 3px solid var(--c-yellow, #ffd60a); outline-offset: 3px; }

/* ---------- 4. COUNT-UP ---------- */
[data-ss-count] { font-variant-numeric: tabular-nums; display: inline-block; text-align: inherit; }

/* ---------- 5/6. MAGNETIC + TILT/GLOW ---------- */
[data-ss-magnetic], [data-ss-magnetic-label] { display: inline-flex; will-change: transform; }
[data-ss-tilt] { position: relative; transform-style: preserve-3d; will-change: transform; overflow: hidden; }
.ssm-glow { position: absolute; left: 0; top: 0; width: 360px; height: 360px; margin: -180px 0 0 -180px; border-radius: 50%; pointer-events: none; z-index: 0;
  background: radial-gradient(circle, var(--ss-glow, rgba(56,189,248,.35)) 0%, transparent 65%); opacity: 0; transition: opacity 240ms var(--ssm-quart); will-change: transform, opacity; }
[data-ss-tilt].is-hot .ssm-glow { opacity: 1; }
[data-ss-tilt] > :not(.ssm-glow) { position: relative; z-index: 1; }

/* ---------- 7. SCROLL REVEALS (hidden only once html.ss-js is set by the head snippet) ---------- */
@media (prefers-reduced-motion: no-preference) {
  html.ss-js [data-ss-reveal]:not(.is-in) { opacity: 0; transform: translateY(var(--ss-reveal-y, 28px)); }
  html.ss-js [data-ss-reveal="scale"]:not(.is-in) { transform: translateY(16px) scale(.96); }
  html.ss-js [data-ss-reveal="fade"]:not(.is-in) { transform: none; }
  html.ss-js [data-ss-reveal="left"]:not(.is-in) { transform: translateX(-28px); }
  [data-ss-reveal].is-in { transition: opacity 700ms var(--ssm-expo), transform 700ms var(--ssm-expo); transition-delay: var(--ss-delay, 0ms); }
}
@media (max-width: 767px) { :root { --ss-reveal-y: 16px; } }

/* ---------- 8. WORKS-WITH MARQUEE ---------- */
[data-ss-marquee] { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
[data-ss-marquee-track] { display: flex; width: max-content; }
[data-ss-marquee-track] > * { flex-shrink: 0; }
@media (prefers-reduced-motion: no-preference) {
  [data-ss-marquee-track] { animation: ssm-marquee var(--ss-marquee-dur, 36s) linear infinite; }
  [data-ss-marquee][data-dir="right"] [data-ss-marquee-track] { animation-direction: reverse; }
  [data-ss-marquee].is-off [data-ss-marquee-track] { animation-play-state: paused; }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  [data-ss-marquee]:hover [data-ss-marquee-track],
  [data-ss-marquee]:focus-within [data-ss-marquee-track] { animation-play-state: paused; }
}
@media (prefers-reduced-motion: reduce) {
  [data-ss-marquee] { -webkit-mask-image: none; mask-image: none; }
  [data-ss-marquee-track] { width: auto; flex-wrap: wrap; }
  [data-ss-marquee-track] > [aria-hidden="true"] { display: none; }
}
@keyframes ssm-marquee { to { transform: translateX(-50%); } }

/* ---------- iOS hotfix (2026-11-29): motion that is obvious on a phone with no hover/scroll ---------- */
@media (prefers-reduced-motion: no-preference) {
  h1 [data-ss-hero-line] { animation: ssm-rise 1100ms var(--ssm-expo) 120ms both; }
  h1 [data-ss-hero-line]:nth-child(2) { animation-delay: 220ms; }
  h1 [data-ss-hero-line]:nth-child(3) { animation-delay: 320ms; }
  h1 [data-ss-hero-line]:nth-child(4) { animation-delay: 420ms; }
  .hero-glow-a { animation: ssm-drift-a 11s ease-in-out infinite alternate; will-change: transform; }
  .hero-glow-b { animation: ssm-drift-b 13s ease-in-out infinite alternate; will-change: transform; }
}
@keyframes ssm-drift-a { from { transform: translate3d(-6%, 4%, 0) scale(1); } to { transform: translate3d(8%, -6%, 0) scale(1.12); } }
@keyframes ssm-drift-b { from { transform: translate3d(6%, -4%, 0) scale(1.06); } to { transform: translate3d(-8%, 6%, 0) scale(.94); } }
@media (prefers-reduced-motion: reduce) {
  h1 [data-ss-hero-line], [data-ss-hero-fade], [data-ss-panel], [data-ss-chips] > * { animation: ssm-fade-only 500ms ease-out both !important; }
  h1 [data-ss-hero-line] { animation-name: ssm-fade-lcp !important; }
  [data-ss-chips] > * { animation-delay: calc(200ms + var(--i, 0) * 80ms) !important; }
  [data-ss-reveal] { transition: opacity 400ms ease-out !important; }
  html.ss-js [data-ss-reveal]:not(.is-in) { opacity: 0; }
}
@keyframes ssm-fade-only { from { opacity: 0; } }
@keyframes ssm-fade-lcp { from { opacity: .35; } }
