:root {
	--background: #0d0b16;
	--surface: #17142a;
	--border: #36305a;
	--text: #f2f0fa;
	--muted: #b7b2d1;
	--accent: #19d9ff;
	--error: #ff8a8a;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
	font-size: 16px;
	line-height: 1.4;
	color: var(--text);
	background: var(--background);
}

* {
	box-sizing: border-box;
}

[hidden] {
	display: none !important;
}

body {
	margin: 0;
}

main {
	max-width: 1400px;
	margin: 0 auto;
	padding: 1rem;
}

h1 {
	font-size: 1.5rem;
	margin: 0 0 1rem;
}

h2 {
	font-size: 1.1rem;
	margin: 0 0 0.75rem;
}

#app {
	display: grid;
	gap: 1.25rem;
}

@media (min-width: 1000px) {
	#app {
		grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr);
		align-items: start;
	}

	.stage {
		position: sticky;
		top: 1rem;
	}
}

.stage {
	display: flex;
	justify-content: center;
}

#preview {
	display: block;
	border-radius: 6px;
	background: #000;
}

.gate {
	max-width: 28rem;
}

.panel {
	display: grid;
	gap: 1rem;
}

section {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 1rem;
}

.field {
	margin: 0 0 0.9rem;
}

.field:last-child {
	margin-bottom: 0;
}

.field > label,
.slider-label {
	display: block;
	margin-bottom: 0.3rem;
}

.slider-label {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
}

.value {
	color: var(--muted);
	font-variant-numeric: tabular-nums;
	text-align: right;
}

.check {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.check label {
	margin: 0;
}

input[type='range'] {
	width: 100%;
	accent-color: var(--accent);
}

input[type='checkbox'] {
	width: 1.2rem;
	height: 1.2rem;
	accent-color: var(--accent);
}

input[type='text'],
input[type='password'],
select {
	width: 100%;
	padding: 0.45rem 0.6rem;
	font: inherit;
	color: var(--text);
	background: var(--background);
	border: 1px solid var(--border);
	border-radius: 6px;
}

input[type='color'] {
	width: 4rem;
	height: 2.2rem;
	padding: 0.15rem;
	background: var(--background);
	border: 1px solid var(--border);
	border-radius: 6px;
}

button {
	font: inherit;
	padding: 0.5rem 1rem;
	color: var(--text);
	background: #2a2546;
	border: 1px solid var(--border);
	border-radius: 6px;
	cursor: pointer;
}

button:hover {
	background: #353057;
}

button.primary {
	color: #001018;
	background: var(--accent);
	border-color: var(--accent);
	font-weight: 600;
}

button.primary:hover {
	background: #7ae9ff;
}

:focus-visible {
	outline: 3px solid #ffd84d;
	outline-offset: 2px;
}

.info {
	margin: 0 0 0.9rem;
	color: var(--muted);
	overflow-wrap: anywhere;
}

.error {
	margin: 0 0 0.9rem;
	color: var(--error);
}

.progress {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin: 0 0 0.9rem;
}

.progress progress {
	flex: 1;
	height: 0.8rem;
	accent-color: var(--accent);
}

.progress span {
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.download {
	display: inline-block;
	margin: 0 0 0.9rem;
	padding: 0.5rem 1rem;
	color: #001018;
	background: var(--accent);
	border-radius: 6px;
	font-weight: 600;
	text-decoration: none;
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}
