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

:root {
  --bg: #f9f8f5;
  --surface: #ffffff;
  --ink: #1a1a1a;
  --ink-muted: #6b6b6b;
  --ink-faint: #b0afa9;
  --accent: #2c5f8a;
  --accent-light: #e8f0f8;
  --accent-border: #c2d8ed;
  --border: #e5e3de;
  --nav-bg: rgba(249,248,245,0.92);
  --serif: 'Playfair Display', Georgia, serif;
  --sans: 'DM Sans', system-ui, sans-serif;
  --radius: 10px;
  --max: 860px;
}

[data-theme="dark"] {
  --bg: #111318;
  --surface: #1c2030;
  --ink: #e2e0dc;
  --ink-muted: #8a8fa8;
  --ink-faint: #7a7f99;
  --accent: #5b9bd5;
  --accent-light: #1a2a40;
  --accent-border: #2a4a6a;
  --border: #252839;
  --nav-bg: rgba(17,19,24,0.92);
}

html { scroll-behavior: smooth; }

#bg-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: -1;
  pointer-events: none;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 300;
  transition: background 0.3s ease, color 0.3s ease;
}

nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
}
.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a {
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent); }

section { max-width: var(--max); margin: 0 auto; padding: 5rem 2rem; }
.section-label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}
h2 {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 400;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 2rem;
}

#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 80px;
}
.hero-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
}
.hero-text {
  flex: 1;
  min-width: 0;
}
.hero-photo {
  flex-shrink: 0;
}
.hero-photo img {
  width: 200px;
  height: 260px;
  border-radius: var(--radius);
  object-fit: cover;
  object-position: center top;
  border: 2px solid var(--border);
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
}
.hero-greeting {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 1rem;
}
.hero-name {
  font-family: var(--serif);
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 400;
  line-height: 1.05;
  color: var(--ink);
  margin-bottom: 1.4rem;
}
.hero-sub {
  font-size: 1.1rem;
  color: var(--ink-muted);
  max-width: 520px;
  line-height: 1.65;
  margin-bottom: 2.5rem;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.4rem;
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #1e4a70; }
.btn-outline { background: transparent; color: var(--ink); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--ink-muted); }
.hero-scroll {
  margin-top: 4rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink-faint);
  font-size: 0.8rem;
}
.scroll-line { width: 36px; height: 1px; background: var(--ink-faint); }

.divider { max-width: var(--max); margin: 0 auto; padding: 0 2rem; }
.divider hr { border: none; border-top: 1px solid var(--border); }

.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
.about-body { color: var(--ink-muted); font-size: 0.97rem; line-height: 1.75; }
.about-body p + p { margin-top: 1rem; }
.about-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
}
.stat-num { font-family: var(--serif); font-size: 1.9rem; color: var(--ink); line-height: 1; margin-bottom: 0.3rem; }
.stat-label { font-size: 0.78rem; color: var(--ink-muted); }

.skills-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.skill-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem 1.4rem; }
.skill-group-title { font-size: 0.72rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.8rem; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag { font-size: 0.78rem; color: var(--ink-muted); background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 0.2rem 0.55rem; }
.cert-row { margin-top: 2rem; display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.cert-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  border-radius: 20px;
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 500;
}

.projects-list { display: flex; flex-direction: column; gap: 1.2rem; }
a.project-card { text-decoration: none; }
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem 1.8rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: start;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.project-card:hover { border-color: #c5d8e8; box-shadow: 0 4px 20px rgba(44,95,138,0.07); }
.project-type { font-size: 0.7rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 0.4rem; }
.project-name { font-family: var(--serif); font-size: 1.25rem; font-weight: 400; color: var(--ink); margin-bottom: 0.5rem; }
.project-desc { font-size: 0.88rem; color: var(--ink-muted); line-height: 1.65; margin-bottom: 0.9rem; }
.project-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.project-arrow {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-muted); flex-shrink: 0; transition: all 0.2s;
}
.project-card:hover .project-arrow { border-color: var(--accent); color: var(--accent); }

.exp-list { display: flex; flex-direction: column; gap: 1.8rem; }
.exp-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1.5rem;
  padding-bottom: 1.8rem;
  border-bottom: 1px solid var(--border);
}
.exp-item:last-child { border-bottom: none; padding-bottom: 0; }
.exp-date { font-size: 0.78rem; color: var(--ink-faint); padding-top: 0.2rem; line-height: 1.5; }
.exp-role { font-family: var(--serif); font-size: 1.15rem; font-weight: 400; color: var(--ink); margin-bottom: 0.15rem; }
.exp-company { font-size: 0.82rem; font-weight: 500; color: var(--accent); margin-bottom: 0.6rem; }
.exp-bullets { list-style: none; display: flex; flex-direction: column; gap: 0.35rem; }
.exp-bullets li { font-size: 0.87rem; color: var(--ink-muted); padding-left: 1rem; position: relative; }
.exp-bullets li::before { content: '–'; position: absolute; left: 0; color: var(--ink-faint); }

#contact { text-align: center; }
#contact h2 { margin-bottom: 0.6rem; }
.contact-sub { color: var(--ink-muted); font-size: 0.97rem; margin-bottom: 2rem; }
.contact-links { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }
.contact-link {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
}
.contact-link:hover { border-color: var(--accent); color: var(--accent); }

footer { border-top: 1px solid var(--border); padding: 1.5rem 2rem; text-align: center; font-size: 0.78rem; color: var(--ink-faint); }

.fade-up { opacity: 0; transform: translateY(22px); transition: opacity 0.55s ease, transform 0.55s ease; }
.fade-up.visible { opacity: 1; transform: none; }

.theme-toggle {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 0.3rem 0.45rem;
  cursor: pointer;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, color 0.2s;
  flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--ink-muted); color: var(--ink); }
.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; }

.nav-right { display: flex; align-items: center; gap: 1.5rem; }

@media (max-width: 640px) {
  .about-grid { grid-template-columns: 1fr; }
  .exp-item { grid-template-columns: 1fr; gap: 0.3rem; }
  .nav-links { display: none; }
  .hero-name { font-size: 2.8rem; }
  .hero-layout { flex-direction: column-reverse; align-items: flex-start; gap: 2rem; }
  .hero-photo img { width: 130px; height: 170px; }
}
