/* ============================================================
   Mingguo Luo — Resume
   Native HTML / CSS / JS · bilingual EN/ZH · light & dark
   ============================================================ */

:root {
	--accent: #2563eb;
	--accent-soft: rgba(37, 99, 235, 0.10);
	--accent-strong: #1d4ed8;

	--bg: #f7f8fa;
	--surface: #ffffff;
	--surface-2: #f1f3f7;
	--border: #e6e8ee;
	--text: #16181d;
	--text-soft: #4b5160;
	--text-mute: #8a90a0;
	--shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
	--radius: 16px;
}

[data-theme="dark"] {
	--accent: #60a5fa;
	--accent-soft: rgba(96, 165, 250, 0.14);
	--accent-strong: #93c5fd;

	--bg: #0d0f14;
	--surface: #15181f;
	--surface-2: #1b1f28;
	--border: #262b36;
	--text: #e9ecf2;
	--text-soft: #aeb6c6;
	--text-mute: #767f92;
	--shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 30px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
	margin: 0;
	font-family: 'Inter', Helvetica, 'Segoe UI', sans-serif;
	background: var(--bg);
	color: var(--text);
	line-height: 1.6;
	font-weight: 400;
	-webkit-font-smoothing: antialiased;
	transition: background .25s ease, color .25s ease;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }

main {
	max-width: 880px;
	margin: 0 auto;
	padding: 0 22px 40px;
}

/* ---------------- Top bar ---------------- */
.topbar {
	position: sticky;
	top: 0;
	z-index: 50;
	display: flex;
	align-items: center;
	gap: 18px;
	max-width: 880px;
	margin: 0 auto;
	padding: 12px 22px;
	background: color-mix(in srgb, var(--bg) 82%, transparent);
	backdrop-filter: saturate(180%) blur(12px);
	border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; }
.brand-mark {
	display: grid; place-items: center;
	width: 50px; height: 30px;
	border-radius: 9px;
	background: var(--accent);
	color: #fff;
	font-size: .8rem;
	font-weight: 800;
	letter-spacing: .5px;
}
.brand-name { font-size: .98rem; }

.topnav { display: flex; gap: 20px; margin-left: auto; }
.topnav a {
	font-size: .9rem;
	color: var(--text-soft);
	font-weight: 500;
	transition: color .15s ease;
}
.topnav a:hover { color: var(--accent); }

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.pill {
	border: 1px solid var(--border);
	background: var(--surface);
	color: var(--text);
	font-weight: 600;
	font-size: .82rem;
	padding: 6px 13px;
	border-radius: 999px;
	cursor: pointer;
	transition: all .15s ease;
}
.pill:hover { border-color: var(--accent); color: var(--accent); }

.icon-btn {
	width: 34px; height: 34px;
	border: 1px solid var(--border);
	background: var(--surface);
	border-radius: 999px;
	cursor: pointer;
	font-size: .95rem;
	display: grid; place-items: center;
	transition: border-color .15s ease;
}
.icon-btn:hover { border-color: var(--accent); }
.theme-moon { display: none; }
[data-theme="dark"] .theme-sun { display: none; }
[data-theme="dark"] .theme-moon { display: inline; }

