:root {
  --accent: #2E6DA4;
  --accent-dark: #214f78;
  --accent-light: #e8f0f8;
  --bg: #ffffff;
  --bg-soft: #f4f7fb;
  --text: #1a1a1a;
  --muted: #5a6470;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 8px 24px rgba(33,79,120,.06);
  --maxw: 1040px;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg-soft);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── STICKY NAV ── */
nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
nav .nav-wrap {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px;
}
nav .brand { font-weight: 700; font-size: 15px; letter-spacing: -.2px; }
nav .brand span { color: var(--accent); }
nav .brand a { color: var(--text); }
nav .brand a:hover { text-decoration: none; }
nav .nav-links { display: flex; gap: 22px; align-items: center; }
nav .nav-links a {
  color: var(--muted); font-size: 14px; font-weight: 500;
}
nav .nav-links a:hover { color: var(--accent); text-decoration: none; }
nav .nav-links a.nav-highlight {
  color: #fff; font-weight: 600;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  padding: 6px 15px; border-radius: 999px;
  box-shadow: 0 2px 8px rgba(46,109,164,.35);
  transition: transform .15s ease, box-shadow .15s ease;
  animation: navPulse 2.6s ease-in-out infinite;
}
nav .nav-links a.nav-highlight:hover {
  color: #fff; text-decoration: none; transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(46,109,164,.55);
}
@keyframes navPulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(46,109,164,.35); }
  50% { box-shadow: 0 3px 16px rgba(46,109,164,.62); }
}

/* ── HERO ── */
header.hero {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: white;
}
.hero-wrap {
  max-width: var(--maxw); margin: 0 auto;
  padding: 56px 24px 64px;
}
.hero h1 {
  font-size: clamp(34px, 6vw, 52px);
  font-weight: 800; letter-spacing: -1px; line-height: 1.05;
}
.hero .role {
  font-size: clamp(16px, 2.4vw, 20px);
  font-weight: 400; opacity: .92; margin-top: 8px;
}
.hero .meta {
  display: flex; flex-wrap: wrap; gap: 18px;
  margin-top: 18px; font-size: 14.5px; opacity: .92;
}
.hero .meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px;
  font-size: 14.5px; font-weight: 600; transition: all .15s ease;
}
.btn-primary { background: white; color: var(--accent-dark); }
.btn-primary:hover { background: #eef4fb; text-decoration: none; transform: translateY(-1px); }
.btn-ghost { background: rgba(255,255,255,.12); color: white; border: 1px solid rgba(255,255,255,.4); }
.btn-ghost:hover { background: rgba(255,255,255,.22); text-decoration: none; transform: translateY(-1px); }

/* ── LAYOUT ── */
main {
  max-width: var(--maxw); margin: -36px auto 0;
  padding: 0 24px 64px;
  position: relative; z-index: 2;
}
.grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}

.card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 28px;
}
.card + .card { margin-top: 24px; }
aside .card + .card { margin-top: 24px; }

.section-label {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.4px; color: var(--accent);
  margin-bottom: 16px;
}

