:root {
  --bg: #f8fafc;
  --bg-alt: #eef2f7;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --border: #dbe3ee;
  --accent: #0284c7;
  --accent-2: #7c3aed;
  --term-bg: #0f172a;
  --term-text: #e2e8f0;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #070b14;
    --bg-alt: #0c1220;
    --surface: #111a2b;
    --text: #e6edf7;
    --muted: #94a3b8;
    --border: #1e2a40;
    --accent: #38bdf8;
    --accent-2: #a78bfa;
    --term-bg: #0b1120;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }
.dim { color: var(--muted); }
.container { width: min(1100px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(680px, 100% - 32px); }
.center { text-align: center; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { font-weight: 600; letter-spacing: -0.02em; }
.logo-mark { color: var(--accent); }
.nav-links { display: flex; gap: 28px; align-items: center; font-size: 0.95rem; }
.nav-links a:not(.btn) { color: var(--muted); transition: color .2s; }
.nav-links a:not(.btn):hover { color: var(--text); }
.menu-btn { display: none; background: none; border: 0; color: var(--text); font-size: 1.4rem; cursor: pointer; }

/* Buttons */
.btn {
  display: inline-block; padding: 12px 22px; border-radius: 999px;
  background: var(--text); color: var(--bg); font-weight: 500;
  transition: transform .15s, opacity .2s;
}
.btn:hover { transform: translateY(-1px); opacity: .9; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-sm { padding: 7px 16px; font-size: .9rem; }
.btn-lg { padding: 16px 30px; font-size: 1.1rem; margin-top: 8px; }

/* Hero */
.hero { position: relative; overflow: hidden; padding: 96px 0 88px; }
#net { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; }
.hero-inner { position: relative; }
.kicker { font-size: .85rem; color: var(--muted); display: flex; align-items: center; gap: 8px; margin-bottom: 20px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.18); }
h1 { font-size: clamp(2.2rem, 6vw, 4rem); line-height: 1.08; letter-spacing: -0.035em; font-weight: 600; max-width: 18ch; }
.grad { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { color: var(--muted); font-size: 1.15rem; max-width: 60ch; margin: 22px 0 32px; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; }

.terminal {
  margin-top: 56px; max-width: 520px; border-radius: var(--radius);
  background: var(--term-bg); color: var(--term-text);
  border: 1px solid var(--border); box-shadow: 0 20px 50px -20px rgba(2,8,23,.45);
  font-size: .88rem; overflow: hidden;
}
.term-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.term-bar i { width: 10px; height: 10px; border-radius: 50%; background: #334155; }
.term-bar span { margin-left: 8px; color: #64748b; font-size: .8rem; }
.terminal pre { padding: 16px 18px; white-space: pre-wrap; }
.terminal .p { color: #38bdf8; }
.terminal .o { color: #94a3b8; }
.cursor { animation: blink 1s steps(1) infinite; color: #38bdf8; }
@keyframes blink { 50% { opacity: 0; } }

/* Sections */
.section { padding: 96px 0; }
.section.alt { background: var(--bg-alt); }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); letter-spacing: -0.03em; font-weight: 600; margin-bottom: 36px; }
h3 { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; }

.two-col { display: grid; grid-template-columns: 1fr 2fr; gap: 48px; }
.avatar {
  width: 140px; height: 140px; border-radius: 28px; display: grid; place-items: center;
  font-size: 2.4rem; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.prose p { color: var(--muted); font-size: 1.08rem; margin-bottom: 18px; }
.prose strong { color: var(--text); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 32px; }
.stats li { border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; background: var(--surface); font-size: 1.8rem; font-weight: 600; }
.stats span { display: block; font-size: .85rem; font-weight: 400; color: var(--muted); }

.grid { display: grid; gap: 20px; }
.cards { grid-template-columns: repeat(4, 1fr); }
.card, .project {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; transition: transform .2s, border-color .2s;
}
.card:hover, .project:hover { transform: translateY(-3px); border-color: var(--accent); }
.card .icon { font-size: 1.6rem; margin-bottom: 14px; }
.card p, .project p { color: var(--muted); margin-top: 8px; font-size: .97rem; }
.tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 36px; }
.tags span { padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px; font-size: .88rem; color: var(--muted); background: var(--surface); }

.projects { grid-template-columns: repeat(3, 1fr); }
.project-top { display: flex; justify-content: space-between; color: var(--muted); margin-bottom: 18px; font-size: .9rem; }
.project-top a { font-size: 1.2rem; color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chips li { font-size: .75rem; padding: 3px 10px; border-radius: 6px; background: var(--bg-alt); color: var(--accent); }

.timeline { border-left: 2px solid var(--border); margin-left: 6px; }
.timeline li { position: relative; padding: 0 0 36px 32px; }
.timeline li::before {
  content: ""; position: absolute; left: -8px; top: 6px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg-alt); border: 2px solid var(--accent);
}
.when { font-size: .82rem; color: var(--accent); }
.timeline p { color: var(--muted); margin-top: 4px; }

.contact h2 { margin-bottom: 12px; }
.contact .lead { margin-inline: auto; }
.socials { display: flex; gap: 24px; justify-content: center; margin-top: 32px; }
.socials a { color: var(--muted); border-bottom: 1px solid transparent; transition: color .2s, border-color .2s; }
.socials a:hover { color: var(--text); border-color: var(--accent); }

.footer { border-top: 1px solid var(--border); padding: 28px 0; font-size: .82rem; color: var(--muted); text-align: center; }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  .cursor { animation: none; }
}

/* Responsive */
@media (max-width: 900px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .projects { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; gap: 24px; }
  .avatar { width: 96px; height: 96px; font-size: 1.7rem; border-radius: 20px; }
}
@media (max-width: 640px) {
  .menu-btn { display: block; }
  .nav-links {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; gap: 18px; padding: 24px 16px;
    background: var(--bg); border-bottom: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .cards { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .section { padding: 72px 0; }
  .hero { padding: 64px 0; }
}
