:root {
	--phosphor: #9DFF20;
	--phosphor-dim: #5da50f;
	--phosphor-faint: rgba(157, 255, 32, 0.30);
	--phosphor-bg: rgba(157, 255, 32, 0.05);
	--phosphor-text: #c4e8b0;
	--amber: #ffb000;
	--amber-faint: rgba(255, 176, 0, 0.4);
	--bg: #060805;

	color-scheme: dark;
	color: var(--phosphor);
	background: var(--bg);
	font-family: 'JetBrains Mono', ui-monospace, monospace;
	line-height: 1.55;
}

html, body { margin: 0; padding: 0; }

body {
	background-image:
		radial-gradient(ellipse 90% 70% at center top, rgba(157, 255, 32, 0.06), transparent 60%),
		repeating-linear-gradient(0deg, transparent 0 23px, rgba(157, 255, 32, 0.035) 23px 24px),
		repeating-linear-gradient(90deg, transparent 0 23px, rgba(157, 255, 32, 0.035) 23px 24px);
	background-attachment: fixed;
	max-width: 48rem;
	margin: 0 auto;
	padding: 1.5rem 1.5rem 4rem;
	min-height: 100vh;
	overflow-x: hidden;
}

/* ─── CRT overlay (shared) ────────────────────────────────────────── */
.crt {
	position: fixed;
	inset: 0;
	pointer-events: none;
	z-index: 1000;
	background:
		repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0,0,0,0.22) 2px 3px),
		radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.55) 100%);
	mix-blend-mode: multiply;
}
.crt::after {
	content: '';
	position: absolute;
	inset: -10% 0;
	background: linear-gradient(180deg, transparent, rgba(157, 255, 32, 0.05) 50%, transparent);
	animation: crt-scan 7s linear infinite;
}
@keyframes crt-scan {
	0%   { transform: translateY(-100%); }
	100% { transform: translateY(120%); }
}

/* ─── Links ──────────────────────────────────────────────────────── */
a {
	color: var(--phosphor);
	text-decoration: none;
	transition: text-shadow 0.15s, color 0.15s;
}
a:hover, a:focus-visible {
	text-shadow: 0 0 8px rgba(157, 255, 32, 0.7);
	text-decoration: underline;
	text-underline-offset: 0.2em;
	outline: none;
}

/* ─── Subpage header (home icon + title) ──────────────────────────── */
body:not(.home) header {
	margin: 1.5rem 0 2rem;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	opacity: 0;
	animation: fade-in 0.4s ease-out 0.1s forwards;
}
body:not(.home) header h1 {
	font-family: 'VT323', monospace;
	font-size: 2.6rem;
	font-weight: normal;
	letter-spacing: 0.03em;
	margin: 0;
	color: var(--phosphor);
	text-shadow: 0 0 12px rgba(157, 255, 32, 0.4);
}
.home-link {
	display: inline-flex;
	align-items: center;
	width: max-content;
	color: var(--phosphor-dim);
	transition: color 0.15s, text-shadow 0.15s;
}
.home-link svg { display: block; }
.home-link:hover, .home-link:focus-visible {
	color: var(--phosphor);
	text-shadow: 0 0 6px rgba(157, 255, 32, 0.5);
	text-decoration: none;
}

/* ─── Subpage main / prose ───────────────────────────────────────── */
body:not(.home) main {
	font-family: 'JetBrains Mono', ui-monospace, monospace;
	font-size: 0.95rem;
	line-height: 1.7;
	color: var(--phosphor-text);
	opacity: 0;
	animation: fade-in 0.4s ease-out 0.25s forwards;
}
body:not(.home) main p { margin: 0 0 1rem; }
body:not(.home) main strong {
	color: var(--phosphor);
	font-weight: 700;
	text-shadow: 0 0 5px rgba(157, 255, 32, 0.4);
}
body:not(.home) main a {
	color: var(--amber);
	text-shadow: 0 0 4px var(--amber-faint);
}
body:not(.home) main a:hover,
body:not(.home) main a:focus-visible {
	text-shadow: 0 0 10px rgba(255, 176, 0, 0.75);
}

/* ─── Section cards (proyectos landing) ──────────────────────────── */
.sections {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
	gap: 1rem;
	margin-top: 1.5rem;
}
.section-card {
	display: block;
	padding: 1.1rem 1.3rem;
	border: 1px solid var(--phosphor-faint);
	background: var(--phosphor-bg);
	color: var(--phosphor);
	text-decoration: none;
	font-family: 'JetBrains Mono', ui-monospace, monospace;
	transition: background 0.15s, border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.section-card:hover, .section-card:focus-visible {
	background: rgba(157, 255, 32, 0.1);
	border-color: var(--phosphor);
	text-decoration: none;
	outline: none;
	transform: translateY(-1px);
	box-shadow: 0 0 18px rgba(157, 255, 32, 0.15);
}
.section-card h2 {
	margin: 0 0 0.4rem;
	font-family: 'VT323', monospace;
	font-size: 1.7rem;
	font-weight: normal;
	letter-spacing: 0.03em;
	color: var(--phosphor);
	text-shadow: 0 0 8px rgba(157, 255, 32, 0.4);
}
.section-card p {
	margin: 0;
	color: var(--phosphor-text);
	font-size: 0.88rem;
	line-height: 1.55;
}

/* ─── Video embed (CRT bezel) ────────────────────────────────────── */
figure {
	margin: 1.75rem 0;
	padding: 4px;
	background: var(--bg);
	border: 1px solid var(--phosphor-faint);
	box-shadow: 0 0 25px rgba(157, 255, 32, 0.08);
}
figure iframe {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	height: auto;
	border: 0;
}

/* ─── Footer ─────────────────────────────────────────────────────── */
footer {
	font-family: 'VT323', monospace;
	font-size: 1.15rem;
	color: var(--phosphor-faint);
	margin-top: 3rem;
	padding-top: 1rem;
	border-top: 1px dashed var(--phosphor-faint);
	text-align: center;
}
body:not(.home) footer {
	opacity: 0;
	animation: fade-in 0.4s ease-out 0.5s forwards;
}

@keyframes fade-in { to { opacity: 1; } }

/* ─── Legacy logo classes (still used on homepage in the past) ───── */
.logo { display: inline-block; }
.logo-large { width: 100%; max-width: 25rem; height: auto; }
.logo-small {
	width: 32px;
	height: 32px;
	vertical-align: middle;
	image-rendering: pixelated;
}

/* ─── Mobile ─────────────────────────────────────────────────────── */
@media (max-width: 640px) {
	body { padding: 1rem 1rem 2.5rem; max-width: 100%; }
	body:not(.home) header h1 { font-size: 2rem; }
	.section-card h2 { font-size: 1.45rem; }
}

/* ─── Reduced motion ─────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
	body:not(.home) header,
	body:not(.home) main,
	body:not(.home) footer {
		animation: none !important;
		opacity: 1 !important;
	}
	.section-card { transform: none !important; }
	.crt::after { animation: none; }
}
