/* ---------- tokens ---------- */
:root {
	--bg: #f6f8fc;
	--bg-raised: #ffffff;
	--surface: #ffffff;
	--ink: #0c1830;
	--ink-2: #2e3e5e;
	--ink-3: #5d6e8b;
	--line: #dde4ef;
	--line-2: #eaeff7;
	--chip-bg: #eef2fa;
	--chip-ink: #2e3e5e;
	--accent: #2563eb;
	--accent-2: #1d4ed8;
	--accent-ink: #1e40af;
	--accent-soft: #dbeafe;
	--accent-rgb: 37, 99, 235;
	--pulse: #f59e0b;
	--pulse-rgb: 245, 158, 11;
	--warn: #b45309;
	--shadow-sm: 0 1px 2px rgba(12, 24, 48, .05);
	--shadow-md: 0 6px 20px rgba(12, 24, 48, .07), 0 1px 3px rgba(12, 24, 48, .04);
	--shadow-lg: 0 24px 60px rgba(12, 24, 48, .12), 0 2px 6px rgba(12, 24, 48, .05);
	--radius: 12px;
	--radius-sm: 8px;
	--radius-lg: 16px;
	--maxw: 1120px;
	--gutter: clamp(1.25rem, 3vw, 3rem);
	--font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
	--font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

:root[data-theme="dark"] {
	--bg: #070d1a;
	--bg-raised: #0d1626;
	--surface: #121d34;
	--ink: #e8edf7;
	--ink-2: #b6c2dc;
	--ink-3: #7d8db0;
	--line: #1c2a47;
	--line-2: #131e36;
	--chip-bg: #131e36;
	--chip-ink: #b6c2dc;
	--accent: #60a5fa;
	--accent-2: #93c5fd;
	--accent-ink: #93c5fd;
	--accent-soft: #1e3a8a;
	--accent-rgb: 96, 165, 250;
	--pulse: #fbbf24;
	--pulse-rgb: 251, 191, 36;
	--warn: #fbbf24;
	--shadow-sm: 0 1px 2px rgba(0, 0, 0, .45);
	--shadow-md: 0 6px 20px rgba(0, 0, 0, .4);
	--shadow-lg: 0 24px 60px rgba(0, 0, 0, .55);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--font-sans);
	font-size: 16px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}
img, picture, svg { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent-2); }
h1, h2, h3, h4 { color: var(--ink); letter-spacing: -0.02em; line-height: 1.15; margin: 0; font-weight: 600; }
p { margin: 0; color: var(--ink-2); }
ul { margin: 0; padding: 0; list-style: none; }

.skip {
	position: absolute; left: -9999px; top: 0;
	background: var(--ink); color: white; padding: .5rem 1rem; border-radius: 0 0 8px 0; z-index: 100;
}
.skip:focus { left: 0; }

/* ---------- eyebrow, tags, icons ---------- */
.eyebrow {
	margin: 0 0 .75rem;
	color: var(--accent-ink);
	font-size: .78rem;
	font-weight: 600;
	letter-spacing: .12em;
	text-transform: uppercase;
}

.tags {
	display: flex; flex-wrap: wrap; gap: .4rem;
	font-family: var(--font-mono);
	font-size: .78rem;
}
.tags li {
	padding: .3rem .6rem;
	background: var(--chip-bg);
	color: var(--chip-ink);
	border-radius: 999px;
	border: 1px solid var(--line);
	white-space: nowrap;
}

.ic { width: 1rem; height: 1rem; fill: currentColor; display: inline-block; vertical-align: -.15em; }

/* ---------- hero ---------- */
.hero {
	position: relative;
	padding: clamp(3rem, 7vw, 5.5rem) var(--gutter) clamp(2.5rem, 6vw, 4.5rem);
	background:
		radial-gradient(1100px 400px at 85% -10%, rgba(var(--accent-rgb), .14), transparent 60%),
		radial-gradient(900px 360px at -10% 20%, rgba(var(--accent-rgb), .08), transparent 55%),
		linear-gradient(180deg, var(--bg-raised) 0%, var(--bg) 100%);
	border-bottom: 1px solid var(--line);
	overflow: hidden;
}
.hero::before {
	content: "";
	position: absolute; inset: 0;
	background-image:
		linear-gradient(to right, rgba(12,24,48,.04) 1px, transparent 1px),
		linear-gradient(to bottom, rgba(12,24,48,.04) 1px, transparent 1px);
	background-size: 48px 48px;
	mask-image: radial-gradient(ellipse at center, rgba(0,0,0,.6), transparent 70%);
	pointer-events: none;
}
[data-theme="dark"] .hero::before {
	background-image:
		linear-gradient(to right, rgba(255,255,255,.035) 1px, transparent 1px),
		linear-gradient(to bottom, rgba(255,255,255,.035) 1px, transparent 1px);
}
.hero-inner {
	position: relative;
	max-width: var(--maxw);
	margin: 0 auto;
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
	gap: clamp(2rem, 4vw, 3.5rem);
	align-items: center;
}

