/* Interactive product demo and privacy code preview. */
.demo-video {
	position: relative;
	isolation: isolate;
}

.demo-video figcaption {
	position: relative;
	z-index: 8;
}

.video-phases {
	position: relative;
	width: 12.5rem;
	height: 1em;
	text-align: right;
}

.video-phases .phase {
	position: absolute;
	top: 0;
	right: 0;
	color: var(--cyan);
	font-weight: 600;
	letter-spacing: 0.08em;
	opacity: 0;
	animation: demo-phase 12s linear infinite;
}

.video-phases .phase-analyze {
	color: #a78bfa;
	animation-delay: 4s;
}

.video-phases .phase-result {
	color: #67e8f9;
	animation-delay: 8s;
}

.video-editor {
	background:
		linear-gradient(rgba(47, 140, 255, 0.035) 1px, transparent 1px),
		#01050d;
	background-size: 100% 2rem;
}

.video-code .code-line {
	display: block;
	min-height: 2em;
}

.video-code .video-selected {
	border-left: 2px solid transparent;
	background: transparent;
	animation: demo-selection 12s ease infinite;
}

.video-code .video-selected:nth-child(3) {
	animation-delay: 80ms;
}

.video-code .video-selected:nth-child(4) {
	animation-delay: 160ms;
}

.video-context {
	position: absolute;
	z-index: 6;
	top: 9.6rem;
	left: clamp(4.5rem, 29%, 10rem);
	display: grid;
	width: min(18rem, calc(100% - 5rem));
	padding: 0.45rem;
	border: 1px solid rgba(127, 171, 255, 0.34);
	border-radius: 8px;
	background: #0a1424;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.58), 0 0 26px rgba(47, 140, 255, 0.12);
	color: #aebfd5;
	font: 0.64rem/1.4 var(--mono);
	opacity: 0;
	transform: translateY(-5px) scale(0.97);
	transform-origin: top left;
	pointer-events: none;
	animation: demo-menu 12s ease infinite;
}

.video-context span,
.video-context strong {
	padding: 0.42rem 0.55rem;
	font-weight: 400;
}

.video-context strong {
	border-radius: 5px;
	background: linear-gradient(90deg, rgba(47, 140, 255, 0.95), rgba(34, 211, 238, 0.78));
	color: #031027;
	font-weight: 700;
}

.video-cursor {
	position: absolute;
	z-index: 7;
	top: 6.5rem;
	left: 57%;
	width: 15px;
	height: 21px;
	filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.72));
	transform: rotate(-18deg);
	transform-origin: top left;
	animation: demo-cursor 12s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.video-cursor::before {
	position: absolute;
	inset: 0;
	content: "";
	background: #f4f8ff;
	clip-path: polygon(0 0, 100% 70%, 61% 75%, 80% 100%, 61% 100%, 44% 77%, 16% 100%);
}

.video-cursor::after {
	position: absolute;
	top: 3px;
	left: 3px;
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: var(--cyan);
	box-shadow: 0 0 0 5px rgba(34, 211, 238, 0.12);
	content: "";
	animation: demo-click 12s ease infinite;
}

.video-selected-pill {
	opacity: 0;
	transform: translateY(6px);
	animation: demo-pill 12s ease infinite;
}

.video-explain {
	position: relative;
	overflow: hidden;
}

.video-explain::after {
	position: absolute;
	inset: 0;
	z-index: 4;
	background: #071528;
	content: "";
	transform-origin: top;
	animation: demo-result-cover 12s ease infinite;
	pointer-events: none;
}

.video-explain article,
.video-explain section,
.video-explain footer {
	animation: demo-result-content 12s ease infinite;
}

.video-toggle {
	position: absolute;
	z-index: 12;
	right: 0.8rem;
	bottom: 0.8rem;
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	padding: 0.5rem 0.7rem;
	border: 1px solid rgba(127, 171, 255, 0.34);
	border-radius: 999px;
	background: rgba(3, 12, 27, 0.88);
	box-shadow: 0 9px 26px rgba(0, 0, 0, 0.35);
	color: #c7d8ee;
	font: 600 0.58rem var(--mono);
	cursor: pointer;
	backdrop-filter: blur(8px);
}

.video-toggle:hover,
.video-toggle:focus-visible {
	border-color: var(--cyan);
	color: #fff;
	outline: none;
}

.pause-icon {
	color: var(--cyan);
	font-size: 0.52rem;
}

.demo-video.is-paused *,
.demo-video.is-paused *::before,
.demo-video.is-paused *::after {
	animation-play-state: paused !important;
}

@keyframes demo-phase {
	0%, 3% { opacity: 0; transform: translateY(4px); }
	7%, 27% { opacity: 1; transform: translateY(0); }
	31%, 100% { opacity: 0; transform: translateY(-4px); }
}

