/* ============================================================
   GoatStore — Rose Pine / Lexend, matched to neokex.xyz
   ============================================================ */

:root,
html[data-theme="dark"] {
	--base-100: #191724; /* page background */
	--base-200: #1f1d2e; /* raised surface  */
	--base-300: #26233a; /* borders         */
	--content: #e0def4; /* body text       */
	--primary: #ebbcba; /* rose            */
	--accent: #f6c177; /* gold            */
	--neutral: #9ccfd8; /* foam            */
	--secondary: #31748f; /* pine           */
	--info: #c4a7e7; /* iris            */
	--error: #eb6f92; /* love            */
	--theme-label: "Rose Pine";
}

html[data-theme="light"] {
	--base-100: #faf4ed;
	--base-200: #fffaf3;
	--base-300: #f2e9e1;
	--content: #575279;
	--primary: #d7827e;
	--accent: #ea9d34;
	--neutral: #286983;
	--secondary: #56949f;
	--info: #907aa9;
	--error: #b4637a;
	--theme-label: "Rose Pine Dawn";
}

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

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	min-height: 100dvh;
	background-color: var(--base-100);
	color: var(--content);
	font-family: "Lexend", ui-sans-serif, system-ui, sans-serif;
	font-size: 17px;
	line-height: 1.625;
	-webkit-font-smoothing: antialiased;
	transition:
		background-color 0.25s ease,
		color 0.25s ease;
}

h1,
h2,
h3 {
	margin: 0;
	font-weight: 400;
	line-height: 1.2;
}
p {
	margin: 0 0 1.15em;
}
p:last-child {
	margin-bottom: 0;
}

a {
	color: inherit;
	text-decoration: none;
	transition: color 0.15s ease;
}
a:hover {
	color: var(--info);
}

code {
	background: var(--base-300);
	border-radius: 6px;
	padding: 1px 6px;
	font-size: 0.88em;
	color: var(--accent);
}

.icon {
	width: 1em;
	height: 1em;
	flex-shrink: 0;
	display: inline-block;
	vertical-align: -0.125em;
}

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

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 100;
	background: var(--base-200);
	padding: 10px 16px;
	border-radius: 0 0 10px 0;
}
.skip-link:focus {
	left: 0;
}

/* ---------- Shell ---------- */
.shell {
	display: flex;
	flex-direction: column;
	max-width: 1152px;
	min-height: 100dvh;
	margin: 0 auto;
	padding: 12px;
}
.grow {
	flex-grow: 1;
}

/* ---------- Nav ---------- */
.nav {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 8px;
	padding: 8px 16px;
}

.tabs {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 8px;
}

.pill {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 33.25px;
	padding: 0 16px;
	border-radius: 16px;
	font-size: 16px;
	color: var(--neutral);
	transition:
		color 0.15s ease,
		background-color 0.15s ease;
}
.pill .icon {
	font-size: 20px;
}
.pill:hover {
	color: var(--primary);
	background: color-mix(in oklab, var(--primary) 20%, transparent);
}
.pill[aria-current="page"] {
	color: #fff;
	background: var(--primary);
}

.theme-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: space-between;
	width: 144px;
	height: 33.25px;
	padding: 0 12px;
	border-radius: 16px;
	background: var(--base-100);
	color: var(--content);
	border: 1px solid color-mix(in oklab, var(--content) 40%, transparent);
	font: inherit;
	font-size: 16px;
	cursor: pointer;
	transition: border-color 0.15s ease;
}
.theme-toggle:hover {
	border-color: var(--primary);
}
.theme-toggle .icon {
	font-size: 16px;
	color: color-mix(in oklab, var(--content) 55%, transparent);
}

