#php2shell-animation {
	--ps-text: #172439;
	--ps-muted: #526278;
	--ps-border: #cbd5e1;
	--ps-bg: #f8fafc;
	--ps-surface: #fff;
	--ps-blue: #3155a3;
	--ps-blue-bg: #eef2ff;
	--ps-button-bg: #3155a3;
	--ps-button-hover: #24417f;
	--ps-button-text: #fff;
	--ps-pink: #a5224e;
	--ps-pink-bg: #fff1f5;
	color: var(--ps-text);
	font-size: 1rem;
	line-height: 1.5;
}

#php2shell-animation * {
	box-sizing: border-box;
}
#php2shell-animation [hidden] {
	display: none !important;
}
#php2shell-animation p {
	margin: 0;
	color: inherit;
}
#php2shell-animation strong,
#php2shell-animation b {
	color: inherit;
}
#php2shell-animation code {
	padding: 0;
	color: inherit;
	background: none;
}
#php2shell-animation .ps-controls {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 1rem;
}
#php2shell-animation button {
	min-height: 44px;
	padding: 0.5rem 0.8rem;
	border: 1px solid var(--ps-border);
	border-radius: 0.5rem;
	background: var(--ps-surface);
	color: var(--ps-text);
	font: inherit;
	cursor: pointer;
}
#php2shell-animation button:hover:not(:disabled) {
	background: var(--ps-blue-bg);
	color: var(--ps-text);
	border-color: var(--ps-blue);
}
#php2shell-animation button:focus-visible {
	outline: 2px solid var(--ps-blue);
	outline-offset: 3px;
}
#php2shell-animation button:disabled {
	opacity: 0.45;
	cursor: default;
}
#php2shell-animation .ps-controls .ps-next {
	background: var(--ps-button-bg);
	color: var(--ps-button-text);
	border-color: var(--ps-button-bg);
}
#php2shell-animation .ps-controls .ps-next:hover:not(:disabled) {
	background: var(--ps-button-hover);
	color: var(--ps-button-text);
	border-color: var(--ps-button-hover);
}
#php2shell-animation .ps-progress {
	display: flex;
	gap: 0.35rem;
	margin-bottom: 1rem;
}
#php2shell-animation .ps-progress span {
	flex: 1;
	height: 5px;
	background: var(--ps-border);
	border-radius: 4px;
}
#php2shell-animation .ps-progress .ps-complete {
	background: var(--ps-blue);
}
#php2shell-animation .ps-step {
	font-size: 1.15rem;
	font-weight: 700;
}
#php2shell-animation .ps-description {
	margin-top: 0.4rem;
	min-height: 4.5em;
}
#php2shell-animation .ps-requests {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	margin: 1rem 0;
}
#php2shell-animation .ps-requests > span {
	padding: 0.35rem 0.65rem;
	border-radius: 2rem;
	background: var(--ps-bg);
	border: 1px solid var(--ps-border);
	font-size: 0.9rem;
}
#php2shell-animation[data-step='0'] .ps-request-a,
#php2shell-animation[data-step='1'] .ps-request-a {
	background: var(--ps-blue-bg);
	border-color: var(--ps-blue);
}
#php2shell-animation[data-step='2'] .ps-request-b,
#php2shell-animation[data-step='3'] .ps-request-b,
#php2shell-animation[data-step='4'] .ps-request-b {
	background: var(--ps-pink-bg);
	border-color: var(--ps-pink);
}
#php2shell-animation .ps-worker {
	padding: 1rem;
	border: 2px solid var(--ps-blue);
	border-radius: 0.9rem;
	background: var(--ps-bg);
}
#php2shell-animation .ps-worker-title {
	font-weight: 700;
}
#php2shell-animation .ps-worker-note {
	font-size: 0.9rem;
	color: var(--ps-muted);
	margin-top: 0.25rem;
}
#php2shell-animation .ps-memory-flow {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 2.5rem minmax(0, 1.6fr);
	align-items: center;
	margin-top: 1.25rem;
}
#php2shell-animation .ps-pointer {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	padding: 0.9rem;
	background: var(--ps-blue-bg);
	border-radius: 0.5rem;
}
#php2shell-animation .ps-pointer > strong {
	font:
		700 1.4rem ui-monospace,
		Menlo,
		monospace;
}
#php2shell-animation .ps-stale {
	font-size: 0.85rem;
	font-weight: 700;
	color: var(--ps-pink);
	visibility: hidden;
}
#php2shell-animation:not([data-step='0']) .ps-stale {
	visibility: visible;
}
#php2shell-animation .ps-pointer-arrow {
	position: relative;
	text-align: center;
	color: var(--ps-blue);
	font-size: 2rem;
}
#php2shell-animation[data-step='3'] .ps-pointer-arrow > span {
	display: inline-block;
	animation: ps-follow 0.9s ease-in-out 2;
}
#php2shell-animation .ps-slot {
	background: var(--ps-surface);
	border: 2px solid var(--ps-blue);
	border-radius: 0.5rem;
	transition: border-color 0.5s;
}
#php2shell-animation .ps-address {
	padding: 0.6rem 0.75rem;
	border-bottom: 1px solid var(--ps-border);
	font-size: 0.9rem;
}
#php2shell-animation .ps-address strong {
	font-family: ui-monospace, Menlo, monospace;
}
#php2shell-animation .ps-slot-content {
	display: grid;
	overflow: hidden;
	border-radius: 0 0 0.4rem 0.4rem;
}
#php2shell-animation .ps-slot-content > div {
	grid-area: 1 / 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 0.45rem;
	padding: 0.9rem 0.75rem;
	min-height: 8rem;
	transition:
		transform 1.1s ease,
		opacity 0.8s ease;
}
#php2shell-animation .ps-slot-content span {
	font-size: 0.85rem;
}
#php2shell-animation .ps-slot-content strong {
	font:
		700 1rem ui-monospace,
		Menlo,
		monospace;
	overflow-wrap: anywhere;
}
#php2shell-animation .ps-original {
	background: var(--ps-blue-bg);
}
#php2shell-animation .ps-free {
	opacity: 0;
	background: var(--ps-bg);
}
#php2shell-animation .ps-replacement {
	opacity: 0;
	transform: translate(3rem, -5rem);
	background: var(--ps-pink-bg);
}
#php2shell-animation:not([data-step='0']) .ps-original {
	opacity: 0;
	transform: translateY(3rem);
}
#php2shell-animation[data-step='1'] .ps-slot {
	border-style: dashed;
	border-color: var(--ps-muted);
}
#php2shell-animation[data-step='1'] .ps-free {
	opacity: 1;
}
#php2shell-animation[data-step='2'] .ps-slot,
#php2shell-animation[data-step='3'] .ps-slot,
#php2shell-animation[data-step='4'] .ps-slot {
	border-color: var(--ps-pink);
}
#php2shell-animation[data-step='2'] .ps-replacement,
#php2shell-animation[data-step='3'] .ps-replacement,
#php2shell-animation[data-step='4'] .ps-replacement {
	opacity: 1;
	transform: translate(0, 0);
}
#php2shell-animation .ps-call-path {
	position: relative;
	height: 2.5rem;
	margin-left: 60%;
}
#php2shell-animation .ps-call-path::before {
	content: '↓';
	position: absolute;
	inset: 0;
	text-align: center;
	font-size: 1.6rem;
	color: var(--ps-muted);
}
#php2shell-animation .ps-call-path > span {
	display: block;
	position: absolute;
	left: 50%;
	top: -1rem;
	opacity: 0;
	font:
		700 0.9rem ui-monospace,
		Menlo,
		monospace;
	color: var(--ps-pink);
	background: var(--ps-pink-bg);
	padding: 0.15rem 0.4rem;
	border-radius: 0.25rem;
}
#php2shell-animation[data-step='4'] .ps-call-path > span {
	animation: ps-address-travel 1.3s ease-in-out forwards;
}
#php2shell-animation .ps-call {
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
	min-height: 8rem;
	padding: 1rem;
	border-radius: 0.5rem;
	border: 1px solid var(--ps-border);
	background: var(--ps-surface);
	transition:
		background-color 0.6s,
		border-color 0.6s;
}
#php2shell-animation .ps-call > span {
	font-size: 0.9rem;
}
#php2shell-animation .ps-target {
	font-family: ui-monospace, Menlo, monospace;
	overflow-wrap: anywhere;
}
#php2shell-animation[data-step='4'] .ps-call {
	background: var(--ps-pink-bg);
	border-color: var(--ps-pink);
}
#php2shell-animation[data-step='4'] .ps-output {
	font-weight: 700;
}
#php2shell-animation .ps-takeaway {
	margin-top: 1rem;
}
#php2shell-animation figcaption {
	margin-top: 1rem;
	font-size: 0.9rem;
	color: var(--ps-muted);
}

