/* Humane Games - Shared Styles
   Global theme variables, base styles, and reusable components
   ========================================================================== */

/* Theme Variables */
:root {
	--fur: #fef6ea;
	--treat: #ffb347;
	--treat-deep: #ff7a3c;
	--ink: #2c1c19;
	--mint: #6bc4a6;
	--cream: #fffaf3;
	--shadow: 0 16px 36px rgba(44, 28, 25, 0.18);
	--cell: 28px;
	--gap: 3px;
	--radius: 16px;
}

/* Reset & Base */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html,
body {
	height: 100%;
	width: 100%;
	overflow-x: hidden;
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background:
		radial-gradient(circle at 20% 20%, rgba(255, 182, 138, 0.28), transparent 34%),
		radial-gradient(circle at 80% 40%, rgba(107, 196, 166, 0.22), transparent 42%),
		#fdf1e3;
	font-family: "Trebuchet MS", "Segoe UI", system-ui, -apple-system, sans-serif;
	color: var(--ink);
	display: flex;
	flex-direction: column;
	align-items: stretch;
	justify-content: flex-start;
	padding: 0;
	min-height: 100vh;
	overscroll-behavior: none;
}

/* Accessibility: Skip Link */
.skip-link {
	position: absolute;
	left: -999px;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
}

.skip-link:focus {
	left: 12px;
	top: 12px;
	width: auto;
	height: auto;
	clip: auto;
	clip-path: none;
	padding: 10px 14px;
	border-radius: 999px;
	background: #fff;
	box-shadow: 0 6px 12px rgba(44, 28, 25, 0.15);
	z-index: 100;
}

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

/* Header */
.site-header {
	position: sticky;
	top: 0;
	z-index: 20;
	backdrop-filter: blur(8px);
	background: rgba(255, 250, 243, 0.85);
	border-bottom: 1px solid rgba(44, 28, 25, 0.08);
	box-shadow: 0 6px 18px rgba(44, 28, 25, 0.06);
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 14px clamp(16px, 3vw, 32px);
	max-width: 1200px;
	margin: 0 auto;
}

/* Brand */
.brand {
	font-weight: 800;
	letter-spacing: 0.5px;
	display: flex;
	align-items: center;
	gap: 8px;
	text-transform: uppercase;
	color: #1c3d35;
	text-decoration: none;
}

.brand:hover {
	opacity: 0.9;
}

.brand__mark {
	font-size: 1.25rem;
}

/* Navigation */
.nav {
	display: flex;
	align-items: center;
	gap: clamp(10px, 2vw, 18px);
	flex-wrap: wrap;
}

.nav__launcher-btn {
	appearance: none;
	border: none;
	border-radius: 999px;
	padding: 8px 18px;
	font-weight: 700;
	background: linear-gradient(140deg, #ffd39f, #ffb347);
	color: var(--ink);
	box-shadow: 0 10px 18px rgba(255, 138, 101, 0.25);
	cursor: pointer;
	transition: transform 120ms ease, box-shadow 120ms ease;
}

.nav__launcher-btn:hover,
.nav__launcher-btn:focus-visible {
	transform: translateY(-1px);
	box-shadow: 0 12px 22px rgba(255, 138, 101, 0.3);
	outline: none;
}

.nav a {
	color: var(--ink);
	text-decoration: none;
	font-weight: 700;
	padding: 8px 12px;
	border-radius: 999px;
	transition: background 0.2s ease, transform 0.2s ease;
}

.nav__link-btn {
	appearance: none;
	border: none;
	background: transparent;
	color: var(--ink);
	font-weight: 700;
	padding: 8px 12px;
	border-radius: 999px;
	cursor: pointer;
	font-size: 1rem;
	transition: background 0.2s ease, transform 0.2s ease;
}

.nav a:hover,
.nav a:focus-visible,
.nav__link-btn:hover,
.nav__link-btn:focus-visible {
	background: rgba(107, 196, 166, 0.2);
	transform: translateY(-1px);
}

.nav a:focus-visible {
	outline: 2px solid rgba(44, 28, 25, 0.5);
	outline-offset: 2px;
}

.nav__link-btn:focus-visible {
	outline: 2px solid rgba(44, 28, 25, 0.5);
	outline-offset: 2px;
}

/* Main Content Layout */
.site-main {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	gap: clamp(32px, 5vw, 64px);
	padding: clamp(16px, 3vw, 32px);
}

.site-main--hero {
	justify-content: center;
	min-height: calc(100vh - 160px);
	position: relative;
	overflow: hidden;
}

/* Sections */
.section {
	max-width: 1200px;
	width: 100%;
	margin: 0 auto;
	background: rgba(255, 250, 243, 0.85);
	border: 1px solid rgba(44, 28, 25, 0.08);
	border-radius: 20px;
	padding: clamp(16px, 4vw, 32px);
	box-shadow: var(--shadow);
}

.section + .section {
	scroll-margin-top: 100px;
}

.section__header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 12px;
}

