/* ============ Lionel Dsilva — portfolio ============
   Dark avionics / terminal aesthetic. Hand-rolled, no framework. */

:root {
	--bg: #0d0a09;
	--bg-raised: #161110;
	--panel: #1a1412;
	--line: #2e2320;
	--text: #e8e0d9;
	--muted: #a3928a;
	--accent: #e5484d;
	--accent-2: #f0e9e2;
	--red: #ff6b6b;
	--green: #3ddc84;
	--mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	--sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
	background: var(--bg);
	color: var(--text);
	font-family: var(--sans);
	line-height: 1.65;
	overflow-x: hidden;
}

.mono { font-family: var(--mono); }
::selection { background: var(--accent); color: var(--bg); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- nav ---------- */
#nav {
	position: fixed;
	inset: 0 0 auto 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.75rem 1.5rem;
	background: color-mix(in srgb, var(--bg) 82%, transparent);
	backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--line);
	z-index: 100;
}

.brand { font-family: var(--mono); font-weight: 700; font-size: 0.95rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand .prompt { color: var(--accent); }
.brand-path { color: var(--muted); }

.cursor-block {
	display: inline-block;
	width: 0.55em; height: 1.05em;
	margin-left: 0.25em;
	background: var(--accent);
	vertical-align: text-bottom;
	animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.nav-links { display: flex; gap: 1.5rem; list-style: none; }
.nav-links a {
	font-family: var(--mono);
	font-size: 0.85rem;
	color: var(--muted);
}
.nav-links a::before { content: "./"; color: var(--line); }
.nav-links a:hover { color: var(--accent); text-decoration: none; }

#nav-toggle { display: none; background: none; border: 0; cursor: pointer; }
#nav-toggle span { display: block; width: 22px; height: 2px; background: var(--accent); margin: 5px 0; transition: 0.25s; }

/* ---------- hero ---------- */
.hero {
	position: relative;
	min-height: 100svh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 6rem 1.5rem 4rem;
}

#cogitator {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0.5;
	-webkit-mask-image: radial-gradient(ellipse 70% 60% at center, transparent 30%, black 80%);
	mask-image: radial-gradient(ellipse 70% 60% at center, transparent 30%, black 80%);
}

.hero-inner { position: relative; max-width: 760px; width: 100%; text-align: center; }

.kicker {
	font-family: var(--mono);
	font-size: 0.8rem;
	letter-spacing: 0.25em;
	color: var(--accent-2);
	margin-bottom: 1rem;
}

.hero h1 {
	font-size: clamp(2.5rem, 7vw, 4.5rem);
	font-weight: 700;
	letter-spacing: -0.02em;
	color: #fff;
}

.subtitle { color: var(--muted); font-size: 1.1rem; max-width: 560px; margin: 1rem auto 2rem; }
.subtitle strong { color: var(--accent); font-weight: 600; }

/* terminal */
.terminal {
	text-align: left;
	background: color-mix(in srgb, var(--panel) 92%, transparent);
	border: 1px solid var(--line);
	border-radius: 10px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
	overflow: hidden;
	margin-bottom: 2rem;
}

.terminal-bar {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.55rem 0.9rem;
	background: var(--bg-raised);
	border-bottom: 1px solid var(--line);
}
.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot.red { background: #ff5f57; } .dot.yellow { background: #febc2e; } .dot.green { background: #28c840; }
.terminal-title { margin-left: 0.6rem; font-family: var(--mono); font-size: 0.72rem; color: var(--muted); }
.terminal-title code { color: var(--accent-2); }

.terminal-body {
	padding: 0.9rem 1rem;
	font-family: var(--mono);
	font-size: 0.85rem;
	min-height: 150px;
	max-height: 260px;
	overflow-y: auto;
	cursor: text;
}
#terminal-output { white-space: pre-wrap; word-break: break-word; }
#terminal-output .line { display: block; }
#terminal-output .cmd-echo { color: var(--text); }
#terminal-output .cmd-echo .prompt { color: var(--accent); }
#terminal-output .out { color: var(--muted); }
#terminal-output .out a { color: var(--accent); }
#terminal-output .accent { color: var(--accent-2); }
#terminal-output .err { color: var(--red); }

.terminal-input-line { display: flex; gap: 0.5rem; align-items: center; }
.terminal-input-line .prompt { color: var(--accent); white-space: nowrap; }
#terminal-input {
	flex: 1;
	background: none;
	border: 0;
	outline: 0;
	color: var(--text);
	font-family: var(--mono);
	font-size: 0.85rem;
	caret-color: var(--accent);
}

.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.btn {
	display: inline-block;
	font-family: var(--mono);
	font-size: 0.9rem;
	padding: 0.7rem 1.5rem;
	border-radius: 6px;
	background: var(--accent);
	color: var(--bg);
	font-weight: 700;
	transition: transform 0.15s, box-shadow 0.15s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(229, 72, 77, 0.25); }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }

.scroll-hint {
	position: absolute;
	bottom: 1.2rem; left: 50%;
	transform: translateX(-50%);
	color: var(--muted);
	font-size: 0.8rem;
	animation: bob 2s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translate(-50%, 6px); } }

/* ---------- sections ---------- */
.section { max-width: 1000px; margin: 0 auto; padding: 5rem 1.5rem; }

