:root {
  --bg: #ffffff;
  --bg-soft: #f7f8fa;
  --bg-soft-2: #f1f3f7;
  --text: #14161a;
  --muted: #6b7280;
  --muted-2: #9aa1b0;
  --border: #e7e9ee;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-soft: #eef2ff;
  --mint: #0ea885;
  --mint-soft: #e7f8f3;
  --radius: 12px;
  --radius-sm: 8px;
  --maxw: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.logo {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  margin-right: auto;
}
.nav { display: flex; gap: 28px; }
.nav a {
  font-size: 14.5px;
  color: var(--muted);
  font-weight: 500;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.nav a:hover { color: var(--text); }
.nav a.active { color: var(--text); border-bottom-color: var(--accent); }
.nav-cta {
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.nav-cta:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span { width: 20px; height: 2px; background: var(--text); border-radius: 2px; }
.nav-mobile {
  display: none;
  flex-direction: column;
  border-top: 1px solid var(--border);
  padding: 8px 24px 16px;
}
.nav-mobile a {
  padding: 12px 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.nav-mobile a:last-child { border-bottom: none; color: var(--accent); }
.nav-mobile.open { display: flex; }

@media (max-width: 760px) {
  .nav, .nav-cta { display: none; }
  .nav-toggle { display: flex; }
}

/* ---------- Generic section rhythm ---------- */
.app { min-height: 60vh; }
section { padding: 72px 0; }
section.tight { padding: 48px 0; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 14px;
}
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 46px; font-weight: 800; }
h2 { font-size: 30px; font-weight: 800; }
h3 { font-size: 19px; font-weight: 700; }
p { color: var(--muted); margin: 0; }
.lede { font-size: 18px; color: var(--muted); max-width: 640px; margin-top: 16px; }

@media (max-width: 640px) {
  h1 { font-size: 34px; }
  h2 { font-size: 25px; }
  section { padding: 48px 0; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14.5px;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary { background: var(--text); color: #fff; }
.btn-primary:hover { background: #000; }
.btn-outline { border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent-dark); background: var(--accent-soft); }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

/* ---------- Hero ---------- */
.hero { padding-top: 88px; padding-bottom: 56px; }
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.stat-num { font-size: 28px; font-weight: 800; color: var(--text); }
.stat-label { font-size: 13px; color: var(--muted); margin-top: 4px; }
@media (max-width: 640px) {
  .hero-stats { grid-template-columns: 1fr; gap: 20px; }
}

/* ---------- Cards / Grid ---------- */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  background: var(--bg);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card-link { display: block; }
.card-link:hover .card { border-color: var(--accent); transform: translateY(-2px); }
.card-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
  font-size: 16px;
  margin-bottom: 18px;
}
.card-meta { font-size: 12.5px; color: var(--muted-2); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.card h3 { margin-bottom: 8px; }
.card p { font-size: 14.5px; margin-top: 8px; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.tag {
  font-size: 12px; font-weight: 600; color: var(--muted);
  background: var(--bg-soft); border: 1px solid var(--border);
  padding: 4px 10px; border-radius: 999px;
}
.card-arrow { margin-top: 16px; font-size: 13.5px; font-weight: 700; color: var(--accent); }

/* ---------- Section header row ---------- */
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; margin-bottom: 36px; flex-wrap: wrap;
}
.section-head .see-all { font-size: 14px; font-weight: 700; color: var(--accent); white-space: nowrap; }

/* ---------- Project detail ---------- */
.detail-back { font-size: 13.5px; font-weight: 600; color: var(--muted); margin-bottom: 20px; display: inline-block; }
.detail-back:hover { color: var(--accent); }
.detail-header { border-bottom: 1px solid var(--border); padding-bottom: 32px; margin-bottom: 32px; }
.detail-meta { font-size: 14px; color: var(--muted); margin-top: 10px; }
.detail-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; }
@media (max-width: 860px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-block { margin-bottom: 28px; }
.detail-block h3 { color: var(--accent); font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 12px; }
.detail-block p { color: var(--text); font-size: 15.5px; line-height: 1.65; }

.stat-block { display: flex; flex-direction: column; gap: 22px; }
.stat-item { border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stat-item .stat-num { font-size: 26px; }
.stat-item .stat-label { margin-top: 6px; font-size: 13.5px; }

.highlight-box {
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 8px;
}
.highlight-box h3 { color: var(--text); font-size: 15px; margin-bottom: 12px; }
.highlight-box ul { margin: 0; padding-left: 18px; color: var(--text); font-size: 14.5px; }
.highlight-box li { margin-bottom: 8px; }

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }

.project-pager {
  display: flex; justify-content: space-between; margin-top: 56px;
  border-top: 1px solid var(--border); padding-top: 24px;
  font-size: 14px; font-weight: 600;
}
.project-pager a:hover { color: var(--accent); }

/* ---------- Timeline ---------- */
.timeline { position: relative; margin-top: 8px; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px;
  width: 2px; background: var(--border);
}
.timeline-item { position: relative; padding-left: 36px; margin-bottom: 32px; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-dot {
  position: absolute; left: 0; top: 4px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--accent); border: 3px solid var(--accent-soft);
}
.timeline-item.current .timeline-dot { background: var(--mint); border-color: var(--mint-soft); }
.timeline-title { font-size: 17px; font-weight: 700; }
.timeline-sub { font-size: 13.5px; color: var(--accent); font-weight: 600; margin-top: 2px; }
.timeline-desc { font-size: 14.5px; color: var(--muted); margin-top: 6px; }
.timeline-list { font-size: 14.5px; color: var(--muted); margin: 8px 0 0; padding-left: 18px; }
.timeline-list li { margin-bottom: 6px; }
.timeline-list li:last-child { margin-bottom: 0; }
.timeline-list strong { color: var(--text); }

/* ---------- Skills grid ---------- */
.skill-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.skill-card h3 { font-size: 15.5px; margin-bottom: 8px; }
.skill-card p { font-size: 13.5px; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1fr; gap: 40px; max-width: 720px; }
.about-grid p { font-size: 16px; color: var(--text); line-height: 1.75; margin-bottom: 18px; }
.contact-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; background: var(--bg-soft);
}
.contact-card h3 { margin-bottom: 10px; }
.contact-row { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 15px; font-weight: 600; }
.contact-row a:hover { color: var(--accent); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0; margin-top: 40px; }
.footer-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 24px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  font-size: 13.5px; color: var(--muted-2);
}
.footer-links { display: flex; gap: 20px; }
.footer-links a:hover { color: var(--accent); }

/* ---------- utility ---------- */
.mt-lg { margin-top: 56px; }
.text-center { text-align: center; }
.badge {
  display: inline-block; font-size: 12.5px; font-weight: 700;
  background: var(--mint-soft); color: var(--mint);
  padding: 4px 12px; border-radius: 999px; margin-bottom: 16px;
}
