/* "Екип" as the light Dr. Montessori speaks of (parts/team.php): the team's picture comes up beside her words, which
   glow round a small flickering flame; the photos of the team are pinned to a cork board one after another and stand
   straight under the pointer; the decalogue is a string of bulbs that light up one by one. */

.crew { position: relative; padding: 40px 0 80px; overflow: hidden; }
.bg .crew .crew__quote p, .bg .crew .crew__deca-title, .bg .crew .bulb__glass b { font-family: 'Neucha', Arial, sans-serif; }

/* ---------- The picture and the words ---------- */
.crew__hello { position: relative; display: flex; align-items: center; gap: 50px; }
.crew__pic { flex: none; width: 400px; margin: 0; overflow: hidden; border-bottom: 6px solid #7ad068; border-radius: 0 0 6px 6px; }
.crew__pic img { display: block; width: 100%; height: auto; transform-origin: 50% 100%; transform: translateY(105%); transition: transform 1.2s cubic-bezier(.34, 1.3, .64, 1) .2s; cursor: pointer; }
.crew__pic.is-in img { transform: none; animation: crew-breathe 3.2s ease-in-out 1.6s infinite alternate; }
@keyframes crew-breathe { from { scale: 1 1; } to { scale: 1.01 1.025; } }
.crew__quote { position: relative; flex: 1; min-width: 0; margin: 0; padding: 40px 46px 34px 120px; border-radius: 30px; background: #fff; box-shadow: 0 24px 40px -26px rgba(60, 40, 20, .5); opacity: 0; transform: translateX(40px); transition: opacity .8s .3s, transform 1s cubic-bezier(.34, 1.3, .64, 1) .3s; }
.crew__quote.is-in { opacity: 1; transform: none; }
/* the warm light round the flame */
.crew__quote::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 70%; border-radius: 30px 0 0 30px; background: radial-gradient(circle at 62px 50%, rgba(255, 206, 84, .5), rgba(255, 206, 84, 0) 62%); opacity: 0; transition: opacity 2s 1.2s; pointer-events: none; }
.crew__quote.is-in::before { opacity: 1; animation: crew-glow 2.6s ease-in-out 3s infinite alternate; }
@keyframes crew-glow { from { opacity: .7; } to { opacity: 1; } }
.crew .crew__quote p { position: relative; margin: 0; font: 400 27px/1.5 'Cabin Sketch', Arial, sans-serif; color: #3c4741; }
.crew__quote footer { position: relative; margin-top: 14px; text-align: right; font: 400 20px/1.3 'Neucha', Arial, sans-serif; color: #8763be; }
.crew__quote footer::before { content: '— '; }
/* a little candle: the flame comes alight and flickers */
.crew__flame { position: absolute; left: 44px; top: 50%; width: 36px; height: 100px; margin-top: -50px; }
.crew__flame::after { content: ''; position: absolute; left: 9px; bottom: 0; width: 18px; height: 44px; border-radius: 4px 4px 3px 3px; background: linear-gradient(90deg, #f3e9dc, #fffaf3 45%, #e6d6c3); box-shadow: 0 6px 8px -4px rgba(0, 0, 0, .2); }
.crew__flame::before { content: ''; position: absolute; left: 17px; bottom: 43px; width: 2px; height: 7px; background: #4a3b2c; }
.crew__flame i { position: absolute; left: 6px; bottom: 48px; width: 24px; height: 40px; border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%; background: radial-gradient(circle at 50% 72%, #fff 0 16%, #ffe680 32%, #ffb12b 62%, rgba(255, 110, 40, .2) 78%, rgba(255, 110, 40, 0) 80%); box-shadow: 0 0 26px 10px rgba(255, 196, 70, .45); transform-origin: 50% 90%; transform: scale(0); transition: transform .8s cubic-bezier(.34, 1.56, .64, 1) 1s; }
.crew__quote.is-in .crew__flame i { transform: none; animation: crew-flicker 1.4s ease-in-out 1.8s infinite; }
@keyframes crew-flicker { 0%, 100% { scale: 1 1; skew: 0deg; } 20% { scale: .94 1.06; skew: 2deg; } 40% { scale: 1.04 .96; skew: -1.5deg; } 60% { scale: .97 1.04; skew: 1deg; } 80% { scale: 1.02 .98; skew: -2deg; } }

/* ---------- The cork board with the photos ---------- */
.crew__board { margin-top: 70px; }
.crew__photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 46px 36px; margin: 0; padding: 56px 44px 46px; list-style: none; border: 14px solid #a8713c; border-radius: 20px; background: radial-gradient(circle at 20% 30%, rgba(120, 70, 30, .18) 0 1.5px, transparent 2px) 0 0 / 14px 14px, radial-gradient(circle at 70% 60%, rgba(255, 240, 210, .25) 0 1px, transparent 1.5px) 0 0 / 11px 11px, #d6a46b; box-shadow: inset 0 0 0 3px rgba(0, 0, 0, .08), inset 0 0 30px rgba(90, 50, 20, .3), 0 26px 40px -24px rgba(70, 40, 20, .6); }
.pola { position: relative; rotate: var(--r); opacity: 0; transform: translateY(-46px) scale(1.12); transition: opacity .5s calc(var(--k) * .12s), transform .8s cubic-bezier(.34, 1.4, .64, 1) calc(var(--k) * .12s), rotate .5s cubic-bezier(.34, 1.56, .64, 1), scale .4s; }
.pola.is-in { opacity: 1; transform: none; }
.pola:hover { z-index: 2; rotate: 0deg; scale: 1.05; }
.pola a { display: block; padding: 12px 12px 16px; background: #fff; box-shadow: 0 16px 22px -14px rgba(60, 30, 10, .7); text-decoration: none; }
.pola__pin { position: absolute; z-index: 2; left: 50%; top: -20px; width: 24px; height: 36px; margin-left: -12px; background: url('../images/pin.svg') no-repeat center / contain; transform: scale(0); transform-origin: 50% 100%; transition: transform .45s cubic-bezier(.34, 1.8, .64, 1) calc(.45s + var(--k) * .12s); }
.pola.is-in .pola__pin { transform: none; }
.pola__photo { display: block; aspect-ratio: 1; overflow: hidden; background: #efe8e0; }
.pola__photo img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.pola:hover .pola__photo img { transform: scale(1.06); }
.pola__name { display: block; margin-top: 12px; font: 700 16px/1.3 'Open Sans', Arial, sans-serif; color: #3c4741; text-align: center; }
.pola__role { display: block; margin-top: 4px; font: 400 13px/1.4 'Open Sans', Arial, sans-serif; color: #6b7a72; text-align: center; }
/* "Виж повече": a little button in the member's colour, so it is clear the photo opens their page */
.pola a { display: flex; flex-direction: column; align-items: center; height: 100%; box-sizing: border-box; }
.pola__photo { align-self: stretch; }
.pola__role { flex: 1; }
.pola__more { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; padding: 5px 14px 5px 16px; border: 2px solid var(--c); border-radius: 20px; font: 700 12px/1.3 'Open Sans', Arial, sans-serif; letter-spacing: .03em; color: var(--c); background: #fff; transition: background .25s, color .25s; }
.pola__more::after { content: '›'; font-size: 17px; line-height: .8; transition: translate .25s; }
.pola:hover .pola__more, .pola a:focus-visible .pola__more { background: var(--c); color: #fff; }
.pola:hover .pola__more::after { translate: 3px 0; }
/* when a photo is pinned, its button nods twice: the cards open */
.pola.is-in .pola__more { animation: crew-nod 1.1s ease-in-out calc(1.3s + var(--k) * .15s) 2; }
@keyframes crew-nod { 0%, 100% { translate: 0 0; } 25% { translate: 4px 0; } 50% { translate: 0 0; } 75% { translate: 4px 0; } }

/* ---------- One of the team (parts/member.php): the photo taken off the board ---------- */
.mb-cork { position: relative; margin: 40px 10px 0 0; padding: 34px 30px 30px; border: 10px solid #a8713c; border-radius: 16px; background: radial-gradient(circle at 20% 30%, rgba(120, 70, 30, .18) 0 1.5px, transparent 2px) 0 0 / 14px 14px, radial-gradient(circle at 70% 60%, rgba(255, 240, 210, .25) 0 1px, transparent 1.5px) 0 0 / 11px 11px, #d6a46b; box-shadow: inset 0 0 24px rgba(90, 50, 20, .3), 0 24px 36px -22px rgba(70, 40, 20, .6); rotate: -2deg; }
.mb-pola { position: relative; margin: 0; padding: 12px 12px 30px; background: #fff; box-shadow: 0 18px 24px -14px rgba(60, 30, 10, .7); rotate: 3deg; transition: rotate .5s cubic-bezier(.34, 1.56, .64, 1), scale .4s; }
.mb-pola::after { content: ''; position: absolute; left: 50%; bottom: 12px; width: 50px; height: 4px; margin-left: -25px; border-radius: 2px; background: var(--c); }
.mb-pola:hover { rotate: 0deg; scale: 1.03; }
.mb-pola__photo { display: block; aspect-ratio: 1; overflow: hidden; background: #efe8e0; }
.mb-pola__photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.mb-pola__pin { position: absolute; z-index: 2; left: 50%; top: -22px; width: 26px; height: 40px; margin-left: -13px; background: url('../images/pin.svg') no-repeat center / contain; transform-origin: 50% 100%; }
.mb { overflow-x: clip; }
.mb-js .mb:not(.is-in) .mb-pola, .mb-js .mb:not(.is-in) .mb-text > *, .mb-js .mb:not(.is-in) .bird-2::after { opacity: 0; }
/* it is pinned on: the photo drops onto the cork, the pin pops in */
.mb.is-in .mb-pola { animation: mb-pin .8s cubic-bezier(.34, 1.4, .64, 1) .2s backwards; }
.mb.is-in .mb-pola__pin { animation: mb-pop .45s cubic-bezier(.34, 1.8, .64, 1) .85s backwards; }
@keyframes mb-pin { from { opacity: 0; translate: 0 -50px; scale: 1.12; } to { opacity: 1; translate: 0 0; scale: 1; } }
@keyframes mb-pop { from { scale: 0; } to { scale: 1; } }
/* the bird (the drawing looks left) flies in from the right to the name, then hovers there */
.mb.is-in .bird-2::after { animation: mb-bird 1.6s cubic-bezier(.2, .7, .3, 1) .4s backwards, mb-hover 2.4s ease-in-out 2s infinite alternate; }
@keyframes mb-bird { from { opacity: 0; translate: 60vw -60px; } 20% { opacity: 1; } to { opacity: 1; translate: 0 0; } }
@keyframes mb-hover { from { translate: 0 -5px; rotate: -2deg; } to { translate: 0 5px; rotate: 2deg; } }
/* the text comes up after it */
.mb.is-in .mb-text > * { animation: mb-up .7s cubic-bezier(.3, 1.2, .5, 1) backwards; }
.mb.is-in .mb-text > :nth-child(2) { animation-delay: .5s; }
.mb.is-in .mb-text > :nth-child(3) { animation-delay: .6s; }
.mb.is-in .mb-text > :nth-child(4) { animation-delay: .7s; }
.mb.is-in .mb-text > :nth-child(n+5) { animation-delay: .8s; }
@keyframes mb-up { from { opacity: 0; translate: 0 20px; } to { opacity: 1; translate: 0 0; } }
@media only screen and (max-width: 768px) {
	.mb-cork { max-width: 320px; margin: 30px auto 10px; }
}
@media (prefers-reduced-motion: reduce) {
	.mb.is-in .mb-pola, .mb.is-in .mb-pola__pin, .mb.is-in .bird-2::after, .mb.is-in .mb-text > * { animation: none; }
}

/* ---------- The decalogue: a string of bulbs ---------- */
.crew__lights { margin-top: 90px; }
.crew .crew__deca-title { margin: 0 0 50px; font: 400 40px/1.2 'Cabin Sketch', Arial, sans-serif; text-align: center; color: #3c4741; opacity: 0; transform: translateY(20px); transition: opacity .8s, transform .8s; }
.crew .crew__deca-title.is-in { opacity: 1; transform: none; }
.crew__deca { position: relative; margin: 0; padding: 0; list-style: none; }
.crew__deca::before { content: ''; position: absolute; left: 50%; top: -30px; bottom: 30px; width: 3px; margin-left: -1.5px; border-radius: 2px; background: #5b6670; }
.bulb { position: relative; width: 50%; margin: 0 0 22px; padding-right: 64px; }
/* the two sides interlock a little (the bulbs on the wire still keep apart) */
.bulb + .bulb { margin-top: -30px; }
.bulb.is-right { margin-left: 50%; padding: 0 0 0 64px; }
.bulb p { margin: 0; padding: 20px 24px; border-radius: 22px; background: #fff; box-shadow: 0 18px 30px -20px rgba(60, 40, 20, .5); font-size: 16px; line-height: 1.7; color: #3c4741; opacity: .35; transform: translateX(-20px); transition: opacity .7s .35s, transform .9s cubic-bezier(.34, 1.3, .64, 1) .35s; }
.bulb.is-left p { border-right: 5px solid var(--c); }
.bulb.is-right p { border-left: 5px solid var(--c); transform: translateX(20px); }
.bulb.is-in p { opacity: 1; transform: none; }
/* the bulb hangs from the wire: grey while off, it flickers alight in its colour */
.bulb__glass { position: absolute; top: 14px; right: -22px; width: 44px; height: 54px; border-radius: 50% 50% 46% 46% / 56% 56% 44% 44%; background: radial-gradient(circle at 38% 32%, #fff 0 14%, #e3e8ec 40%, #cfd6dc); }
.bulb.is-right .bulb__glass { right: auto; left: -22px; }
.bulb__glass::before { content: ''; position: absolute; left: 13px; top: -10px; width: 18px; height: 14px; border-radius: 3px; background: repeating-linear-gradient(#7d8790 0 3px, #a3acb4 3px 5px); }
.crew .bulb__glass b { position: absolute; inset: 0; display: grid; place-items: center; padding-top: 6px; font: 400 20px/1 'Cabin Sketch', Arial, sans-serif; color: #8a949c; }
.bulb.is-in .bulb__glass { background: radial-gradient(circle at 38% 32%, #fff 0 16%, color-mix(in srgb, var(--c) 60%, #fff) 42%, var(--c)); box-shadow: 0 0 22px 8px color-mix(in srgb, var(--c) 55%, transparent); animation: crew-light 1.1s steps(1, end) .1s backwards; }
.bulb.is-in .bulb__glass b { color: #fff; transition: color .2s .9s; }
@keyframes crew-light {
	0%, 30%, 55% { background: radial-gradient(circle at 38% 32%, #fff 0 14%, #e3e8ec 40%, #cfd6dc); box-shadow: none; }
	15%, 42%, 70%, 100% { background: radial-gradient(circle at 38% 32%, #fff 0 16%, color-mix(in srgb, var(--c) 60%, #fff) 42%, var(--c)); box-shadow: 0 0 22px 8px color-mix(in srgb, var(--c) 55%, transparent); }
}

/* ---------- Smaller screens ---------- */
@media only screen and (max-width: 1100px) {
	.crew__hello { flex-direction: column; gap: 30px; }
	.crew__pic { width: 360px; }
	.crew__photos { grid-template-columns: repeat(3, 1fr); padding: 50px 30px 40px; }
}
@media only screen and (max-width: 768px) {
	.crew__pic { width: 100%; max-width: 340px; }
	.crew__quote { padding: 110px 22px 26px; }
	.crew__flame { left: 50%; top: 4px; margin: 0 0 0 -18px; }
	.crew .crew__quote p { font-size: 22px; text-align: center; }
	.crew__quote::before { width: 100%; height: 60%; border-radius: 30px 30px 0 0; background: radial-gradient(circle at 50% 60px, rgba(255, 206, 84, .5), rgba(255, 206, 84, 0) 62%); }
	.crew__board { margin-top: 50px; }
	.crew__photos { grid-template-columns: 1fr 1fr; gap: 34px 16px; padding: 40px 14px 26px; border-width: 10px; }
	.pola a { padding: 8px 8px 12px; }
	.pola__name { font-size: 14px; }
	.pola__role { font-size: 12px; }
	/* "Learn more" on one line, also on the narrowest phones */
	.pola__more { gap: 4px; padding: 6px 10px 6px 12px; font-size: 11.5px; white-space: nowrap; }
	.crew .crew__deca-title { font-size: 30px; }
	.crew__deca::before { left: 22px; }
	.bulb, .bulb.is-right { width: auto; margin-left: 0; padding: 0 0 0 64px; }
	.bulb + .bulb { margin-top: 0; }
	.bulb__glass, .bulb.is-right .bulb__glass { left: 0; right: auto; }
	.bulb.is-left p { border-right: 0; border-left: 5px solid var(--c); transform: translateX(20px); }
	.bulb.is-in p { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
	.crew *, .crew *::before, .crew *::after { animation: none !important; transition: none !important; }
	.crew__pic img, .crew__quote, .crew__flame i, .pola, .pola__pin, .bulb p, .crew .crew__deca-title { opacity: 1 !important; transform: none !important; }
	.crew__quote::before { opacity: 1; }
}