@keyframes ps-follow {
	50% {
		transform: translateX(0.4rem);
	}
}
@keyframes ps-address-travel {
	0% {
		opacity: 0;
		transform: translate(-50%, -1rem);
	}
	25% {
		opacity: 1;
	}
	75% {
		opacity: 1;
	}
	100% {
		opacity: 0;
		transform: translate(-50%, 2rem);
	}
}

@media (max-width: 480px) {
	#php2shell-animation .ps-memory-flow {
		grid-template-columns: minmax(0, 1fr);
	}
	#php2shell-animation .ps-pointer {
		flex-direction: row;
		flex-wrap: wrap;
		align-items: center;
		justify-content: space-between;
	}
	#php2shell-animation .ps-stale {
		flex-basis: 100%;
	}
	#php2shell-animation .ps-pointer-arrow {
		height: 2.5rem;
		line-height: 2.5rem;
	}
	#php2shell-animation .ps-pointer-arrow > span {
		display: inline-block;
		rotate: 90deg;
	}
	#php2shell-animation .ps-call-path {
		margin-left: 0;
	}
}

@media (prefers-color-scheme: dark) {
	#php2shell-animation {
		--ps-text: #e2e8f0;
		--ps-muted: #b0bfd1;
		--ps-border: #475569;
		--ps-bg: #172439;
		--ps-surface: #0f172a;
		--ps-blue: #9bb9ff;
		--ps-blue-bg: #243655;
		--ps-button-bg: #9bb9ff;
		--ps-button-hover: #bed0ff;
		--ps-button-text: #0f172a;
		--ps-pink: #fda4c1;
		--ps-pink-bg: #46283d;
	}
}

@media (prefers-reduced-motion: reduce) {
	#php2shell-animation *,
	#php2shell-animation *::before {
		animation: none !important;
		transition: none !important;
	}
}

@media (scripting: none) {
	#php2shell-animation .ps-demo {
		display: none;
	}
}
