/* ==========================================================================
   Crashnauts — site styles
   ========================================================================== */

:root {
	--bg: #05060a;
	--panel: rgba(18, 18, 22, 0.88);
	--panel-solid: #151515;
	--panel-border: rgba(197, 255, 6, 0.14);
	--text: #e9ebe4;
	--text-dim: #a3a79b;
	--lime: #c5ff06;
	--lime-deep: #8fc400;
	--yellow: #f2e313;
	--magenta: #e23cff;
	--switch: #e60012;
	--switch-hover: #ff1a2d;
	--steam: #1b2838;
	--steam-hover: #2a475e;
	--radius: 14px;
	--max: 1120px;
	--font-display: "Bungee", "Impact", system-ui, sans-serif;
	--font-body: "Chakra Petch", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font-body);
	font-size: 1.0625rem;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}

img, video, iframe { max-width: 100%; display: block; }
a { color: var(--lime); text-decoration: none; }
a:hover { color: var(--yellow); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.15; margin: 0 0 0.6em; letter-spacing: 0.01em; }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); color: var(--lime); text-shadow: 0 2px 0 #2b3a00; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

.skip-link {
	position: absolute; left: -9999px; top: 8px; z-index: 100;
	background: var(--lime); color: #000; padding: 8px 14px; border-radius: 6px; font-weight: 700;
}
.skip-link:focus { left: 8px; }

:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; border-radius: 4px; }

/* ---------- Parallax starfield (the original site's signature) ---------- */
.space { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.space div { position: absolute; inset: 0 0 -1100px 0; will-change: transform, background-position; }
.space .stars { background: #000 url(../images/bg/stars_bg.jpg) repeat; background-size: 1920px auto; animation: drift 240s linear infinite; }
.space .mid   { background: url(../images/bg/midground.png) repeat; animation: drift 140s linear infinite; }
.space .fore  { background: url(../images/bg/foreground.png) repeat; animation: drift 80s linear infinite; }
.space::after {
	content: ""; position: absolute; inset: 0;
	background:
		radial-gradient(ellipse 60% 45% at 15% 10%, rgba(226, 60, 255, 0.16), transparent 70%),
		radial-gradient(ellipse 55% 45% at 90% 70%, rgba(197, 255, 6, 0.08), transparent 70%),
		linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.55));
}
@keyframes drift { from { background-position: 0 0; } to { background-position: -1000px 500px; } }