.section__title {
	margin: 0;
	font-size: clamp(1.4rem, 2vw, 1.8rem);
}

.section__eyebrow {
	text-transform: uppercase;
	letter-spacing: 1px;
	font-size: 0.75rem;
	color: #3e5b54;
	margin: 0;
}

.section__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: clamp(16px, 3vw, 28px);
	align-items: start;
}

/* Hero Layout & Animations */
.hero {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: clamp(24px, 4vw, 48px);
	min-height: clamp(460px, 70vh, 640px);
	position: relative;
	overflow: hidden;
	isolation: isolate;
}

/* Soft animated glow behind hero */
.hero::before {
	content: "";
	position: absolute;
	inset: -20%;
	background:
		radial-gradient(circle at 10% 0%, rgba(255, 213, 196, 0.65), transparent 55%),
		radial-gradient(circle at 90% 100%, rgba(199, 240, 214, 0.7), transparent 55%);
	filter: blur(24px);
	opacity: 0.7;
	z-index: -1;
	animation: heroGlow 16s linear infinite alternate;
}

/* Staggered text entrance */
.hero__content {
	display: grid;
	gap: 16px;
}

.hero__content > * {
	opacity: 0;
	transform: translateY(14px);
	animation: heroFadeUp 620ms ease-out forwards;
}

.hero__content > *:nth-child(1) { animation-delay: 0.05s; }
.hero__content > *:nth-child(2) { animation-delay: 0.14s; }
.hero__content > *:nth-child(3) { animation-delay: 0.22s; }
.hero__content > *:nth-child(4) { animation-delay: 0.32s; }

.hero__eyebrow {
	font-size: 0.85rem;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	margin: 0;
	color: rgba(44, 28, 25, 0.7);
}

.hero__title {
	font-size: clamp(2rem, 4vw, 3rem);
	margin: 0;
}

.hero__lead {
	margin: 0;
	line-height: 1.6;
}

.hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

/* Hero preview + sparkles */
.hero__preview {
	position: relative;
	display: grid;
	place-items: center;
}

.hero__preview-card {
	background: rgba(255, 255, 255, 0.9);
	border: 1px solid rgba(44, 28, 25, 0.08);
	border-radius: 24px;
	padding: 24px;
	box-shadow: 0 30px 60px rgba(44, 28, 25, 0.18);
	min-width: 260px;
	display: grid;
	gap: 10px;
	animation: previewFloat 6s ease-in-out infinite;
}

.hero__preview-label {
	text-transform: uppercase;
	letter-spacing: 0.25em;
	font-size: 0.75rem;
	margin: 0;
	color: rgba(44, 28, 25, 0.7);
}

.hero__preview-card h2 {
	margin: 0;
}

.hero__preview-card ul {
	margin: 0;
	padding-left: 18px;
	color: rgba(44, 28, 25, 0.8);
}

