:root {
	--bg: #f4f8fb;
	--card: #fff;
	--text: #132033;
	--muted: #657489;
	--line: #dce7f1;
	--blue: #0b87d1;
	--blue2: #1db6ff;
	--green: #22b573;
	--shadow: 0 14px 34px rgba(26, 72, 110, .11);
}

* { box-sizing: border-box; }

body {
	margin: 0;
	font-family: Arial, Helvetica, sans-serif;
	color: var(--text);
	background:
		radial-gradient(circle at 10% 0, rgba(29, 182, 255, .18), transparent 30%),
		linear-gradient(180deg, #fff 0, var(--bg) 360px);
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: #005f9d; }

.user-badge {
	position: fixed;
	top: 14px;
	right: 14px;
	z-index: 10;
	display: flex;
	align-items: center;
	gap: 9px;
	max-width: min(280px, calc(100vw - 28px));
	padding: 8px 11px 8px 8px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: rgba(255, 255, 255, .92);
	box-shadow: 0 10px 28px rgba(26, 72, 110, .12);
	backdrop-filter: blur(10px);
}

.user-badge img,
.user-badge span {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	object-fit: cover;
	flex: 0 0 auto;
	background: linear-gradient(135deg, var(--blue), var(--blue2));
	color: #fff;
	display: grid;
	place-items: center;
	font-weight: 800;
}

.user-badge b {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 14px;
}

.top,
main,
footer {
	width: min(1180px, calc(100% - 32px));
	margin: 0 auto;
}

.top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 0 8px;
}

.brand {
	font-size: 24px;
	font-weight: 800;
	letter-spacing: -.03em;
	color: var(--text);
}

.brand span {
	margin-left: 6px;
	color: var(--blue);
}

.top nav {
	display: flex;
	gap: 18px;
	font-size: 14px;
}

.hero {
	display: grid;
	grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
	gap: 28px;
	align-items: end;
	padding: 12px 0 24px;
}

.eyebrow {
	margin: 0 0 12px;
	color: var(--green);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .08em;
	font-size: 13px;
}

h1 {
	margin: 0 0 18px;
	font-size: clamp(36px, 7vw, 68px);
	line-height: .95;
	letter-spacing: -.06em;
}

h1 a { color: inherit; }

.hero p {
	max-width: 740px;
	margin: 0;
	color: var(--muted);
	font-size: 18px;
	line-height: 1.55;
}

.search {
	display: flex;
	gap: 10px;
	padding: 8px;
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 18px;
	box-shadow: var(--shadow);
}

.search input {
	min-width: 0;
	flex: 1;
	border: 0;
	outline: 0;
	padding: 14px 12px;
	font-size: 16px;
	background: transparent;
}

button,
.primary {
	border: 0;
	border-radius: 13px;
	padding: 13px 18px;
	background: linear-gradient(135deg, var(--blue), var(--blue2));
	color: #fff;
	font-weight: 700;
	cursor: pointer;
}

.primary:hover,
button:hover { color: #fff; filter: brightness(.96); }

.categories {
	display: flex;
	gap: 10px;
	overflow-x: auto;
	padding: 4px 0 20px;
	scrollbar-width: thin;
}

.categories a {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	white-space: nowrap;
	padding: 10px 14px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: rgba(255, 255, 255, .78);
	color: var(--text);
}

.categories a.active {
	border-color: transparent;
	background: var(--text);
	color: #fff;
}

.categories small {
	color: var(--muted);
	font-size: 12px;
}

.categories a.active small { color: rgba(255, 255, 255, .72); }

.intro {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	margin: 10px 0 24px;
	padding: 18px 20px;
	border: 1px solid var(--line);
	border-radius: 22px;
	background: rgba(255, 255, 255, .72);
}

.intro div {
	display: flex;
	align-items: baseline;
	gap: 8px;
	white-space: nowrap;
}

.intro b {
	font-size: 34px;
	letter-spacing: -.05em;
}

.intro p {
	margin: 0;
	color: var(--muted);
	line-height: 1.45;
}

.grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 18px;
}

.card {
	display: flex;
	flex-direction: column;
	min-height: 285px;
	padding: 20px;
	border: 1px solid var(--line);
	border-radius: 24px;
	background: var(--card);
	box-shadow: 0 8px 24px rgba(26, 72, 110, .07);
	cursor: pointer;
}

.card-head,
.actions,
.auth {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.identity {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.identity img,
.avatar-fallback {
	width: 42px;
	height: 42px;
	border-radius: 14px;
	object-fit: cover;
	flex: 0 0 auto;
	background: linear-gradient(135deg, var(--blue), var(--blue2));
}

.avatar-fallback {
	display: grid;
	place-items: center;
	color: #fff;
	font-weight: 800;
}

.type {
	padding: 6px 10px;
	border-radius: 999px;
	background: #eef8ff;
	color: var(--blue);
	font-size: 13px;
	font-weight: 700;
}

.members {
	color: var(--muted);
	font-size: 13px;
}

.card h2 {
	margin: 18px 0 10px;
	font-size: 22px;
	line-height: 1.16;
	letter-spacing: -.03em;
}

.card h2 a { color: inherit; }

.card p {
	margin: 0 0 14px;
	color: var(--muted);
	line-height: 1.48;
	overflow-wrap: anywhere;
}

.card h2 { overflow-wrap: anywhere; }

.tags {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
	margin: auto 0 16px;
}

.tags a {
	padding: 6px 9px;
	border-radius: 999px;
	background: #f2f6fa;
	color: var(--muted);
	font-size: 12px;
}

.vote {
	display: grid;
	justify-items: end;
	line-height: 1.05;
}

.vote b { font-size: 24px; }
.vote span { color: var(--muted); font-size: 12px; }

.auth {
	justify-content: flex-start;
	flex-wrap: wrap;
	margin-top: 16px;
	padding-top: 14px;
	border-top: 1px solid var(--line);
	color: var(--muted);
	font-size: 13px;
}

.auth a {
	padding: 7px 10px;
	border-radius: 10px;
	background: #f2f7fb;
	font-weight: 700;
}

.empty {
	padding: 46px 20px;
	text-align: center;
	border: 1px dashed var(--line);
	border-radius: 24px;
	background: rgba(255, 255, 255, .65);
}

.category-editor {
	padding-top: 34px;
	max-width: 760px;
}

.category-editor h1 {
	font-size: clamp(34px, 7vw, 58px);
}

.category-editor h2 {
	margin: 0 0 18px;
	font-size: 28px;
}

.category-form {
	display: grid;
	gap: 10px;
	padding: 18px;
	border: 1px solid var(--line);
	border-radius: 24px;
	background: #fff;
	box-shadow: var(--shadow);
}

.category-form label {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	border-radius: 14px;
	background: #f5f9fc;
}

.category-form button {
	margin-top: 10px;
	width: max-content;
}

.success {
	padding: 12px 14px;
	border-radius: 14px;
	background: #e9f9f1;
	color: #13784a;
}

.item-page {
	max-width: 920px;
	padding-top: 34px;
}

.item-hero {
	display: grid;
	grid-template-columns: 132px minmax(0, 1fr);
	gap: 24px;
	align-items: center;
	margin-bottom: 26px;
	padding: 24px;
	border: 1px solid var(--line);
	border-radius: 28px;
	background: #fff;
	box-shadow: var(--shadow);
}

.item-avatar img,
.item-avatar {
	width: 132px;
	height: 132px;
	border-radius: 34px;
	object-fit: cover;
	background: linear-gradient(135deg, var(--blue), var(--blue2));
}

.item-hero h1 {
	margin-bottom: 8px;
	font-size: clamp(34px, 6vw, 56px);
}

.item-hero h2 {
	margin: 0;
	font-size: clamp(26px, 5vw, 42px);
	line-height: 1.06;
	letter-spacing: -.04em;
	overflow-wrap: anywhere;
}

.item-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 16px;
	color: var(--muted);
}

.item-meta span {
	padding: 8px 11px;
	border-radius: 999px;
	background: #f2f7fb;
}

.item-block {
	margin: 18px 0;
	padding: 22px;
	border: 1px solid var(--line);
	border-radius: 24px;
	background: rgba(255, 255, 255, .78);
}

.item-block h3 {
	margin: 0 0 12px;
	font-size: 20px;
}

.item-block p {
	margin: 0;
	color: var(--muted);
	line-height: 1.6;
	overflow-wrap: anywhere;
}

.item-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 20px 0 42px;
}

.item-actions a:not(.primary) {
	padding: 13px 16px;
	border-radius: 13px;
	background: #f2f7fb;
	font-weight: 700;
}

.secondary-primary {
	background: linear-gradient(135deg, var(--green), #64d8a3);
}

#load-more {
	margin: 28px auto 6px;
	padding: 14px 18px;
	width: max-content;
	max-width: 100%;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: rgba(255, 255, 255, .8);
	color: var(--muted);
	font-size: 14px;
}

footer {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 38px 0;
	color: var(--muted);
	font-size: 14px;
}

@media (max-width: 900px) {
	.hero { grid-template-columns: 1fr; padding-top: 30px; }
	.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
	.top { align-items: flex-start; gap: 12px; flex-direction: column; }
	.top nav { width: 100%; overflow-x: auto; padding-bottom: 4px; }
	.search { flex-direction: column; }
	.intro { align-items: flex-start; flex-direction: column; }
	.grid { grid-template-columns: 1fr; }
	.card { min-height: 0; }
	footer { flex-direction: column; }
	.item-hero { grid-template-columns: 1fr; }
}
