:root{
  --bg:#f7f7fb;
  --bg-elev:#ffffff;
  --text:#15161d;
  --text-dim:#565a6e;
  --border:#e4e4ee;
  --accent:#5b5bff;
  --accent-2:#00c2a8;
  --grad: linear-gradient(120deg, var(--accent), var(--accent-2));
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --sans: 'Inter', system-ui, sans-serif;
  --shadow: 0 8px 30px -12px rgba(20,20,40,.15);
  --radius: 16px;
}

@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg:#0b0c12;
    --bg-elev:#14151d;
    --text:#eceef5;
    --text-dim:#9498ab;
    --border:#242634;
    --shadow: 0 8px 30px -12px rgba(0,0,0,.5);
  }
}
:root[data-theme="dark"]{
  --bg:#0b0c12;
  --bg-elev:#14151d;
  --text:#eceef5;
  --text-dim:#9498ab;
  --border:#242634;
  --shadow: 0 8px 30px -12px rgba(0,0,0,.5);
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:var(--sans);
  line-height:1.55;
  -webkit-font-smoothing:antialiased;
}
a{color:inherit}
img{max-width:100%;display:block}

.bg-grid{
  position:fixed; inset:0; z-index:-1;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size:48px 48px;
  mask-image:radial-gradient(ellipse 80% 60% at 50% 0%, black 40%, transparent 100%);
  opacity:.5;
}

.nav{
  position:sticky; top:0; z-index:50;
  background:color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter:blur(10px);
  border-bottom:1px solid var(--border);
}
.nav-inner{
  max-width:1080px; margin:0 auto; padding:14px 24px;
  display:flex; align-items:center; justify-content:space-between; gap:16px;
}
.brand{ font-family:var(--mono); font-weight:700; font-size:1.1rem; text-decoration:none; }
.brand .dot{ color:var(--accent) }
.nav-links{ display:flex; gap:24px; }
.nav-links a{ text-decoration:none; font-size:.92rem; color:var(--text-dim); font-weight:500; transition:color .15s; }
.nav-links a:hover{ color:var(--text) }

.theme-toggle{
  width:36px; height:36px; border-radius:10px; border:1px solid var(--border);
  background:var(--bg-elev); color:var(--text); cursor:pointer;
  display:flex; align-items:center; justify-content:center;
}
.theme-toggle:hover{ border-color:var(--accent) }

main{ max-width:1080px; margin:0 auto; padding:0 24px; }

.hero{
  display:flex; align-items:center; justify-content:space-between; gap:48px;
  padding:88px 0 64px;
}
.hero-inner{ max-width:620px }
.eyebrow{ font-family:var(--mono); color:var(--accent); font-size:.85rem; margin:0 0 12px; letter-spacing:.02em; }
.hero h1{ font-size:clamp(2rem, 5vw, 2.8rem); line-height:1.15; margin:0 0 18px; font-weight:800; letter-spacing:-.02em; }
.grad{ background:var(--grad); -webkit-background-clip:text; background-clip:text; color:transparent; }
.lede{ color:var(--text-dim); font-size:1.08rem; margin:0 0 28px; }
.lede strong{ color:var(--text) }

.hero-actions{ display:flex; flex-wrap:wrap; gap:12px; margin-bottom:36px; }
.btn{
  display:inline-flex; align-items:center; gap:8px;
  padding:11px 20px; border-radius:999px; text-decoration:none;
  font-weight:600; font-size:.92rem; border:1px solid transparent; transition:.15s;
}
.btn-primary{ background:var(--text); color:var(--bg); }
.btn-primary:hover{ opacity:.85 }
.btn-ghost{ border-color:var(--border); color:var(--text); }
.btn-ghost:hover{ border-color:var(--accent); color:var(--accent); }

.hero-stats{ display:flex; gap:32px; }
.stat{ display:flex; flex-direction:column; }
.stat strong{ font-size:1.4rem; font-weight:800; }
.stat span{ color:var(--text-dim); font-size:.8rem; }

.hero-avatar img{
  width:200px; height:200px; border-radius:28px; object-fit:cover;
  border:1px solid var(--border); box-shadow:var(--shadow);
}

.section{ padding:56px 0; border-top:1px solid var(--border); }
.section-title{ display:flex; align-items:center; gap:12px; font-size:1.5rem; margin:0 0 8px; letter-spacing:-.01em; }
.section-title .tag{
  font-family:var(--mono); font-size:.75rem; color:var(--accent);
  border:1px solid var(--border); border-radius:6px; padding:2px 8px;
}
.section-sub{ color:var(--text-dim); margin:0 0 32px; }
.section-sub a{ color:var(--accent); text-decoration:none; }
.section-sub a:hover{ text-decoration:underline; }

.about-grid p{ color:var(--text-dim); max-width:760px; }
.about-grid p strong{ color:var(--text); }

.skills-grid{ display:grid; grid-template-columns:repeat(auto-fit, minmax(220px,1fr)); gap:16px; }
.skill-card{
  background:var(--bg-elev); border:1px solid var(--border); border-radius:var(--radius);
  padding:22px;
}
.skill-card h3{ margin:0 0 14px; font-size:1rem; }
.chips{ list-style:none; margin:0; padding:0; display:flex; flex-wrap:wrap; gap:8px; }
.chips li{
  font-family:var(--mono); font-size:.78rem; padding:5px 10px; border-radius:8px;
  background:color-mix(in srgb, var(--accent) 12%, transparent); color:var(--accent);
}

.project-grid{
  display:grid; grid-template-columns:repeat(auto-fill, minmax(260px,1fr)); gap:16px;
}
.project-card{
  background:var(--bg-elev); border:1px solid var(--border); border-radius:var(--radius);
  padding:20px; text-decoration:none; color:var(--text); display:flex; flex-direction:column; gap:10px;
  transition:transform .15s, border-color .15s, box-shadow .15s;
}
.project-card:hover{ transform:translateY(-3px); border-color:var(--accent); box-shadow:var(--shadow); }
.project-card h3{ margin:0; font-size:1.02rem; font-family:var(--mono); word-break:break-word; }
.project-card p{ margin:0; color:var(--text-dim); font-size:.88rem; flex-grow:1; }
.project-meta{ display:flex; align-items:center; gap:14px; font-size:.78rem; color:var(--text-dim); }
.lang-dot{ width:9px; height:9px; border-radius:50%; display:inline-block; margin-right:5px; }
.project-empty, .project-error{ color:var(--text-dim); font-size:.9rem; }

.contact-links{ display:flex; gap:14px; flex-wrap:wrap; }
.contact-card{
  display:flex; align-items:center; gap:10px; text-decoration:none; color:var(--text);
  border:1px solid var(--border); background:var(--bg-elev); border-radius:12px; padding:14px 20px;
  font-weight:600; font-size:.92rem; transition:.15s;
}
.contact-card:hover{ border-color:var(--accent); color:var(--accent); }

.footer{ text-align:center; padding:32px 24px 48px; color:var(--text-dim); font-size:.82rem; }

@media (max-width: 760px){
  .hero{ flex-direction:column-reverse; text-align:center; padding-top:56px; }
  .hero-actions, .hero-stats{ justify-content:center; }
  .nav-links{ display:none; }
}