/* Orbital sparkles layer */
.hero__sparkles {
	position: absolute;
	inset: 0;
	pointer-events: none;
	mix-blend-mode: soft-light;
	opacity: 0.7;
}

.hero__sparkles::before,
.hero__sparkles::after {
	content: "";
	position: absolute;
	width: 220px;
	height: 220px;
	border-radius: 50%;
	border: 1px dashed rgba(255, 255, 255, 0.4);
	top: 12%;
	right: 8%;
	animation: sparkOrbit 22s linear infinite;
}

.hero__sparkles::after {
	width: 160px;
	height: 160px;
	top: auto;
	bottom: 8%;
	left: 12%;
	animation-duration: 18s;
	animation-direction: reverse;
}

/* About Section */
.about {
	text-align: left;
	display: grid;
	gap: 12px;
}

.about__title {
	margin: 0;
	font-size: 1.6rem;
}

.about__lead,
.about__note {
	margin: 0;
	line-height: 1.6;
}

/* Buttons (generic CTA) */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 999px;
	padding: 12px 22px;
	font-weight: 700;
	font-size: 1rem;
	text-decoration: none;
	cursor: pointer;
	transition:
		transform 150ms ease,
		box-shadow 150ms ease,
		background 150ms ease;
}

.btn--primary {
	border: none;
	background: linear-gradient(140deg, #ffd39f, #ffb347);
	color: var(--ink);
	box-shadow: 0 12px 24px rgba(255, 138, 101, 0.35);
}

.btn--ghost {
	border: 1px solid rgba(44, 28, 25, 0.15);
	color: var(--ink);
	background: rgba(255, 255, 255, 0.8);
}

.btn:hover,
.btn:focus-visible {
	transform: translateY(-2px);
	box-shadow: 0 20px 36px rgba(44, 28, 25, 0.18);
	outline: none;
}

/* Cards */
.card {
	background: #fffaf3;
	border: 1px solid rgba(44, 28, 25, 0.08);
	border-radius: 16px;
	padding: 16px;
	box-shadow: 0 12px 28px rgba(44, 28, 25, 0.08);
}

.card h3 {
	margin: 0 0 8px;
}

.card p {
	margin: 0 0 12px;
	line-height: 1.5;
}

/* Pills / Tags */
.pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 12px;
	border-radius: 999px;
	background: rgba(107, 196, 166, 0.16);
	color: #1c3d35;
	font-weight: 700;
	margin-bottom: 8px;
}

/* Lists */
.list-simple {
	padding-left: 18px;
	margin: 0;
	display: grid;
	gap: 6px;
}

.list-simple li {
	line-height: 1.5;
}

/* Inline Links */
.link-inline {
	color: #1c3d35;
	font-weight: 700;
}

.link-inline:focus-visible {
	outline: 2px solid rgba(28, 61, 53, 0.5);
	outline-offset: 4px;
}

/* Game Grid for Launcher */
.game-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: clamp(16px, 3vw, 28px);
}

.game-card {
	background: linear-gradient(140deg, rgba(255, 250, 243, 0.96), rgba(255, 230, 207, 0.9));
	border: 2px solid rgba(44, 28, 25, 0.08);
	border-radius: 20px;
	padding: clamp(16px, 3vw, 24px);
	box-shadow: var(--shadow);
	text-decoration: none;
	color: var(--ink);
	display: flex;
	flex-direction: column;
	gap: 12px;
	transition: transform 180ms ease, box-shadow 180ms ease;
}

.game-card:hover,
.game-card:focus-visible {
	transform: translateY(-4px) scale(1.01);
	box-shadow: 0 20px 40px rgba(44, 28, 25, 0.22);
}

.game-card__icon {
	font-size: 3rem;
	line-height: 1;
}

.game-card__title {
	margin: 0;
	font-size: 1.4rem;
}

.game-card__desc {
	margin: 0;
	color: rgba(44, 28, 25, 0.75);
	line-height: 1.5;
}

