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

:root {
	--bg: #0a0a0f;
	--surface: #14141e;
	--border: #2a2a3a;
	--text: #e4e4ef;
	--text-muted: #8888a0;
	--accent: #6c63ff;
	--accent-hover: #7d75ff;
	--radius: 12px;
}

html,
body {
	height: 100%;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
		Arial, sans-serif;
	background: var(--bg);
	color: var(--text);
	display: flex;
	flex-direction: column;
}

/* Landing page */
.landing {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 2rem;
	gap: 2rem;
}

.hero {
	text-align: center;
}

.title {
	font-size: clamp(2rem, 5vw, 3.5rem);
	font-weight: 700;
	letter-spacing: -0.02em;
	background: linear-gradient(135deg, var(--accent), #a78bfa);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

.subtitle {
	margin-top: 0.5rem;
	color: var(--text-muted);
	font-size: 1.1rem;
}

/* Search form */
.search-form {
	width: 100%;
	max-width: 600px;
}

.input-wrapper {
	display: flex;
	align-items: center;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 0.25rem;
	transition: border-color 0.2s;
}

.input-wrapper:focus-within {
	border-color: var(--accent);
}

.input-wrapper input {
	flex: 1;
	background: none;
	border: none;
	outline: none;
	color: var(--text);
	font-size: 1rem;
	padding: 0.75rem 1rem;
}

.input-wrapper input::placeholder {
	color: var(--text-muted);
}

.input-wrapper button {
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--accent);
	border: none;
	border-radius: 8px;
	color: #fff;
	width: 42px;
	height: 42px;
	cursor: pointer;
	transition: background 0.2s;
	flex-shrink: 0;
}

.input-wrapper button:hover {
	background: var(--accent-hover);
}

.input-wrapper button .icon-spinner {
	display: none;
	animation: spin 0.8s linear infinite;
}

.input-wrapper button.loading .icon-arrow {
	display: none;
}

.input-wrapper button.loading .icon-spinner {
	display: block;
}

.input-wrapper button.loading {
	pointer-events: none;
	opacity: 0.7;
}

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

/* Error display */
.error-container {
	text-align: center;
	max-width: 600px;
}

#sj-error {
	color: #f87171;
	font-size: 0.9rem;
}

#sj-error-code {
	color: var(--text-muted);
	font-size: 0.8rem;
	margin-top: 0.5rem;
	white-space: pre-wrap;
	word-break: break-word;
}

/* Scramjet iframe */
#sj-frame {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	border: none;
	z-index: 1000;
	background: #fff;
}

/* Footer */
footer {
	text-align: center;
	padding: 1rem;
	color: var(--text-muted);
	font-size: 0.8rem;
}

/* 404 page */
.not-found {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1rem;
}

.not-found h1 {
	font-size: 4rem;
	font-weight: 700;
	color: var(--accent);
}

.not-found p {
	color: var(--text-muted);
}

.not-found a {
	color: var(--accent);
	text-decoration: none;
}

.not-found a:hover {
	text-decoration: underline;
}
