/* =========================================================
   Design tokens
   ========================================================= */
:root {
  --bg: #0a0c10;
  --bg-alt: #0e1117;
  --surface: #131722;
  --surface-2: #181d29;
  --border: #232838;
  --border-soft: #1a1f2b;

  --text: #e9ebf1;
  --text-dim: #9aa3b7;
  --text-faint: #616a7d;

  --accent: #2563eb;
  --accent-bright: #4f83f7;
  --accent-soft: rgba(37, 99, 235, .13);
  --accent-2: #22c07a;
  --accent-2-soft: rgba(34, 192, 122, .13);

  --gh-0: #171b22;
  --gh-1: #123524;
  --gh-2: #175a37;
  --gh-3: #1f8a4d;
  --gh-4: #2fd47a;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;

  --container: 1160px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;

  --ease: cubic-bezier(.22, .8, .3, 1);
  --shadow-card: 0 1px 0 rgba(255,255,255,.02) inset, 0 8px 24px -12px rgba(0,0,0,.5);
}

/* =========================================================
   Reset
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
.mono { font-family: var(--font-mono); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--accent); color: #fff; padding: .6em 1em; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

section { padding: 110px 0; position: relative; }
@media (max-width: 720px) { section { padding: 72px 0; } }

.section-head { max-width: 640px; margin-bottom: 48px; }
.eyebrow {
  font-size: 13px;
  letter-spacing: .06em;
  color: var(--accent-bright);
  margin-bottom: 14px;
  display: block;
}
.section-head h2 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 650;
  letter-spacing: -.02em;
  margin-bottom: 12px;
}
.section-sub { color: var(--text-dim); font-size: 16px; max-width: 56ch; }

/* =========================================================
   Reveal-on-scroll
   Content is visible by default (progressive enhancement) so
   pages stay fully usable if JS fails to load. JS opts into
   the hidden/animated state by marking <body class="js-armed">.
   ========================================================= */
.reveal { transition: opacity .7s var(--ease), transform .7s var(--ease); }
body.js-armed .reveal { opacity: 0; transform: translateY(18px); }
body.js-armed .reveal.is-visible { opacity: 1; transform: none; }

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  transition: transform .25s var(--ease), background .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 20px -8px rgba(37, 99, 235, .55);
}
.btn-primary:hover { background: var(--accent-bright); }
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-bright); }
.btn-lg { padding: 16px 30px; font-size: 16px; }
.btn-sm { padding: 9px 16px; font-size: 13px; }

/* =========================================================
   Header / Nav
   ========================================================= */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(10, 12, 16, .7);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.site-header.scrolled {
  border-bottom-color: var(--border-soft);
  background: rgba(10, 12, 16, .88);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.nav-logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -.02em;
}
.nav-logo .dot { color: var(--accent-bright); }
.nav-menu {
  display: flex;
  align-items: center;
  gap: 34px;
}
.nav-menu a {
  font-size: 14.5px;
  color: var(--text-dim);
  transition: color .2s;
  position: relative;
  padding: 4px 0;
}
.nav-menu a:hover { color: var(--text); }
.nav-menu a.active { color: var(--text); }
.nav-menu a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 2px;
  background: var(--accent-bright);
  border-radius: 2px;
}
.nav-cta {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 16px !important;
  color: var(--text) !important;
}
.nav-cta:hover { border-color: var(--accent); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 34px; height: 34px;
  align-items: center;
  justify-content: center;
}
.nav-toggle span {
  width: 20px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .3s var(--ease), opacity .3s var(--ease);
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .nav-menu {
    position: fixed;
    top: 68px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border-soft);
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s var(--ease);
  }
  .nav-menu.open { max-height: 420px; }
  .nav-menu li { border-top: 1px solid var(--border-soft); }
  .nav-menu a { display: block; padding: 16px 24px; }
  .nav-cta { margin: 16px 24px; text-align: center; }
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
  padding-top: 168px;
  padding-bottom: 100px;
  background:
    radial-gradient(700px 420px at 85% -10%, var(--accent-soft), transparent 65%);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 64px;
  align-items: center;
}
.hero-title {
  font-size: clamp(38px, 5.4vw, 60px);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.05;
  margin: 6px 0 20px;
}
.hero-lede {
  font-size: 18px;
  color: var(--text-dim);
  max-width: 52ch;
  margin-bottom: 34px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 30px; }
.hero-links { display: flex; gap: 22px; flex-wrap: wrap; }
.hero-link {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--text-dim); font-size: 14px; font-weight: 500;
  transition: color .2s;
}
.hero-link:hover { color: var(--accent-bright); }
.hero-link .icon { width: 16px; height: 16px; }

.terminal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.terminal-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface-2);
}
.terminal-bar .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }
.terminal-title { margin-left: 6px; font-size: 12.5px; color: var(--text-faint); }
.terminal-body {
  padding: 22px 20px 28px;
  font-size: 14px;
  line-height: 1.9;
  min-height: 220px;
  color: var(--accent-2);
  white-space: pre-wrap;
}

@media (max-width: 940px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 130px; }
  .hero-visual { order: -1; }
}

/* =========================================================
   GitHub section
   ========================================================= */
.github-section {
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}
.gh-profile-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  margin-bottom: 28px;
}
.gh-identity { display: flex; align-items: center; gap: 14px; }
.gh-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
}
.gh-username { font-size: 15px; color: var(--text); margin-bottom: 4px; }
.gh-stat-line { font-size: 13.5px; color: var(--text-dim); }
.gh-stat-line strong { color: var(--accent-2); font-weight: 600; }

