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

/* ── Tokens ──────────────────────────────────────────────────── */
:root {
  --bg:           #fafafa;
  --bg-alt:       #f4f4f5;
  --surface:      #ffffff;
  --border:       #e4e4e7;
  --text:         #18181b;
  --text-2:       #3f3f46;
  --text-muted:   #71717a;
  --text-faint:   #a1a1aa;
  --accent:       #2563eb;
  --accent-bg:    #eff6ff;
  --accent-border:#bfdbfe;
  --accent-dark:  #1d4ed8;
  --green:        #16a34a;
  --orange:       #ea580c;
  --gold:         #b45309;
  --nav-h:        60px;
  --max-w:        760px;
  --r:            10px;
  --font:         'Inter', system-ui, -apple-system, sans-serif;
}

/* ── Base ────────────────────────────────────────────────────── */
html  { scroll-behavior: smooth; }
body  {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a     { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }
ul    { list-style: none; }

/* ── Layout ──────────────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 72px 0;
  border-top: 1px solid var(--border);
}
.section-alt { background: var(--bg-alt); }

.section-title {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 36px;
}

/* ── Nav ─────────────────────────────────────────────────────── */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(250,250,250,0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: box-shadow 0.2s;
}
.nav-scrolled { box-shadow: 0 1px 0 var(--border); }

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  text-decoration: none;
}
.nav-name:hover { color: var(--text); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav-links a {
  font-size: 13.5px;
  font-weight: 450;
  color: var(--text-muted);
  transition: color 0.15s;
  position: relative;
}
.nav-links a:hover   { color: var(--text); }
.nav-links a.active  { color: var(--text); }
.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0; right: 0;
  height: 1.5px;
  background: var(--accent);
  border-radius: 2px;
}
.nav-cta {
  color: var(--accent) !important;
  font-weight: 500 !important;
}
.nav-cta:hover { color: var(--accent-dark) !important; }

/* hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  display: block;
  height: 1.5px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
  transform-origin: center;
}
.hamburger.active span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.active span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ── Hero ────────────────────────────────────────────────────── */
.hero {
  padding: calc(var(--nav-h) + 68px) 0 72px;
  border-bottom: 1px solid var(--border);
}

/* staggered load animation */
.hero > .container > * {
  opacity: 0;
  transform: translateY(12px);
  animation: heroIn 0.5s ease forwards;
}
.hero > .container > *:nth-child(1) { animation-delay: 0.05s; }
.hero > .container > *:nth-child(2) { animation-delay: 0.12s; }
.hero > .container > *:nth-child(3) { animation-delay: 0.18s; }
.hero > .container > *:nth-child(4) { animation-delay: 0.24s; }
.hero > .container > *:nth-child(5) { animation-delay: 0.30s; }
.hero > .container > *:nth-child(6) { animation-delay: 0.36s; }

@keyframes heroIn {
  to { opacity: 1; transform: translateY(0); }
}

.hero-eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.hero-name {
  font-size: clamp(34px, 7vw, 50px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--text);
  margin-bottom: 8px;
}
.hero-location {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 22px;
}
.hero-bio {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-2);
  max-width: 580px;
  margin-bottom: 24px;
}
.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 32px;
}
.tag {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  border-radius: 20px;
  padding: 4px 11px;
}
.hero-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}
.btn-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #fff;
}
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--bg-alt);
  color: var(--text);
  border-color: #d4d4d8;
}
.btn-sm {
  font-size: 13px;
  padding: 6px 14px;
}

/* ── Timeline ────────────────────────────────────────────────── */
.timeline-item {
  display: grid;
  grid-template-columns: 148px 1fr;
  gap: 20px;
  padding: 26px 0;
  border-bottom: 1px solid var(--border);
}
.timeline-item:last-child { border-bottom: none; }

.timeline-meta {
  padding-top: 2px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.timeline-date {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}
.timeline-type {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
  width: fit-content;
}

.job-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}
.job-company {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.job-location {
  font-weight: 400;
  color: var(--text-faint);
}
.job-bullets {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.job-bullets li {
  font-size: 13.5px;
  color: var(--text-2);
  padding-left: 14px;
  position: relative;
  line-height: 1.55;
}
.job-bullets li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--text-faint);
}
.job-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.skill-chip {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
}

