/* Same tokens as sevdrill.site (src/styles/global.css): cool paper and navy
   ink, one cobalt accent, green only for passes and red only for fails. */
@font-face {
	font-family: 'Archivo';
	src: url('/fonts/archivo.woff2') format('woff2');
	font-weight: 100 900;
	font-stretch: 62% 125%;
	font-display: swap;
}

@font-face {
	font-family: 'JetBrains Mono';
	src: url('/fonts/jetbrains-mono.woff2') format('woff2');
	font-weight: 100 800;
	font-display: swap;
}

:root {
	--background: #eef1f5;
	--surface: #f9fafc;
	--text: #101a2c;
	--muted: #4c5a70;
	--border: #cfd6e0;
	--rule: #8f9bb0;
	--accent: #1f3fd6;
	--accent-contrast: #ffffff;
	--pass: #0f7340;
	--fail: #c2261d;
	--term: #101a2c;
	--term-text: #e6ebf5;
	--term-pass: #4fd18b;
	--font-sans: 'Archivo', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
	--font-mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
	--ease: cubic-bezier(0.22, 1, 0.36, 1);
	color-scheme: light;
}

.dark {
	--background: #0c1220;
	--surface: #131b2d;
	--text: #e6ebf5;
	--muted: #9aa7bd;
	--border: #263148;
	--rule: #4a5874;
	--accent: #93a8ff;
	--accent-contrast: #0c1220;
	--pass: #4fd18b;
	--fail: #ff7b72;
	--term: #070b14;
	color-scheme: dark;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--background);
	color: var(--text);
	font-family: var(--font-sans);
	font-size: 16px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

[hidden] {
	display: none !important;
}

:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 3px;
}

/* ---------- Shell ---------- */

.shell {
	display: flex;
	flex-direction: column;
	min-height: 100dvh;
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 32px;
}

.top,
.foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.top {
	height: 72px;
}

.foot {
	padding: 24px 0;
	font-size: 14px;
	color: var(--muted);
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--text);
	text-decoration: none;
	font-size: 18px;
	font-weight: 600;
	font-stretch: 112%;
}

.brand svg {
	width: 28px;
	height: 28px;
}

.quiet-link {
	color: var(--muted);
	font-size: 15px;
	text-decoration: none;
	transition: color 0.15s var(--ease);
}

.quiet-link:hover {
	color: var(--text);
}

/* ---------- Split ---------- */

.split {
	flex: 1;
	display: grid;
	grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
	align-items: center;
	gap: 64px;
	padding: 32px 0 48px;
}

.meta {
	margin: 0;
	font-family: var(--font-mono);
	font-size: 13px;
	font-weight: 500;
	color: var(--accent);
}

h1,
h2 {
	margin: 0;
	font-weight: 600;
	font-stretch: 112%;
	letter-spacing: -0.015em;
	line-height: 1.08;
	text-wrap: balance;
}

h1 {
	margin-top: 12px;
	font-size: clamp(2.25rem, 1.6rem + 2.2vw, 3.5rem);
}

h2 {
	font-size: 28px;
}

.lead {
	max-width: 46ch;
	margin: 20px 0 0;
	font-size: 18px;
	line-height: 1.55;
	color: var(--muted);
}

/* ---------- Example run (the one rich moment on the page) ---------- */

.run {
	margin: 40px 0 0;
	max-width: 520px;
	border: 1px solid var(--border);
	border-radius: 12px;
	background: var(--surface);
	font-family: var(--font-mono);
	font-size: 14px;
	font-variant-numeric: tabular-nums;
}

.run-head,
.run-foot {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 16px;
}

.run-head {
	border-bottom: 1px solid var(--border);
	font-weight: 500;
}

.run-foot {
	border-top: 1px solid var(--border);
	color: var(--muted);
}

.run-rows {
	margin: 0;
	padding: 4px 0;
	list-style: none;
}

.run-rows li {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto 40px;
	align-items: center;
	gap: 16px;
	padding: 8px 16px;
}

.run-rows li > span:first-child {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-family: var(--font-sans);
	font-size: 15px;
}

.dots {
	display: inline-flex;
	gap: 6px;
}

.dots i {
	width: 10px;
	height: 10px;
	border-radius: 50%;
}

.dots .p {
	background: var(--pass);
}

.dots .f {
	background: var(--fail);
}

.num {
	text-align: right;
}

.muted {
	color: var(--muted);
	font-weight: 400;
}

/* ---------- Card ---------- */

.card {
	padding: 32px;
	border: 1px solid var(--border);
	border-radius: 16px;
	background: var(--surface);
}

.hint {
	margin: 8px 0 0;
	color: var(--muted);
	line-height: 1.5;
}

form {
	display: grid;
	gap: 8px;
	margin-top: 24px;
}

label {
	margin-top: 8px;
	font-size: 15px;
	font-weight: 500;
}

label:first-child {
	margin-top: 0;
}

input,
textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--rule);
	border-radius: 8px;
	background: var(--background);
	color: var(--text);
	font: inherit;
	transition: border-color 0.15s var(--ease);
}

input::placeholder,
textarea::placeholder {
	color: var(--muted);
	opacity: 0.8;
}

input:hover,
textarea:hover {
	border-color: var(--text);
}

input[aria-invalid='true'] {
	border-color: var(--fail);
}

textarea {
	resize: vertical;
	min-height: 88px;
}

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	margin-top: 16px;
	padding: 10px 16px;
	border: 1px solid transparent;
	border-radius: 8px;
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition:
		background-color 0.15s var(--ease),
		border-color 0.15s var(--ease),
		transform 0.1s var(--ease);
}

.btn:active {
	transform: scale(0.98);
}

.btn:disabled {
	cursor: progress;
	opacity: 0.7;
}

.btn-primary {
	background: var(--accent);
	color: var(--accent-contrast);
}

.btn-primary:hover {
	background: color-mix(in oklab, var(--accent) 86%, var(--text));
}

.btn-secondary {
	width: 100%;
	border-color: var(--rule);
	background: transparent;
	color: var(--text);
}

.btn-secondary:hover {
	border-color: var(--text);
}

.error {
	margin: 4px 0 0;
	font-size: 14px;
	color: var(--fail);
}

.switch {
	margin: 24px 0 0;
	padding-top: 16px;
	border-top: 1px solid var(--border);
	font-size: 15px;
	color: var(--muted);
}

.link {
	padding: 0;
	border: 0;
	background: none;
	color: var(--accent);
	font: inherit;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 4px;
	cursor: pointer;
}

.link:hover {
	text-decoration-thickness: 2px;
}

.done-mark {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	margin-bottom: 16px;
	border-radius: 50%;
	background: color-mix(in oklab, var(--pass) 14%, transparent);
	color: var(--pass);
}

.done-mark svg {
	width: 22px;
	height: 22px;
}

h2:focus {
	outline: none;
}

/* One short entrance for the card view that just changed. */
@media (prefers-reduced-motion: no-preference) {
	[data-view]:not([hidden]) {
		animation: rise 0.25s var(--ease) both;
	}
}

@keyframes rise {
	from {
		opacity: 0;
		transform: translateY(6px);
	}
}

/* ---------- Small screens: the card first, then the pitch ---------- */

@media (max-width: 860px) {
	.shell {
		padding: 0 20px;
	}

	.split {
		grid-template-columns: minmax(0, 1fr);
		gap: 40px;
		padding-top: 8px;
	}

	.card {
		order: -1;
		padding: 24px;
	}

	.run {
		margin-top: 32px;
	}
}
