* {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	padding: 0;
	min-height: 100vh;
	font-family:
		system-ui,
		-apple-system,
		BlinkMacSystemFont,
		"Segoe UI",
		Roboto,
		Ubuntu,
		Cantarell,
		"Noto Sans",
		sans-serif;
	color: #1a1a1a;
	background: #f7f8fa;
}

[hidden] {
	display: none !important;
}

body {
	display: flex;
	flex-direction: column;
}

.site-header,
.site-footer {
	padding: 1rem;
	background: #ffffff;
	border-bottom: 1px solid #e0e4ea;
}

.site-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
}

.header-nav {
	display: flex;
	gap: 1.25rem;
}

.site-footer {
	border-top: 1px solid #e0e4ea;
	border-bottom: none;
	text-align: center;
	font-size: 0.85rem;
	color: #5a5f66;
	margin-top: auto;
}

.footer-link {
	color: #3b61bc;
	text-decoration: none;
}

.footer-link:hover,
.footer-link:focus-visible {
	text-decoration: underline;
	outline: none;
}

.quiet-link {
	color: #6b717a;
	text-decoration: none;
	font-size: 0.9rem;
}

.quiet-link:hover,
.quiet-link:focus-visible {
	color: #2f3b4d;
	text-decoration: underline;
	outline: none;
}

.brand-mark {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.95rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #000000;
}

.brand-link {
	color: inherit;
	text-decoration: none;
	font-family:
		"SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New",
		monospace;
	font-weight: 600;
	transition: color 150ms ease;
	text-transform: none;
}

.brand-link:hover,
.brand-link:focus-visible {
	color: #2f3b4d;
	outline: none;
}

.content {
	flex: 1;
	display: flex;
	justify-content: center;
	align-items: flex-start;
	padding: 2.5rem 1.25rem;
}

.create-card {
	width: 100%;
	max-width: 560px;
	background: #ffffff;
	border: 1px solid #e0e4ea;
	border-radius: 16px;
	padding: 2rem 1.75rem;
	box-shadow: 0 12px 32px rgba(26, 35, 48, 0.08);
}

.card-title {
	margin: 0 0 0.6rem;
	font-size: 1.5rem;
	font-weight: 600;
}

.card-lede {
	margin: 0 0 1.25rem;
	color: #3a3f45;
}

/* Tabs */
.tab-bar {
	display: flex;
	gap: 0;
	border: 1px solid #d7dce4;
	border-radius: 10px;
	overflow: hidden;
	margin-bottom: 1.25rem;
}

.tab {
	flex: 1;
	padding: 0.7rem 1rem;
	border: none;
	background: #f9fafc;
	color: #6b717a;
	font-weight: 600;
	font-size: 0.95rem;
	cursor: pointer;
	transition:
		background 120ms ease,
		color 120ms ease;
}

.tab:not(:last-child) {
	border-right: 1px solid #d7dce4;
}

.tab.active {
	background: #3b61bc;
	color: #ffffff;
}

.tab:not(.active):hover {
	background: #eef1f8;
	color: #2a2f36;
}

/* Drop zone */
.drop-zone {
	border: 2px dashed #c4cad4;
	border-radius: 12px;
	background: #f9fafc;
	min-height: 140px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition:
		border-color 150ms ease,
		background 150ms ease;
	padding: 2rem 1rem;
	text-align: center;
}

.drop-zone:hover,
.drop-zone:focus-visible,
.drop-zone.dragover {
	border-color: #3b61bc;
	background: #eef2fb;
	outline: none;
}

.drop-hint {
	margin: 0;
	color: #6b717a;
	font-size: 0.95rem;
	pointer-events: none;
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}

/* Camera */
.camera-wrap {
	position: relative;
	border-radius: 12px;
	overflow: hidden;
	background: #0a0a0a;
	aspect-ratio: 4 / 3;
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

#camera-view {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

#camera-canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: none;
}

.scan-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
}

.scan-frame {
	width: 55%;
	aspect-ratio: 1;
	border: 2.5px solid rgba(255, 255, 255, 0.7);
	border-radius: 12px;
	box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35);
}

/* Result */
.result-panel {
	margin-top: 1.25rem;
	padding: 1rem;
	border: 1px solid #d7dce4;
	border-radius: 12px;
	background: #f9fafc;
}

.result-label {
	margin: 0 0 0.6rem;
	font-weight: 600;
	font-size: 0.9rem;
	color: #2a2f36;
}

.text-input {
	width: 100%;
	padding: 0.75rem 0.85rem;
	border: 1px solid #d7dce4;
	border-radius: 10px;
	font-size: 1rem;
	background: #f9fafc;
	color: #1a1a1a;
	transition:
		border-color 120ms ease,
		box-shadow 120ms ease;
}

.text-input:focus-visible {
	border-color: #3b61bc;
	box-shadow: 0 0 0 3px rgba(59, 97, 188, 0.15);
	outline: none;
	background: #ffffff;
}

.text-area {
	resize: vertical;
	min-height: 80px;
	font-family: inherit;
	line-height: 1.5;
}

.mono-result {
	font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
	font-size: 0.9rem;
}

.actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	align-items: center;
}

.button {
	padding: 0.8rem 1.2rem;
	border: 1px solid #3b61bc;
	background: #3b61bc;
	color: #ffffff;
	border-radius: 10px;
	font-weight: 600;
	font-size: 1rem;
	cursor: pointer;
	transition:
		background 120ms ease,
		border-color 120ms ease,
		box-shadow 120ms ease;
}

.button:hover,
.button:focus-visible {
	background: #2f4fa0;
	border-color: #2f4fa0;
	box-shadow: 0 0 0 3px rgba(59, 97, 188, 0.2);
	outline: none;
}

.ghost-button {
	padding: 0.8rem 1.1rem;
	border: 1px solid #d7dce4;
	background: #ffffff;
	color: #2a2f36;
	border-radius: 10px;
	font-weight: 600;
	font-size: 1rem;
	cursor: pointer;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	transition:
		border-color 120ms ease,
		box-shadow 120ms ease;
}

.ghost-button:hover,
.ghost-button:focus-visible {
	border-color: #3b61bc;
	box-shadow: 0 0 0 3px rgba(59, 97, 188, 0.15);
	outline: none;
}

.muted-note {
	margin: 0;
	color: #6b717a;
	font-size: 0.9rem;
}

.noscript {
	padding: 1rem;
	margin: 1rem;
	border: 1px solid #e0a200;
	background: #fff7e0;
	color: #4a3c00;
	border-radius: 8px;
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0s !important;
		transition-duration: 0s !important;
	}
}

@media (max-width: 480px) {
	.create-card {
		padding: 1.5rem 1.25rem;
	}

	.header-nav {
		gap: 0.75rem;
	}
}