.summary p { font-size: 16px; color: #2b3440; }
.summary strong { color: var(--text); font-weight: 600; }

/* ── EXPERIENCE TIMELINE ── */
.company { margin-bottom: 26px; }
.company:last-child { margin-bottom: 0; }
.company-head {
  display: flex; justify-content: space-between; align-items: baseline;
  flex-wrap: wrap; gap: 4px; margin-bottom: 14px;
}
.company-name { font-size: 18px; font-weight: 700; color: var(--accent-dark); }
.company-meta { font-size: 13px; color: var(--muted); }

.role {
  position: relative; padding-left: 22px; margin-bottom: 20px;
  border-left: 2px solid var(--accent-light);
}
.role:last-child { margin-bottom: 0; }
.role::before {
  content: ''; position: absolute; left: -7px; top: 4px;
  width: 12px; height: 12px; border-radius: 50%;
  background: white; border: 3px solid var(--accent);
}
.role-head {
  display: flex; justify-content: space-between; align-items: baseline;
  flex-wrap: wrap; gap: 2px;
}
.role-title { font-size: 15.5px; font-weight: 700; }
.role-dates { font-size: 13px; color: var(--muted); white-space: nowrap; }
.role-loc { font-size: 13px; color: var(--muted); margin: 2px 0 8px; }
.badge {
  display: inline-block; margin: 4px 0 8px;
  background: #fff8e6; border: 1px solid #f0c14b; color: #7a5200;
  border-radius: 999px; padding: 3px 11px; font-size: 12px; font-weight: 600;
}
.badge.promo { background: #e7f8ef; border-color: #36c98a; color: #136b46; }
.bullets { list-style: none; }
.bullets li {
  position: relative; padding-left: 18px; margin-bottom: 6px;
  font-size: 14.5px; color: #2b3440;
}
.bullets li::before {
  content: '▸'; position: absolute; left: 0; top: 0;
  color: var(--accent); font-size: 12px;
}
.bullets strong { color: var(--text); font-weight: 600; }
.role-tags { margin-top: 10px; font-size: 12.5px; color: var(--accent); font-weight: 500; }

/* ── SIDEBAR ── */
.skill-group { margin-bottom: 16px; }
.skill-group:last-child { margin-bottom: 0; }
.skill-group-label {
  font-size: 11.5px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .6px; margin-bottom: 7px;
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  background: var(--accent-light); color: var(--accent-dark);
  border-radius: 6px; padding: 4px 9px; font-size: 12.5px; font-weight: 500;
}

.edu { margin-bottom: 14px; }
.edu:last-child { margin-bottom: 0; }
.edu .school { font-weight: 600; font-size: 14px; }
.edu .degree { font-size: 13px; color: #2b3440; }
.edu .date { font-size: 12px; color: var(--muted); margin-top: 1px; }

/* ── PROJECTS SHOWCASE (cards) ── */
.projects { margin-top: 24px; }
.projects > .section-label { padding: 0 4px; }
.projects-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 0 4px; margin-bottom: 16px;
}
.projects-head .section-label { margin-bottom: 0; }
.projects-head a { font-size: 13px; font-weight: 600; }
.proj-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.proj-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px;
}
.proj-card.featured { grid-column: 1 / -1; border-top: 3px solid var(--accent); }
.proj-banner { display: block; width: 100%; height: auto; border-radius: 10px; margin-bottom: 18px; }
.proj-pill {
  display: inline-block; background: var(--accent); color: white;
  font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
  border-radius: 999px; padding: 4px 12px; margin-bottom: 12px;
}
.proj-titlebar { display: flex; align-items: flex-start; gap: 10px; }
.proj-card h3 { font-size: 21px; font-weight: 700; letter-spacing: -.3px; line-height: 1.2; }
.permalink {
  flex-shrink: 0; font-size: 15px; color: var(--muted); opacity: .45;
  border: 1px solid var(--border); border-radius: 6px; padding: 1px 8px;
  text-decoration: none; line-height: 1.5; margin-top: 2px;
}
.permalink:hover { opacity: 1; color: var(--accent); background: var(--accent-light); text-decoration: none; }
.proj-card .proj-ctx { font-size: 13px; color: var(--muted); margin: 4px 0 14px; }
.proj-card .proj-overview { font-size: 15px; color: #2b3440; }
.proj-card .proj-overview strong { color: var(--text); font-weight: 600; }

.proj-stats { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0; }
.stat {
  background: var(--accent-light); border-radius: 10px;
  padding: 12px 16px; min-width: 96px;
}
.stat .num { display: block; font-size: 22px; font-weight: 800; color: var(--accent-dark); line-height: 1.1; }
.stat .lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }

.proj-flow {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  background: var(--bg-soft); border: 1px dashed var(--border);
  border-radius: 10px; padding: 14px 16px; margin: 20px 0;
  font-size: 13px;
}
.proj-flow .node {
  background: white; border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 12px; font-weight: 600; color: var(--accent-dark);
}
.proj-flow .arrow { color: var(--accent); font-weight: 700; }

.proj-card h4 {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  color: var(--muted); margin: 20px 0 10px;
}
.proj-card .bullets li { font-size: 14.5px; margin-bottom: 7px; }

/* ── PROJECT TEASERS (homepage) ── */
.proj-teasers { display: grid; grid-template-columns: repeat(auto-fit, minmax(228px, 1fr)); gap: 20px; }
.proj-teaser {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px; display: flex; flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
}
.proj-teaser:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(33,79,120,.13); }
.proj-teaser .proj-thumb { display: block; width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--border); margin-bottom: 14px; }
.proj-teaser .proj-pill { font-size: 10px; padding: 3px 10px; margin-bottom: 10px; }
.proj-teaser h3 { font-size: 16px; font-weight: 700; line-height: 1.28; margin-bottom: 6px; }
.proj-teaser h3 a { color: var(--text); }
.proj-teaser h3 a:hover { color: var(--accent); text-decoration: none; }
.proj-teaser .t-desc { font-size: 13.5px; color: var(--muted); flex: 1; }
.proj-teaser .role-tags { margin-top: 12px; font-size: 11.5px; }
.proj-teaser .t-more { margin-top: 12px; font-size: 13px; font-weight: 600; }
.proj-teaser .t-more a:hover { text-decoration: none; }