/* ---------------- Hero ---------------- */
.hero { padding: 46px 0 10px; }
.hero-inner {
	display: flex;
	gap: 34px;
	align-items: center;
}
.avatar {
	width: 300px;
	height: 300px;

	object-fit: cover;
	border-radius: 50%;

	flex-shrink: 0;

	border: 4px solid var(--surface);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);

	transition: transform 0.3s ease;
}
.eyebrow {
	display: inline-block;
	margin: 0 0 10px;
	font-size: .8rem;
	font-weight: 600;
	color: var(--accent);
	background: var(--accent-soft);
	padding: 4px 11px;
	border-radius: 999px;
}
.hero-text h1 {
	margin: 0;
	font-size: 2.6rem;
	font-weight: 800;
	letter-spacing: -.02em;
	line-height: 1.1;
}
.role {
	margin: 4px 0 12px;
	font-size: 1.15rem;
	font-weight: 600;
	color: var(--text-soft);
}
.tagline {
	margin: 0 0 18px;
	color: var(--text-soft);
	max-width: 38em;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chip {
	font-size: .82rem;
	color: var(--text-soft);
	background: var(--surface);
	border: 1px solid var(--border);
	padding: 5px 11px;
	border-radius: 999px;
}

.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.cta-row.center { justify-content: center; }
.btn {
	display: inline-flex; align-items: center;
	padding: 10px 20px;
	border-radius: 11px;
	font-weight: 600;
	font-size: .92rem;
	cursor: pointer;
	transition: transform .12s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
	background: var(--accent);
	color: #fff;
	box-shadow: 0 6px 16px var(--accent-soft);
}
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost {
	background: var(--surface);
	color: var(--text);
	border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.contact-line { font-size: .88rem; color: var(--text-soft); display: flex; flex-wrap: wrap; gap: 8px; }
.contact-line a:hover { color: var(--accent); }
.sep { color: var(--text-mute); }

/* ---------------- Stats ---------------- */
.stats {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 14px;
	margin: 34px 0 10px;
}
.stat {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 18px;
	text-align: center;
	box-shadow: var(--shadow);
}
.stat-num {
	font-size: 1.9rem;
	font-weight: 800;
	color: var(--accent);
	font-family: 'JetBrains Mono', monospace;
	letter-spacing: -.02em;
}
.stat-label { font-size: .78rem; color: var(--text-mute); margin-top: 2px; }

/* ---------------- Upwork pitch ---------------- */
.pitch {
	margin: 44px 0 8px;
	padding: 34px 32px;
	border-radius: var(--radius);
	border: 1px solid var(--border);
	background:
		radial-gradient(120% 120% at 0% 0%, var(--accent-soft), transparent 55%),
		var(--surface);
	box-shadow: var(--shadow);
}
.pitch-badge {
	display: inline-block;
	font-size: .78rem;
	font-weight: 700;
	letter-spacing: .04em;
	color: var(--accent-strong);
	background: var(--accent-soft);
	padding: 5px 13px;
	border-radius: 999px;
	margin-bottom: 16px;
}
.pitch-lead {
	margin: 0 0 24px;
	font-size: 1.12rem;
	line-height: 1.7;
	color: var(--text);
	font-weight: 500;
	max-width: 60ch;
}
.value-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 14px;
	margin-bottom: 22px;
}
.value-card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 12px;
	padding: 18px;
}
.value-ico { font-size: 1.4rem; display: block; margin-bottom: 8px; }
.value-card h4 { margin: 0 0 6px; font-size: 1rem; font-weight: 700; }
.value-card p { margin: 0; font-size: .9rem; color: var(--text-soft); }
.pitch-trust {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	padding: 16px 0;
	margin-bottom: 22px;
	border-top: 1px dashed var(--border);
	border-bottom: 1px dashed var(--border);
}
.trust-item { font-size: .88rem; font-weight: 500; color: var(--text-soft); }
.pitch-cta { font-size: 1rem; }

/* ---------------- Blocks ---------------- */
.block { padding: 40px 0 8px; }
.block-title {
	display: flex; align-items: baseline; gap: 12px;
	font-size: 1.5rem;
	font-weight: 700;
	letter-spacing: -.01em;
	margin: 0 0 22px;
}
.block-title .num {
	font-family: 'JetBrains Mono', monospace;
	font-size: .9rem;
	color: var(--accent);
	font-weight: 600;
}
.lead { color: var(--text-soft); max-width: 64ch; margin: 0 0 14px; }

/* ---------------- Skills ---------------- */
.skills-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 14px;
}
.skill-card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 18px 18px 16px;
	box-shadow: var(--shadow);
}
.skill-card h4 {
	margin: 0 0 12px;
	font-size: .82rem;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: var(--text-mute);
	font-weight: 700;
}
.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tags.small .tag { font-size: .76rem; padding: 3px 9px; }
.tag {
	font-size: .83rem;
	padding: 5px 11px;
	border-radius: 8px;
	background: var(--surface-2);
	border: 1px solid var(--border);
	color: var(--text-soft);
	font-weight: 500;
}
.tag-strong {
	background: var(--accent-soft);
	border-color: transparent;
	color: var(--accent-strong);
	font-weight: 600;
}

