@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@300;400;500;600&display=swap");

/* ─────────────────────────────────────────
   Tokens
───────────────────────────────────────── */
:root {
	--bg:       #011627;
	--soft:     #0d2137;
	--text:     #d6deeb;
	--accent:   #82aaff;
	--green:    #addb67;
	--cyan:     #7fdbca;
	--purple:   #c792ea;
	--orange:   #f78c6c;
	--yellow:   #ffcb8b;
	--muted:    #90a4ae;
	--border:   #1d3b53;
	--mono:     "JetBrains Mono", monospace;
	--sans:     "Inter", sans-serif;

	--radius:    5px;
	--header-h:  56px;
	--footer-h:  41px;
}

/* ─────────────────────────────────────────
   Reset
───────────────────────────────────────── */
*, *::before, *::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

/* ─────────────────────────────────────────
   Scrollbar
───────────────────────────────────────── */
html {
	scrollbar-width: thin;
	scrollbar-color: var(--border) var(--bg);
}
::-webkit-scrollbar         { width: 6px; height: 6px; }
::-webkit-scrollbar-track   { background: var(--bg); }
::-webkit-scrollbar-thumb   { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ─────────────────────────────────────────
   Base
───────────────────────────────────────── */
body {
	background: var(--bg);
	color: var(--text);
	font-family: var(--sans);
	font-weight: 300;
	font-size: 14px;
	line-height: 1.75;
	min-height: 100vh;
}

/* ─────────────────────────────────────────
   Skip link
───────────────────────────────────────── */
.skip-link {
	position: absolute;
	top: 0; left: 0;
	background: var(--bg);
	color: var(--accent);
	padding: 0.5rem 1rem;
	font-size: 0.875rem;
	z-index: 100;
	transform: translateY(-100%);
	transition: transform 0.2s;
}
.skip-link:focus { transform: translateY(0); }

/* ─────────────────────────────────────────
   Focus
───────────────────────────────────────── */
:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}
:focus:not(:focus-visible) { outline: none; }

/* ─────────────────────────────────────────
   Layout — header / main / footer
───────────────────────────────────────── */
header {
	height: var(--header-h);
	padding: 0 2rem;
	border-bottom: 1px solid var(--border);
	display: flex;
	align-items: center;
	justify-content: space-between;
	position: sticky;
	top: 0;
	background: var(--bg);
	z-index: 40;
}

main {
	max-width: 860px;
	margin: 0 auto;
	padding: 4rem 2rem calc(var(--footer-h) + 2.5rem);
	animation: page-in 0.2s ease-out;
}
@keyframes page-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}

.site-footer {
	position: fixed;
	bottom: 0; left: 0; right: 0;
	height: var(--footer-h);
	background: var(--soft);
	border-top: 1px solid var(--border);
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 1.25rem;
	z-index: 30;
	font-family: var(--mono);
	font-size: 0.72rem;
}
.footer-left {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	color: var(--muted);
}
.footer-left .footer-branch { color: var(--purple); }
.footer-left .footer-cwd    { color: var(--cyan); }

/* ─────────────────────────────────────────
   Logo
───────────────────────────────────────── */
.logo-link { text-decoration: none; font-size: 1rem; letter-spacing: 0.01em; font-family: var(--mono); }
.logo .user { color: var(--green);  font-weight: 500; }
.logo .sep,
.logo .path { color: var(--muted); }
.logo .host { color: var(--accent); font-weight: 500; }
.logo .sym  { color: var(--purple); }

/* ─────────────────────────────────────────
   Nav
───────────────────────────────────────── */
nav { display: flex; gap: 2rem; }
nav a {
	color: var(--muted);
	text-decoration: none;
	font-size: 0.9rem;
	font-weight: 500;
	font-family: var(--mono);
	transition: color 0.12s;
	letter-spacing: 0.01em;
}
nav a:hover  { color: var(--cyan); }
nav a.active { color: var(--text); font-weight: 600; }

.nav-easter {
	position: absolute;
	top: calc(var(--header-h) + 0.3rem);
	left: 50%;
	transform: translateX(-50%);
	background: var(--soft);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 0.2rem 0.55rem;
	font-size: 0.8rem;
	font-family: var(--mono);
	color: var(--muted);
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.2s;
	white-space: nowrap;
}

