:root {
  --bg: #fafaf7;
  --bg-elevated: #ffffff;
  --text: #1a1a1a;
  --text-muted: #5a5a5a;
  --text-subtle: #8a8a8a;
  --border: #e8e6df;
  --accent: #2d5f4e;
  --accent-soft: #e8f0ec;
  --code: #6b4423;
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.04);
}

[data-theme="dark"] {
  --bg: #0f0f0e;
  --bg-elevated: #1a1a18;
  --text: #f0ede5;
  --text-muted: #a8a8a0;
  --text-subtle: #6a6a62;
  --border: #2a2a26;
  --accent: #7fc8ad;
  --accent-soft: #1e2a25;
  --code: #d4a574;
  --shadow: 0 1px 2px rgba(0,0,0,0.2), 0 4px 16px rgba(0,0,0,0.2);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 32px;
}

.container.narrow { max-width: 720px; }

/* Nav */
.nav {
  position: sticky;
  top: 0;
  background: rgba(250, 250, 247, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}
[data-theme="dark"] .nav { background: rgba(15, 15, 14, 0.85); }

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

.logo {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 17px;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.logo span { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 28px;
}

.nav-links a {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent); }

.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 9px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  transition: all 0.2s;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

/* Hero */
.hero {
  padding: 120px 0 100px;
}

.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: var(--accent);
  margin-bottom: 20px;
  letter-spacing: 0.02em;
}

.hero h1 {
  font-size: clamp(48px, 8vw, 88px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.04em;
  margin-bottom: 28px;
}

.tagline {
  font-size: clamp(18px, 2.2vw, 22px);
  color: var(--text-muted);
  max-width: 640px;
  line-height: 1.5;
  margin-bottom: 32px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text-subtle);
  margin-bottom: 40px;
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  margin-right: 6px;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.2);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.cta-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 13px 24px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(45, 95, 78, 0.25);
}
[data-theme="dark"] .btn-primary { color: #0f0f0e; }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Sections */
.section {
  padding: 80px 0;
  border-top: 1px solid var(--border);
}

.section h2 {
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-bottom: 40px;
}

.num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55em;
  color: var(--accent);
  font-weight: 400;
  margin-right: 12px;
  vertical-align: 0.2em;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 60px;
}

@media (max-width: 768px) {
  .two-col { grid-template-columns: 1fr; gap: 20px; }
}

.prose p {
  color: var(--text-muted);
  margin-bottom: 18px;
  font-size: 16px;
}
.prose p strong { color: var(--text); font-weight: 600; }

/* Projects */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 24px;
}

@media (max-width: 640px) {
  .project-grid { grid-template-columns: 1fr; }
}

.project {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  transition: all 0.25s ease;
}

.project:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
}

.project-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 4px;
}

.project h3 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-subtle);
  white-space: nowrap;
}

.role {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  color: var(--accent);
  margin-bottom: 14px;
}

.project p:not(.role) {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 14px;
}

.project ul {
  list-style: none;
  margin-bottom: 18px;
}

.project ul li {
  color: var(--text-muted);
  font-size: 14.5px;
  padding-left: 18px;
  position: relative;
  margin-bottom: 8px;
  line-height: 1.55;
}

.project ul li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 12px;
  top: 2px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-links {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
}

.project-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.project-links a:hover { color: var(--accent); }

.repo-private {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  color: var(--text-subtle);
  cursor: not-allowed;
}

.repo-private svg { opacity: 0.7; }

.grad-badge {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  font-weight: 500;
  padding: 2px 8px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 100px;
  margin-left: 8px;
  vertical-align: middle;
  letter-spacing: 0.02em;
}

.tags span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  padding: 4px 10px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 100px;
  font-weight: 500;
}

/* Experience */
.exp { margin-bottom: 36px; }
.exp:last-child { margin-bottom: 0; }

.exp-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

.exp h3 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.exp .role {
  margin-bottom: 12px;
}

.exp ul {
  list-style: none;
}
.exp ul li {
  color: var(--text-muted);
  font-size: 15px;
  padding-left: 18px;
  position: relative;
  margin-bottom: 8px;
}
.exp ul li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 12px;
  top: 2px;
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.skill-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px;
  transition: all 0.2s;
}

.skill-card:hover {
  border-color: var(--accent);
}

.skill-card h4 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 10px;
  font-weight: 500;
}

.skill-card p {
  color: var(--text-muted);
  font-size: 14.5px;
  line-height: 1.55;
}

/* Contact */
.section-contact {
  text-align: center;
  padding: 100px 0 120px;
}

.section-contact h2 {
  margin-bottom: 24px;
}

.lede {
  color: var(--text-muted);
  font-size: 17px;
  margin-bottom: 36px;
  line-height: 1.6;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 32px;
}

.contact-links a {
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}
.contact-links a:hover { color: var(--accent); }

.socials {
  display: flex;
  gap: 20px;
  justify-content: center;
}

.socials a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s;
}
.socials a:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* Footer */
footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

footer p {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  color: var(--text-subtle);
}

.muted { color: var(--text-subtle); margin-left: 8px; }

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .container { padding: 0 22px; }
  .hero { padding: 70px 0 60px; }
  .section { padding: 60px 0; }
}