/* ---------------- Timeline ---------------- */
.timeline { display: flex; flex-direction: column; gap: 16px; }
.tl-item {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 22px 24px;
	box-shadow: var(--shadow);
	position: relative;
}
.tl-item::before {
	content: '';
	position: absolute;
	left: 0; top: 22px; bottom: 22px;
	width: 3px;
	border-radius: 3px;
	background: var(--accent);
	opacity: .8;
}
.tl-head {
	display: flex; justify-content: space-between; align-items: flex-start; gap: 14px;
	margin-bottom: 8px;
}
.tl-head h4 { margin: 0; font-size: 1.15rem; font-weight: 700; }
.tl-role { margin: 2px 0 0; color: var(--accent); font-weight: 600; font-size: .9rem; }
.tl-date {
	font-family: 'JetBrains Mono', monospace;
	font-size: .8rem;
	color: var(--text-mute);
	white-space: nowrap;
	flex-shrink: 0;
}
.tl-summary { color: var(--text-soft); margin: 6px 0 12px; font-size: .94rem; }
.bullets { margin: 0; padding-left: 0; list-style: none; }
.bullets li {
	position: relative;
	padding-left: 20px;
	margin-bottom: 9px;
	color: var(--text-soft);
	font-size: .92rem;
}
.bullets li::before {
	content: '▹';
	position: absolute; left: 0;
	color: var(--accent);
	font-weight: 700;
}
.awards { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.award {
	font-size: .8rem;
	color: var(--text-soft);
	background: var(--surface-2);
	border: 1px solid var(--border);
	padding: 5px 11px;
	border-radius: 999px;
}

/* ---------------- Projects ---------------- */
.projects-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 14px;
}
.proj-card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 20px;
	box-shadow: var(--shadow);
	display: flex;
	flex-direction: column;
	transition: transform .15s ease, border-color .15s ease;
}
.proj-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.proj-head {
	display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
	margin-bottom: 8px;
}
.proj-head h4 { margin: 0; font-size: 1.05rem; font-weight: 700; line-height: 1.3; }
.repo-link {
	font-size: .8rem;
	color: var(--accent);
	font-weight: 600;
	white-space: nowrap;
	flex-shrink: 0;
}
.repo-link:hover { text-decoration: underline; }
.proj-date {
	font-family: 'JetBrains Mono', monospace;
	font-size: .76rem;
	color: var(--text-mute);
	margin: 0 0 8px;
}
.proj-card p { color: var(--text-soft); font-size: .9rem; margin: 0 0 14px; }
.metrics { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 14px; margin-top: auto; }
.metric { font-size: .78rem; color: var(--text-mute); }
.metric b {
	display: block;
	font-family: 'JetBrains Mono', monospace;
	font-size: 1.1rem;
	color: var(--accent);
	font-weight: 600;
}

/* ---------------- Education ---------------- */
.edu-item {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 20px 24px;
	box-shadow: var(--shadow);
	margin-bottom: 14px;
}
.edu-head { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; }
.edu-head h4 { margin: 0; font-size: 1.1rem; font-weight: 700; }
.edu-note { font-size: .88rem; color: var(--text-soft); margin: 8px 0 12px; }
.edu-note a { color: var(--accent); }
.edu-note a:hover { text-decoration: underline; }
.course-groups { display: grid; gap: 10px; }
.course-group { font-size: .88rem; }
.cg-title {
	display: inline-block;
	min-width: 150px;
	font-weight: 700;
	color: var(--text);
	margin-right: 8px;
}
.courses { color: var(--text-mute); }

/* ---------------- CTA footer ---------------- */
.cta-footer {
	margin-top: 46px;
	text-align: center;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 44px 28px;
	box-shadow: var(--shadow);
}
.cta-footer h3 { margin: 0 0 10px; font-size: 1.5rem; font-weight: 800; letter-spacing: -.01em; }
.cta-footer p { margin: 0 auto 22px; color: var(--text-soft); max-width: 42ch; }

.site-footer {
	max-width: 880px;
	margin: 0 auto;
	padding: 28px 22px 40px;
	text-align: center;
	color: var(--text-mute);
	font-size: .84rem;
	display: flex;
	justify-content: center;
	gap: 10px;
	flex-wrap: wrap;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 720px) {
	.topnav { display: none; }
	.topbar-actions { margin-left: auto; }
	.hero-inner { flex-direction: column; text-align: center; align-items: center; gap: 20px; }
	.hero-text h1 { font-size: 2.1rem; }
	.chips, .cta-row, .contact-line { justify-content: center; }
	.stats { grid-template-columns: repeat(2, 1fr); }
	.skills-grid, .projects-grid, .value-grid { grid-template-columns: 1fr; }
	.pitch { padding: 26px 22px; }
	.tl-head, .edu-head { flex-direction: column; gap: 4px; }
	.cg-title { min-width: auto; display: block; margin-bottom: 2px; }
}

/* ---------------- Print ---------------- */
@media print {
	.topbar, .cta-footer, .cta-row, #printBtn, .site-footer, .pitch-cta { display: none !important; }
	.pitch { background: #fff; border: 1px solid #ddd; break-inside: avoid; }
	body { background: #fff; color: #000; }
	main { max-width: 100%; padding: 0; }
	.stat, .skill-card, .tl-item, .proj-card, .edu-item {
		box-shadow: none;
		border: 1px solid #ddd;
		break-inside: avoid;
	}
	.hero { padding-top: 10px; }
}