/* ─────────────────────────────────────────
   Footer links
───────────────────────────────────────── */
.footer-links { display: flex; gap: 1rem; }
.footer-links a {
	color: var(--muted);
	text-decoration: none;
	font-size: 0.72rem;
	font-family: var(--mono);
}
.footer-links a:hover { color: var(--cyan); }

/* ─────────────────────────────────────────
   Utility
───────────────────────────────────────── */
.muted { color: var(--muted); }

/* ─────────────────────────────────────────
   Hero
───────────────────────────────────────── */
.hero { margin-bottom: 3.5rem; font-family: var(--mono); }
.hero h1 {
	font-size: 2.4rem;
	font-weight: 500;
	letter-spacing: -0.03em;
	margin-bottom: 0.9rem;
	color: var(--text);
	display: inline-flex;
	align-items: center;
	gap: 0.15em;
}
.hero h1 .h1-cursor {
	display: inline-block;
	width: 0.55em;
	height: 0.85em;
	background: var(--text);
	vertical-align: text-bottom;
	animation: blink 1.2s step-end infinite;
}
.hero-line {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.875rem;
	color: var(--muted);
	margin-bottom: 0.15rem;
}
.hero-line .pfx { color: var(--green); }
.hero-line .val { color: var(--text); }

.cursor {
	display: inline-block;
	width: 0.55em;
	height: 0.9em;
	background: var(--accent);
	vertical-align: text-bottom;
	animation: blink 1.2s step-end infinite;
}
@keyframes blink {
	0%, 100% { opacity: 1; }
	50%       { opacity: 0; }
}

/* ─────────────────────────────────────────
   Bio
───────────────────────────────────────── */
.bio {
	font-size: 0.9rem;
	color: #b8cad8;
	line-height: 1.65;
	margin-bottom: 3rem;
	max-width: 680px;
}

/* ─────────────────────────────────────────
   Section label
───────────────────────────────────────── */
.section-label {
	font-size: 0.65rem;
	font-family: var(--mono);
	color: var(--purple);
	letter-spacing: 0.2em;
	text-transform: uppercase;
	margin: 3rem 0 1.5rem;
	display: flex;
	align-items: center;
	gap: 0.75rem;
}
.section-label::before { content: "//"; color: var(--muted); }
.section-label::after  { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ─────────────────────────────────────────
   Experience list
───────────────────────────────────────── */
.experience-list { list-style: none; }

.experience-item {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 1rem;
	padding: 0.9rem 0;
	border-bottom: 1px solid var(--border);
}
.experience-item:last-child { border-bottom: none; }

.experience-role { color: var(--text);   font-size: 0.88rem; font-weight: 400; font-family: var(--mono); }
.experience-role::before { content: "> "; color: var(--green); }
.experience-org  { color: var(--accent); font-size: 0.8rem;  margin-top: 0.1rem; font-family: var(--mono); }
.experience-tech { color: var(--green);  font-size: 0.72rem; margin-top: 0.2rem; font-family: var(--mono); }

.experience-meta { text-align: right; flex-shrink: 0; }
.experience-date,
.experience-loc  { color: var(--muted); font-size: 0.72rem; font-family: var(--mono); }

/* ─────────────────────────────────────────
   Page header (projects page)
───────────────────────────────────────── */
.page-header { margin-bottom: 2.5rem; }
.page-header h1 {
	font-size: 1.3rem;
	font-weight: 500;
	font-family: var(--mono);
	color: var(--green);
}
.page-header p {
	color: var(--muted);
	font-size: 0.8rem;
	margin-top: 0.2rem;
	font-family: var(--mono);
}

.projects-disclaimer {
	color: var(--orange);
	font-size: 0.75rem;
	margin-top: 0.4rem;
	line-height: 1.5;
}

/* ─────────────────────────────────────────
   Project grid
───────────────────────────────────────── */
.project-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1rem;
}

