:root {
  --bg: #07090d;
  --bg-soft: #0d1117;
  --panel: #10151d;
  --panel-2: #141b25;
  --line: #1e2733;
  --line-soft: #172030;
  --fg: #e8edf5;
  --fg-dim: #9aa8bd;
  --fg-faint: #64748b;
  --accent: #5eead4;
  --accent-2: #818cf8;
  --accent-3: #f0abfc;
  --warm: #fbbf24;
  --maxw: 1120px;
  --r: 14px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 600px at 12% -8%, rgba(94, 234, 212, .10), transparent 60%),
    radial-gradient(800px 700px at 95% 8%, rgba(129, 140, 248, .11), transparent 62%),
    radial-gradient(700px 500px at 50% 105%, rgba(240, 171, 252, .06), transparent 60%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .5;
  background-image:
    linear-gradient(rgba(255,255,255,.017) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.017) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 100% 70% at 50% 0%, #000 30%, transparent 85%);
}

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

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

/* ---------- nav ---------- */
nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(7, 9, 13, .78);
  border-bottom: 1px solid var(--line-soft);
}
nav .wrap { display: flex; align-items: center; gap: 26px; height: 58px; }
.brand {
  font-family: var(--mono); font-size: 14px; font-weight: 600;
  color: var(--fg); letter-spacing: -.3px; white-space: nowrap;
}
.brand span { color: var(--accent); }
nav ul { display: flex; gap: 22px; list-style: none; margin: 0 0 0 auto; padding: 0; }
nav ul a {
  font-size: 13.5px; color: var(--fg-dim); font-weight: 500;
  text-decoration: none; transition: color .16s;
}
nav ul a:hover { color: var(--fg); text-decoration: none; }
@media (max-width: 820px) { nav ul { display: none; } }

/* ---------- hero ---------- */
header.hero { padding: 84px 0 64px; }
.eyebrow {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 1.6px;
  text-transform: uppercase; color: var(--accent); margin-bottom: 18px;
  display: flex; align-items: center; gap: 10px;
}
.eyebrow::before {
  content: ""; width: 26px; height: 1px; background: var(--accent); opacity: .6;
}
h1 {
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  line-height: 1.03; margin: 0 0 20px; letter-spacing: -2.4px; font-weight: 700;
}
h1 .grad {
  background: linear-gradient(103deg, var(--accent) 0%, var(--accent-2) 52%, var(--accent-3) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tagline {
  font-size: clamp(1.05rem, 2.3vw, 1.32rem); color: var(--fg-dim);
  max-width: 64ch; margin: 0 0 14px; line-height: 1.58;
}
.tagline strong { color: var(--fg); font-weight: 600; }
.subline { color: var(--fg-faint); font-size: 15px; max-width: 62ch; margin: 0 0 30px; }

.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 42px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; font-size: 14.5px; font-weight: 500;
  border: 1px solid var(--line); color: var(--fg); background: var(--panel);
  transition: all .17s; text-decoration: none;
}
.btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.btn.primary {
  background: linear-gradient(103deg, var(--accent), var(--accent-2));
  color: #06131a; border-color: transparent; font-weight: 600;
}
.btn.primary:hover { color: #06131a; filter: brightness(1.08); }

/* ---------- stat strip ---------- */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px; background: var(--line-soft);
  border: 1px solid var(--line-soft); border-radius: var(--r); overflow: hidden;
}
.stat { background: var(--panel); padding: 20px 18px; }
.stat b {
  display: block; font-size: clamp(1.5rem, 3.4vw, 2rem); font-weight: 700;
  letter-spacing: -1px; line-height: 1.1; font-variant-numeric: tabular-nums;
}
.stat span {
  display: block; font-size: 11.5px; color: var(--fg-faint); margin-top: 5px;
  text-transform: uppercase; letter-spacing: .9px; font-family: var(--mono);
}
.stat:nth-child(1) b { color: var(--accent); }
.stat:nth-child(2) b { color: var(--accent-2); }
.stat:nth-child(3) b { color: var(--accent-3); }
.stat:nth-child(4) b { color: var(--warm); }
.stat:nth-child(5) b { color: var(--accent); }

/* ---------- sections ---------- */
section { padding: 66px 0; scroll-margin-top: 64px; }
.sec-head { margin-bottom: 32px; }
.sec-num {
  font-family: var(--mono); font-size: 12px; color: var(--accent);
  letter-spacing: 1.4px; display: block; margin-bottom: 8px;
}
h2 {
  font-size: clamp(1.7rem, 3.6vw, 2.3rem); margin: 0 0 8px;
  letter-spacing: -1.1px; font-weight: 700;
}
.sec-sub { color: var(--fg-dim); font-size: 15.5px; max-width: 70ch; margin: 0; }

/* ---------- project grid ---------- */
.proj-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px;
}
.proj {
  position: relative; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: var(--r); padding: 22px; overflow: hidden;
  transition: border-color .2s, transform .2s, background .2s;
}
.proj::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  opacity: 0; transition: opacity .2s;
}
.proj:hover { border-color: var(--line); transform: translateY(-3px); background: var(--panel-2); }
.proj:hover::before { opacity: 1; }
.proj-top { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.rank {
  font-family: var(--mono); font-size: 11.5px; color: var(--fg-faint);
  font-weight: 600; letter-spacing: .5px;
}
.proj h3 { font-size: 1.14rem; margin: 0; letter-spacing: -.5px; font-weight: 650; }
.proj h3 a { color: var(--fg); }
.proj h3 a:hover { color: var(--accent); text-decoration: none; }
.proj .slug {
  font-family: var(--mono); font-size: 11.5px; color: var(--fg-faint);
  margin: 2px 0 12px; word-break: break-all;
}
.proj .desc { font-size: 14.2px; color: var(--fg-dim); margin: 0 0 12px; line-height: 1.55; }
.proj .role {
  font-size: 13.4px; color: var(--fg-dim); margin: 0 0 16px; padding-left: 12px;
  border-left: 2px solid var(--line); line-height: 1.5;
}
.proj .role b { color: var(--accent); font-weight: 600; }
.proj-meta {
  display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin-top: auto;
  font-family: var(--mono); font-size: 11.5px;
}
.pill {
  padding: 3.5px 9px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--fg-dim); background: rgba(255,255,255,.015); white-space: nowrap;
}
.pill.commits { color: var(--accent); border-color: rgba(94,234,212,.28); background: rgba(94,234,212,.06); }
.pill.star { color: var(--warm); border-color: rgba(251,191,36,.25); background: rgba(251,191,36,.05); }
.pill.lang::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--d, var(--fg-faint)); margin-right: 6px; vertical-align: 1px;
}