.hero-copy h1 {
	margin: .25rem 0 1rem;
	font-size: clamp(2.5rem, 6vw, 4rem);
	font-weight: 700;
	letter-spacing: -.03em;
}
.lede {
	max-width: 34ch;
	font-size: clamp(1.05rem, 1.5vw, 1.25rem);
	color: var(--ink-2);
	margin: 0 0 1.25rem;
}
.hero-tags { margin: 0 0 1.25rem; }
.meta {
	display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
	color: var(--ink-3); font-size: .92rem;
	margin: 0 0 1.5rem;
}
.meta .ic { color: var(--accent); }
.meta .dot { color: var(--ink-3); opacity: .5; }
.meta .status { display: inline-flex; align-items: center; gap: .45rem; }
.meta .pulse {
	width: 8px; height: 8px; border-radius: 50%;
	background: #10b981;
	box-shadow: 0 0 0 0 rgba(16, 185, 129, .6);
	animation: pulse 2.2s cubic-bezier(.4,0,.6,1) infinite;
}
@keyframes pulse {
	0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,.55); }
	50% { box-shadow: 0 0 0 7px rgba(16,185,129,0); }
}
@media (prefers-reduced-motion: reduce) {
	.meta .pulse { animation: none; }
	html { scroll-behavior: auto; }
}

.actions {
	display: flex; flex-wrap: wrap; gap: .75rem;
}
.btn {
	display: inline-flex; align-items: center; gap: .5rem;
	padding: .7rem 1.1rem;
	border-radius: 10px;
	font-size: .95rem; font-weight: 600;
	border: 1px solid var(--line);
	background: var(--surface);
	color: var(--ink) !important;
	transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease;
	cursor: pointer;
}
.btn:hover {
	transform: translateY(-1px);
	border-color: var(--accent);
	box-shadow: var(--shadow-md);
	color: var(--ink) !important;
}
.btn svg { width: 1rem; height: 1rem; fill: currentColor; }
.btn-primary {
	background: var(--accent);
	border-color: var(--accent);
	color: #fff !important;
}
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: #fff !important; }

/* hero card */
.hero-card {
	position: relative;
	padding: 1.5rem;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-lg);
}
.portrait {
	margin: 0 0 1rem;
}
.portrait img {
	width: 96px; height: 96px;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid var(--surface);
	box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow-sm);
}
.hero-card-title {
	font-size: 1rem;
	color: var(--ink-3);
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: .08em;
	margin: 0 0 1rem;
}
.metrics {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: .6rem;
}
.metrics li {
	padding: .85rem .9rem;
	background: var(--bg);
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	transition: transform .15s ease, border-color .15s ease;
}
.metrics li:hover { transform: translateY(-1px); border-color: var(--accent); }
.metrics b {
	display: block;
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--accent-ink);
	letter-spacing: -.02em;
	line-height: 1.1;
	margin-bottom: .15rem;
}
.metrics span {
	font-size: .78rem;
	color: var(--ink-3);
	line-height: 1.35;
	display: block;
}

/* ---------- sticky nav ---------- */
.site-nav {
	position: sticky; top: 0; z-index: 20;
	background: color-mix(in srgb, var(--bg-raised) 88%, transparent);
	backdrop-filter: saturate(180%) blur(10px);
	-webkit-backdrop-filter: saturate(180%) blur(10px);
	border-bottom: 1px solid var(--line);
}
.site-nav-inner {
	max-width: var(--maxw);
	margin: 0 auto;
	padding: 0 var(--gutter);
	display: flex;
	align-items: center;
	gap: .75rem;
}
.site-nav ul {
	flex: 1;
	min-width: 0;
	display: flex; gap: .25rem;
	overflow-x: auto;
	scrollbar-width: none;
}
.site-nav ul::-webkit-scrollbar { display: none; }
.site-nav a {
	display: inline-block;
	padding: 1rem .9rem;
	color: var(--ink-3) !important;
	font-size: .92rem;
	font-weight: 500;
	border-bottom: 2px solid transparent;
	white-space: nowrap;
}
.site-nav a:hover { color: var(--ink) !important; }
.site-nav a.is-active {
	color: var(--ink) !important;
	border-bottom-color: var(--accent);
}

