:root {
	--bg: #f5f7fb;
	--bg-accent: #eef4fb;
	--surface: rgba(255, 255, 255, 0.94);
	--surface-strong: #ffffff;
	--surface-soft: #f8fbff;
	--text: #13243a;
	--text-soft: #2a405f;
	--muted: #697c94;
	--border: rgba(19, 36, 58, 0.1);
	--border-strong: rgba(19, 36, 58, 0.16);
	--accent: #0f766e;
	--accent-strong: #0f5d74;
	--accent-soft: rgba(15, 118, 110, 0.1);
	--shadow: 0 18px 54px rgba(17, 35, 57, 0.08);
	--shadow-soft: 0 10px 30px rgba(17, 35, 57, 0.05);
	--radius-xl: 26px;
	--radius-lg: 22px;
	--radius-md: 18px;
	--radius-sm: 14px;
}

html[data-theme="dark"] {
	--bg: #08111f;
	--bg-accent: #0b1728;
	--surface: rgba(13, 23, 40, 0.92);
	--surface-strong: #0f1a2d;
	--surface-soft: #13243a;
	--text: #e8f1ff;
	--text-soft: #d9e7f8;
	--muted: #8da0bc;
	--border: rgba(255, 255, 255, 0.08);
	--border-strong: rgba(255, 255, 255, 0.14);
	--accent: #5eead4;
	--accent-strong: #7dd3fc;
	--accent-soft: rgba(94, 234, 212, 0.12);
	--shadow: 0 20px 60px rgba(0, 0, 0, 0.34);
	--shadow-soft: 0 14px 36px rgba(0, 0, 0, 0.22);
}

* {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
	background:
		radial-gradient(circle at top, rgba(15, 118, 110, 0.08), transparent 35%),
		linear-gradient(180deg, var(--bg-accent) 0%, var(--bg) 100%);
	color: var(--text);
	line-height: 1.65;
}

a {
	color: inherit;
	text-decoration: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
	outline: 3px solid rgba(15, 118, 110, 0.22);
	outline-offset: 2px;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	border: 0;
}