.contrib-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 22px 18px;
  margin-bottom: 40px;
  box-shadow: var(--shadow-card);
}
.contrib-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; flex-wrap: wrap; gap: 10px;
}
.contrib-head .label { font-size: 12.5px; color: var(--text-faint); letter-spacing: .04em; }
.contrib-legend { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-faint); }
.contrib-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin: 0 1px; }
.contrib-graph-wrap { overflow-x: auto; }
.contrib-graph { min-width: 640px; width: 100%; filter: saturate(1.05); }

.repo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
@media (max-width: 940px) { .repo-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .repo-grid { grid-template-columns: 1fr; } }

.repo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.repo-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-2);
  box-shadow: 0 14px 30px -16px rgba(34, 192, 122, .35);
}
.repo-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.repo-name { font-size: 15.5px; font-weight: 650; color: var(--text); word-break: break-word; }
.repo-desc { font-size: 13.5px; color: var(--text-dim); flex-grow: 1; }
.repo-meta { display: flex; align-items: center; gap: 14px; font-size: 12.5px; color: var(--text-faint); flex-wrap: wrap; }
.repo-meta .lang-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 5px; background: var(--accent-bright); }
.repo-meta span { display: inline-flex; align-items: center; }

.skeleton {
  position: relative;
  overflow: hidden;
  min-height: 150px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.skeleton::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.04), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* =========================================================
   Work / Projects
   ========================================================= */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}
@media (max-width: 780px) { .project-grid { grid-template-columns: 1fr; } }

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.project-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: var(--shadow-card);
}
.project-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.project-name { font-size: 19px; font-weight: 650; letter-spacing: -.01em; }
.project-links { display: flex; gap: 10px; flex-shrink: 0; }
.icon-link {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  color: var(--text-dim);
  transition: color .2s, border-color .2s, transform .2s;
}
.icon-link:hover { color: var(--accent-bright); border-color: var(--accent); transform: translateY(-2px); }
.icon-link svg { width: 15px; height: 15px; }
.project-desc { color: var(--text-dim); font-size: 14.5px; flex-grow: 1; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 100px;
  background: var(--accent-soft);
  color: var(--accent-bright);
  border: 1px solid rgba(37, 99, 235, .25);
}
.project-foot { display: flex; align-items: center; gap: 16px; font-size: 12.5px; color: var(--text-faint); }

/* =========================================================
   Experience timeline
   ========================================================= */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: "";
  position: absolute; left: 5px; top: 8px; bottom: 8px;
  width: 1px;
  background: var(--border);
}
.timeline-item { position: relative; margin-bottom: 8px; }
.timeline-marker {
  position: absolute; left: -28px; top: 6px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.timeline-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 28px;
}
.timeline-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.timeline-top h3 { font-size: 19px; font-weight: 650; }
.timeline-date { font-size: 13px; color: var(--text-faint); white-space: nowrap; }
.timeline-org { color: var(--accent-bright); font-size: 14.5px; margin-bottom: 16px; }
.timeline-points { margin-bottom: 18px; }
.timeline-points li {
  position: relative;
  padding-left: 20px;
  font-size: 14.5px;
  color: var(--text-dim);
  margin-bottom: 9px;
  line-height: 1.6;
}
.timeline-points li::before {
  content: "";
  position: absolute; left: 4px; top: 9px;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent-2);
}

/* =========================================================
   About
   ========================================================= */
.about-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 56px; }
.about-body p { color: var(--text-dim); font-size: 16.5px; margin-bottom: 18px; line-height: 1.75; }
.about-body p:last-child { margin-bottom: 0; }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; gap: 20px; } }

/* =========================================================
   Skills
   ========================================================= */
.skills-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px 48px; }
@media (max-width: 780px) { .skills-grid { grid-template-columns: 1fr; } }
.skill-group h3 {
  font-size: 12.5px;
  letter-spacing: .06em;
  color: var(--text-faint);
  margin-bottom: 14px;
  text-transform: uppercase;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  font-size: 13.5px;
  padding: 8px 14px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  transition: color .2s, border-color .2s, transform .2s;
}
.chip:hover { color: var(--text); border-color: var(--accent); transform: translateY(-2px); }

/* =========================================================
   Education
   ========================================================= */
.edu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 780px) { .edu-grid { grid-template-columns: 1fr; } }
.edu-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px;
}
.edu-card h3 { font-size: 17px; font-weight: 650; margin-bottom: 10px; }
.edu-formerly { font-weight: 400; color: var(--text-faint); font-size: 13.5px; }
.edu-meta { font-size: 13.5px; color: var(--text-dim); margin-bottom: 4px; }

/* =========================================================
   Contact
   ========================================================= */
.contact-section { text-align: center; }
.contact-inner { display: flex; flex-direction: column; align-items: center; }
.contact-inner .eyebrow { }
.contact-inner h2 { font-size: clamp(30px, 5vw, 46px); margin-bottom: 16px; }
.contact-inner .section-sub { margin: 0 auto 36px; }
.contact-links {
  margin-top: 28px;
  display: flex; align-items: center; gap: 12px;
  font-size: 14.5px; color: var(--text-dim);
  flex-wrap: wrap; justify-content: center;
}
.contact-links a { transition: color .2s; }
.contact-links a:hover { color: var(--accent-bright); }
.contact-links span { color: var(--text-faint); }

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  border-top: 1px solid var(--border-soft);
  padding: 28px 0 40px;
}
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  font-size: 13px; color: var(--text-faint);
}
.back-to-top { color: var(--text-dim); transition: color .2s; }
.back-to-top:hover { color: var(--accent-bright); }
