/* Frog Creek Leapfrog Modal */

.fcm-overlay,
.fcm-overlay *,
.fcm-overlay *::before,
.fcm-overlay *::after {
	box-sizing: border-box;
}

html.fcm-lock,
html.fcm-lock body {
	overflow: hidden;
}

.fcm-overlay {
	--fcm-blue: #1752B5;
	--fcm-green: #2E9C7E;
	--fcm-green-line: #15563F;
	--fcm-green-line: color-mix(in srgb, var(--fcm-green) 50%, #001a10);
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	display: grid;
	place-items: center;
	padding: 16px;
	background: rgba(6, 22, 56, 0.55);
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
	opacity: 0;
	transition: opacity 0.35s ease;
}
.fcm-overlay[hidden] { display: none; }
.fcm-overlay.is-open { opacity: 1; }
.fcm-overlay.is-closing { opacity: 0; transition-duration: 0.5s; }

.fcm-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- Modal shell ---------- */

.fcm-overlay .fcm-modal {
	position: relative;
	width: min(1000px, 100%, calc((100vh - 32px) * 1.2658));
	width: min(1000px, 100%, calc((100dvh - 32px) * 1.2658));
	aspect-ratio: 1000 / 790;
	overflow: hidden;
	container-type: inline-size;
	background: var(--fcm-blue);
	color: #fff;
	border-radius: 18px;
	font-family: var(--fcm-font, inherit);
	box-shadow: 0 30px 80px -20px rgba(0, 18, 60, 0.6);
	transform: translateY(14px) scale(0.98);
	transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
	outline: none;
}
.fcm-overlay.is-open .fcm-modal { transform: none; }
.fcm-overlay.is-closing .fcm-modal { transform: translateY(10px) scale(0.97); }

.fcm-shore {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	fill: #fff;
}
/* Simplified shore used only on narrow screens */
.fcm-curve {
	display: none;
	position: absolute;
	border-radius: 50%;
	background: #fff;
}

/* ---------- Copy ---------- */

.fcm-overlay .fcm-content {
	position: absolute;
	z-index: 2;
	left: 4.2%;
	top: 5.5%;
	bottom: 5.5%;
	width: 44%;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

.fcm-overlay .fcm-logo {
	display: block;
	width: 9.6cqw;
	height: auto;
	max-height: 11cqw;
	object-fit: contain;
	object-position: left top;
	margin: 0;
}

.fcm-overlay .fcm-title {
	margin: auto 0 0;
	padding: 0;
	font-family: inherit;
	font-size: 8.4cqw;
	font-weight: 800;
	line-height: 0.93;
	letter-spacing: -0.01em;
	text-transform: uppercase;
	color: #fff;
}

.fcm-overlay .fcm-body {
	margin: 2.4cqw 0 0;
	max-width: 34ch;
	font-size: max(13px, 1.55cqw);
	line-height: 1.4;
	color: #fff;
}
.fcm-overlay .fcm-body p { margin: 0 0 0.6em; font: inherit; color: inherit; }
.fcm-overlay .fcm-body p:last-child { margin-bottom: 0; }
.fcm-overlay .fcm-body a { color: #fff; text-decoration: underline; }

.fcm-overlay .fcm-close {
	appearance: none;
	margin: 2.6cqw 0 0;
	padding: 1.15cqw 2.6cqw;
	min-height: 32px;
	border: 0;
	border-radius: 3px;
	background: #fff;
	color: var(--fcm-blue);
	font: 700 max(11px, 1.2cqw) / 1 var(--fcm-font, inherit);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.15s ease;
}
.fcm-overlay .fcm-close:hover { background: #e3ebfa; }
.fcm-overlay .fcm-close:active { transform: translateY(1px); }
.fcm-overlay .fcm-close:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 3px;
}

.fcm-overlay .fcm-footer {
	margin: auto 0 0;
	font-size: max(11px, 1.2cqw);
	line-height: 1.3;
	color: #fff;
	opacity: 0.92;
}

/* ---------- Frog stage (600 x 450 grid) ---------- */

.fcm-stage {
	position: absolute;
	z-index: 3;
	right: 0;
	bottom: 6%;
	width: 60%;
	aspect-ratio: 600 / 450;
	pointer-events: none;
}

.fcm-stream {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: visible;
}
.fcm-stream-ribbon { fill: #fff; }
.fcm-stream-water { fill: var(--fcm-blue); }

/* Each frog box is 17% of the stage wide at a 5:4 ratio (wider poses overflow it).
   Negative margins put its bottom-centre on (left, top). */
.fcm-overlay .fcm-frog {
	position: absolute;
	left: 0;
	top: 0;
	display: block;
	width: 17%;
	aspect-ratio: 100 / 80;
	margin: -13.6% 0 0 -8.5%;
	padding: 0;
	border: 0;
	border-radius: 40%;
	background: none;
	transform-origin: 50% 100%;
	pointer-events: none;
	-webkit-tap-highlight-color: transparent;
}

.fcm-frog--white {
	--frog-ink: #fff;
	--frog-under: var(--fcm-blue);
	--frog-edge: var(--fcm-blue);
}
.fcm-frog--green {
	--frog-ink: var(--fcm-green);
	--frog-under: #d6efe6;
	--frog-under: color-mix(in srgb, var(--fcm-green) 18%, #fff);
	--frog-edge: transparent;
	visibility: hidden;
}
.fcm-frog--green.is-in { visibility: visible; }

.fcm-overlay .fcm-frog--white { pointer-events: auto; cursor: pointer; }
.fcm-overlay.is-playing .fcm-frog--white { cursor: default; }
.fcm-overlay .fcm-frog--white:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--fcm-blue);
}

.fcm-frog-art {
	position: absolute;
	inset: 0;
	display: block;
	transform-origin: 50% 100%;
}
.fcm-frog-svg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: visible;
}
.fcm-under {
	fill: var(--frog-under);
	stroke: var(--frog-edge);
	stroke-width: 7;
	stroke-linejoin: round;
}
.fcm-ink { fill: var(--frog-ink); }

/* Pose frames from the artwork: 1 ground, 2 ready, 3 leaping,
   4 full spread, 5 over the other frog, 6 landing, 7 landed */
.fcm-pose { display: none; }
.fcm-frog[data-pose="1"] .fcm-pose--1,
.fcm-frog[data-pose="2"] .fcm-pose--2,
.fcm-frog[data-pose="3"] .fcm-pose--3,
.fcm-frog[data-pose="4"] .fcm-pose--4,
.fcm-frog[data-pose="5"] .fcm-pose--5,
.fcm-frog[data-pose="6"] .fcm-pose--6,
.fcm-frog[data-pose="7"] .fcm-pose--7 { display: inline; }

/* Hovering the idle white frog makes it get ready to jump */
.fcm-overlay:not(.is-playing) .fcm-frog--white:hover[data-pose="1"] .fcm-pose--1 { display: none; }
.fcm-overlay:not(.is-playing) .fcm-frog--white:hover[data-pose="1"] .fcm-pose--2 { display: inline; }

/* Fixed layer the green frog escapes into, above the overlay */
.fcm-escape {
	position: fixed;
	inset: 0;
	z-index: 2147483001;
	overflow: hidden;
	pointer-events: none;
}
.fcm-escape .fcm-frog {
	display: block;
	appearance: none;
	padding: 0;
	border: 0;
	background: none;
}

/* Hint bubble above the white frog (frog sits at 30, 319) */
.fcm-hint {
	position: absolute;
	left: 5%;
	bottom: 50%;
	transform: translateX(-50%);
	padding: 0.45em 0.8em;
	border: 2px solid var(--fcm-blue);
	border-radius: 999px;
	background: #fff;
	color: var(--fcm-blue);
	font: 700 max(11px, 1.1cqw) / 1 var(--fcm-font, inherit);
	white-space: nowrap;
	opacity: 0;
	transition: opacity 0.3s ease;
}
.fcm-hint::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: -7px;
	width: 10px;
	height: 10px;
	margin-left: -5px;
	background: #fff;
	border-right: 2px solid var(--fcm-blue);
	border-bottom: 2px solid var(--fcm-blue);
	transform: rotate(45deg);
}
.fcm-overlay.is-open .fcm-hint { opacity: 1; transition-delay: 1.6s; }
.fcm-overlay.is-playing .fcm-hint { opacity: 0; transition-delay: 0s; }

/* ---------- Narrow screens: stack copy over the pond ---------- */

@media (max-width: 640px) {
	.fcm-overlay .fcm-modal {
		width: min(100%, calc((100vh - 32px) * 0.5625));
		width: min(100%, calc((100dvh - 32px) * 0.5625));
		aspect-ratio: 9 / 16;
	}
	.fcm-shore { display: none; }
	.fcm-curve { display: block; left: 24.7%; top: 66.7%; width: 168.75%; height: 39.55%; }
	.fcm-overlay .fcm-content { left: 7%; right: 7%; top: 6%; bottom: auto; width: auto; }
	.fcm-overlay .fcm-logo { width: 19cqw; max-height: 20cqw; }
	.fcm-overlay .fcm-title { margin-top: 7cqw; font-size: 11.5cqw; }
	.fcm-overlay .fcm-body { margin-top: 4cqw; font-size: max(14px, 4cqw); }
	.fcm-overlay .fcm-close { margin-top: 5cqw; padding: 3cqw 6cqw; font-size: max(12px, 3.4cqw); }
	.fcm-overlay .fcm-footer { margin-top: 4cqw; font-size: max(12px, 3.2cqw); }
	.fcm-stage { width: 93.75%; bottom: 3%; }
	.fcm-hint { font-size: max(11px, 3.2cqw); }
}

@media (prefers-reduced-motion: reduce) {
	.fcm-overlay,
	.fcm-overlay .fcm-modal { transition-duration: 0.01s; }
}