.site-shell {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

.site-header,
.site-footer {
	padding: 1rem 1.25rem;
}

.site-header__inner,
.site-footer,
.hero,
.search-layout,
.page-shell {
	width: min(1120px, calc(100% - 2rem));
	margin-inline: auto;
}

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

.brand {
	display: inline-flex;
	gap: 0.8rem;
	align-items: center;
	font-weight: 700;
	color: var(--text);
	min-width: 0;
}

.brand__media,
.theme-toggle {
	display: inline-grid;
	place-items: center;
	width: 3rem;
	height: 3rem;
	border-radius: 999px;
	border: 1px solid var(--border);
	background: var(--surface);
	box-shadow: var(--shadow-soft);
	overflow: hidden;
}

.theme-toggle {
	color: var(--text);
	cursor: pointer;
	width: 3rem;
	height: 3rem;
	padding: 0;
	font-weight: 700;
}

.theme-toggle svg {
	width: 1.15rem;
	height: 1.15rem;
}

.brand__media .custom-logo-link,
.brand__media .custom-logo {
	display: block;
}

.brand__media .custom-logo {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.brand__fallback {
	display: inline-grid;
	place-items: center;
	width: 100%;
	height: 100%;
	font-size: 1.2rem;
	font-weight: 800;
	color: var(--accent-strong);
}

.brand__content {
	display: grid;
	gap: 0.12rem;
	min-width: 0;
}

.brand__title {
	font-size: 1rem;
	line-height: 1.2;
}

.brand__tagline {
	color: var(--muted);
	font-size: 0.82rem;
	line-height: 1.35;
}

.site-main {
	flex: 1;
}

.hero {
	display: grid;
	place-items: center;
	padding: 4.5rem 0 5rem;
}

.hero__content,
.search-layout__top,
.result-card,
.empty-state,
.ase-sponsored-card,
.page-shell {
	background: var(--surface);
	backdrop-filter: blur(16px);
	border: 1px solid var(--border);
	border-radius: var(--radius-xl);
	box-shadow: var(--shadow);
}

.hero__content {
	width: min(760px, 100%);
	padding: 3rem;
	text-align: center;
}

.hero__eyebrow {
	margin: 0 0 0.55rem;
	font-size: 0.8rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--accent);
}

.hero h1 {
	margin: 0;
	font-size: clamp(2.5rem, 6vw, 4.6rem);
	line-height: 1.02;
	letter-spacing: -0.03em;
}

.hero p {
	max-width: 44rem;
	margin: 1rem auto 0;
	color: var(--muted);
}

.search-form {
	margin-top: 2rem;
	position: relative;
}

.search-form__field,
.filters-bar {
	display: flex;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.search-form__field input,
.filters-bar input,
.filters-bar select {
	flex: 1;
	min-width: 130px;
	border: 1px solid var(--border);
	background: var(--surface-strong);
	color: var(--text);
	border-radius: var(--radius-sm);
	padding: 1rem 1.1rem;
	font-size: 1rem;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.search-form__field button,
.filters-bar button {
	border: 0;
	border-radius: var(--radius-sm);
	padding: 0.95rem 1.35rem;
	background: linear-gradient(135deg, var(--text) 0%, var(--accent-strong) 100%);
	color: #fff;
	font-weight: 700;
	cursor: pointer;
	box-shadow: var(--shadow-soft);
}

.search-form__suggestions {
	position: absolute;
	left: 0;
	right: 0;
	top: calc(100% + 0.65rem);
	display: none;
	padding: 0.65rem;
	border-radius: var(--radius-md);
	background: var(--surface-strong);
	border: 1px solid var(--border);
	box-shadow: var(--shadow);
	text-align: left;
	z-index: 15;
}

.search-form__suggestions.is-visible {
	display: block;
}

.search-form__suggestions a {
	display: block;
	padding: 0.72rem 0.85rem;
	border-radius: 12px;
}

.search-form__suggestions a:hover,
.search-form__suggestions a:focus-visible {
	background: var(--accent-soft);
	outline: none;
}

.hero__chips,
.result-card__badges {
	display: flex;
	flex-wrap: wrap;
	gap: 0.65rem;
}

.hero__chips {
	margin-top: 1.35rem;
	justify-content: center;
}

.hero__chips a,
.result-card__badges span {
	padding: 0.42rem 0.78rem;
	border-radius: 999px;
	background: var(--accent-soft);
	color: var(--accent-strong);
	font-size: 0.84rem;
	font-weight: 600;
}

.search-layout {
	padding: 1rem 0 3.25rem;
}

.search-layout__top {
	padding: 1.1rem;
}

.search-meta {
	margin: 0.9rem 0 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.45rem;
	color: var(--muted);
	font-size: 0.95rem;
}

.filters-bar {
	margin-top: 0.9rem;
}

.search-layout__results {
	display: grid;
	gap: 1rem;
	margin-top: 1rem;
}

.result-card,
.ase-sponsored-card,
.empty-state,
.page-shell {
	padding: 1.35rem 1.45rem;
}

.result-card,
.ase-sponsored-card {
	transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.result-card:hover,
.ase-sponsored-card:hover {
	transform: translateY(-1px);
	box-shadow: 0 22px 50px rgba(17, 35, 57, 0.09);
	border-color: var(--border-strong);
}

.result-card__meta,
.result-card__footer,
.result-card__site {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.result-card__site {
	justify-content: flex-start;
	min-width: 0;
}

.result-card__site img {
	border-radius: 999px;
	flex: 0 0 auto;
}

.result-card__site-text {
	display: grid;
	gap: 0.1rem;
	min-width: 0;
}

.result-card__site-text strong,
.result-card__site-text span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.result-card__site-text strong {
	font-size: 0.96rem;
	color: var(--text-soft);
}

.result-card__site-text span,
.result-card__footer,
.result-card__snippet,
.site-footer {
	color: var(--muted);
}

.result-card__title {
	margin: 0.8rem 0 0.55rem;
	font-size: clamp(1.2rem, 2.4vw, 1.42rem);
	line-height: 1.35;
	letter-spacing: -0.02em;
}

.result-card__title a {
	color: color-mix(in srgb, var(--text) 88%, var(--accent-strong));
}

.result-card__title a:hover,
.result-card__title a:focus-visible {
	color: var(--accent-strong);
}

.result-card__snippet {
	margin: 0;
	font-size: 0.98rem;
	line-height: 1.72;
}

.result-card__footer {
	margin-top: 0.95rem;
	font-size: 0.9rem;
	gap: 0.75rem 1rem;
	align-items: flex-start;
}

.result-card__url {
	word-break: break-word;
	color: var(--text-soft);
}

.result-card__date {
	flex: 0 0 auto;
	white-space: nowrap;
}

.ase-sponsored-slot {
	display: grid;
	gap: 0.85rem;
	margin-top: 1rem;
}

.ase-sponsored-card {
	background: linear-gradient(180deg, var(--surface-strong) 0%, var(--surface-soft) 100%);
}

.ase-sponsored-card__meta {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: 0.55rem;
}

.ase-sponsored-card__label {
	color: var(--muted);
	font-size: 0.88rem;
}

.ase-sponsored-card__title {
	font-size: 1.04rem;
	font-weight: 700;
	color: color-mix(in srgb, var(--text) 88%, var(--accent-strong));
}

.ase-sponsored-card__desc,
.ase-sponsored-card__url {
	display: block;
	margin-top: 0.45rem;
	color: var(--muted);
}

.empty-state h2 {
	margin-top: 0;
	margin-bottom: 0.5rem;
	font-size: 1.45rem;
}

.empty-state p {
	margin: 0;
	color: var(--muted);
}

.empty-state__group + .empty-state__group {
	margin-top: 1.1rem;
}

.search-pagination {
	margin-top: 0.4rem;
	padding-top: 0.25rem;
}

.search-pagination__list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.search-pagination__item .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.8rem;
	padding: 0.75rem 0.95rem;
	border-radius: 999px;
	border: 1px solid var(--border);
	background: var(--surface);
	color: var(--text-soft);
	font-weight: 600;
	box-shadow: var(--shadow-soft);
}

.search-pagination__item .page-numbers.current {
	background: linear-gradient(135deg, var(--text) 0%, var(--accent-strong) 100%);
	border-color: transparent;
	color: #fff;
}

.search-pagination__item .page-numbers:hover,
.search-pagination__item .page-numbers:focus-visible {
	border-color: var(--border-strong);
	color: var(--accent-strong);
}

.search-pagination__item .page-numbers.current:hover,
.search-pagination__item .page-numbers.current:focus-visible {
	color: #fff;
}

.page-shell {
	margin-top: 2rem;
}

.site-footer {
	padding-top: 0;
	padding-bottom: 1.75rem;
	font-size: 0.92rem;
	display: grid;
	gap: 0.2rem;
	text-align: center;
}

@media (max-width: 820px) {
	.result-card__meta,
	.result-card__footer {
		flex-direction: column;
		align-items: flex-start;
	}

	.result-card__badges {
		margin-top: -0.15rem;
	}
}

@media (max-width: 720px) {
	.hero__content {
		padding: 1.6rem;
	}

	.site-header__inner {
		align-items: flex-start;
	}

	.brand {
		align-items: flex-start;
	}

	.brand__content {
		max-width: min(220px, 100%);
	}

	.search-layout__top,
	.result-card,
	.ase-sponsored-card,
	.empty-state,
	.page-shell {
		padding: 1.1rem;
	}

	.search-form__field button,
	.filters-bar button,
	.search-form__field input,
	.filters-bar input,
	.filters-bar select {
		width: 100%;
	}

	.search-pagination__item .page-numbers {
		min-width: 2.55rem;
		padding-inline: 0.85rem;
	}
}