@media (max-width: 767px) {
	.theme-toggle {
		width: 32px;
		height: 32px;
		padding: 0;
		justify-content: center;
	}
	.theme-toggle .theme-label,
	.theme-toggle .icon {
		display: none;
	}
	.theme-toggle::before {
		content: "";
		width: 16px;
		height: 16px;
		border-radius: 50%;
		background: var(--accent);
		box-shadow: inset -5px -2px 0 0 var(--base-100);
	}
}
@media (max-width: 640px) {
	.nav {
		padding: 8px 10px;
	}
	.tabs {
		gap: 4px;
	}
	.pill {
		height: 32px;
		padding: 0 11px;
		gap: 6px;
		font-size: 15px;
	}
	.pill .icon {
		font-size: 18px;
	}
}

/* ---------- Hero ---------- */
.hero {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 24px;
	margin-top: 6vh;
	padding: 20px 0 8px;
}
@media (min-width: 768px) {
	.hero {
		margin-top: 12vh;
	}
}

.hero-mark {
	width: 96px;
	height: 96px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 44px;
	flex-shrink: 0;
	background: color-mix(in oklab, var(--accent) 14%, var(--base-200));
	border: 1px solid var(--base-300);
}
.hero-name {
	display: inline-block;
	margin: 0 8px 0 0;
	color: var(--accent);
	font-size: 36px;
	line-height: 1.2;
}
.tagline {
	display: block;
	margin: 0 0 8px;
	font-style: italic;
	font-size: 18px;
	color: color-mix(in oklab, var(--content) 70%, transparent);
}
.hero-lede {
	max-width: 52ch;
	margin: 0 0 16px;
	font-size: 16px;
	color: color-mix(in oklab, var(--content) 78%, transparent);
}
.accent {
	color: var(--accent);
}

.stats {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.soft-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 14px;
	border-radius: 16px;
	background: color-mix(in oklab, var(--neutral) 12%, var(--base-100));
	color: var(--neutral);
	font-size: 15px;
	line-height: 1.4;
}
.soft-pill strong {
	color: var(--accent);
	font-weight: 600;
}

@media (max-width: 640px) {
	.hero {
		flex-direction: column;
		text-align: center;
		gap: 16px;
		margin-top: 4vh;
	}
	.hero-name {
		font-size: 30px;
	}
	.soft-pill {
		font-size: 14px;
		padding: 5px 11px;
	}
}

/* ---------- Controls ---------- */
main {
	padding: 26px 4px 40px;
}

.controls {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	margin: 22px 0 20px;
}
.field {
	flex: 1 1 200px;
	display: flex;
}
.controls input,
.controls select {
	width: 100%;
	background: var(--base-200);
	border: 1px solid var(--base-300);
	color: var(--content);
	border-radius: 12px;
	padding: 11px 14px;
	font: inherit;
	font-size: 15px;
	transition: border-color 0.15s ease;
}
.controls input::placeholder {
	color: color-mix(in oklab, var(--content) 45%, transparent);
}
.controls input:focus,
.controls select:focus {
	outline: none;
	border-color: var(--accent);
}

/* ---------- Cards ---------- */
.grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	gap: 12px;
}

.card {
	position: relative;
	background: var(--base-200);
	border: 1px solid var(--base-300);
	border-radius: 14px;
	padding: 16px 16px 14px 22px;
	text-align: left;
	cursor: pointer;
	color: inherit;
	font: inherit;
	transition:
		border-color 0.15s ease,
		transform 0.15s ease,
		background-color 0.15s ease;
}
.card::before {
	content: "";
	position: absolute;
	left: 8px;
	top: 22px;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--accent);
}
.card:hover {
	border-color: color-mix(in oklab, var(--accent) 55%, var(--base-300));
	background: color-mix(in oklab, var(--accent) 6%, var(--base-200));
	transform: translateY(-2px);
}
.card h3 {
	margin: 0 0 4px;
	font-size: 17px;
	color: var(--content);
	display: flex;
	align-items: center;
	gap: 8px;
}
.badge {
	font-size: 11px;
	background: var(--base-300);
	border-radius: 999px;
	padding: 2px 8px;
	color: var(--neutral);
}
.card .author {
	color: color-mix(in oklab, var(--content) 60%, transparent);
	font-size: 14px;
	margin: 0 0 8px;
}
.card .desc {
	font-size: 14px;
	color: color-mix(in oklab, var(--content) 65%, transparent);
	min-height: 40px;
	margin: 0 0 10px;
}
.card .meta {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	font-size: 12.5px;
	color: color-mix(in oklab, var(--content) 55%, transparent);
	border-top: 1px solid var(--base-300);
	padding-top: 9px;
}
.card .meta .cat {
	color: var(--neutral);
}