/* ─────────────────────────────────────────
   Project card
───────────────────────────────────────── */
.project-card-btn {
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;
	background: var(--soft);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	cursor: pointer;
	text-align: left;
	color: inherit;
	font-family: inherit;
	padding: 0;
	overflow: hidden;
	transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.project-card-btn:hover {
	border-color: var(--accent);
	background: #0a1d30;
	transform: translateY(-1px);
}
.project-card-btn:active {
	transform: scale(0.98);
	transition-duration: 0.06s;
}

/* ─────────────────────────────────────────
   Thumbnail
───────────────────────────────────────── */
.thumb-area {
	width: 100%;
	aspect-ratio: 16 / 7;
	background: #000f1e;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	flex-shrink: 0;
}
.thumb-area img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}
.dialog-thumb { border-radius: calc(var(--radius) - 1px); }

.thumb-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.45rem;
	width: 100%;
	height: 100%;
}
.thumb-placeholder-initials {
	font-size: 1.8rem;
	font-weight: 500;
	color: var(--muted);
	opacity: 0.45;
	letter-spacing: 0.06em;
	line-height: 1;
}
.thumb-placeholder-label {
	font-size: 0.6rem;
	color: var(--muted);
	opacity: 0.45;
	letter-spacing: 0.15em;
}