/* ---------- theme toggle ---------- */
.theme-toggle {
	position: relative;
	flex-shrink: 0;
	width: 40px; height: 40px;
	border-radius: 50%;
	border: 1px solid var(--line);
	background: var(--surface);
	color: var(--accent);
	display: inline-flex; align-items: center; justify-content: center;
	cursor: pointer;
	padding: 0;
	transition: border-color .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.theme-toggle:hover {
	border-color: var(--pulse);
	color: var(--accent-2);
	transform: translateY(-1px);
}
.theme-toggle:focus-visible {
	outline: none;
	border-color: var(--pulse);
	box-shadow: 0 0 0 3px rgba(var(--pulse-rgb), .35);
}
.theme-toggle .theme-icon {
	width: 18px; height: 18px;
	transition: transform .25s ease, opacity .2s ease;
}
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
.theme-toggle .theme-glow {
	position: absolute;
	inset: -1px;
	border-radius: 50%;
	pointer-events: none;
	box-shadow: 0 0 0 0 rgba(var(--pulse-rgb), .65);
	animation: theme-pulse 2.2s cubic-bezier(.4,0,.6,1) infinite;
}
@keyframes theme-pulse {
	0%, 100% { box-shadow: 0 0 0 0 rgba(var(--pulse-rgb), .6); }
	50% { box-shadow: 0 0 0 9px rgba(var(--pulse-rgb), 0); }
}
@media (prefers-reduced-motion: reduce) {
	.theme-toggle .theme-glow { animation: none; box-shadow: 0 0 0 2px rgba(var(--pulse-rgb), .35); }
}

/* ---------- sections ---------- */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.section {
	padding: clamp(3rem, 6vw, 5rem) 0;
	border-bottom: 1px solid var(--line);
}
.section:last-child { border-bottom: 0; }
.section > h2 {
	font-size: clamp(1.5rem, 2.5vw, 2rem);
	margin-bottom: 1.75rem;
	max-width: 30ch;
}

/* about */
.about-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.75rem;
}
.about-grid p { font-size: 1.02rem; }

