/* P2Xstudio V2 — base: document, plasma background, animated grid, scrollbars,
   accessibility primitives. Derived from V1 style.css (values preserved). */

html,
body {
	margin: 0;
	background: var(--xeno-bg);
	font-family: var(--font-body);
	color: var(--xeno-text);
	overflow-x: hidden;
	touch-action: manipulation;
}

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

img,
canvas,
iframe,
video {
	max-width: 100%;
}

a {
	color: var(--xeno-green);
}

button {
	font-family: inherit;
	color: inherit;
}

::selection {
	background: var(--xeno-green);
	color: var(--xeno-ink);
}

/* ── Plasma layer ─────────────────────────────────────────────────────── */

body::before {
	content: "";
	position: fixed;
	inset: 0;
	background:
		radial-gradient(circle at 30% 40%, var(--xeno-green-25), transparent 40%),
		radial-gradient(circle at 70% 60%, rgba(0, 255, 100, 0.15), transparent 50%),
		radial-gradient(circle at 50% 50%, rgba(0, 255, 80, 0.08), transparent 70%);
	filter: blur(40px);
	z-index: -2;
	pointer-events: none;
}

/* ── Animated grid ────────────────────────────────────────────────────── */

body::after {
	content: "";
	position: fixed;
	inset: 0;
	background-image:
		linear-gradient(var(--xeno-green-10) 1px, transparent 1px),
		linear-gradient(90deg, var(--xeno-green-10) 1px, transparent 1px);
	background-size: 60px 60px;
	animation: gridMove 20s linear infinite;
	animation-play-state: paused;
	z-index: var(--z-grid);
	pointer-events: none;
}

body.active::after {
	animation-play-state: running;
}

@keyframes gridMove {
	0% {
		background-position: 0 0, 0 0;
	}
	100% {
		background-position: 120px -120px, 120px -120px;
	}
}

/* ── Scrollbars ───────────────────────────────────────────────────────── */

::-webkit-scrollbar {
	width: 6px;
}

::-webkit-scrollbar-track {
	background: rgba(0, 20, 10, 0.6);
	border-radius: 10px;
}

::-webkit-scrollbar-thumb {
	background: linear-gradient(180deg, var(--xeno-green), #00cc66);
	border-radius: 10px;
	box-shadow:
		0 0 8px var(--xeno-green-80),
		inset 0 0 4px rgba(255, 255, 255, 0.2);
}

::-webkit-scrollbar-thumb:hover {
	background: var(--xeno-green);
	box-shadow:
		0 0 12px var(--xeno-green-strong),
		inset 0 0 6px rgba(255, 255, 255, 0.4);
}

* {
	scrollbar-width: thin;
	scrollbar-color: var(--xeno-green) rgba(0, 20, 10, 0.6);
}

#terminalOutput::-webkit-scrollbar {
	width: 4px;
}

/* ── Accessibility ────────────────────────────────────────────────────── */

:focus-visible {
	outline: 2px solid var(--xeno-green);
	outline-offset: 2px;
}

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

.screen-reader-text:focus,
.skip-link:focus {
	background: var(--xeno-bg);
	clip: auto !important;
	clip-path: none;
	color: var(--xeno-green);
	display: block;
	font-size: 12px;
	height: auto;
	left: 16px;
	line-height: normal;
	padding: 12px 18px;
	text-decoration: none;
	top: 16px;
	width: auto;
	z-index: var(--z-skip);
	border: 1px solid var(--xeno-green);
	border-radius: var(--radius-xs);
	box-shadow: var(--glow-hard);
}

/* Respect the user's motion preference: kill decorative animation. */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}
