/* WhoChanged Playground demo page — matches landing dark palette. */

:root {
	--ink: #f5f5f7;
	--ink-soft: #a1a1a6;
	--ink-faint: #6e6e73;
	--bg: #000000;
	--bg-elevated: #0d0d10;
	--bg-section: #131318;
	--line: rgba(255, 255, 255, .1);
	--line-soft: rgba(255, 255, 255, .06);
	--brand: #4f7cff;
	--brand-dark: #2f5ce0;
	--radius: 18px;
	--font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
	margin: 0;
	min-height: 100%;
	font-family: var(--font);
	color: var(--ink);
	background: var(--bg);
	-webkit-font-smoothing: antialiased;
	line-height: 1.5;
}

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus {
	left: 8px;
	top: 8px;
	background: #fff;
	color: #000;
	padding: 8px 12px;
	border-radius: 8px;
	z-index: 9;
}

/* ---------- Header ---------- */
.demo-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(0, 0, 0, .6);
	backdrop-filter: saturate(180%) blur(16px);
	border-bottom: 1px solid var(--line-soft);
}

.demo-header-inner {
	max-width: 1280px;
	margin: 0 auto;
	padding: 0 28px;
	height: 64px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
}

.demo-header-brand {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	text-decoration: none;
	color: inherit;
	min-width: 0;
}

.demo-header-logo {
	width: 40px;
	height: 40px;
	border-radius: 8px;
	display: block;
	flex-shrink: 0;
}

.demo-header-text {
	display: flex;
	flex-direction: column;
	gap: 1px;
	min-width: 0;
}

.demo-header-name {
	font-size: 17px;
	font-weight: 800;
	letter-spacing: -.01em;
	line-height: 1.15;
	color: var(--ink);
}

.demo-header-tag {
	font-size: 12px;
	font-weight: 500;
	color: var(--ink-faint);
	line-height: 1.2;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.demo-header-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
}

.demo-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 40px;
	padding: 0 16px;
	border-radius: 10px;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: -.01em;
	text-decoration: none;
	border: 1px solid transparent;
	cursor: pointer;
	transition: background .15s ease, border-color .15s ease, color .15s ease;
	font-family: inherit;
	white-space: nowrap;
}

.demo-btn-outline {
	color: var(--ink);
	background: transparent;
	border-color: var(--line);
}

.demo-btn-outline:hover {
	border-color: rgba(255, 255, 255, .28);
	background: rgba(255, 255, 255, .04);
}

.demo-btn-solid {
	color: #fff;
	background: var(--brand);
	border-color: var(--brand);
}

.demo-btn-solid:hover {
	background: var(--brand-dark);
	border-color: var(--brand-dark);
}

/* ---------- Shell ---------- */
.demo-shell {
	max-width: 1280px;
	margin: 0 auto;
	padding: 28px 28px 40px;
}

.demo-intro {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	margin-bottom: 20px;
}

.demo-intro-copy h1 {
	margin: 0;
	font-size: clamp(28px, 4vw, 40px);
	font-weight: 800;
	letter-spacing: -.03em;
	line-height: 1.1;
	color: var(--ink);
}

.demo-intro-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
}

/* ---------- Playground frame ---------- */
.demo-frame-wrap {
	position: relative;
	width: 100%;
	height: min(85vh, 860px);
	min-height: 520px;
	border-radius: var(--radius);
	overflow: hidden;
	border: 1px solid var(--line);
	background:
		radial-gradient(ellipse 80% 60% at 50% 0%, rgba(79, 124, 255, .14), transparent 60%),
		var(--bg-elevated);
	box-shadow: 0 0 0 1px rgba(255, 255, 255, .04), 0 24px 64px rgba(0, 0, 0, .45);
	border: 1px solid var(--line);
}

.demo-frame {
	position: relative;
	z-index: 1;
	width: 100%;
	height: 100%;
	border: 0;
	background: transparent;
	opacity: 0;
	transition: opacity .4s ease;
	border: 1px solid var(--line);
}

.demo-frame.is-ready {
	opacity: 1;
}

.demo-loading {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 24px;
	text-align: center;
	pointer-events: none;
	transition: opacity .35s ease;
}

.demo-loading.is-done {
	opacity: 0;
}

.demo-loading p {
	margin: 0;
	color: var(--ink);
	font-size: 15px;
	font-weight: 600;
}

.demo-loading-hint {
	color: var(--ink-faint) !important;
	font-size: 13px !important;
	font-weight: 500 !important;
}

.demo-spinner {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, .12);
	border-top-color: var(--brand);
	animation: demo-spin .7s linear infinite;
	margin-bottom: 6px;
}

@keyframes demo-spin {
	to { transform: rotate(360deg); }
}

@media (max-width: 720px) {
	.demo-header-inner {
		padding: 0 16px;
		height: 58px;
	}

	.demo-header-tag { display: none; }

	.demo-header-actions .demo-btn-outline { display: none; }

	.demo-shell {
		padding: 20px 16px 32px;
	}

	.demo-intro {
		flex-direction: column;
		align-items: flex-start;
	}

	.demo-intro-actions {
		width: 100%;
	}

	.demo-intro-actions .demo-btn {
		flex: 1;
	}

	.demo-frame-wrap {
		height: min(70vh, 640px);
		min-height: 420px;
		border-radius: 14px;
	}
}