.project-card-body {
	padding: 0.85rem 1rem 0.6rem;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
}
.project-card-title  { font-weight: 500; font-size: 0.88rem; font-family: var(--mono); color: var(--text); line-height: 1.35; }
.project-card-period { color: var(--muted); font-size: 0.7rem; font-family: var(--mono); }
.project-card-tech   { color: var(--green); font-size: 0.7rem; font-family: var(--mono); }
.project-card-desc {
	font-size: 0.78rem;
	color: var(--muted);
	line-height: 1.55;
	margin-top: 0.3rem;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.project-card-footer {
	padding: 0.45rem 0.85rem;
	border-top: 1px solid var(--border);
	display: flex;
	justify-content: flex-end;
}
.project-card-cta { font-size: 0.68rem; font-family: var(--mono); color: var(--muted); transition: color 0.12s; }
.project-card-btn:hover .project-card-cta { color: var(--accent); }

/* ─────────────────────────────────────────
   Project dialog / modal
───────────────────────────────────────── */
.project-dialog {
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: 8px;
	color: var(--text);
	font-family: var(--mono);
	max-width: 700px;
	width: 92vw;
	max-height: 88vh;
	padding: 0;
	margin: auto;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: var(--border) var(--bg);
}
.project-dialog::-webkit-scrollbar       { width: 5px; }
.project-dialog::-webkit-scrollbar-track { background: var(--bg); }
.project-dialog::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.project-dialog::backdrop {
	background: rgba(1, 22, 39, 0.85);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}
@keyframes dialog-enter {
	from { opacity: 0; transform: translateY(10px); }
	to   { opacity: 1; transform: translateY(0); }
}
@keyframes dialog-exit {
	from { opacity: 1; transform: translateY(0); }
	to   { opacity: 0; transform: translateY(10px); }
}
.project-dialog[open]:not(.is-closing) .dialog-inner { animation: dialog-enter 0.15s ease-out; }
.project-dialog.is-closing .dialog-inner             { animation: dialog-exit 0.12s ease-in forwards; }

.dialog-inner {
	padding: 1.4rem 1.5rem 1.5rem;
	display: flex;
	flex-direction: column;
	gap: 1rem;
}
.dialog-topbar {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 1rem;
}
.dialog-title { font-size: 1rem; font-weight: 500; color: var(--text); line-height: 1.3; }
.dialog-title a       { color: var(--text); text-decoration: none; }
.dialog-title a:hover { color: var(--accent); }

.dialog-close {
	background: none;
	border: 1px solid var(--border);
	border-radius: 4px;
	color: var(--muted);
	font-size: 0.78rem;
	cursor: pointer;
	padding: 0.4rem 0.75rem;
	min-height: 2.25rem;
	line-height: 1.4;
	flex-shrink: 0;
	font-family: inherit;
	transition: color 0.12s, border-color 0.12s;
}
.dialog-close:hover { color: var(--text); border-color: var(--muted); }

.dialog-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.dialog-period { font-size: 0.75rem; color: var(--muted); }
.dialog-tech   { font-size: 0.75rem; color: var(--green); }

/* ─────────────────────────────────────────
   Project links
───────────────────────────────────────── */
.project-links { display: flex; gap: 1rem; }
.project-links a { color: var(--cyan); font-size: 0.75rem; text-decoration: none; }
.project-links a:hover { text-decoration: underline; }

/* ─────────────────────────────────────────
   Prose
───────────────────────────────────────── */
.prose {
	font-size: 0.875rem;
	color: var(--muted);
	line-height: 1.7;
	font-family: var(--sans);
}
.prose > * + * { margin-top: 0.75rem; }
.prose h1, .prose h2, .prose h3, .prose h4 {
	color: var(--text);
	font-family: var(--mono);
	font-weight: 500;
	line-height: 1.35;
}
.prose h1 { font-size: 1.05rem; }
.prose h2 { font-size: 1rem; }
.prose h3,
.prose h4 { font-size: 0.92rem; }
.prose ul, .prose ol { padding-left: 1.2rem; }
.prose ul  { list-style: disc; }
.prose ol  { list-style: decimal; }
.prose li + li { margin-top: 0.3rem; }
.prose a {
	color: var(--cyan);
	text-decoration: underline;
	text-underline-offset: 2px;
	word-break: break-word;
}
.prose img {
	display: block;
	max-width: 100%;
	height: auto;
	border: 1px solid var(--border);
	border-radius: var(--radius);
}
.prose code {
	font-family: var(--mono);
	font-size: 0.82rem;
	background: rgba(13, 33, 55, 0.8);
	border: 1px solid var(--border);
	border-radius: 3px;
	padding: 0.05rem 0.3rem;
	color: var(--yellow);
}
.prose pre {
	overflow-x: auto;
	padding: 0.7rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: rgba(13, 33, 55, 0.8);
}
.prose pre code   { padding: 0; border: none; background: transparent; }
.prose blockquote { border-left: 2px solid var(--border); padding-left: 0.75rem; }
.prose em     { color: var(--muted); }
.prose strong { color: var(--text); font-weight: 500; }

/* ─────────────────────────────────────────
   Reduced motion
───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
	main { animation: none; }
	.cursor, .h1-cursor { animation: none; opacity: 1; }
	.project-card-btn { transition: border-color 0.15s, background 0.15s; }
	.project-card-btn:hover { transform: none; }
	.project-card-btn:active { transform: none; }
	.project-dialog[open] .dialog-inner { animation: none; }
}

/* ─────────────────────────────────────────
   Responsive — 700px
───────────────────────────────────────── */
@media (max-width: 700px) {
	header { padding: 0 1rem; }
	nav { gap: 1.25rem; }
	nav a { font-size: 0.85rem; }

	main { padding: 2.5rem 1rem calc(var(--footer-h) + 2rem); }

	.hero { margin-bottom: 2.5rem; }
	.hero h1 { font-size: 1.9rem; }
	.hero-line { font-size: 0.82rem; flex-wrap: wrap; row-gap: 0.1rem; }

	.bio { font-size: 0.875rem; margin-bottom: 2.5rem; }

	.project-grid { grid-template-columns: 1fr; }

	.experience-item { flex-direction: column; gap: 0.3rem; }
	.experience-meta { text-align: left; }
}

/* ─────────────────────────────────────────
   Responsive — 480px
───────────────────────────────────────── */
@media (max-width: 480px) {
	:root { --footer-h: 52px; }

	header {
		flex-wrap: wrap;
		height: auto;
		padding: 0.5rem 1rem;
		row-gap: 0.35rem;
	}
	nav { margin-left: auto; }

	.hero h1 { font-size: 1.6rem; }

	.footer-links { gap: 0.75rem; flex-wrap: wrap; justify-content: center; }

	main { padding-bottom: calc(var(--footer-h) + 1.5rem); }

	.project-dialog { width: 97vw; max-height: 92vh; border-radius: 6px; }
	.dialog-inner { padding: 1rem; gap: 0.85rem; }
}