/* ── PROJECTS PAGE ── */
.page-hero {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: white;
}
.page-hero .hero-wrap { padding: 44px 24px 56px; }
.page-hero h1 { font-size: clamp(28px, 5vw, 42px); font-weight: 800; letter-spacing: -.6px; }
.page-hero .sub { opacity: .92; margin-top: 8px; font-size: 15px; max-width: 680px; }
.projects-page {
  max-width: var(--maxw); margin: -30px auto 0;
  padding: 0 24px 64px; position: relative; z-index: 2;
}
.projects-page .proj-card { margin-bottom: 24px; scroll-margin-top: 80px; }
.projects-page .proj-card:last-child { margin-bottom: 0; }

/* projects layout with left table-of-contents */
.proj-layout { display: grid; grid-template-columns: 230px 1fr; gap: 24px; align-items: start; }
.proj-layout > .proj-card.featured { grid-column: auto; }
.toc-wrap { position: sticky; top: 80px; }
.toc {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px;
}
.toc .toc-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--muted); margin-bottom: 10px; padding: 0 8px;
}
.toc ul { list-style: none; }
.toc li { margin-bottom: 2px; }
.toc a {
  display: block; padding: 8px 10px; border-radius: 8px;
  font-size: 13.5px; color: var(--muted); font-weight: 500; line-height: 1.3;
}
.toc a:hover { background: var(--accent-light); color: var(--accent-dark); text-decoration: none; }
.toc a.active { background: var(--accent); color: #fff; }
.toc .toc-num { font-weight: 700; opacity: .5; margin-right: 7px; }
.toc a.active .toc-num { opacity: .85; }
.toc-foot { margin-top: 12px; padding: 12px 8px 2px; border-top: 1px solid var(--border); }
.toc-foot a { font-size: 13px; font-weight: 600; color: var(--accent); }

/* ── FOOTER ── */
footer {
  text-align: center; color: var(--muted); font-size: 13px;
  padding: 32px 24px 48px;
}
footer a { font-weight: 500; }

/* ── RESPONSIVE ── */
@media (max-width: 860px) {
  .grid { grid-template-columns: 1fr; }
  .proj-grid { grid-template-columns: 1fr; }
  .proj-teasers { grid-template-columns: 1fr; }
  .proj-layout { grid-template-columns: 1fr; }
  .toc-wrap { position: static; }
  nav .nav-links { gap: 14px; }
  nav .nav-links a:not(.nav-highlight) { display: none; }
  .card, .proj-card { padding: 22px; }
  .proj-card h3 { font-size: 19px; }
}
