/* === Tokens === */
:root {
	--bg:          #f2efe8;
	--bg-surface:  #e9e5db;
	--bg-raised:   #faf8f4;
	--text:        #1e1a16;
	--text-muted:  #6b5f52;
	--text-dim:    #9b8f82;
	--accent:      #3d6b52;
	--accent-dk:   #2d5040;
	--accent-pale: rgba(61, 107, 82, 0.08);
	--rule:        #ddd6c8;
	--border:      #d8d0c2;
	--nav-h:       60px;
	--f-serif:     'Cormorant Garant', 'Palatino Linotype', Georgia, serif;
	--f-sans:      'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
	--f-mono:      'JetBrains Mono', 'Fira Code', monospace;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
	background: var(--bg);
	color: var(--text);
	font-family: var(--f-sans);
	font-size: 15px;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-dk); }
img { max-width: 100%; display: block; }

/* === Layout === */
.container {
	max-width: 1060px;
	margin: 0 auto;
	padding: 0 32px;
}

/* === Nav === */
#nav {
	position: fixed;
	inset: 0 0 auto 0;
	height: var(--nav-h);
	background: rgba(242, 239, 232, 0.88);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	border-bottom: 1px solid transparent;
	z-index: 100;
	transition: border-color 0.3s;
}
#nav.scrolled { border-bottom-color: var(--border); }

.nav-inner {
	max-width: 1060px;
	margin: 0 auto;
	padding: 0 32px;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.nav-logo {
	font-family: var(--f-serif);
	font-size: 1.3rem;
	font-weight: 500;
	color: var(--text);
	letter-spacing: 0.04em;
}
.nav-logo:hover { color: var(--accent); }

.nav-links {
	list-style: none;
	display: flex;
	align-items: center;
	gap: 28px;
}
.nav-links a {
	color: var(--text-muted);
	font-size: 0.82rem;
	font-weight: 500;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}
.nav-links a:hover { color: var(--text); }

.btn-resume {
	background: var(--accent) !important;
	color: #fff !important;
	padding: 6px 14px !important;
	border-radius: 3px !important;
	font-size: 0.75rem !important;
	font-weight: 600 !important;
	letter-spacing: 0.05em !important;
	text-transform: uppercase !important;
	transition: background 0.2s !important;
}
.btn-resume:hover { background: var(--accent-dk) !important; color: #fff !important; }

.nav-toggle { display: none; }

/* === Buttons === */
.btn-primary {
	display: inline-block;
	background: var(--accent);
	color: #fff;
	padding: 10px 24px;
	border-radius: 4px;
	font-weight: 600;
	font-size: 0.875rem;
	letter-spacing: 0.02em;
	transition: background 0.2s;
}
.btn-primary:hover { background: var(--accent-dk); color: #fff; }

.btn-ghost {
	display: inline-block;
	border: 1px solid var(--border);
	color: var(--text-muted);
	padding: 10px 24px;
	border-radius: 4px;
	font-size: 0.875rem;
	letter-spacing: 0.02em;
	transition: border-color 0.2s, color 0.2s;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* === Sections === */
section { padding: 100px 0; }
.alt-bg { background: var(--bg-surface); }

.section-heading {
	display: flex;
	align-items: baseline;
	gap: 20px;
	margin-bottom: 56px;
}
.section-num {
	font-family: var(--f-mono);
	font-size: 0.75rem;
	color: var(--accent);
	letter-spacing: 0.06em;
}
.section-title {
	font-family: var(--f-serif);
	font-size: clamp(1.6rem, 3vw, 2.2rem);
	font-weight: 500;
	color: var(--text);
	letter-spacing: 0.01em;
}

/* === Hero === */
#hero {
	padding-top: calc(var(--nav-h) + 100px);
	padding-bottom: 100px;
	min-height: 100vh;
	display: flex;
	align-items: center;
	border-bottom: 1px solid var(--rule);
	/* Ruled notebook paper — lab notebook / lecture notes */
	background-image: repeating-linear-gradient(
		to bottom,
		transparent 0px,
		transparent 27px,
		rgba(61, 107, 82, 0.065) 27px,
		rgba(61, 107, 82, 0.065) 28px
	);
}

.hero-inner {
	display: grid;
	grid-template-columns: 1fr 320px;
	gap: 80px;
	align-items: start;
}

.hero-location {
	display: block;
	font-family: var(--f-mono);
	font-size: 0.72rem;
	color: var(--text-dim);
	letter-spacing: 0.1em;
	text-transform: uppercase;
	margin-bottom: 20px;
}

#hero h1 {
	font-family: var(--f-serif);
	font-size: clamp(3.5rem, 7vw, 6rem);
	font-weight: 400;
	line-height: 1.0;
	color: var(--text);
	margin-bottom: 28px;
	letter-spacing: -0.01em;
}
#hero h1 em {
	font-style: italic;
	color: var(--accent);
}

.tagline {
	font-size: 1.05rem;
	color: var(--text-muted);
	max-width: 480px;
	margin-bottom: 36px;
	line-height: 1.7;
	font-weight: 300;
}

.hero-actions {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 32px;
}

.hero-social {
	display: flex;
	gap: 18px;
}
.hero-social a {
	color: var(--text-dim);
	font-size: 1.05rem;
}
.hero-social a:hover { color: var(--accent); }

/* Hero right panel */
.hero-right {
	padding-top: 12px;
	display: flex;
	flex-direction: column;
	gap: 32px;
}

.hero-data {
	border-top: 1px solid var(--rule);
}

.data-row {
	display: grid;
	grid-template-columns: 80px 1fr;
	gap: 12px;
	padding: 14px 0;
	border-bottom: 1px solid var(--rule);
	align-items: baseline;
}
.data-row dt {
	font-family: var(--f-mono);
	font-size: 0.68rem;
	color: var(--text-dim);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	padding-top: 2px;
}
.data-row dd {
	font-size: 0.875rem;
	color: var(--text);
	font-weight: 400;
}

.resume-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-family: var(--f-mono);
	font-size: 0.75rem;
	color: var(--text-muted);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	transition: color 0.2s;
}
.resume-link:hover { color: var(--accent); }
.resume-link i { font-size: 0.65rem; }