/* ---------- Empty / pager ---------- */
.empty {
	text-align: center;
	color: color-mix(in oklab, var(--content) 60%, transparent);
	padding: 60px 0;
}

.pager {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	margin-top: 26px;
}
.pill-btn {
	background: var(--base-200);
	border: 1px solid var(--base-300);
	color: var(--content);
	border-radius: 16px;
	padding: 8px 16px;
	font: inherit;
	font-size: 15px;
	cursor: pointer;
	transition:
		border-color 0.15s ease,
		color 0.15s ease;
}
.pill-btn:hover:not(:disabled) {
	border-color: var(--primary);
	color: var(--primary);
}
.pill-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}
#page-label {
	color: color-mix(in oklab, var(--content) 60%, transparent);
	font-size: 14px;
}

/* ---------- Detail dialog ---------- */
dialog {
	background: var(--base-200);
	color: var(--content);
	border: 1px solid var(--base-300);
	border-radius: 16px;
	max-width: 780px;
	width: calc(100% - 32px);
	padding: 26px;
}
dialog::backdrop {
	background: rgba(25, 23, 36, 0.72);
}

.close {
	position: absolute;
	top: 12px;
	right: 14px;
	background: none;
	border: none;
	color: color-mix(in oklab, var(--content) 60%, transparent);
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}
.close:hover {
	color: var(--primary);
}

#detail-body h2 {
	margin: 0 0 6px;
	color: var(--accent);
	display: flex;
	align-items: center;
	gap: 10px;
}
#detail-body .author {
	color: color-mix(in oklab, var(--content) 60%, transparent);
	margin: 0 0 12px;
}

#detail-body .kv {
	display: grid;
	grid-template-columns: 130px 1fr;
	gap: 7px 14px;
	margin: 16px 0;
	font-size: 15px;
}
#detail-body .kv dt {
	color: color-mix(in oklab, var(--content) 55%, transparent);
}
#detail-body .kv dd {
	margin: 0;
	overflow-wrap: anywhere;
}
#detail-body .kv a {
	color: var(--info);
}
#detail-body .kv a:hover {
	text-decoration: underline;
}

#detail-body .guide {
	margin: 14px 0;
	font-size: 15px;
}
#detail-body .guide strong {
	color: var(--neutral);
}

.actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 18px;
}
.btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 16px;
	border-radius: 16px;
	font-size: 15px;
	border: 1px solid var(--base-300);
	background: var(--base-100);
	color: var(--content);
	cursor: pointer;
	transition:
		border-color 0.15s ease,
		color 0.15s ease,
		background-color 0.15s ease;
}
.btn:hover {
	border-color: var(--primary);
	color: var(--primary);
}
.btn--primary {
	background: var(--primary);
	border-color: var(--primary);
	color: #191724;
}
.btn--primary:hover {
	color: #191724;
	background: color-mix(in oklab, var(--primary) 85%, white);
}

#detail-body pre {
	background: var(--base-100);
	border: 1px solid var(--base-300);
	border-radius: 12px;
	padding: 14px;
	overflow: auto;
	max-height: 340px;
	font-size: 12.5px;
	line-height: 1.5;
}

/* ---------- Footer ---------- */
.footer {
	text-align: center;
	margin: 40px 0 0;
	padding: 8px 0 20px;
	font-size: 16px;
	line-height: 1.6;
	color: color-mix(in oklab, var(--content) 75%, transparent);
}
.footer p {
	margin: 0 0 6px;
}
.footer a {
	color: var(--neutral);
}
.footer a:hover {
	color: var(--primary);
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
	* {
		transition: none !important;
	}
}