/* skills */
.skills-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 1rem;
}
.skill-group {
	padding: 1.25rem;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.skill-group:hover { border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.skill-group h3 {
	font-size: .82rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .08em;
	color: var(--ink-3);
	margin-bottom: .85rem;
}

/* experience */
.role {
	padding: 1.5rem;
	margin-bottom: 1rem;
	background: var(--surface);
	border: 1px solid var(--line);
	border-left: 3px solid var(--accent);
	border-radius: var(--radius);
	transition: box-shadow .2s ease, transform .2s ease;
}
.role:hover { box-shadow: var(--shadow-md); }
.role:last-child { margin-bottom: 0; }
.role-head {
	display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
	flex-wrap: wrap;
	margin-bottom: .75rem;
}
.role-head h3 {
	font-size: 1.15rem;
	margin: 0 0 .2rem;
}
.role-company {
	color: var(--ink-3);
	font-size: .95rem;
	margin: 0;
}
.role-date {
	font-family: var(--font-mono);
	color: var(--ink-3);
	font-size: .82rem;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: .06em;
	white-space: nowrap;
}
.role-summary {
	color: var(--ink-2);
	font-size: 1rem;
	margin: 0 0 1rem;
}
.role-bullets {
	margin: 0 0 1.25rem;
	padding-left: 1.1rem;
	list-style: disc;
	color: var(--ink-2);
}
.role-bullets li { margin-bottom: .55rem; padding-left: .25rem; }
.role-bullets li:last-child { margin-bottom: 0; }
.role-bullets b { color: var(--ink); font-weight: 600; }

/* education */
.edu {
	display: grid;
	grid-template-columns: minmax(280px, 1fr) 1.2fr;
	gap: 1.5rem;
	align-items: start;
}
.edu-card {
	padding: 1.5rem;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
}
.edu-card h3 { font-size: 1.15rem; margin-bottom: .35rem; }
.edu-card p { margin: 0; }
.edu-card p:nth-of-type(1) { color: var(--ink-2); margin-bottom: .35rem; }
.honors { color: var(--accent-ink); font-style: italic; font-weight: 500; }
.edu-note { color: var(--ink-2); font-size: 1.02rem; align-self: center; }
.muted { color: var(--ink-3); }

/* projects */
.projects {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 1rem;
}
.project {
	display: grid;
	grid-template-columns: 104px 1fr;
	gap: 1rem;
	padding: 1rem;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	color: var(--ink-2) !important;
	transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.project:hover {
	border-color: var(--accent);
	transform: translateY(-2px);
	box-shadow: var(--shadow-md);
	color: var(--ink-2) !important;
}
.project img {
	width: 104px; height: 104px;
	object-fit: cover;
	border-radius: var(--radius-sm);
	background: var(--line-2);
	border: 1px solid var(--line);
}
.project h3 { font-size: 1rem; margin-bottom: .3rem; }
.project p { font-size: .9rem; color: var(--ink-3); margin: 0 0 .5rem; }
.project-cta { color: var(--accent-ink) !important; font-weight: 600; font-size: .85rem; margin: 0 !important; }

/* contact */
.contact { text-align: left; }
.contact-lede {
	max-width: 60ch;
	font-size: 1.05rem;
	margin-bottom: 1.5rem;
}
.contact-links {
	display: flex; flex-wrap: wrap; gap: .6rem;
}
.contact-links a {
	display: inline-flex; align-items: center; gap: .5rem;
	padding: .7rem 1rem;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 999px;
	color: var(--ink) !important;
	font-size: .92rem; font-weight: 500;
	transition: border-color .15s ease, color .15s ease, transform .15s ease, background .15s ease;
}
.contact-links a:hover {
	border-color: var(--accent);
	color: var(--accent-ink) !important;
	transform: translateY(-1px);
	background: var(--accent-soft);
}
.contact-links svg { width: 1.1rem; height: 1.1rem; fill: currentColor; }

/* footer */
.site-footer {
	border-top: 1px solid var(--line);
	background: var(--bg-raised);
	padding: 2rem var(--gutter);
	margin-top: 2rem;
}
.footer-inner {
	max-width: var(--maxw);
	margin: 0 auto;
	display: flex; justify-content: space-between; align-items: center;
	gap: 1rem;
	flex-wrap: wrap;
	font-size: .9rem;
}
.footer-name { font-weight: 600; color: var(--ink); margin: 0; }
.footer-inner p { margin: 0; }
.small { font-size: .82rem; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
	.hero-inner { grid-template-columns: 1fr; gap: 2rem; }
	.hero-card { max-width: 100%; }
	.about-grid { grid-template-columns: 1fr; }
	.edu { grid-template-columns: 1fr; }
	.role-head { flex-direction: column; }
	.role-date { align-self: flex-start; }
	.projects { grid-template-columns: 1fr; }
	.project { grid-template-columns: 80px 1fr; }
	.project img { width: 80px; height: 80px; }
}

@media (max-width: 520px) {
	.metrics { grid-template-columns: 1fr 1fr; }
	.metrics b { font-size: 1.3rem; }
	.hero { padding-top: clamp(2rem, 8vw, 3rem); padding-bottom: clamp(2rem, 6vw, 3rem); }
	.hero-card { padding: 1.1rem; }
	.role { padding: 1.1rem; }
	.site-nav a { padding: .85rem .65rem; }
	.theme-toggle { width: 36px; height: 36px; }
	.theme-toggle .theme-icon { width: 16px; height: 16px; }
}

/* ---------- print ---------- */
@media print {
	.hero { padding: 1rem 0; background: none; border: 0; }
	.hero::before { display: none; }
	.site-nav, .contact-links, .actions, .btn, .project-cta, .theme-toggle { display: none !important; }
	body { background: white; color: black; font-size: 11pt; }
	.section { padding: .75rem 0; page-break-inside: avoid; border-bottom: 1px solid #ccc; }
	.role { box-shadow: none; border: 1px solid #ddd; border-left: 3px solid #2563eb; page-break-inside: avoid; }
	.site-footer { display: none; }
	a { color: black !important; text-decoration: underline; }
}