/* === Wave divider === */
.wave-divider {
	color: var(--border);
	line-height: 0;
	overflow: hidden;
}
.wave-divider svg {
	display: block;
	width: 100%;
	height: 40px;
}

/* === Experience === */
.timeline { display: flex; flex-direction: column; }

.timeline-item {
	display: grid;
	grid-template-columns: 180px 1fr;
	gap: 0;
	border-top: 1px solid var(--rule);
	padding: 40px 0;
}

.timeline-meta {
	padding-right: 32px;
	padding-top: 4px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.timeline-date {
	font-family: var(--f-mono);
	font-size: 0.72rem;
	color: var(--text-dim);
	letter-spacing: 0.04em;
	line-height: 1.5;
}

.timeline-badge {
	display: inline-block;
	font-family: var(--f-mono);
	font-size: 0.62rem;
	font-weight: 500;
	padding: 2px 7px;
	border-radius: 2px;
	text-transform: uppercase;
	letter-spacing: 0.07em;
}
.timeline-badge.current  { background: rgba(61, 107, 82, 0.1); color: var(--accent); border: 1px solid rgba(61, 107, 82, 0.25); }
.timeline-badge.volunteer { background: rgba(60, 100, 160, 0.08); color: #3a6499; border: 1px solid rgba(60, 100, 160, 0.2); }

.timeline-body { padding-left: 32px; border-left: 1px solid var(--rule); }

.timeline-header { margin-bottom: 20px; }

.timeline-body h3 {
	font-family: var(--f-serif);
	font-size: 1.35rem;
	font-weight: 500;
	color: var(--text);
	margin-bottom: 2px;
	letter-spacing: 0.01em;
}

.company {
	font-size: 0.85rem;
	color: var(--accent);
	font-weight: 500;
}

.tech-stack {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 12px;
}
.tech-stack span {
	font-family: var(--f-mono);
	font-size: 0.68rem;
	color: var(--text-dim);
	letter-spacing: 0.04em;
}
.tech-stack span:not(:last-child)::after {
	content: ' ·';
	margin-left: 6px;
}

.impact-list {
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.impact-list li {
	position: relative;
	padding-left: 16px;
	color: var(--text-muted);
	font-size: 0.875rem;
	line-height: 1.7;
	font-weight: 300;
}
.impact-list li::before {
	content: '–';
	position: absolute;
	left: 0;
	color: var(--text-dim);
}
.impact-list li strong {
	color: var(--text);
	font-weight: 500;
}

/* === Skills === */
.skills-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 0;
}

.skill-group {
	padding: 28px;
	border-right: 1px solid var(--rule);
	border-bottom: 1px solid var(--rule);
}
.skill-group:nth-child(3n) { border-right: none; }
.skill-group:nth-last-child(-n+3) { border-bottom: none; }

.skill-group h4 {
	font-family: var(--f-mono);
	font-size: 0.67rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--accent);
	margin-bottom: 14px;
}

.skill-list {
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.skill-list span {
	font-size: 0.875rem;
	color: var(--text-muted);
	font-weight: 300;
}

/* === Projects === */
.projects-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	border-top: 1px solid var(--rule);
}

.project-card {
	padding: 32px;
	border-right: 1px solid var(--rule);
	display: flex;
	flex-direction: column;
	gap: 14px;
	transition: background 0.25s;
}
.project-card:last-child { border-right: none; }
.project-card:hover { background: var(--bg-raised); }

.project-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
}

.project-card h3 {
	font-family: var(--f-serif);
	font-size: 1.15rem;
	font-weight: 500;
	color: var(--text);
	letter-spacing: 0.01em;
}

.project-links {
	display: flex;
	gap: 10px;
}
.project-links a {
	color: var(--text-dim);
	font-size: 0.9rem;
}
.project-links a:hover { color: var(--accent); }

