/* Section entrances (assets/section-motion.js). Loaded last. */
:root { --m-ease: cubic-bezier(.16, .84, .24, 1); }

/* until the script has prepared the page, keep hero extras hidden so nothing flashes; shown anyway after 3s */
html.motion:not(.motion-on) :is(.hero .house-btn, .hero .touch, .hero .sub, .hero .acts3 .act, .hero-start) { opacity: 0; animation: m-show 0s 3s forwards; }
@keyframes m-show { to { opacity: 1; } }

html.motion-on [data-m]:not(.m-in):not([data-m="draw"]) { opacity: 0; }

[data-m="rise"].m-in { animation: m-rise .95s var(--m-ease) var(--md, 0ms) backwards; }
@keyframes m-rise { from { opacity: 0; transform: translateY(26px); } }

[data-m="bloom"].m-in { animation: m-bloom 1.4s var(--m-ease) var(--md, 0ms) backwards; }
@keyframes m-bloom { from { opacity: 0; transform: scale(.9); filter: blur(10px); } }

[data-m="fade"].m-in { animation: m-fade .8s ease var(--md, 0ms) backwards; }
@keyframes m-fade { from { opacity: 0; } }

[data-m="settle"].m-in { animation: m-settle 1.3s var(--m-ease) var(--md, 0ms) backwards; }
@keyframes m-settle { from { opacity: 0; transform: scale(1.06); clip-path: inset(6% 6% 6% 6% round 18px); } to { clip-path: inset(0 0 0 0 round 0); } }

/* the cross-section drawing draws itself, line by line */
html.motion-on [data-m="draw"] path[pathLength] { stroke-dasharray: 1; stroke-dashoffset: 1; }
html.motion-on [data-m="draw"].m-in path[pathLength] { animation: m-draw 1.5s cubic-bezier(.45, 0, .2, 1) var(--pd, 0ms) forwards; }
@keyframes m-draw { to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
  html.motion :is(.hero .house-btn, .hero .touch, .hero .sub, .hero .acts3 .act, .hero-start) { opacity: 1; animation: none; }
}