/* ---------- Header ---------- */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: rgba(10, 10, 12, 0.78);
	backdrop-filter: blur(12px) saturate(140%);
	-webkit-backdrop-filter: blur(12px) saturate(140%);
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.header-inner {
	max-width: var(--max); margin: 0 auto; padding: 10px 20px;
	display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.brand img { height: 56px; width: auto; transition: transform 0.2s; }
.brand:hover img { transform: rotate(-2deg) scale(1.04); }

.nav, .nav-panel { display: flex; align-items: center; gap: 10px; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 8px; }

.btn {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 9px 16px; border-radius: 8px;
	font-family: var(--font-body); font-weight: 700; font-size: 0.95rem; letter-spacing: 0.02em;
	color: #fff; border: 0; cursor: pointer; white-space: nowrap;
	transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}
.btn:hover { color: #fff; transform: translateY(-2px); }
.btn img { width: 20px; height: 20px; }
.btn-switch { background: var(--switch); }
.btn-switch:hover { background: var(--switch-hover); box-shadow: 0 6px 18px rgba(230, 0, 18, 0.45); }
.btn-steam { background: var(--steam); }
.btn-steam:hover { background: var(--steam-hover); box-shadow: 0 6px 18px rgba(102, 192, 244, 0.3); }
.btn-lime { background: var(--lime); color: #111; }
.btn-lime:hover { background: var(--yellow); color: #111; box-shadow: 0 6px 22px rgba(197, 255, 6, 0.4); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { color: var(--lime); }
.btn-lg { padding: 13px 22px; font-size: 1.05rem; }
.btn-lg img { width: 24px; height: 24px; }

.social { display: inline-block; width: 40px; height: 40px; border-radius: 8px; overflow: hidden; transition: transform 0.15s, box-shadow 0.2s; }
.social img { width: 100%; height: 100%; }
.social:hover { transform: translateY(-2px) rotate(-4deg); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6); }
.nav .sep { width: 1px; height: 28px; background: rgba(255, 255, 255, 0.12); margin: 0 4px; }
.nav a[aria-current="page"] { color: var(--lime); }

.menu-toggle {
	display: none; background: none; border: 2px solid rgba(255, 255, 255, 0.2); border-radius: 8px;
	width: 44px; height: 44px; cursor: pointer; padding: 0; color: var(--text);
}
.menu-toggle span, .menu-toggle span::before, .menu-toggle span::after {
	display: block; width: 20px; height: 2px; background: currentColor; margin: 0 auto; position: relative; transition: transform 0.2s;
}
.menu-toggle span::before, .menu-toggle span::after { content: ""; position: absolute; left: 0; }
.menu-toggle span::before { top: -6px; }
.menu-toggle span::after { top: 6px; }
.menu-toggle[aria-expanded="true"] span { background: transparent; }
.menu-toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Layout ---------- */
main { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

.panel {
	background: var(--panel);
	border: 1px solid var(--panel-border);
	border-radius: var(--radius);
	padding: clamp(22px, 4vw, 44px);
	margin: 28px 0;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
	backdrop-filter: blur(4px);
}

.eyebrow {
	display: inline-block; font-family: var(--font-display); font-size: 0.8rem; letter-spacing: 0.12em;
	color: var(--magenta); text-transform: uppercase; margin-bottom: 10px;
}

/* ---------- Hero ---------- */
.hero { padding: 44px 0 8px; text-align: center; }
.hero-tagline {
	font-family: var(--font-display); font-size: clamp(1.6rem, 5vw, 3.2rem); color: #fff; margin: 0 0 6px;
	text-shadow: 0 3px 0 #000, 0 0 30px rgba(197, 255, 6, 0.25);
}
.hero-tagline em { font-style: normal; color: var(--lime); }
.hero-sub { color: var(--text-dim); font-size: 1.1rem; margin: 0 auto 26px; max-width: 640px; }

.video-frame {
	position: relative; aspect-ratio: 16 / 9; width: 100%;
	border-radius: var(--radius); overflow: hidden; background: #000;
	border: 2px solid rgba(197, 255, 6, 0.35);
	box-shadow: 0 0 0 6px rgba(0, 0, 0, 0.5), 0 0 60px rgba(197, 255, 6, 0.18), 0 30px 60px rgba(0, 0, 0, 0.6);
}
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Lightweight YouTube facade: loads the real player only on click */
.yt-facade { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; cursor: pointer; background: #000; }
.yt-facade img { width: 100%; height: 100%; object-fit: cover; opacity: 0.85; transition: opacity 0.2s, transform 0.4s; }
.yt-facade:hover img { opacity: 1; transform: scale(1.02); }
.yt-facade .play {
	position: absolute; left: 50%; top: 50%; width: 88px; height: 88px; transform: translate(-50%, -50%);
	border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 10px rgba(197, 255, 6, 0.25), 0 10px 30px rgba(0, 0, 0, 0.6);
	transition: transform 0.2s, box-shadow 0.2s;
}
.yt-facade .play::after {
	content: ""; position: absolute; left: 36px; top: 26px;
	border-style: solid; border-width: 18px 0 18px 30px; border-color: transparent transparent transparent #111;
}
.yt-facade:hover .play { transform: translate(-50%, -50%) scale(1.08); box-shadow: 0 0 0 16px rgba(197, 255, 6, 0.2), 0 10px 30px rgba(0, 0, 0, 0.6); }
.yt-facade .label {
	position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 20px 16px; text-align: left;
	color: #fff; font-family: var(--font-body); font-weight: 700; font-size: 1rem;
	background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
}

.cta-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 26px 0 0; }

.runners { display: flex; justify-content: center; align-items: flex-end; gap: 40px; margin: 26px 0 -8px; }
.runners img { image-rendering: auto; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.6)); }
.runners img:first-child { height: 110px; width: auto; }
.runners img:last-child { height: 92px; width: auto; }

.steam-widget { padding: 16px; }
.steam-widget iframe { width: 100%; height: 190px; border: 0; }

/* ---------- Feature rows ---------- */
.feature { display: grid; grid-template-columns: 1fr 2fr; gap: clamp(20px, 4vw, 48px); align-items: center; }
.feature.reverse { grid-template-columns: 2fr 1fr; }
.feature.reverse .feature-media { order: -1; }
.feature + .feature { margin-top: 48px; }
.feature-media {
	border-radius: 10px; overflow: hidden; background: #000;
	border: 1px solid rgba(255, 255, 255, 0.08); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
}
.feature-media img, .feature-media video { width: 100%; height: auto; }
.pixel { image-rendering: pixelated; }

.divider { border: 0; height: 2px; margin: 44px 0; background: linear-gradient(90deg, transparent, rgba(197, 255, 6, 0.35), transparent); }

/* ---------- Gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 32px 0 0; padding: 0; list-style: none; }
.gallery a {
	display: block; position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #000;
	border: 1px solid rgba(255, 255, 255, 0.08);
}
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s ease, filter 0.35s; }
.gallery a:hover img, .gallery a:focus-visible img { transform: scale(1.06); filter: brightness(1.1); }
.gallery a::after {
	content: ""; position: absolute; inset: 0; border-radius: 8px; box-shadow: inset 0 0 0 2px transparent; transition: box-shadow 0.2s;
}
.gallery a:hover::after { box-shadow: inset 0 0 0 2px var(--lime); }

/* ---------- Factions ---------- */
.factions-intro { text-align: center; max-width: 680px; margin: 0 auto 28px; }
.factions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; list-style: none; margin: 0; padding: 0; }
.faction {
	position: relative; text-align: center; padding: 18px 10px 14px; border-radius: 12px;
	background: radial-gradient(circle at 50% 35%, rgba(197, 255, 6, 0.12), transparent 65%), rgba(0, 0, 0, 0.35);
	border: 1px solid rgba(255, 255, 255, 0.07);
	transition: transform 0.2s, border-color 0.2s, background 0.3s;
}
.faction:hover { transform: translateY(-6px); border-color: rgba(197, 255, 6, 0.4); }
.faction img { width: 100%; height: auto; margin: 0 auto 10px; filter: drop-shadow(0 10px 10px rgba(0, 0, 0, 0.55)); transition: transform 0.25s; }
.faction:hover img { transform: scale(1.06) rotate(-2deg); }
.faction h3 { margin: 0; color: #fff; }
.faction p { margin: 2px 0 0; font-size: 0.9rem; color: var(--text-dim); }

/* ---------- Newsletter ---------- */
.newsletter { text-align: center; background: linear-gradient(135deg, rgba(197, 255, 6, 0.12), rgba(226, 60, 255, 0.1)), var(--panel); }
.newsletter p { color: var(--text-dim); }
.signup { display: flex; gap: 10px; max-width: 520px; margin: 18px auto 0; }
.signup input[type="email"] {
	flex: 1; min-width: 0; padding: 13px 16px; border-radius: 8px; font: inherit; color: #fff;
	background: rgba(0, 0, 0, 0.55); border: 2px solid rgba(255, 255, 255, 0.15); transition: border-color 0.2s;
}
.signup input[type="email"]::placeholder { color: #8b8f84; }
.signup input[type="email"]:focus { outline: none; border-color: var(--lime); }
.hp { position: absolute; left: -5000px; }

/* ---------- Press page ---------- */
.page-title { padding: 44px 0 0; }
.page-title h1 { font-size: clamp(2rem, 6vw, 3.4rem); color: #fff; text-shadow: 0 3px 0 #000; margin: 0; }
.page-title p { color: var(--text-dim); margin: 6px 0 0; }

.press-grid { display: grid; grid-template-columns: 1fr 1.6fr; gap: 28px; align-items: start; }
.facts { margin: 0; display: grid; gap: 14px; }
.facts div { padding-bottom: 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.facts div:last-child { border: 0; padding: 0; }
.facts dt { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-dim); }
.facts dd { margin: 2px 0 0; font-weight: 600; }
.features-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.features-list li { padding-left: 30px; position: relative; }
.features-list li::before {
	content: ""; position: absolute; left: 0; top: 7px; width: 14px; height: 14px; border-radius: 3px;
	background: var(--lime); transform: rotate(45deg); box-shadow: 0 0 12px rgba(197, 255, 6, 0.6);
}
.features-list strong { display: block; color: #fff; }
.features-list span { color: var(--text-dim); }

.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.asset {
	display: flex; flex-direction: column; border-radius: 10px; overflow: hidden; color: var(--text);
	background: rgba(0, 0, 0, 0.4); border: 1px solid rgba(255, 255, 255, 0.08); transition: border-color 0.2s, transform 0.2s;
}
.asset:hover { border-color: var(--lime); transform: translateY(-3px); color: var(--text); }
.asset .thumb { aspect-ratio: 16 / 9; display: grid; place-items: center; background: #0b0b0d; overflow: hidden; }
.asset .thumb img { width: 100%; height: 100%; object-fit: cover; }
.asset .thumb.contain img { object-fit: contain; padding: 14px; }
.asset .meta { padding: 10px 12px; font-size: 0.88rem; display: flex; justify-content: space-between; gap: 8px; }
.asset .meta span:last-child { color: var(--lime); font-weight: 700; }
.video-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.video-grid h3 { margin-top: 12px; font-size: 1rem; }
.callout {
	border-left: 4px solid var(--magenta); padding: 14px 18px; border-radius: 0 10px 10px 0;
	background: rgba(226, 60, 255, 0.08);
}

/* ---------- Footer ---------- */
.site-footer { margin-top: 40px; padding: 36px 20px 44px; text-align: center; color: var(--text-dim); background: linear-gradient(transparent, rgba(0, 0, 0, 0.75)); }
.site-footer .socials { display: flex; justify-content: center; gap: 10px; margin-bottom: 16px; }
.site-footer img.logo { height: 40px; width: auto; margin: 0 auto 14px; opacity: 0.85; }
.site-footer p { margin: 0; font-size: 0.9rem; }

/* ---------- Lightbox ---------- */
.lightbox {
	padding: 0; border: 0; background: transparent; max-width: 94vw; max-height: 92vh; overflow: visible;
}
.lightbox::backdrop { background: rgba(0, 0, 0, 0.88); backdrop-filter: blur(4px); }
.lightbox img { max-width: 94vw; max-height: 86vh; width: auto; height: auto; border-radius: 8px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8); }
.lightbox button {
	position: fixed; background: rgba(20, 20, 20, 0.85); color: #fff; border: 1px solid rgba(255, 255, 255, 0.2);
	width: 48px; height: 48px; border-radius: 50%; font-size: 1.5rem; line-height: 1; cursor: pointer; transition: background 0.2s, color 0.2s;
}
.lightbox button:hover { background: var(--lime); color: #000; }
.lightbox .lb-close { top: 16px; right: 16px; }
.lightbox .lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 16px; top: 50%; transform: translateY(-50%); }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
	.menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
	.nav-panel {
		position: absolute; top: 100%; left: 0; right: 0; display: none; flex-direction: column; align-items: stretch;
		padding: 16px 20px 22px; background: rgba(10, 10, 12, 0.97); border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	}
	.nav-panel.open { display: flex; }
	.nav-panel ul { flex-wrap: wrap; justify-content: center; }
	.nav-panel .stores { width: 100%; }
	.nav-panel .stores li { flex: 1; }
	.nav-panel .stores .btn { width: 100%; justify-content: center; }
	.nav .sep { display: none; }
	.nav-panel > * + * { margin-top: 12px; }
	.brand img { height: 46px; }
}
@media (max-width: 760px) {
	.feature, .feature.reverse { grid-template-columns: 1fr; }
	.feature.reverse .feature-media { order: 0; }
	.gallery { grid-template-columns: repeat(2, 1fr); }
	.factions { grid-template-columns: repeat(2, 1fr); }
	.press-grid, .video-grid { grid-template-columns: 1fr; }
	.signup { flex-direction: column; }
	.steam-widget { display: none; }
	.runners { gap: 20px; }
	.runners img:first-child { height: 80px; }
	.runners img:last-child { height: 66px; }
	.yt-facade .label { display: none; }
	.cta-row .btn { width: 100%; justify-content: center; }
	.yt-facade .play { width: 68px; height: 68px; }
	.yt-facade .play::after { left: 27px; top: 19px; border-width: 15px 0 15px 24px; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.space div { animation: none; }
	.js .reveal { opacity: 1; transform: none; transition: none; }
	*, *::before, *::after { transition-duration: 0.01ms !important; }
}