/* ── Education ───────────────────────────────────────────────── */
.edu-block {
  display: grid;
  grid-template-columns: 148px 1fr;
  gap: 20px;
  padding: 26px 0 0;
  margin-top: 2px;
  border-top: 1px solid var(--border);
}
.edu-meta {
  padding-top: 2px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.grade-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--green);
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 4px;
  padding: 2px 7px;
  width: fit-content;
}
.edu-note {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 9px;
  line-height: 1.6;
}

/* ── Scroll progress bar ─────────────────────────────────────── */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  z-index: 200;
  transition: transform 0.1s linear;
}

/* ── Back to top ─────────────────────────────────────────────── */
.back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s, transform 0.25s, background 0.15s, color 0.15s;
  pointer-events: none;
  z-index: 99;
}
.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.back-to-top:hover {
  background: var(--bg-alt);
  color: var(--text);
}

/* ── Projects ────────────────────────────────────────────────── */
.projects-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 26px 28px;
}
.project-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.project-title {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.015em;
  margin-bottom: 3px;
}
.project-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
}
.project-badges {
  display: flex;
  gap: 7px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.award-badge {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--gold);
  background: #fefce8;
  border: 1px solid #fde68a;
  border-radius: 5px;
  padding: 3px 9px;
  white-space: nowrap;
}
.award-badge-blue {
  color: var(--accent);
  background: var(--accent-bg);
  border-color: var(--accent-border);
}
.project-desc {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 18px;
}
.project-highlights {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
  padding: 14px 18px;
  background: var(--bg-alt);
  border-radius: 7px;
  border-left: 2.5px solid var(--accent);
}
.highlight-item {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: 13px;
  color: var(--text-2);
}
.highlight-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  min-width: 68px;
  flex-shrink: 0;
}
.project-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Certifications ──────────────────────────────────────────── */
.cert-grid {
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}
.cert-card {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 20px 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.cert-card:last-child { border-bottom: none; }
.cert-card:hover      { background: #f9f9fb; }

.cert-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}
.cert-icon-blue   { background: var(--accent-bg);  color: var(--accent); border: 1px solid var(--accent-border); }
.cert-icon-orange { background: #fff7ed; color: var(--orange); border: 1px solid #fed7aa; }
.cert-icon-green  { background: #f0fdf4; color: var(--green);  border: 1px solid #bbf7d0; }
.cert-icon-gold   { background: #fefce8; color: var(--gold);   border: 1px solid #fde68a; font-size: 17px; }

.cert-name   { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 2px; letter-spacing: -0.01em; }
.cert-issuer { font-size: 12px; color: var(--text-muted); margin-bottom: 5px; }
.cert-detail { font-size: 13px; color: var(--text-2); line-height: 1.5; }

/* ── Footer ──────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.footer-name  { font-size: 13px; font-weight: 600; color: var(--text); }
.footer-links { display: flex; gap: 18px; }
.footer-links a { font-size: 13px; color: var(--text-muted); transition: color 0.15s; }
.footer-links a:hover { color: var(--text); }
.footer-copy  { font-size: 13px; color: var(--text-faint); }

/* ── Fade-in animation ───────────────────────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive: 768px ───────────────────────────────────────── */
@media (max-width: 768px) {
  .timeline-item,
  .edu-block { grid-template-columns: 130px 1fr; }
}

/* ── Responsive: 640px ───────────────────────────────────────── */
@media (max-width: 640px) {
  /* show hamburger, hide desktop links */
  .hamburger { display: flex; }

  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a {
    display: block;
    padding: 13px 24px;
    font-size: 15px;
    border-bottom: none;
  }
  .nav-links a.active::after { display: none; }

  .timeline-item,
  .edu-block {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .timeline-meta,
  .edu-meta {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
  }

  .hero { padding-top: calc(var(--nav-h) + 48px); }
  .hero-bio { font-size: 15px; }

  .project-card  { padding: 20px; }
  .project-header { flex-direction: column; gap: 10px; }

  .cert-card { padding: 16px 18px; }
  .cert-icon { width: 36px; height: 36px; font-size: 9.5px; }

  .highlight-item { flex-direction: column; gap: 2px; }

  .footer-inner { flex-direction: column; text-align: center; gap: 10px; }

  .section { padding: 52px 0; }
  .back-to-top { bottom: 16px; right: 16px; }
}

/* ── Responsive: 420px ───────────────────────────────────────── */
@media (max-width: 420px) {
  .hero-name { font-size: 30px; }
  .container { padding: 0 18px; }
  .tag { font-size: 11.5px; }
}