@keyframes demo-selection {
	0%, 10% { border-left-color: transparent; background: transparent; }
	18%, 88% { border-left-color: #2f8cff; background: rgba(47, 140, 255, 0.18); }
	96%, 100% { border-left-color: transparent; background: transparent; }
}

@keyframes demo-menu {
	0%, 29% { opacity: 0; transform: translateY(-5px) scale(0.97); }
	34%, 50% { opacity: 1; transform: translateY(0) scale(1); }
	55%, 100% { opacity: 0; transform: translateY(-3px) scale(0.98); }
}

@keyframes demo-cursor {
	0%, 5% { top: 6.5rem; left: 57%; opacity: 0; }
	8% { top: 6.5rem; left: 57%; opacity: 1; }
	13% { top: 6.5rem; left: 33%; opacity: 1; }
	22% { top: 10.2rem; left: 62%; opacity: 1; }
	29%, 33% { top: 9rem; left: 54%; opacity: 1; }
	41%, 49% { top: 14.15rem; left: 52%; opacity: 1; }
	55%, 88% { top: 14.15rem; left: 52%; opacity: 0; }
	96%, 100% { top: 6.5rem; left: 57%; opacity: 0; }
}

@keyframes demo-click {
	0%, 11%, 25%, 42%, 100% { transform: scale(0); opacity: 0; }
	14%, 28%, 46% { transform: scale(2.2); opacity: 0.75; }
	17%, 31%, 49% { transform: scale(4); opacity: 0; }
}

@keyframes demo-pill {
	0%, 18% { opacity: 0; transform: translateY(6px); }
	24%, 88% { opacity: 1; transform: translateY(0); }
	96%, 100% { opacity: 0; transform: translateY(6px); }
}

@keyframes demo-result-cover {
	0%, 51% { opacity: 0.94; transform: scaleY(1); }
	59%, 88% { opacity: 0; transform: scaleY(0); }
	96%, 100% { opacity: 0.94; transform: scaleY(1); }
}

@keyframes demo-result-content {
	0%, 52% { opacity: 0.12; transform: translateY(6px); }
	61%, 88% { opacity: 1; transform: translateY(0); }
	96%, 100% { opacity: 0.12; transform: translateY(6px); }
}

/* Privacy panel: a compact, read-only editor and verified result. */
.privacy-code {
	overflow: hidden;
	border: 1px solid rgba(94, 147, 255, 0.32);
	border-radius: 18px;
	background: #020711;
	box-shadow: 0 28px 80px rgba(0, 0, 0, 0.46), 0 0 48px rgba(47, 140, 255, 0.08);
}

.privacy-code > header {
	display: flex;
	justify-content: space-between;
	padding: 0.8rem 1rem;
	border-bottom: 1px solid rgba(127, 171, 255, 0.2);
	background: #08172d;
	color: #879bb5;
	font: 0.58rem var(--mono);
}

.privacy-code > header b {
	color: var(--cyan);
	font-weight: 600;
}

.privacy-code-body {
	display: grid;
	grid-template-columns: minmax(0, 1.12fr) minmax(180px, 0.88fr);
	min-height: 310px;
}

.privacy-source {
	position: relative;
	min-width: 0;
	border-right: 1px solid rgba(127, 171, 255, 0.2);
	background: #01050d;
}

.privacy-tab {
	padding: 0.85rem 1rem;
	border-bottom: 1px solid rgba(127, 171, 255, 0.2);
	color: #d5e3f5;
	font: 600 0.64rem var(--mono);
}

.privacy-source pre {
	margin: 0;
	padding: 3rem 0 5rem;
	overflow: hidden;
	color: #bdcde1;
	font: clamp(0.58rem, 0.72vw, 0.7rem)/2.15 var(--mono);
}

.privacy-source code,
.privacy-source code span,
.privacy-source mark {
	display: block;
	min-width: 390px;
}

.privacy-source code i {
	display: inline-block;
	width: 2.5rem;
	margin-right: 0.6rem;
	color: #526985;
	text-align: right;
}

.privacy-source code b {
	color: #c084fc;
}

.privacy-source code u {
	color: var(--cyan);
	text-decoration: none;
}

.privacy-source mark {
	border-left: 2px solid #2f8cff;
	background: rgba(47, 140, 255, 0.18);
	color: inherit;
}

.privacy-source > small {
	position: absolute;
	right: 1rem;
	bottom: 1rem;
	padding: 0.42rem 0.65rem;
	border: 1px solid rgba(47, 140, 255, 0.36);
	border-radius: 999px;
	background: #0c315f;
	color: #b9d9ff;
	font: 0.48rem var(--mono);
}

.privacy-result {
	display: flex;
	min-width: 0;
	flex-direction: column;
	padding: 1rem;
	background: linear-gradient(155deg, #091a32, #071426);
}

.privacy-result-title {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	padding-bottom: 0.9rem;
	border-bottom: 1px solid rgba(127, 171, 255, 0.2);
}

.privacy-result-title span {
	display: grid;
	width: 34px;
	height: 34px;
	place-items: center;
	border-radius: 8px;
	background: linear-gradient(135deg, #2f8cff, #22d3ee);
	color: #031027;
	font: 700 0.62rem var(--mono);
}

.privacy-result-title strong {
	font-size: 0.78rem;
}

.privacy-result > small {
	margin-top: 1rem;
	color: var(--cyan);
	font: 0.5rem var(--mono);
}

.privacy-result p {
	margin: 0.65rem 0 1rem;
	color: #c4d3e6;
	font-size: 0.72rem;
	line-height: 1.7;
}

.privacy-result code {
	color: #67e8f9;
	font-family: var(--mono);
}

.privacy-result ul {
	display: grid;
	gap: 0.55rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.privacy-result li {
	color: #91a6c1;
	font: 0.56rem var(--mono);
}

.privacy-result li::before {
	margin-right: 0.45rem;
	color: var(--cyan);
	content: "\2713";
}

.privacy-result footer {
	margin-top: auto;
	padding-top: 1rem;
	border-top: 1px solid rgba(127, 171, 255, 0.2);
	background: none;
	color: #67e8f9;
	font: 0.48rem var(--mono);
}

/* Language marks and restrained interaction polish. */
.languages {
	gap: 0.75rem;
}

.language-item {
	position: relative;
	display: flex;
	align-items: center;
	gap: 0.45rem;
	min-width: 0;
	padding: 0.45rem 0.55rem;
	border: 1px solid transparent;
	border-radius: 12px;
	background: rgba(8, 19, 35, 0.38);
	transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.language-item::after {
	position: absolute;
	inset: auto 16% -1px;
	height: 1px;
	background: linear-gradient(90deg, transparent, var(--language-color, var(--lime)), transparent);
	content: "";
	opacity: 0;
	transition: opacity 180ms ease;
}

.language-item img {
	width: 15px;
	height: 15px;
	flex: 0 0 15px;
	border-radius: 4px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
	transition: transform 180ms ease, filter 180ms ease;
}

.language-item > div {
	display: grid;
	gap: 0.18rem;
}

.language-item b {
	color: #e9f2ff;
	font-size: 0.74rem;
	white-space: nowrap;
}

.language-item small {
	color: #6f86a3;
	font: 0.48rem var(--mono);
}

.language-js { --language-color: #f7df1e; }
.language-ts { --language-color: #3178c6; }
.language-jsx { --language-color: #61dafb; }
.language-tsx { --language-color: #8b5cf6; }
.language-vscode { --language-color: #29b6f6; }

.language-item:hover,
.language-item:focus-visible {
	border-color: color-mix(in srgb, var(--language-color) 54%, transparent);
	background: color-mix(in srgb, var(--language-color) 9%, #081323);
	box-shadow: 0 12px 28px color-mix(in srgb, var(--language-color) 12%, transparent);
	transform: translateY(-4px);
	outline: none;
}

.language-item:hover::after,
.language-item:focus-visible::after {
	opacity: 1;
}

.language-item:hover img,
.language-item:focus-visible img {
	filter: saturate(1.15) brightness(1.08);
	transform: scale(1.07) rotate(-2deg);
}

.brand-icon,
.button,
.text-link,
.links a,
.steps button,
.privacy-list article,
.faq-list article,
.product,
.demo,
.privacy-code {
	transition: transform 180ms ease, color 180ms ease, border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.brand:hover .brand-icon {
	border-color: var(--cyan);
	color: var(--cyan);
	transform: rotate(-5deg) scale(1.05);
}

.links a:hover,
.links a:focus-visible,
.links a[aria-current="page"] {
	color: var(--cyan);
}

.links a[aria-current="page"] {
	background: rgba(47, 140, 255, 0.08);
}

.button:hover,
.button:focus-visible {
	box-shadow: 0 15px 34px rgba(47, 140, 255, 0.25);
	transform: translateY(-3px);
}

.text-link:hover,
.text-link:focus-visible {
	border-bottom-color: var(--cyan);
	color: var(--cyan);
}

.steps button:hover {
	border-color: rgba(34, 211, 238, 0.24);
	transform: translateX(5px);
}

.privacy-list article:hover {
	background: linear-gradient(90deg, rgba(47, 140, 255, 0.08), transparent 72%);
	transform: translateX(5px);
}

.faq-list article:hover {
	border-color: rgba(139, 92, 246, 0.38);
	background: rgba(139, 92, 246, 0.025);
}

.product:hover,
.demo:hover,
.privacy-code:hover {
	border-color: rgba(34, 211, 238, 0.4);
	box-shadow: 0 30px 84px rgba(0, 0, 0, 0.58), 0 0 55px rgba(47, 140, 255, 0.11);
}

@media (max-width: 1100px) {
	.languages {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.languages > span {
		grid-column: 1 / -1;
	}

	.video-explain::after {
		transform-origin: left;
	}

	.privacy-code-body {
		grid-template-columns: 1fr 0.9fr;
	}
}

@media (max-width: 760px) {
	.languages {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.language-item {
		padding: 0.5rem;
	}

	.video-phases {
		width: 9rem;
	}

	.video-phases .phase {
		font-size: 0.5rem;
	}

	.video-context {
		left: 3.5rem;
		width: min(17rem, calc(100% - 4.5rem));
	}

	.privacy-code-body {
		grid-template-columns: 1fr;
	}

	.privacy-source {
		min-height: 270px;
		border-right: 0;
		border-bottom: 1px solid rgba(127, 171, 255, 0.2);
	}

	.privacy-result {
		min-height: 280px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.language-item,
	.language-item img,
	.brand-icon,
	.button,
	.steps button,
	.privacy-list article {
		transition: none;
	}

	.video-phases .phase-select,
	.video-code .video-selected,
	.video-selected-pill,
	.video-explain article,
	.video-explain section,
	.video-explain footer {
		animation: none;
		opacity: 1;
		transform: none;
	}

	.video-code .video-selected {
		border-left-color: #2f8cff;
		background: rgba(47, 140, 255, 0.18);
	}

	.video-phases .phase:not(.phase-result),
	.video-context,
	.video-cursor,
	.video-explain::after {
		display: none;
	}

	.video-phases .phase-result {
		animation: none;
		opacity: 1;
		transform: none;
	}
}

@media (max-width: 760px) {
	.demo-video figcaption {
		gap: 0.75rem;
	}

	.demo-video .ide {
		min-height: 0;
	}

	.demo-video .video-editor {
		min-height: 390px;
	}

	.video-code {
		padding-top: 2rem !important;
		font-size: 0.67rem !important;
	}

	.video-code code {
		min-width: 430px;
	}

	.video-context {
		left: 2.5rem;
		width: min(16.5rem, calc(100% - 3.5rem));
	}

	.demo {
		min-height: 500px;
	}

	.demo pre {
		margin: 3rem 1rem;
		overflow-x: auto;
	}

	.context {
		right: 1rem;
		max-width: calc(100% - 2rem);
	}

	.privacy-code > header {
		gap: 0.75rem;
	}

	.privacy-source pre {
		overflow-x: auto;
	}
}

@media (max-width: 600px) {
	.demo-video figcaption {
		display: grid;
		min-height: 3.7rem;
	}

	.video-phases {
		width: 100%;
		text-align: left;
	}

	.video-phases .phase {
		right: auto;
		left: 0;
	}

	.demo-video .video-editor {
		min-height: 360px;
	}

	.video-code code {
		min-width: 390px;
	}

	.video-context {
		top: 8.8rem;
		left: 1.75rem;
		width: min(15rem, calc(100% - 2.5rem));
	}

	.video-toggle {
		right: 0.65rem;
		bottom: 0.65rem;
		min-height: 44px;
	}

	.demo {
		min-height: 470px;
	}

	.demo > header,
	.privacy-code > header {
		align-items: flex-start;
		flex-direction: column;
	}

	.demo pre {
		margin: 2rem 0.75rem;
		padding: 1.25rem;
		font-size: 0.62rem;
	}

	.context {
		top: 11rem;
		right: 0.75rem;
		width: 13.5rem;
		max-width: calc(100% - 1.5rem);
	}

	.demo article {
		right: 0.75rem;
		bottom: 0.75rem;
		left: 0.75rem;
		padding: 1rem;
	}

	.demo article strong {
		font-size: 1.1rem;
	}

	.privacy-source {
		min-height: 250px;
	}

	.privacy-source pre {
		padding: 2.25rem 0 4.5rem;
		font-size: 0.56rem;
	}

	.privacy-source code,
	.privacy-source code span,
	.privacy-source mark {
		min-width: 350px;
	}

	.privacy-source > small {
		right: 0.65rem;
		bottom: 0.65rem;
	}

	.privacy-result {
		min-height: 260px;
	}
}

@media (max-width: 380px) {
	.video-code code {
		min-width: 355px;
	}

	.video-context {
		left: 1rem;
		width: calc(100% - 1.5rem);
	}

	.privacy-source code,
	.privacy-source code span,
	.privacy-source mark {
		min-width: 325px;
	}
}