/* ---------- heatmap ---------- */
.hm-panel {
  background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: var(--r); padding: 22px;
}
.hm-scroll { overflow-x: auto; padding-bottom: 6px; }
.hm-scroll::-webkit-scrollbar { height: 7px; }
.hm-scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
.hm-year { margin-bottom: 22px; }
.hm-year:last-child { margin-bottom: 0; }
.hm-year-head {
  display: flex; align-items: baseline; gap: 12px; margin-bottom: 9px;
}
.hm-year-head b { font-family: var(--mono); font-size: 14px; letter-spacing: .5px; }
.hm-year-head span { font-size: 12.5px; color: var(--fg-faint); font-family: var(--mono); }
/* fixed-width columns + start alignment: a partial year must end early,
   not stretch its weeks to fill the panel */
.hm-grid {
  display: grid; grid-auto-flow: column;
  grid-template-rows: repeat(7, 11px);
  grid-auto-columns: 11px;
  justify-content: start;
  gap: 3px;
  width: max-content;
}
.hm-d {
  width: 11px; height: 11px; border-radius: 2.5px; background: #161c25;
  transition: transform .1s;
}
.hm-d[data-l="1"] { background: #0f766e; }
.hm-d[data-l="2"] { background: #14b8a6; }
.hm-d[data-l="3"] { background: #5eead4; }
.hm-d[data-l="4"] { background: #a7f3e4; box-shadow: 0 0 7px rgba(94,234,212,.45); }
.hm-d:hover { transform: scale(1.5); z-index: 2; position: relative; }
.hm-legend {
  display: flex; align-items: center; gap: 7px; margin-top: 16px;
  font-size: 11.5px; color: var(--fg-faint); font-family: var(--mono);
}
.hm-legend .hm-d:hover { transform: none; }

/* ---------- language bar ---------- */
.langbar {
  display: flex; height: 9px; border-radius: 999px; overflow: hidden;
  margin: 26px 0 14px; background: var(--line-soft);
}
.langbar i { display: block; height: 100%; }
.langkeys { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12.5px; font-family: var(--mono); }
.langkeys span { color: var(--fg-dim); display: flex; align-items: center; gap: 7px; }
.langkeys i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.langkeys b { color: var(--fg); font-weight: 600; }

/* ---------- timeline ---------- */
.tl { position: relative; padding-left: 26px; }
.tl::before {
  content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 1px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2) 45%, var(--accent-3) 80%, transparent);
  opacity: .45;
}
.tl-year {
  position: relative; font-family: var(--mono); font-size: 1.25rem; font-weight: 700;
  margin: 34px 0 14px; letter-spacing: -.5px; color: var(--fg);
}
.tl-year:first-child { margin-top: 0; }
.tl-year::before {
  content: ""; position: absolute; left: -26px; top: 9px; width: 11px; height: 11px;
  border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(94,234,212,.13);
}
.tl-year small { font-family: var(--sans); font-size: 12.5px; color: var(--fg-faint); font-weight: 400; margin-left: 10px; letter-spacing: 0; }
.tl-items { display: flex; flex-direction: column; gap: 2px; }
.tl-row {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 14px;
  padding: 9px 13px; border-radius: 9px; border: 1px solid transparent;
  transition: background .15s, border-color .15s;
}
.tl-row:hover { background: var(--panel); border-color: var(--line-soft); }
.tl-name { font-size: 14px; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; min-width: 0; }
.tl-name a { color: var(--fg); font-weight: 500; }
.tl-name .org { color: var(--fg-faint); font-family: var(--mono); font-size: 12px; }
.tl-tag {
  font-family: var(--mono); font-size: 10.5px; padding: 1.5px 7px; border-radius: 5px;
  border: 1px solid var(--line); color: var(--fg-faint); text-transform: uppercase; letter-spacing: .5px;
}
.tl-right { display: flex; align-items: center; gap: 11px; }
.tl-bar { width: clamp(60px, 14vw, 150px); height: 5px; border-radius: 3px; background: var(--line-soft); overflow: hidden; }
.tl-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); border-radius: 3px; }
.tl-n {
  font-family: var(--mono); font-size: 12px; color: var(--fg-dim);
  min-width: 52px; text-align: right; font-variant-numeric: tabular-nums;
}
@media (max-width: 620px) {
  .tl-row { grid-template-columns: 1fr; gap: 7px; }
  .tl-bar { width: 100%; }
}