.game-card__cta {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 16px;
	border-radius: 12px;
	background: linear-gradient(140deg, #ffd39f, #ffb347);
	color: var(--ink);
	font-weight: 700;
	margin-top: auto;
	width: fit-content;
	box-shadow: 0 8px 14px rgba(255, 138, 101, 0.25);
}

/* Back Link (secondary nav) */
.back-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.92);
	border: 1px solid rgba(44, 28, 25, 0.08);
	box-shadow: 0 6px 12px rgba(44, 28, 25, 0.1);
	text-decoration: none;
	color: var(--ink);
	font-weight: 700;
	transition: transform 120ms ease, box-shadow 120ms ease;
}

.back-link:hover {
	transform: translateY(-1px);
	box-shadow: 0 8px 16px rgba(44, 28, 25, 0.14);
}

.back-link:focus-visible,
.game-card__cta:focus-visible {
	outline: 3px solid rgba(28, 61, 53, 0.6);
	outline-offset: 4px;
}

/* Footer */
.site-footer {
	max-width: 1200px;
	width: 100%;
	margin: 24px auto;
	padding: 16px;
	text-align: center;
	color: rgba(44, 28, 25, 0.7);
}

/* Launcher Overlay */
body.is-launcher-open {
	overflow: hidden;
}

body.is-about-open {
	overflow: hidden;
}

.launcher-overlay {
	position: fixed;
	inset: 0;
	display: grid;
	place-items: center;
	background: rgba(20, 12, 10, 0.35);
	backdrop-filter: blur(6px);
	opacity: 0;
	pointer-events: none;
	transition: opacity 220ms ease;
	z-index: 100;
}

.launcher-overlay.is-active {
	opacity: 1;
	pointer-events: auto;
}

.launcher-overlay__backdrop {
	position: absolute;
	inset: 0;
}

/* Panel slides/scales in when active */
.launcher-overlay__panel {
	position: relative;
	max-width: 900px;
	width: min(90vw, 900px);
	background: rgba(255, 250, 243, 0.98);
	border: 1px solid rgba(44, 28, 25, 0.1);
	border-radius: 28px;
	padding: clamp(20px, 4vw, 32px);
	box-shadow: 0 40px 80px rgba(44, 28, 25, 0.35);
	transform: translateY(18px) scale(0.98);
	opacity: 0;
	transition:
		transform 210ms ease-out,
		opacity 210ms ease-out;
}

.launcher-overlay.is-active .launcher-overlay__panel {
	transform: translateY(0) scale(1);
	opacity: 1;
}