.project-card p {
	color: var(--text-muted);
	font-size: 0.875rem;
	line-height: 1.75;
	flex: 1;
	font-weight: 300;
}

.project-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.project-tags span {
	font-family: var(--f-mono);
	font-size: 0.67rem;
	color: var(--text-dim);
	letter-spacing: 0.04em;
}
.project-tags span:not(:last-child)::after {
	content: ' ·';
	margin-left: 4px;
}

.section-sub {
	color: var(--text-muted);
	font-size: 0.875rem;
	margin-top: -40px;
	margin-bottom: 40px;
	font-weight: 300;
}

/* === About === */
.about-grid {
	display: grid;
	grid-template-columns: 200px 1fr;
	gap: 64px;
	align-items: start;
}

.about-photo img {
	width: 100%;
	aspect-ratio: 3/4;
	object-fit: cover;
	object-position: top center;
}

.about-text {
	display: flex;
	flex-direction: column;
	gap: 20px;
}
.about-text p {
	font-size: 1rem;
	line-height: 1.85;
	color: var(--text-muted);
	font-weight: 300;
}
.about-text p strong {
	color: var(--text);
	font-weight: 500;
}

/* === Contact === */
#contact { text-align: left; }

.contact-inner {
	display: flex;
	flex-direction: column;
	gap: 32px;
}

.contact-inner > p {
	color: var(--text-muted);
	font-size: 1rem;
	max-width: 480px;
	line-height: 1.75;
	font-weight: 300;
}

.contact-email { font-size: 0.9rem; align-self: flex-start; }

.contact-links {
	display: flex;
	gap: 32px;
	flex-wrap: wrap;
}
.contact-links a {
	color: var(--text-muted);
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 0.875rem;
	font-weight: 400;
}
.contact-links a:hover { color: var(--accent); }

/* === Footer === */
footer {
	background: var(--bg-surface);
	border-top: 1px solid var(--rule);
	padding: 28px 32px;
	text-align: center;
	color: var(--text-dim);
	font-family: var(--f-mono);
	font-size: 0.72rem;
	letter-spacing: 0.04em;
}

/* === Skills outer border === */
#skills .container {
	border: 1px solid var(--rule);
}

/* === Mobile nav === */
@media (max-width: 768px) {
	.nav-toggle {
		display: flex;
		flex-direction: column;
		gap: 5px;
		background: none;
		border: none;
		cursor: pointer;
		padding: 6px;
	}
	.nav-toggle span {
		display: block;
		width: 22px;
		height: 1.5px;
		background: var(--text-muted);
		border-radius: 1px;
		transition: all 0.25s;
	}
	.nav-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
	.nav-toggle.open span:nth-child(2) { opacity: 0; }
	.nav-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

	.nav-links {
		display: none;
		position: absolute;
		top: var(--nav-h);
		left: 0; right: 0;
		background: var(--bg);
		border-bottom: 1px solid var(--border);
		flex-direction: column;
		padding: 20px 32px 28px;
		gap: 20px;
		align-items: flex-start;
	}
	.nav-links.open { display: flex; }
	.nav-links a { font-size: 0.9rem; }
	.btn-resume { display: block; text-align: center; width: 100%; }
}

/* === Responsive === */
@media (max-width: 900px) {
	.hero-inner {
		grid-template-columns: 1fr;
		gap: 48px;
	}
	.hero-right { max-width: 400px; }

	.skills-grid { grid-template-columns: repeat(2, 1fr); }
	.skill-group:nth-child(3n) { border-right: 1px solid var(--rule); }
	.skill-group:nth-child(2n) { border-right: none; }
	.skill-group:nth-last-child(-n+3) { border-bottom: 1px solid var(--rule); }
	.skill-group:nth-last-child(-n+2) { border-bottom: none; }

	.projects-grid { grid-template-columns: 1fr; border: 1px solid var(--rule); }
	.project-card { border-right: none; border-bottom: 1px solid var(--rule); }
	.project-card:last-child { border-bottom: none; }
}

@media (max-width: 680px) {
	section { padding: 72px 0; }

	#hero {
		padding-top: calc(var(--nav-h) + 56px);
		padding-bottom: 72px;
		min-height: auto;
	}

	.timeline-item {
		grid-template-columns: 1fr;
		gap: 0;
	}
	.timeline-meta {
		flex-direction: row;
		align-items: center;
		flex-wrap: wrap;
		gap: 10px;
		padding-right: 0;
		padding-bottom: 16px;
	}
	.timeline-body {
		padding-left: 0;
		border-left: none;
		border-top: 1px solid var(--rule);
		padding-top: 20px;
	}

	.about-grid {
		grid-template-columns: 1fr;
		gap: 32px;
	}
	.about-photo { max-width: 140px; }

	.skills-grid { grid-template-columns: 1fr; }
	.skill-group:nth-child(n) { border-right: none; border-bottom: 1px solid var(--rule); }
	.skill-group:last-child { border-bottom: none; }
}
