/* "За нас" as a sunrise over the house of the site (parts/about.php): the mission said word by word in the sky as
   the sun comes up, hills that move apart with the scroll, cards with a big first letter, a seal stamped on the last
   one, and the home page's elephant and ladder with the bird at the bottom. */

.about { position: relative; overflow: hidden; overflow: clip; display: flow-root; } /* clip: never scrolled sideways */
.bg .about .about__mission, .bg .about__card p::first-letter { font-family: 'Neucha', Arial, sans-serif; }

/* ---------- The sky ---------- */
.about__sky { position: relative; height: 560px; margin-top: 20px; background: linear-gradient(#ffcf9e 0, #ffe7c4 30%, #bfe3fb 70%); overflow: hidden; --p: 0; }
.about__sky::before { content: ''; position: absolute; inset: 0; background: linear-gradient(#6fbdf6, #bfe3fb 70%); opacity: 0; transition: opacity 3.5s ease-in-out .8s; }
.about__sky.is-up::before { opacity: 1; }
/* the sun comes up from behind the hills */
.about__sun { position: absolute; z-index: 0; left: 50%; top: 330px; width: 120px; height: 124px; margin-left: 150px; background: url('../images/sun.svg') no-repeat center / contain; filter: drop-shadow(0 0 30px rgba(255, 210, 0, .9)); translate: 0 160px; transition: translate 3.2s cubic-bezier(.3, .6, .3, 1) .3s; }
/* (it rises with translate and turns with rotate: turned with a transform it circled round a point far below itself) */
/* it ends beside the roof of the house, under the words (behind them it shone through the letters) */
.about__sky.is-up .about__sun { translate: 0 -80px; animation: about-turn 30s linear 3.5s infinite; }
@keyframes about-turn { from { rotate: 0deg; } to { rotate: 360deg; } }
.about__clouds { position: absolute; z-index: 1; left: 0; top: 30px; width: 3720px; height: 165px; background: url('../images/clouds3.svg') repeat-x 0 0 / 1860px 165px; opacity: .8; animation: about-drift 90s linear infinite; }
@keyframes about-drift { to { transform: translateX(-1860px); } }
.about__birds i { position: absolute; z-index: 2; top: 120px; left: 100%; width: 70px; height: 39px; animation: about-fly 22s linear infinite; }
.about__birds i:nth-child(2) { top: 170px; width: 50px; height: 28px; animation-delay: -9s; animation-duration: 27s; }
.about__birds i::before { content: ''; position: absolute; inset: 0; background: url('../images/bird-2.svg') no-repeat center / contain; transform-origin: 50% 32%; animation: about-wings .42s ease-in-out infinite alternate; }
@keyframes about-fly { 0% { transform: translate(0, 0); } 50% { transform: translate(-60vw, -20px); } 100% { transform: translate(calc(-100vw - 200px), 10px); } }
@keyframes about-wings { from { transform: scaleY(1); } to { transform: scaleY(.62) translateY(3px); } }
/* the mission, word by word */
.about .about__mission { position: relative; z-index: 3; max-width: 980px; margin: 0 auto; padding-top: 70px; font: 400 44px/1.3 'Cabin Sketch', Arial, sans-serif; text-align: center; color: #3c4741; text-shadow: 0 2px 0 rgba(255, 255, 255, .6); }
.about__mission .w { display: inline-block; opacity: 0; transform: translateY(18px) scale(.8); }
.about__sky.is-up .about__mission .w { animation: about-word .6s cubic-bezier(.34, 1.56, .64, 1) forwards; animation-delay: calc(.4s + var(--w) * .12s); }
@keyframes about-word { to { opacity: 1; transform: none; } }
/* the hills and the house: they part a little as the page scrolls */
.about__hill { position: absolute; left: -5%; right: -5%; bottom: 0; background-repeat: no-repeat; background-position: center bottom; background-size: 100% 100%; will-change: transform; }
.about__hill--back { z-index: 1; height: 230px; background-image: url('../images/hills2.svg'); transform: translateY(calc(var(--p) * 40px)); }
/* (its drawing is empty at the foot, so it reaches below the sky's edge and only ever moves down) */
.about__hill--front { z-index: 3; bottom: -50px; height: 200px; background-image: url('../images/hills1.svg'); transform: translateY(calc(var(--p) * 24px)); }
.about__house { position: absolute; z-index: 2; left: 50%; bottom: 90px; width: 280px; height: 240px; margin-left: -140px; background: url('../images/montessorihouse.svg') no-repeat center bottom / contain; transform: translateY(calc(var(--p) * 10px)); }
.about__fan { position: absolute; left: 58%; top: 52.3%; width: 6.43%; height: 7.83%; background: url('../images/fan.svg') no-repeat center / contain; animation: about-spin 1.4s linear infinite; }
@keyframes about-spin { to { transform: rotate(360deg); } }

/* ---------- The cards ---------- */
.about__cards { position: relative; z-index: 4; display: flex; flex-direction: column; gap: 40px; padding: 60px 0 40px; }
.about__card { position: relative; width: 78%; padding: 34px 42px; border-radius: 30px; background: #fff; box-shadow: 0 24px 40px -26px rgba(60, 40, 20, .5); border-left: 8px solid var(--c); opacity: 0; transform: translateX(-60px) rotate(-1.5deg); transition: opacity .7s, transform 1s cubic-bezier(.34, 1.3, .64, 1); }
.about__card.is-right { align-self: flex-end; border-left: 0; border-right: 8px solid var(--c); transform: translateX(60px) rotate(1.5deg); }
.about__card.is-in { opacity: 1; transform: none; }
.about__card p { margin: 0; font-size: 18px; line-height: 1.8; color: #3c4741; }
.about__card p::first-letter { float: left; margin: 6px 12px 0 0; font: 400 66px/.8 'Cabin Sketch', Arial, sans-serif; color: var(--c); }
/* the seal is stamped on the last card */
.about__card--seal { align-self: center; width: 70%; padding-right: 150px; border-left: 0; border-bottom: 8px solid var(--c); transform: translateY(40px); }
.about__seal { position: absolute; right: 30px; top: 50%; width: 96px; height: 96px; margin-top: -60px; opacity: 0; transform: scale(2.6) rotate(-40deg); }
.about__card--seal.is-in .about__seal { animation: about-stamp .7s cubic-bezier(.5, 0, .3, 1.4) .8s forwards; }
@keyframes about-stamp { 0% { opacity: 0; transform: scale(2.6) rotate(-40deg); } 70% { opacity: 1; transform: scale(.92) rotate(-6deg); } 100% { opacity: 1; transform: scale(1) rotate(-8deg); } }
.about__seal b { position: absolute; z-index: 1; inset: 0; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle, #ffd54f 0 52%, #f5b800 53% 58%, #ffd54f 59%); box-shadow: 0 0 0 5px #fff, 0 0 0 9px #f5b800, 0 8px 14px rgba(0, 0, 0, .2); color: #ff5736; font-size: 40px; font-weight: 400; line-height: 1; }
.about__ribbon { position: absolute; top: 70px; width: 26px; height: 56px; background: #ff5736; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%); }
.about__ribbon--l { left: 18px; transform: rotate(18deg); }
.about__ribbon--r { right: 18px; transform: rotate(-18deg); background: #52aae8; }

/* ---------- The end: the elephant and the ladder with the bird ---------- */
.about__end { position: relative; height: 400px; margin-top: 20px; background: url('../images/background-grass-top.svg') repeat-x center bottom 50px / 960px 35px, linear-gradient(transparent calc(100% - 60px), #7ad068 calc(100% - 60px)); }
.about__end-in { position: relative; max-width: 700px; height: 100%; margin: 0 auto; }
.about__elephant { position: absolute; z-index: 2; left: 60px; bottom: 30px; width: 316px; height: 233px; padding: 0; border: 0; background: url('../images/elephant-sprite.svg') no-repeat 0 0; transform: scale(.85); transform-origin: 50% 100%; cursor: pointer; }
.about__elephant.is-spray { animation: about-spray 1s steps(10, end) 2 alternate; }
@keyframes about-spray { from { background-position: 0 0; } to { background-position: -3160px 0; } }
.about__ladder { position: absolute; z-index: 1; right: 120px; bottom: 30px; width: 58px; height: 291px; background: url('../images/ladder.svg') no-repeat center bottom / contain; }
.about__bird { position: absolute; left: -22px; top: -50px; width: 98px; height: 94px; background: url('../images/bird-sprite.svg') no-repeat 0 0 / 588px 94px; animation: about-look 5s steps(1, end) infinite; }
@keyframes about-look { 0%, 70% { background-position: 0 0; } 74% { background-position: -98px 0; } 78% { background-position: -196px 0; } 82% { background-position: -294px 0; } 86% { background-position: -196px 0; } 90% { background-position: -98px 0; } 100% { background-position: 0 0; } }

/* ---------- Smaller screens ---------- */
@media only screen and (max-width: 1100px) {
	.about .about__mission { font-size: 38px; }
	.about__sky.is-up .about__sun { translate: 0 -50px; }
	.about__card, .about__card--seal { width: 88%; }
}
@media only screen and (max-width: 768px) {
	/* a phone: the birds fly over the clouds above the words and the sun comes up beside the roof, under the words –
	   nothing crosses the mission */
	.about__sky { height: 520px; }
	.about .about__mission { padding: 60px 16px 0; font-size: 27px; }
	.about__birds i { top: 12px; }
	.about__birds i:nth-child(2) { top: 38px; }
	.about__sun { top: 340px; width: 76px; height: 79px; margin-left: 84px; }
	.about__sky.is-up .about__sun { translate: 0 -112px; }
	.about__house { width: 200px; height: 172px; margin-left: -100px; bottom: 70px; }
	.about__hill--back { height: 170px; } .about__hill--front { height: 150px; }
	.about__card, .about__card.is-right, .about__card--seal { width: auto; align-self: stretch; padding: 24px 22px; transform: translateY(40px); }
	.about__card.is-in { transform: none; }
	.about__card--seal { padding-top: 165px; }
	.about__seal { right: 50%; top: 20px; margin: 0 -48px 0 0; }
	.about__card p { font-size: 16px; }
	.about__card p::first-letter { font-size: 52px; }
	.about__end { height: 280px; margin-top: 0; }
	.about__end-in { max-width: none; }
	.about__elephant { left: -30px; transform: scale(.62); }
	.about__ladder { right: 24px; width: 46px; height: 230px; }
	.about__bird { left: -18px; top: -40px; width: 78px; height: 75px; background-size: 468px 75px; animation-name: about-look-s; }
	@keyframes about-look-s { 0%, 70% { background-position: 0 0; } 74% { background-position: -78px 0; } 78% { background-position: -156px 0; } 82% { background-position: -234px 0; } 86% { background-position: -156px 0; } 90% { background-position: -78px 0; } 100% { background-position: 0 0; } }
}
@media (prefers-reduced-motion: reduce) {
	.about *, .about *::before, .about *::after { animation: none !important; transition: none !important; }
	.about__card, .about__seal, .about__mission .w { opacity: 1 !important; transform: none !important; }
	.about__sun { translate: 0 -80px !important; }
	.about__birds { display: none; }
}