.section h2 {
	font-family: var(--mono);
	font-size: 1.5rem;
	color: #fff;
	margin-bottom: 2rem;
}
.section h2::after {
	content: "";
	display: block;
	width: 64px; height: 3px;
	margin-top: 0.6rem;
	background: linear-gradient(90deg, var(--accent), transparent);
}
.section-no { color: var(--accent); font-size: 0.9em; margin-right: 0.5rem; }
.section-lead { color: var(--muted); font-size: 0.85rem; margin: -1rem 0 1.75rem; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; align-items: start; }
.about-text p + p { margin-top: 1rem; }
.about-text { color: var(--muted); }

.about-panel {
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: 10px;
	padding: 1.25rem;
	font-size: 0.82rem;
}
.kv { display: flex; gap: 0.75rem; padding: 0.45rem 0; border-bottom: 1px dashed var(--line); }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--accent); min-width: 4.5rem; }
.kv .v { color: var(--text); }

.status-dot {
	display: inline-block;
	width: 8px; height: 8px;
	border-radius: 50%;
	background: var(--green);
	margin-right: 0.4rem;
	box-shadow: 0 0 8px var(--green);
	animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.4; } }

/* ---------- projects ---------- */
.filters { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 1.75rem; }
.filter {
	font-family: var(--mono);
	font-size: 0.82rem;
	padding: 0.4rem 0.9rem;
	background: transparent;
	color: var(--muted);
	border: 1px solid var(--line);
	border-radius: 999px;
	cursor: pointer;
	transition: 0.2s;
}
.filter:hover { border-color: var(--accent); color: var(--accent); }
.filter.active { background: var(--accent); border-color: var(--accent); color: var(--bg); font-weight: 700; }

.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.25rem; }

.card {
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: 10px;
	padding: 1.4rem;
	display: flex;
	flex-direction: column;
	gap: 0.7rem;
	transition: transform 0.2s, border-color 0.2s, opacity 0.3s;
}
.card:hover { transform: translateY(-4px); border-color: var(--accent); }
.card.hidden { display: none; }

.card-top { display: flex; justify-content: space-between; align-items: center; }
.card-icon { font-size: 1.3rem; color: var(--accent); }
.chips { display: flex; gap: 0.35rem; flex-wrap: wrap; justify-content: flex-end; }
.chip {
	font-family: var(--mono);
	font-size: 0.66rem;
	padding: 0.15rem 0.5rem;
	border: 1px solid var(--line);
	border-radius: 999px;
	color: var(--accent-2);
}
.card h3 { color: #fff; font-size: 1.05rem; }
.card p { color: var(--muted); font-size: 0.9rem; flex: 1; }
.card-link { font-family: var(--mono); font-size: 0.82rem; }
.card-link.private { color: var(--muted); cursor: default; }

.visually-hidden {
	position: absolute;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ---------- research / flight plan ---------- */
.flightplan { list-style: none; display: flex; flex-direction: column; gap: 1rem; }
.flightplan li {
	display: flex;
	gap: 1.25rem;
	align-items: flex-start;
	background: var(--panel);
	border: 1px solid var(--line);
	border-left: 3px solid var(--accent);
	border-radius: 8px;
	padding: 1.2rem 1.4rem;
}
.flightplan h3 { color: #fff; font-size: 1rem; margin-bottom: 0.3rem; }
.flightplan h3 a { color: #fff; }
.flightplan h3 a:hover { color: var(--accent); text-decoration: none; }
.flightplan p { color: var(--muted); font-size: 0.9rem; }

.fp-status {
	font-family: var(--mono);
	font-size: 0.66rem;
	letter-spacing: 0.08em;
	padding: 0.25rem 0.6rem;
	border-radius: 4px;
	white-space: nowrap;
	margin-top: 0.2rem;
}
.fp-status.wip { background: rgba(229, 72, 77, 0.12); color: var(--accent); border: 1px solid var(--accent); }
.fp-status.pub { background: rgba(61, 220, 132, 0.1); color: var(--green); border: 1px solid var(--green); }
.fp-status.filed { background: rgba(240, 233, 226, 0.1); color: var(--accent-2); border: 1px solid var(--accent-2); }

/* ---------- skills ---------- */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.25rem; }
.skill-block {
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: 10px;
	padding: 1.2rem 1.4rem;
}
.skill-block h3 { font-size: 0.85rem; color: var(--accent); font-weight: 500; margin-bottom: 0.7rem; }
.skill-block ul { list-style: none; }
.skill-block li { font-size: 0.82rem; color: var(--muted); padding: 0.2rem 0; }
.skill-block li::before { content: "▸ "; color: var(--accent); }

/* ---------- contact ---------- */
.contact-panel {
	text-align: center;
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: 12px;
	padding: 3rem 1.5rem;
}
.contact-panel p { color: var(--muted); margin-bottom: 1.5rem; }
.contact-links { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ---------- footer ---------- */
footer {
	text-align: center;
	padding: 2rem 1.5rem;
	border-top: 1px solid var(--line);
	color: var(--muted);
	font-size: 0.75rem;
}

/* ---------- responsive ---------- */
@media (max-width: 720px) {
	#nav-toggle { display: block; }
	.nav-links {
		position: absolute;
		top: 100%; left: 0; right: 0;
		flex-direction: column;
		gap: 0;
		background: var(--bg-raised);
		border-bottom: 1px solid var(--line);
		max-height: 0;
		overflow: hidden;
		transition: max-height 0.3s ease;
	}
	.nav-links.open { max-height: 320px; }
	.nav-links li { padding: 0.8rem 1.5rem; border-top: 1px solid var(--line); }
	.about-grid { grid-template-columns: 1fr; }
	.flightplan li { flex-direction: column; gap: 0.6rem; }
}

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