/* Motion for the website (motion.js): how things appear as you scroll, how they answer the pointer, and the small
   animations inside the widgets. Everything here is decoration: without JavaScript or with reduced motion the page is
   simply there. Shared by index, business, families and pricing. */

:root { --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1); --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1); }

/* ---- appearing on scroll ---- */
.motion-ready .reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.85s var(--ease-out), transform 0.85s var(--ease-out); transition-delay: calc(var(--i, 0) * 80ms); }
.motion-ready .reveal[data-reveal="left"] { transform: translateX(-30px); }
.motion-ready .reveal[data-reveal="right"] { transform: translateX(30px); }
.motion-ready .reveal[data-reveal="scale"] { transform: scale(0.94); }
.motion-ready .reveal.is-visible { opacity: 1; transform: none; }
/* the hero arrives on load */
.motion-ready .hero-content > *, .motion-ready .sol-hero-copy > * { opacity: 0; transform: translateY(18px); animation: rise 0.9s var(--ease-out) forwards; }
.motion-ready .hero-content > :nth-child(2), .motion-ready .sol-hero-copy > :nth-child(2) { animation-delay: 0.1s; }
.motion-ready .hero-content > :nth-child(3), .motion-ready .sol-hero-copy > :nth-child(3) { animation-delay: 0.2s; }
.motion-ready .hero-content > :nth-child(4), .motion-ready .sol-hero-copy > :nth-child(4) { animation-delay: 0.3s; }
.motion-ready .hero-content > :nth-child(n + 5), .motion-ready .sol-hero-copy > :nth-child(n + 5) { animation-delay: 0.4s; }
.motion-ready .journey-tag { opacity: 0; animation: rise 0.9s var(--ease-out) 0.7s forwards; }
.motion-ready .sol-hero-art { opacity: 0; animation: rise 1s var(--ease-out) 0.3s forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---- inside the widgets, once they are in view ---- */
/* the alert cards slide in one after another */
.motion-ready .bento-safety .alert-card { opacity: 0; transform: translateX(-24px) rotate(-2deg); transition: opacity 0.6s var(--ease-out), transform 0.7s var(--ease-spring); }
.motion-ready .bento-safety.is-visible .alert-card { opacity: 1; transform: rotate(-2deg); transition-delay: 0.3s; }
.motion-ready .bento-safety.is-visible .alert-card + .alert-card { transform: rotate(1deg); transition-delay: 0.5s; }
.motion-ready .bento-safety.is-visible .alert-card:nth-child(3) { transform: rotate(-1deg); transition-delay: 0.7s; }
/* the journey line draws itself */
.motion-ready .trip-sparkline path { stroke-dasharray: 1200; stroke-dashoffset: 1200; }
.motion-ready .bento-history.is-visible .trip-sparkline path { animation: draw 1.8s var(--ease-out) 0.3s forwards; }
.motion-ready .trip-line i { transform: scale(0); transition: transform 0.5s var(--ease-spring); }
.motion-ready .bento-history.is-visible .trip-line i { transform: scale(1); transition-delay: 0.4s; }
.motion-ready .bento-history.is-visible .trip-line i:last-of-type { transition-delay: 1.6s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
/* the service meter fills, the fuel bar grows */
.motion-ready .meter-fill { stroke-dasharray: 0 252; transition: stroke-dasharray 1.6s var(--ease-out) 0.3s; }
.motion-ready .bento-care.is-visible .meter-fill { stroke-dasharray: 183 252; }
.motion-ready .sensor-progress i { transform-origin: left; transform: scaleX(0); transition: transform 1.2s var(--ease-out) 0.4s; }
.motion-ready .bento-sensors.is-visible .sensor-progress i { transform: scaleX(1); }
.motion-ready .sensor-tiles > div { opacity: 0; transform: translateY(14px); transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out); }
.motion-ready .bento-sensors.is-visible .sensor-tiles > div { opacity: 1; transform: none; transition-delay: 0.25s; }
.motion-ready .bento-sensors.is-visible .sensor-tiles > div + div { transition-delay: 0.4s; }
/* the phone and its toast */
.motion-ready .phone-scene .phone { transform: rotate(5deg) translateY(30px); opacity: 0; transition: transform 1s var(--ease-out), opacity 0.8s var(--ease-out); }
.motion-ready .phone-scene.is-visible .phone { transform: rotate(5deg); opacity: 1; }
.motion-ready .signature-toast { opacity: 0; transform: translateX(-20px) rotate(-4deg); transition: opacity 0.6s var(--ease-out) 0.8s, transform 0.7s var(--ease-spring) 0.8s; }
.motion-ready .phone-scene.is-visible .signature-toast { opacity: 1; transform: rotate(-4deg); }
.motion-ready .phone-scene.is-visible .phone-orbit { animation: breathe 7s ease-in-out infinite; }
.motion-ready .phone-scene.is-visible .orbit-two { animation-delay: -3.5s; }
@keyframes breathe { 50% { transform: scale(1.03); opacity: 0.7; } }
/* the fleet stage: the live map's pins pop, the alert slides in */
.motion-ready .fleet-stage .fleet-marker { opacity: 0; transform: scale(0.5); transition: opacity 0.5s var(--ease-out), transform 0.6s var(--ease-spring); }
.motion-ready .fleet-stage.is-visible .fleet-marker { opacity: 1; transform: none; }
.motion-ready .fleet-stage.is-visible .fleet-marker:nth-of-type(2) { transition-delay: 0.15s; }
.motion-ready .fleet-stage.is-visible .fleet-marker:nth-of-type(3) { transition-delay: 0.3s; }
.motion-ready .fleet-stage.is-visible .fleet-marker:nth-of-type(4) { transition-delay: 0.45s; }
.motion-ready .fleet-stage.is-visible .fleet-marker:nth-of-type(5) { transition-delay: 0.6s; }
.motion-ready .fleet-stage .fleet-toast { opacity: 0; transform: translateY(14px); transition: opacity 0.6s var(--ease-out) 0.9s, transform 0.6s var(--ease-out) 0.9s; }
.motion-ready .fleet-stage.is-visible .fleet-toast { opacity: 1; transform: none; }
.motion-ready .fleet-points li { opacity: 0; transform: translateX(-10px); transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out); }
.motion-ready .fleet-stage.is-visible .fleet-points li { opacity: 1; transform: none; }
.motion-ready .fleet-stage.is-visible .fleet-points li:nth-child(2) { transition-delay: 0.12s; }
.motion-ready .fleet-stage.is-visible .fleet-points li:nth-child(3) { transition-delay: 0.24s; }
/* the hardware orbit: the nodes pop in and float */
.motion-ready .connection-node { opacity: 0; transform: scale(0.6); transition: opacity 0.5s var(--ease-out), transform 0.7s var(--ease-spring); }
.motion-ready .connection-visual.is-visible .connection-node { opacity: 1; transform: none; animation: float 6s ease-in-out infinite 1.2s; }
.motion-ready .connection-visual.is-visible .node-phone { transition-delay: 0.12s; animation-delay: 2.7s; }
.motion-ready .connection-visual.is-visible .node-sensor { transition-delay: 0.24s; animation-delay: 4.2s; }
.motion-ready .connection-visual.is-visible .node-api { transition-delay: 0.36s; animation-delay: 5.7s; }
.motion-ready .connection-center { transform: scale(0.8); opacity: 0; transition: transform 0.8s var(--ease-spring) 0.1s, opacity 0.5s var(--ease-out) 0.1s; }
.motion-ready .connection-visual.is-visible .connection-center { transform: none; opacity: 1; }
.motion-ready .connection-visual.is-visible .connection-orbit { animation: pulse-ring 5s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-6px); } }
@keyframes pulse-ring { 50% { box-shadow: 0 0 0 36px #d9e3d233, 0 0 0 72px #d9e3d21a; } }
/* the family map: the pins land, the card and the toast slide in, the school ring pulses */
.motion-ready .family-pin { opacity: 0; transform: translateY(-14px) scale(0.6); transition: opacity 0.5s var(--ease-out), transform 0.7s var(--ease-spring); }
.motion-ready .family-visual.is-visible .family-pin { opacity: 1; transform: none; }
.motion-ready .family-visual.is-visible .fp-two { transition-delay: 0.15s; }
.motion-ready .family-visual.is-visible .fp-three { transition-delay: 0.3s; }
.motion-ready .family-card { opacity: 0; transform: translateY(20px); transition: opacity 0.7s var(--ease-out) 0.4s, transform 0.7s var(--ease-out) 0.4s; }
.motion-ready .family-visual.is-visible .family-card { opacity: 1; transform: none; }
.motion-ready .family-toast { opacity: 0; transform: translateY(-12px); transition: opacity 0.6s var(--ease-out) 1s, transform 0.6s var(--ease-spring) 1s; }
.motion-ready .family-visual.is-visible .family-toast { opacity: 1; transform: none; }
.motion-ready .family-visual.is-visible .family-map svg circle[stroke-dasharray] { animation: spin 14s linear infinite; transform-origin: 248px 140px; transform-box: view-box; }
@keyframes spin { to { transform: rotate(360deg); } }
/* the platform demo: the route draws and the vehicle pulses */
.motion-ready .platform-demo .demo-route { stroke-dasharray: 900; stroke-dashoffset: 900; }
.motion-ready .platform-demo.is-visible .demo-route { animation: draw 2.2s var(--ease-out) 0.4s forwards; }
.motion-ready .platform-demo.is-visible .vehicle-marker circle:first-child { animation: ping 2.6s ease-out infinite 1.5s; transform-box: fill-box; transform-origin: center; }
@keyframes ping { 0% { transform: scale(1); opacity: 0.9; } 70%, 100% { transform: scale(1.8); opacity: 0; } }
.motion-ready .map-object-card { opacity: 0; transform: translateY(16px); transition: opacity 0.6s var(--ease-out) 0.5s, transform 0.6s var(--ease-out) 0.5s; }
.motion-ready .platform-demo.is-visible .map-object-card { opacity: 1; transform: none; }
/* numbers count up (motion.js) */
.counting { font-variant-numeric: tabular-nums; }

/* ---- answering the pointer (only where there is one) ---- */
@media (hover: hover) and (pointer: fine) {
  .bento, .platform-tab, .fleet-tab, .foundation-grid article, .sensor-tiles > div, .price-card, .fam-card, .connection-node, .hardware-tags span, .family-card, .family-toast, .map-object-card, .alert-card, .faq-list details, .footer-column a, .capability-strip .container > div { transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out), background-color 0.3s, border-color 0.3s, color 0.3s; }
  .bento:hover { transform: translateY(-5px); box-shadow: 0 24px 48px -24px #0b2a3a44; }
  .bento:hover .round-icon, .bento:hover .bento-top > .icon { transform: rotate(-8deg) scale(1.12); }
  .round-icon, .bento-top > .icon { transition: transform 0.4s var(--ease-spring); }
  .alert-card:hover { transform: rotate(0) translateX(4px) !important; box-shadow: 0 14px 28px #071e2a22; cursor: default; }
  .platform-tab:hover, .fleet-tab:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -16px #0b2a3a44; }
  .platform-tab:hover .platform-tab-icon, .fleet-tab:hover .fleet-tab-icon { transform: scale(1.1) rotate(-6deg); }
  .platform-tab-icon, .fleet-tab-icon { transition: transform 0.4s var(--ease-spring), background-color 0.25s, color 0.25s; }
  .foundation-grid article:hover { transform: translateY(-4px); }
  .foundation-grid article > .icon { transition: transform 0.4s var(--ease-spring), color 0.3s; }
  .foundation-grid article:hover > .icon { transform: translateY(-4px) scale(1.15); color: var(--orange); }
  .sensor-tiles > div:hover { transform: translateY(-3px); box-shadow: 0 16px 30px -18px #3b2a1a44; }
  .connection-node:hover { transform: scale(1.1) !important; box-shadow: 0 14px 28px #405b2918; animation-play-state: paused; }
  .hardware-tags span:hover { transform: translateY(-2px); background: var(--brand-soft, #e6eef9); color: var(--brand, #1d4e89); }
  .family-card:hover, .family-toast:hover, .map-object-card:hover { transform: translateY(-4px); box-shadow: 0 22px 50px #3b2a1a33; }
  .family-member { transition: background-color 0.25s, padding-left 0.25s; border-radius: 8px; }
  .family-member:hover { background: #f7f3ec; padding-left: 6px; }
  .fleet-row { transition: background-color 0.25s, transform 0.3s var(--ease-out); }
  .fleet-row:hover { background: #f2f6fb; transform: translateX(3px); }
  .faq-list details:hover { padding-left: 4px; }
  .faq-list summary .faq-plus { transition: transform 0.4s var(--ease-spring); }
  .faq-list details:hover summary .faq-plus { transform: rotate(90deg); }
  .capability-strip .container > div:hover { transform: translateY(-2px); color: var(--brand, #1d4e89); }
  .capability-strip .container > div:hover .icon { transform: scale(1.15); }
  .capability-strip .icon { transition: transform 0.35s var(--ease-spring); }
  .price-card:hover, .fam-card:hover { transform: translateY(-6px); box-shadow: 0 28px 60px -28px #0b2a3a55; }
  .fam-photo:hover img, .biz-story:hover img { transform: scale(1.05); }
  .fam-photo img, .biz-story img { transition: transform 0.8s var(--ease-out); }
  .button { transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), background-color 0.3s; }
  .button:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -14px #0b2a3a66; }
  .button .icon { transition: transform 0.3s var(--ease-out); }
  .button:hover .icon { transform: translateX(4px); }
  .footer-column a:hover { transform: translateX(3px); }
  .phone:hover { transform: rotate(3deg) !important; }
  .phone { transition: transform 0.8s var(--ease-out) !important; }
}

/* ---- the small screen: the same motion, slightly shorter travel ---- */
@media (max-width: 700px) {
  .motion-ready .reveal { transform: translateY(18px); }
  .motion-ready .reveal[data-reveal="left"], .motion-ready .reveal[data-reveal="right"] { transform: translateY(18px); }
}

/* ---- no motion when asked ---- */
@media (prefers-reduced-motion: reduce) {
  .motion-ready .reveal, .motion-ready .hero-content > *, .motion-ready .sol-hero-copy > *, .motion-ready .journey-tag, .motion-ready .sol-hero-art,
  .motion-ready .alert-card, .motion-ready .trip-line i, .motion-ready .sensor-tiles > div, .motion-ready .phone-scene .phone, .motion-ready .signature-toast,
  .motion-ready .fleet-marker, .motion-ready .fleet-toast, .motion-ready .fleet-points li, .motion-ready .connection-node, .motion-ready .connection-center,
  .motion-ready .family-pin, .motion-ready .family-card, .motion-ready .family-toast, .motion-ready .map-object-card { opacity: 1 !important; transform: none !important; animation: none !important; transition: none !important; }
  .motion-ready .trip-sparkline path, .motion-ready .demo-route { stroke-dasharray: none !important; stroke-dashoffset: 0 !important; animation: none !important; }
  .motion-ready .meter-fill { stroke-dasharray: 183 252 !important; transition: none !important; }
  .motion-ready .sensor-progress i { transform: none !important; transition: none !important; }
  .motion-ready .connection-orbit, .motion-ready .phone-orbit, .motion-ready .vehicle-marker circle, .motion-ready .family-map svg circle { animation: none !important; }
}
