/* ===== Tokens ===== */
:root {
  --bg: #ffffff;
  --bg-alt: #f4f6fb;
  --card: #ffffff;
  --border: #e3e8f0;
  --text: #12141a;
  --muted: #5a6472;
  --accent: #2563eb;
  --accent-soft: #dbe6ff;
  --shadow: 0 6px 24px rgba(20, 30, 60, .08);
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
}
:root[data-theme="dark"] {
  --bg: #0b0e14;
  --bg-alt: #10141d;
  --card: #141926;
  --border: #232a3a;
  --text: #e7ecf5;
  --muted: #93a0b5;
  --accent: #5b8dff;
  --accent-soft: #1a2440;
  --shadow: 0 8px 30px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
}
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { line-height: 1.2; font-weight: 700; }
section { padding: 5.5rem 0; }
.wrap { width: min(1080px, 92vw); margin: 0 auto; }

/* ===== Nav ===== */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 1.5rem;
  padding: .9rem min(4vw, 3rem);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav__brand { font-weight: 800; font-size: 1.25rem; color: var(--text); }
.nav__brand span { color: var(--accent); }
.nav__links { margin-left: auto; display: flex; gap: 1.4rem; }
.nav__links a { color: var(--muted); font-weight: 500; font-size: .95rem; transition: color .2s; }
.nav__links a:hover, .nav__links a.active { color: var(--text); }
.nav__theme {
  background: var(--bg-alt); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; width: 38px; height: 38px; font-size: 1.1rem; cursor: pointer;
}
@media (max-width: 680px) { .nav__links { display: none; } }

/* ===== Hero ===== */
.hero { padding: 6rem 0 4rem; background:
  radial-gradient(60% 60% at 80% 0%, var(--accent-soft) 0%, transparent 60%); }
.hero__eyebrow { font-family: var(--mono); color: var(--accent); font-size: .9rem; letter-spacing: .04em; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 800; margin: .6rem 0; letter-spacing: -.02em; }
.hero__role { font-size: clamp(1.1rem, 2.4vw, 1.5rem); color: var(--muted); font-weight: 600; }
.hero__blurb { max-width: 640px; margin: 1.4rem 0 2rem; color: var(--muted); font-size: 1.05rem; }
.hero__cta { display: flex; flex-wrap: wrap; gap: .8rem; }
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .7rem 1.3rem; border-radius: 10px; font-weight: 600; font-size: .95rem;
  border: 1px solid var(--border); transition: transform .15s, box-shadow .15s;
}
.btn--primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn--ghost { background: var(--card); color: var(--text); }
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

/* ===== Section heading ===== */
.shead { display: flex; align-items: baseline; gap: .8rem; margin-bottom: 2.4rem; }
.shead__num { font-family: var(--mono); color: var(--accent); font-size: .95rem; }
.shead h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); letter-spacing: -.01em; }
.shead__rule { flex: 1; height: 1px; background: var(--border); }

.alt { background: var(--bg-alt); }

/* ===== About ===== */
.about { display: grid; grid-template-columns: 1.6fr 1fr; gap: 2.5rem; }
.about p { color: var(--muted); margin-bottom: 1rem; }
.about__facts { display: grid; gap: .8rem; align-content: start; }
.fact { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.2rem; }
.fact b { display: block; font-family: var(--mono); color: var(--accent); font-size: .85rem; }
@media (max-width: 760px) { .about { grid-template-columns: 1fr; } }

/* ===== Skills ===== */
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.2rem; }
.skillcard { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 1.4rem; box-shadow: var(--shadow); }
.skillcard h3 { font-size: 1rem; margin-bottom: .9rem; display: flex; align-items: center; gap: .5rem; }
.skillcard h3::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.tag { font-family: var(--mono); font-size: .78rem; padding: .3rem .6rem; border-radius: 7px;
  background: var(--bg-alt); border: 1px solid var(--border); color: var(--text); }

/* ===== Experience timeline ===== */
.timeline { position: relative; display: grid; gap: 1.6rem; }
.job { background: var(--card); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: 12px; padding: 1.4rem 1.6rem; box-shadow: var(--shadow); }
.job__top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; align-items: baseline; }
.job__role { font-size: 1.1rem; font-weight: 700; }
.job__org { color: var(--accent); font-weight: 600; }
.job__date { font-family: var(--mono); font-size: .8rem; color: var(--muted); }
.job ul { margin: .9rem 0 0 1.1rem; color: var(--muted); }
.job li { margin-bottom: .35rem; }

/* ===== Projects ===== */
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.3rem; }
.proj { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 1.5rem;
  display: flex; flex-direction: column; box-shadow: var(--shadow); transition: transform .18s, border-color .18s; }
.proj:hover { transform: translateY(-4px); border-color: var(--accent); }
.proj__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.proj__head h3 { font-size: 1.15rem; }
.proj__ext { color: var(--muted); font-size: 1.1rem; }
.proj p { color: var(--muted); flex: 1; margin-bottom: 1rem; font-size: .95rem; }
.proj .tags { margin-top: auto; }

/* ===== Publications / Certs ===== */
.list { display: grid; gap: .7rem; }
.list li { list-style: none; background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: .85rem 1.1rem; color: var(--muted); }
.list li b { color: var(--text); font-weight: 600; }

/* ===== Contact ===== */
.contact { text-align: center; }
.contact h2 { font-size: clamp(1.8rem, 5vw, 2.6rem); margin-bottom: .8rem; }
.contact p { color: var(--muted); max-width: 520px; margin: 0 auto 2rem; }
.contact__links { display: flex; justify-content: center; flex-wrap: wrap; gap: .9rem; }

/* ===== Footer ===== */
.footer { border-top: 1px solid var(--border); padding: 2rem 0; text-align: center; color: var(--muted); font-size: .9rem; }
.footer__links { margin-top: .7rem; display: flex; justify-content: center; gap: 1.2rem; }

/* ===== Reveal ===== */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