/* Close button */
.launcher-overlay__close {
	position: absolute;
	top: 16px;
	right: 16px;
	border: none;
	background: rgba(255, 255, 255, 0.9);
	border-radius: 999px;
	width: 44px;
	height: 44px;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 8px 16px rgba(44, 28, 25, 0.15);
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.launcher-overlay__close:hover,
.launcher-overlay__close:focus-visible {
	transform: translateY(-1px);
	box-shadow: 0 10px 18px rgba(44, 28, 25, 0.2);
	outline: none;
}

/* Overlay header text */
.launcher-overlay__header {
	display: grid;
	gap: 6px;
	margin-bottom: 18px;
}

.launcher-overlay__eyebrow {
	text-transform: uppercase;
	letter-spacing: 0.3em;
	font-size: 0.75rem;
	margin: 0;
	color: rgba(44, 28, 25, 0.6);
}

.launcher-overlay__hint {
	margin-top: 18px;
	color: rgba(44, 28, 25, 0.65);
	text-align: center;
}

/* About Overlay */
.about-overlay {
	position: fixed;
	inset: 0;
	display: grid;
	place-items: center;
	background: rgba(20, 12, 10, 0.35);
	backdrop-filter: blur(6px);
	opacity: 0;
	pointer-events: none;
	transition: opacity 200ms ease;
	z-index: 90;
}

.about-overlay.is-active {
	opacity: 1;
	pointer-events: auto;
}

.about-overlay__backdrop {
	position: absolute;
	inset: 0;
}

.about-overlay__panel {
	position: relative;
	max-width: 420px;
	width: min(90vw, 420px);
	background: rgba(255, 250, 243, 0.98);
	border: 1px solid rgba(44, 28, 25, 0.12);
	border-radius: 24px;
	padding: clamp(20px, 5vw, 32px);
	box-shadow: 0 30px 60px rgba(44, 28, 25, 0.3);
	transform: translateY(16px) scale(0.97);
	opacity: 0;
	transition: transform 200ms ease-out, opacity 200ms ease-out;
}

.about-overlay.is-active .about-overlay__panel {
	transform: translateY(0) scale(1);
	opacity: 1;
}

.about-overlay__close {
	position: absolute;
	top: 12px;
	right: 12px;
	border: none;
	background: rgba(255, 255, 255, 0.92);
	border-radius: 999px;
	width: 40px;
	height: 40px;
	font-size: 1.3rem;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 6px 12px rgba(44, 28, 25, 0.15);
}

.about-overlay__close:hover,
.about-overlay__close:focus-visible {
	transform: translateY(-1px);
	box-shadow: 0 10px 18px rgba(44, 28, 25, 0.2);
	outline: none;
}

.about-overlay__eyebrow {
	margin: 0 0 6px;
	text-transform: uppercase;
	letter-spacing: 0.28em;
	font-size: 0.7rem;
	color: rgba(44, 28, 25, 0.65);
}

.about-overlay__title {
	margin: 0 0 12px;
	font-size: 1.6rem;
}

.about-overlay__body {
	margin: 0 0 10px;
	line-height: 1.6;
}

.about-overlay__link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 18px;
	border-radius: 999px;
	background: linear-gradient(140deg, #ffd39f, #ffb347);
	color: var(--ink);
	font-weight: 700;
	text-decoration: none;
	box-shadow: 0 10px 20px rgba(255, 138, 101, 0.3);
}

.about-overlay__link:hover,
.about-overlay__link:focus-visible {
	transform: translateY(-1px);
	box-shadow: 0 16px 30px rgba(44, 28, 25, 0.2);
	outline: none;
}

/* Animations */
@keyframes heroGlow {
	0% {
		transform: translate3d(-10px, 0, 0) scale(1);
		opacity: 0.6;
	}
	50% {
		transform: translate3d(6px, 6px, 0) scale(1.03);
		opacity: 0.8;
	}
	100% {
		transform: translate3d(0, -8px, 0) scale(1.02);
		opacity: 0.7;
	}
}

@keyframes heroFadeUp {
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes previewFloat {
	0%,
	100% {
		transform: translateY(0);
		box-shadow: 0 16px 32px rgba(0, 0, 0, 0.12);
	}
	50% {
		transform: translateY(-6px);
		box-shadow: 0 24px 42px rgba(0, 0, 0, 0.16);
	}
}

@keyframes sparkOrbit {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(360deg);
	}
}

/* Legacy/utility animations that might be reused */
@keyframes stat-pop {
	0% {
		transform: translateY(0) scale(1);
	}
	45% {
		transform: translateY(-3px) scale(1.06);
	}
	100% {
		transform: translateY(0) scale(1);
	}
}

@keyframes stat-shine {
	0% {
		opacity: 0;
		transform: translateX(-70%) skewX(-12deg);
	}
	50% {
		opacity: 0.7;
	}
	100% {
		opacity: 0;
		transform: translateX(130%) skewX(-12deg);
	}
}

@keyframes bob {
	0% {
		transform: translateY(-2px);
	}
	50% {
		transform: translateY(1px);
	}
	100% {
		transform: translateY(0);
	}
}

@keyframes drift {
	0% {
		transform: translate(-10px, -10px) scale(0.8);
	}
	100% {
		transform: translate(20px, 20px) scale(1.1);
	}
}

/* Responsive */
@media (max-width: 720px) {
	body {
		padding: 0;
	}
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation: none !important;
		transition: none !important;
	}
}
