/* Madina page transitions. The cover is drawn by transitions.js in one SVG;
   this file styles the layer, the centre mark and its small assembly motion. */
.mt {
	--mt-bg: #0B4A43;
	--mt-pattern: #78D1C6;
	--mt-gold: #FFD028;
	--mt-mint: #78D1C6;
	--mt-ink: #FFFFFF;
	--mt-soft: rgba(211, 236, 232, .55);
	--mt-glow: rgba(255, 208, 40, .28);
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	pointer-events: none;
	visibility: hidden;
	contain: strict;
}
.mt--light {
	--mt-bg: #FFFFFF;
	--mt-pattern: #008F7E;
	--mt-gold: #C79A00;
	--mt-mint: #008F7E;
	--mt-ink: #0B4A43;
	--mt-soft: rgba(11, 74, 67, .35);
	--mt-glow: rgba(255, 208, 40, .35);
}
.mt.is-on { visibility: visible; pointer-events: auto; }
.mt__fx { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.mt__fill { fill: var(--mt-bg); }
.mt__pat path { fill: none; stroke: var(--mt-pattern); stroke-width: 1; opacity: .09; }
.mt--light .mt__pat path { opacity: .07; }

/* The incoming page starts covered (class added by the inline script in <body>),
   so nothing flashes before the reveal. If scripts fail, the cover lifts by itself. */
html.mt-arriving .mt { visibility: visible; animation: mt-failsafe 0s linear 3.5s forwards; }
html.mt-arriving .mt__mark { opacity: 1; }
@keyframes mt-failsafe { to { visibility: hidden; } }

/* Centre mark */
.mt__mark {
	position: absolute;
	left: 50%;
	top: 50%;
	width: min(42vmin, 230px);
	transform: translate(-50%, -54%);
	text-align: center;
	opacity: 0;
	color: var(--mt-ink);
	will-change: opacity, transform;
}
.mt__mark svg, .mt__mark img { display: block; width: 100%; height: auto; margin: 0 auto; }
.mt__name {
	display: block;
	margin-top: .35em;
	font: 400 clamp(26px, 4.4vmin, 38px)/1 "Instrument Serif", Georgia, serif;
	letter-spacing: .01em;
	color: var(--mt-ink);
}
.mt__cap {
	display: block;
	margin-top: .55em;
	font: 600 12px/1.3 Inter, system-ui, sans-serif;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--mt-gold);
}
.mt__cap:empty { display: none; }

/* Mark artwork classes (shared by every bundled SVG) */
.mt-svg .m-gold-f { fill: var(--mt-gold); }
.mt-svg .m-mint-f { fill: var(--mt-mint); }
.mt-svg .m-deep-f { fill: var(--mt-bg); }
.mt-svg .m-soft-f { fill: var(--mt-soft); }
.mt-svg .m-gold-s, .mt-svg .m-mint-s, .mt-svg .m-soft-s, .mt-svg .m-snow { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.mt-svg .m-gold-s { stroke: var(--mt-gold); stroke-width: 4; }
.mt-svg .m-mint-s { stroke: var(--mt-mint); stroke-width: 2; }
.mt-svg .m-soft-s { stroke: var(--mt-soft); stroke-width: 1.5; }
.mt-svg .m-thin { stroke-width: 1.2; }
.mt-svg .m-lamp { stroke-width: 1.6; }
.mt-svg .m-glow { fill: var(--mt-glow); }
.mt-svg .m-snow { stroke: var(--mt-mint); stroke-width: 1.6; }
.mt-svg .m-vein { stroke: rgba(0, 0, 0, .18); stroke-width: 1; fill: none; }
.mt-svg .m-l1 { fill: #E8873B; }
.mt-svg .m-l2 { fill: #C0392B; }
.mt-svg .m-l3 { fill: #F2B134; }
.mt-svg .m-l4 { fill: #A0672F; }
.mt-svg .m-brick1 { fill: #C8734A; }
.mt-svg .m-brick2 { fill: #A9573A; }
.mt--light .mt-svg .m-brick1 { fill: #D4825A; }

/* Assembly: the window draws, the star turns into place, the ring gathers. */
.mt.is-mark .m-arch, .mt.is-mark .m-arch2, .mt.is-mark .m-sill, .mt.is-mark .m-ring circle[pathLength] {
	stroke-dasharray: 1;
	animation: mt-draw .5s cubic-bezier(.65, 0, .35, 1) both;
}
.mt.is-mark .m-arch2 { animation-delay: .08s; }
.mt.is-mark .m-star { transform-box: fill-box; transform-origin: center; animation: mt-star .55s cubic-bezier(.16, 1, .3, 1) .05s both; }
.mt.is-mark .m-ring > g { transform-box: fill-box; transform-origin: center; animation: mt-pop .45s cubic-bezier(.34, 1.56, .64, 1) both; animation-delay: calc(var(--i) * 22ms + .06s); }
.mt.is-held .m-star { animation: mt-spin 9s linear infinite; }
.mt.is-held .m-glow { animation: mt-flicker 1.6s ease-in-out infinite alternate; }
@keyframes mt-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes mt-star { from { transform: rotate(-45deg) scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes mt-pop { from { transform: scale(0); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes mt-spin { to { transform: rotate(45deg); } }
@keyframes mt-flicker { to { opacity: .55; } }

@media (prefers-reduced-motion: reduce) {
	.mt.is-mark .m-arch, .mt.is-mark .m-arch2, .mt.is-mark .m-sill, .mt.is-mark .m-star, .mt.is-mark .m-ring > g, .mt.is-held .m-star { animation: none; }
}
