/* "Записване" as a bus ride (parts/enroll.php): the flag garland waves over the welcome, the letters of the title
   bounce, every step is a stop – its card drops in and the bus drives up to the sign with its number – and the ride
   ends with confetti, a sprout and the "visit" button. */

.ride { position: relative; padding: 10px 0 70px; overflow: hidden; overflow: clip; display: flow-root; } /* clip: a hidden box can be scrolled sideways (focus, scrollIntoView) */
.bg .ride h2, .bg .ride h3, .bg .stop__no, .bg .stop__sign b, .bg .ride__closing { font-family: 'Neucha', Arial, sans-serif; }
[data-reveal] { --in: 0; }

/* ---------- The welcome under the garland ---------- */
.ride__intro { position: relative; padding: 70px 0 20px; }
.ride__flags { position: absolute; left: -2%; top: 0; width: 104%; height: 66px; background: url('../images/flags.svg') no-repeat center top / 100% 100%; transform-origin: top center; animation: ride-flag 3s ease-in-out infinite alternate; pointer-events: none; }
.ride__welcome { max-width: 860px; margin: 0 auto; padding: 32px 38px; border-radius: 30px; background: #fff; box-shadow: 0 24px 40px -26px rgba(60, 40, 20, .5); text-align: center; opacity: 0; transform: translateY(30px); transition: opacity .7s, transform .9s cubic-bezier(.34, 1.3, .64, 1); }
.is-in .ride__welcome { opacity: 1; transform: none; }
.ride__welcome p { margin: 0 0 12px; font-size: 17px; line-height: 1.7; color: #3c4741; }
.ride__welcome p:last-child { margin-bottom: 0; }
.ride__hello { font: 400 30px/1.25 'Cabin Sketch', Arial, sans-serif !important; color: #ff5736 !important; }
.bg .ride__hello { font-family: 'Neucha', Arial, sans-serif !important; }

/* ---------- The title with bouncing letters ---------- */
.ride__title { margin: 50px auto 10px; font: 400 46px/1.15 'Cabin Sketch', Arial, sans-serif; text-align: center; color: #3c4741; }
.ride__title .l { display: inline-block; color: var(--c); animation: ride-letter 2.2s ease-in-out infinite; animation-delay: calc(var(--k) * .06s); }
.ride__title .l.is-jump { animation: ride-jump .7s cubic-bezier(.3, .8, .4, 1); }
.ride__title .sp { display: inline-block; width: .3em; }
.ride__title .w { display: inline-block; white-space: nowrap; }

/* ---------- A stop ---------- */
.ride__steps { margin: 0 auto; padding: 30px 0 0; list-style: none; }
.stop { position: relative; display: flex; flex-direction: column; width: 62%; padding-bottom: 40px; }
.stop.is-right { margin-left: auto; }
.stop__card { position: relative; z-index: 2; padding: 34px 34px 28px 104px; border-radius: 28px; background: #fff; box-shadow: 0 24px 40px -26px rgba(60, 40, 20, .55); opacity: 0; transform: translateY(-80px) rotate(var(--r0, -5deg)); transform-origin: 50% 0; }
.is-right .stop__card { --r0: 5deg; }
.stop.is-in .stop__card { animation: ride-card 1s cubic-bezier(.3, .7, .4, 1) forwards; }
.stop__no { position: absolute; left: 24px; top: 26px; display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; background: var(--c, #52aae8); color: #fff; font: 400 36px/1 'Cabin Sketch', Arial, sans-serif; box-shadow: 0 6px 0 color-mix(in srgb, var(--c, #52aae8) 70%, #000); transform: scale(0) rotate(-90deg); }
.stop.is-in .stop__no { animation: ride-pop .6s cubic-bezier(.34, 1.56, .64, 1) .7s forwards; }
.stop:nth-child(6n+1) { --c: #ff5736; } .stop:nth-child(6n+2) { --c: #52aae8; } .stop:nth-child(6n+3) { --c: #7ad068; }
.stop:nth-child(6n+4) { --c: #8763be; } .stop:nth-child(6n+5) { --c: #ff7b05; } .stop:nth-child(6n) { --c: #e6b800; }
.stop__title { margin: 0 0 12px; font: 400 28px/1.2 'Cabin Sketch', Arial, sans-serif; color: var(--c); }
.stop__card p { margin: 0 0 10px; font-size: 16px; line-height: 1.7; color: #3c4741; }
.stop__card p:last-child { margin-bottom: 0; }
.stop__card strong { color: #3c4741; }

/* the road under the card, with the stop sign and the bus that drives up to it */
/* the road clips the bus while it is still off the road on the right */
.stop__road { position: relative; z-index: 1; height: 150px; margin: -14px 0 0; overflow: hidden; }
.stop__road::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 30px; border-radius: 15px; background: linear-gradient(transparent 13px, #fff 13px, #fff 16px, transparent 16px) 0 0 / 34px 100% repeat-x, #6b6f78; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .12); }
.stop__sign { position: absolute; left: 22%; bottom: 30px; width: 5px; height: 84px; background: #7d858f; }
.stop__sign b { position: absolute; left: -19px; top: -20px; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 4px solid #fff; background: var(--c); color: #fff; font: 400 26px/1 'Cabin Sketch', Arial, sans-serif; box-shadow: 0 4px 8px -4px rgba(0, 0, 0, .4); transform-origin: 50% 100%; }
.stop.is-here .stop__sign b { animation: ride-wave .5s ease-in-out 3 alternate; }
/* the bus (it faces left) comes in from the right and stops with its front at the sign */
.stop__bus { position: absolute; z-index: 1; left: calc(100% + 40px); bottom: -10px; width: 150px; height: 150px; opacity: 0; }
/* it brakes evenly up to the sign and rocks a little when it stops (assets/js/bus.js turns the wheels and tips it) */
.stop.is-in .stop__bus { animation: ride-drive 2.6s cubic-bezier(.5, 1, .89, 1) .5s forwards; }
.stop__lottie { display: block; width: 100%; height: 100%; }

/* ---------- The end of the ride ---------- */
.ride__end { position: relative; padding: 40px 0 0; text-align: center; }
.ride__sprout { display: block; width: 190px; height: 190px; margin: 0 auto 6px; }
.ride__lottie { display: block; width: 100%; height: 100%; }
.ride .ride__closing { margin: 0 0 22px; font: 400 34px/1.25 'Cabin Sketch', Arial, sans-serif; color: #8763be; opacity: 0; transform: scale(.7); transition: opacity .5s .5s, transform .7s cubic-bezier(.34, 1.56, .64, 1) .5s; }
.ride .is-in .ride__closing { opacity: 1; transform: none; }
.bg .ride .ride__closing { font-family: 'Neucha', Arial, sans-serif; }
.ride__btn.btn { margin: 0; color: #fff; font-size: 22px; padding: 14px 52px 14px 26px; opacity: 0; transform: translateY(20px); transition: opacity .5s 1s, transform .6s cubic-bezier(.34, 1.56, .64, 1) 1s, border-radius .2s; }
.is-in .ride__btn.btn { opacity: 1; transform: none; }
.ride__btn.btn:hover { animation: ride-jelly .7s; }
.ride__confetti { position: absolute; left: 0; top: 0; pointer-events: none; }
.ride__confetti.is-tri { width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 12px solid var(--c); }
.ride__confetti.is-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.ride__confetti.is-star { color: var(--c); font-size: 16px; line-height: 1; }

@keyframes ride-flag { from { transform: rotateX(30deg); } to { transform: rotateX(-30deg); } }
@keyframes ride-letter { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-8px); } }
@keyframes ride-jump { 0% { transform: translateY(0); } 30% { transform: translateY(-26px) scale(.9, 1.15) rotate(-8deg); } 60% { transform: translateY(0) scale(1.2, .85); } 100% { transform: none; } }
@keyframes ride-card { 0% { opacity: 0; transform: translateY(-80px) rotate(var(--r0)); } 35% { opacity: 1; } 65% { transform: translateY(8px) rotate(calc(var(--r0) * -.3)); } 85% { transform: translateY(-3px) rotate(calc(var(--r0) * .1)); } 100% { opacity: 1; transform: none; } }
@keyframes ride-pop { from { transform: scale(0) rotate(-90deg); } to { transform: scale(1) rotate(0); } }
@keyframes ride-wave { from { transform: rotate(-10deg); } to { transform: rotate(10deg); } }
@keyframes ride-drive { 0% { opacity: 1; left: calc(100% + 40px); } 100% { opacity: 1; left: calc(22% - 6px); } }
@keyframes ride-jelly { 0% { transform: scale(1, 1); } 30% { transform: scale(1.14, .86); } 45% { transform: scale(.9, 1.1); } 60% { transform: scale(1.05, .95); } 100% { transform: scale(1, 1); } }

@media only screen and (max-width: 1100px) {
	.stop { width: 78%; }
}
@media only screen and (max-width: 768px) {
	.ride__intro { padding-top: 50px; }
	.ride__flags { height: 44px; }
	.ride__welcome { padding: 22px; }
	.ride__hello { font-size: 25px !important; }
	.ride__title { font-size: 31px; margin-top: 34px; padding: 0 16px; overflow-wrap: anywhere; }
	.stop, .stop.is-right { width: auto; margin: 0; }
	.stop__card { padding: 84px 20px 22px; }
	.stop__no { left: 50%; top: 14px; margin-left: -30px; }
	.stop__title { font-size: 24px; text-align: center; }
	.stop__road { margin: -14px 6px 0; }
	.ride .ride__closing { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
	.ride *, .ride *::before { animation: none !important; transition: none !important; }
	.stop__card, .ride__welcome, .ride__closing, .ride__btn.btn { opacity: 1 !important; transform: none !important; }
	.stop__no { transform: none; }
	.stop__bus { opacity: 1; left: calc(22% - 6px); }
}