/* ---------- experience ---------- */
.xp { display: flex; flex-direction: column; gap: 14px; }
.xp-item {
  display: grid; grid-template-columns: 190px 1fr; gap: 26px;
  background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: var(--r); padding: 24px; transition: border-color .2s;
}
.xp-item:hover { border-color: var(--line); }
.xp-when {
  font-family: var(--mono); font-size: 12.5px; color: var(--accent);
  letter-spacing: .4px; padding-top: 3px;
}
.xp-when span { display: block; color: var(--fg-faint); margin-top: 6px; letter-spacing: 0; }
.xp h3 { margin: 0 0 3px; font-size: 1.1rem; letter-spacing: -.4px; font-weight: 650; }
.xp .org { color: var(--accent-2); font-weight: 600; font-size: 14px; margin-bottom: 11px; }
.xp p { margin: 0 0 9px; font-size: 14.3px; color: var(--fg-dim); line-height: 1.6; }
.xp p:last-child { margin-bottom: 0; }
.xp p strong { color: var(--fg); font-weight: 600; }
@media (max-width: 720px) {
  .xp-item { grid-template-columns: 1fr; gap: 12px; }
  .xp-when span { display: inline; margin-left: 10px; }
}

/* ---------- two column ---------- */
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 860px) { .cols { grid-template-columns: 1fr; } }
.card {
  background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: var(--r); padding: 24px;
}
.card h3 { margin: 0 0 4px; font-size: 1.06rem; letter-spacing: -.3px; }
.card .meta { font-family: var(--mono); font-size: 12px; color: var(--accent); margin-bottom: 12px; }
.card p { font-size: 14.2px; color: var(--fg-dim); margin: 0 0 9px; line-height: 1.6; }
.card p:last-child { margin-bottom: 0; }

.paper {
  border-left: 3px solid var(--accent-3);
  background: linear-gradient(94deg, rgba(240,171,252,.055), transparent 65%);
}
.paper .meta { color: var(--accent-3); }

/* ---------- skills ---------- */
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.skill-group {
  background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: var(--r); padding: 20px;
}
.skill-group h4 {
  margin: 0 0 13px; font-family: var(--mono); font-size: 11.5px;
  text-transform: uppercase; letter-spacing: 1.3px; color: var(--accent); font-weight: 600;
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 12.5px; padding: 4px 10px; border-radius: 7px;
  background: rgba(255,255,255,.028); border: 1px solid var(--line-soft); color: var(--fg-dim);
  transition: all .15s;
}
.tag:hover { border-color: var(--accent); color: var(--accent); }
.tag.hot { color: var(--fg); border-color: var(--line); background: rgba(94,234,212,.07); }

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--line-soft); padding: 46px 0 40px; margin-top: 30px;
}
.foot {
  display: flex; flex-wrap: wrap; gap: 20px;
  justify-content: space-between; align-items: center;
}
.foot-links { display: flex; flex-wrap: wrap; gap: 20px; font-size: 14px; }
.foot-note { font-size: 12.5px; color: var(--fg-faint); font-family: var(--mono); }

.reveal { opacity: 0; transform: translateY(16px); transition: opacity .55s ease, transform .55s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- contact link cards ---------- */
.linkgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.linkcard {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: var(--r); padding: 16px 18px; transition: border-color .15s, transform .15s;
}
.linkcard:hover { border-color: var(--accent); transform: translateY(-2px); }
.linkcard b { font-size: 15px; color: var(--fg); font-weight: 600; }
.linkcard span { font-size: 13px; color: var(--fg-faint); }

/* ---------- footer section nav ---------- */
.foot-nav {
  display: flex; flex-wrap: wrap; gap: 18px; margin-top: 26px;
  padding-top: 22px; border-top: 1px solid var(--line-soft);
  font-size: 13px; font-family: var(--mono);
}
.foot-nav a { color: var(--fg-faint); }
.foot-nav a:hover { color: var(--accent); }

/* brand is a link now; keep it looking like text */
a.brand:hover { text-decoration: none; }
.linkcard:hover, .linkcard b, .linkcard span { text-decoration: none; }
