:root {
	--bg-top: #edf4ff;
	--bg-bottom: #eef8f1;
	--card: rgba(255, 255, 255, 0.78);
	--card-border: rgba(19, 36, 55, 0.12);
	--text-main: #112033;
	--text-muted: #516074;
	--accent: #0f766e;
	--accent-strong: #0b5f58;
	--ghost-bg: rgba(17, 32, 51, 0.06);
	--shadow: 0 20px 40px rgba(12, 28, 48, 0.12);
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	min-height: 100dvh;
	font-family: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
	color: var(--text-main);
	background:
		radial-gradient(circle at 20% -10%, rgba(93, 183, 255, 0.35), transparent 40%),
		radial-gradient(circle at 84% 10%, rgba(83, 223, 172, 0.34), transparent 45%),
		linear-gradient(165deg, var(--bg-top), var(--bg-bottom));
}

body::before {
	content: "";
	position: fixed;
	inset: 0;
	pointer-events: none;
	background-image: linear-gradient(
		to right,
		rgba(17, 32, 51, 0.04) 1px,
		transparent 1px
	);
	background-size: 28px 28px;
	mask-image: linear-gradient(to bottom, transparent, black 14%, black 86%, transparent);
}

.shell {
	position: relative;
	z-index: 1;
	width: min(1200px, calc(100% - 2rem));
	margin: 1.25rem auto 3rem;
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	gap: 0.9rem;
	animation: shell-in 420ms ease-out;
}

.card {
	padding: 1rem;
	border-radius: 18px;
	border: 1px solid var(--card-border);
	background: var(--card);
	backdrop-filter: blur(12px);
	box-shadow: var(--shadow);
	animation: card-in 360ms ease-out both;
}

.card:nth-child(2) {
	animation-delay: 70ms;
}

.card:nth-child(3) {
	animation-delay: 130ms;
}

.card:nth-child(4) {
	animation-delay: 180ms;
}

.card:nth-child(5) {
	animation-delay: 220ms;
}

.hero {
	grid-column: span 12;
	padding: 1.2rem 1.2rem 1.25rem;
}

.controls,
.config {
	grid-column: span 6;
}

.snapshot,
.log {
	grid-column: span 6;
}

h1,
h2 {
	margin: 0;
	line-height: 1.2;
}

h1 {
	font-size: clamp(1.4rem, 4vw, 2rem);
	letter-spacing: -0.02em;
}

h2 {
	font-size: 1.05rem;
	margin-bottom: 0.75rem;
}

.kicker {
	margin: 0 0 0.4rem;
	text-transform: uppercase;
	letter-spacing: 0.13em;
	font-size: 0.72rem;
	color: var(--accent-strong);
	font-weight: 700;
}

p {
	margin: 0.55rem 0 0;
	color: var(--text-muted);
	line-height: 1.45;
	max-width: 72ch;
}

.runtime {
	font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
	font-size: 0.82rem;
	color: #2e465e;
	margin-top: 0.9rem;
	padding: 0.5rem 0.65rem;
	border-radius: 11px;
	background: rgba(255, 255, 255, 0.72);
	border: 1px solid rgba(17, 32, 51, 0.08);
	width: fit-content;
	max-width: 100%;
}

.button-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.6rem;
	margin-bottom: 0.6rem;
}

.button-row {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.6rem;
}

.shell button,
.shell input,
.shell select {
	font: inherit;
}

.shell button {
	border: 0;
	padding: 0.6rem 0.8rem;
	border-radius: 12px;
	color: #f6fffd;
	font-size: 0.88rem;
	font-weight: 600;
	letter-spacing: 0.01em;
	background: linear-gradient(145deg, var(--accent), var(--accent-strong));
	box-shadow: 0 8px 18px rgba(9, 92, 85, 0.22);
	transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
	cursor: pointer;
}

.shell button:hover {
	transform: translateY(-1px);
	box-shadow: 0 10px 20px rgba(9, 92, 85, 0.28);
}

.shell button:active {
	transform: translateY(0);
	box-shadow: 0 6px 14px rgba(9, 92, 85, 0.24);
}

.shell button.ghost {
	color: var(--text-main);
	background: var(--ghost-bg);
	box-shadow: none;
	border: 1px solid rgba(17, 32, 51, 0.12);
}

.card-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	margin-bottom: 0.65rem;
}

.card-head button {
	padding: 0.35rem 0.6rem;
	font-size: 0.79rem;
	border-radius: 9px;
}

.config-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0.7rem;
	align-items: start;
}

label {
	display: grid;
	gap: 0.38rem;
	font-size: 0.82rem;
	color: #34465d;
	font-weight: 500;
}

label > span {
	padding-left: 0.1rem;
	font-size: 0.78rem;
	letter-spacing: 0.01em;
}

.shell input,
.shell select {
	width: 100%;
	padding: 0.48rem 0.55rem;
	border-radius: 9px;
	border: 1px solid rgba(17, 32, 51, 0.15);
	background: rgba(255, 255, 255, 0.9);
	color: var(--text-main);
}

.shell input:focus,
.shell select:focus {
	outline: 2px solid rgba(15, 118, 110, 0.28);
	outline-offset: 1px;
	border-color: rgba(15, 118, 110, 0.5);
}

.checkbox {
	grid-template-columns: auto 1fr;
	align-items: center;
	gap: 0.45rem;
	padding-top: 1.2rem;
}

.checkbox input {
	width: 1rem;
	height: 1rem;
	padding: 0;
	border-radius: 4px;
	accent-color: var(--accent);
}

#snapshotOutput,
#logOutput {
	margin: 0;
	max-height: 340px;
	overflow: auto;
	padding: 0.75rem;
	border-radius: 10px;
	border: 1px solid rgba(17, 32, 51, 0.12);
	background: rgba(6, 24, 42, 0.86);
	color: #dcf7ff;
	font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
	font-size: 0.76rem;
	line-height: 1.38;
}

#logOutput {
	padding-left: 1.85rem;
	background: rgba(6, 24, 42, 0.82);
	color: #d2f0ff;
}

#logOutput li {
	padding-left: 0.2rem;
	margin-bottom: 0.34rem;
	white-space: pre-wrap;
	word-break: break-word;
}

@keyframes shell-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes card-in {
	from {
		opacity: 0;
		transform: translateY(12px) scale(0.99);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

@media (max-width: 1024px) {
	.controls,
	.config,
	.snapshot,
	.log {
		grid-column: span 12;
	}

	.config-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.shell {
		width: min(1200px, calc(100% - 1rem));
		gap: 0.7rem;
	}

	.card {
		padding: 0.85rem;
		border-radius: 14px;
	}

	.button-grid,
	.button-row,
	.config-grid {
		grid-template-columns: 1fr;
	}

	.checkbox {
		padding-top: 0.2rem;
	}

	#snapshotOutput,
	#logOutput {
		max-height: 280px;
	}
}
