:root {
  --navy-900: #0a1830;
  --navy-800: #0f2140;
  --navy-700: #16305a;
  --blue-600: #2f6fed;
  --blue-500: #4f8cf7;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --text-soft: #94a3b8;
  --bg: #f5f7fb;
  --card-bg: #ffffff;
  --card-border: #e8ecf3;
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 1px rgba(15, 23, 42, 0.03);
  --shadow-md: 0 8px 24px -8px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 16px 40px -12px rgba(15, 23, 42, 0.18);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 64px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: linear-gradient(135deg, var(--navy-900), var(--navy-700));
  color: #fff;
  padding: 44px 32px 38px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 15% 20%, rgba(79,140,247,0.28) 0, transparent 2px),
    radial-gradient(circle at 45% 60%, rgba(79,140,247,0.22) 0, transparent 2px),
    radial-gradient(circle at 75% 30%, rgba(79,140,247,0.28) 0, transparent 2px),
    radial-gradient(circle at 90% 70%, rgba(79,140,247,0.22) 0, transparent 2px),
    radial-gradient(circle at 60% 85%, rgba(79,140,247,0.16) 0, transparent 2px);
  background-size: 400px 400px;
  pointer-events: none;
}
.hero-bg::before,
.hero-bg::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
}
.hero-bg::before { background: #2f6fed; top: -180px; right: -100px; }
.hero-bg::after { background: #7c3aed; bottom: -220px; left: -80px; opacity: 0.22; }

.hero-inner { position: relative; max-width: 1200px; margin: 0 auto; }

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 16px;
}

.badge-row { display: flex; gap: 10px; }

.tech-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease);
}
.tech-badge:hover { transform: translateY(-2px) scale(1.04); }
.badge-angular { background: #fde8ea; }
.badge-dotnet { background: #ece4fb; }
.badge-rust { background: #f1f2f4; }

.icon-24 { width: 24px; height: 24px; }
.icon-20 { width: 20px; height: 20px; }
.icon-16 { width: 16px; height: 16px; }
.icon-32 { width: 32px; height: 32px; }
.sq-icon { border-radius: 4px; }

.hero-tagline {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-weight: 600;
  color: #dbe7ff;
  font-size: 15px;
}
.hero-tagline .code-tag {
  margin-top: 6px;
  color: var(--blue-500);
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
}

.hero-title-block h1 {
  margin: 0;
  font-size: clamp(28px, 4.5vw, 46px);
  letter-spacing: 1px;
  font-weight: 800;
}
.title-white { color: #fff; }
.title-blue { color: var(--blue-500); }

.hero-subtitle {
  margin: 6px 0 0;
  letter-spacing: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #cdd9f0;
}

.hero-divider {
  height: 1px;
  background: rgba(255,255,255,0.15);
  margin: 16px 0;
  max-width: 460px;
}

.hero-tags {
  margin: 0;
  color: #9fb4dd;
  font-size: 13px;
  letter-spacing: 1px;
  font-weight: 500;
}

/* ---------- Contact bar ---------- */
.contact-bar {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 22px 32px;
}

.contact-buttons { display: flex; gap: 10px; flex-wrap: wrap; }

.btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--navy-800);
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}
.btn-pill:hover { transform: translateY(-2px); background: var(--navy-700); box-shadow: var(--shadow-md); }
.btn-pill-dark { background: #111827; }

.contact-meta {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
}
.meta-item { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Section nav ---------- */
.section-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 10px 32px;
  background: rgba(247, 249, 252, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--card-border);
  scrollbar-width: none;
}
.section-nav::-webkit-scrollbar { display: none; }
.section-nav a {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.section-nav a:hover { background: #eaf2ff; color: var(--blue-600); }
.section-nav a.active { background: var(--navy-900); color: #fff; }

@media (max-width: 900px) {
  .section-nav { padding: 10px 18px; }
}

/* ---------- Layout ---------- */
.content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 32px 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

@media (max-width: 900px) {
  .content { grid-template-columns: 1fr; padding: 16px 18px 32px; }
  .hero { padding: 32px 18px 28px; }
  .contact-bar { padding: 20px 18px; }
}

.section { margin-bottom: 34px; }

/* Gentle entrance animation — pure CSS, so content is never left invisible
   waiting on a script (e.g. a slow/failed IntersectionObserver). */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.section { animation: fadeInUp 0.6s var(--ease) both; }
.col-left .section:nth-of-type(1) { animation-delay: 0.05s; }
.col-left .section:nth-of-type(2) { animation-delay: 0.12s; }
.col-left .section:nth-of-type(3) { animation-delay: 0.19s; }
.col-left .section:nth-of-type(4) { animation-delay: 0.26s; }
.col-right .section:nth-of-type(1) { animation-delay: 0.08s; }
.col-right .section:nth-of-type(2) { animation-delay: 0.16s; }
.col-right .section:nth-of-type(3) { animation-delay: 0.24s; }
.col-right .section:nth-of-type(4) { animation-delay: 0.32s; }

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--navy-900);
  margin: 0 0 14px;
}
.section-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--navy-900);
  color: #fff;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
}

/* ---------- Cards ---------- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s var(--ease), transform 0.25s var(--ease), border-color 0.25s var(--ease);
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: #dbe4f3;
}

/* Profile */
.profile-card { display: flex; gap: 16px; }
.profile-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #eaf2ff;
  color: var(--blue-600);
  display: flex;
  align-items: center;
  justify-content: center;
}
.profile-text p { margin: 0 0 10px; line-height: 1.6; color: var(--text-dark); font-size: 14px; }
.profile-text .lead { font-weight: 700; font-size: 15px; }
.profile-text p:last-child { margin-bottom: 0; }
.inline-link { color: var(--blue-600); font-weight: 600; text-decoration: none; }
.inline-link:hover { text-decoration: underline; }

/* Currently */
.currently-card {
  border-left: 3px solid var(--card-border);
  margin-bottom: 14px;
}
.currently-card.border-blue { border-left-color: var(--blue-500); }
.currently-card.border-green { border-left-color: #22c58b; }
.currently-card.border-purple { border-left-color: #8b5cf6; }

.currently-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.currently-title { display: flex; align-items: center; gap: 10px; }
.currently-title h3 { margin: 0; font-size: 15px; font-weight: 700; }

.chip-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.chip-blue { background: #eaf2ff; color: var(--blue-600); }
.chip-dark { background: #1f2937; }
.chip-purple { background: #f1e9fe; color: #8b5cf6; }
.chip-green { background: #e3faf0; color: #16a34a; }
.chip-teal { background: #e6fbfa; color: #0d9488; }
.chip-logo { background: #fff; border: 1px solid var(--card-border); padding: 4px; }
.chip-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 6px; }

.tag-status {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 4px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.status-build { background: #eaf2ff; color: var(--blue-600); }
.status-explore { background: #e3faf0; color: #16a34a; }
.status-maintain { background: #f1e9fe; color: #8b5cf6; }

.currently-card p { margin: 0 0 10px; font-size: 13.5px; color: var(--text-muted); }

.pill-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}
.pill-red { background: #fde8ea; color: #dc2626; }
.pill-purple { background: #f1e9fe; color: #8b5cf6; }
.pill-blue { background: #eaf2ff; color: var(--blue-600); }
.pill-orange { background: #fff1e6; color: #ea580c; }
.pill-teal { background: #e6fbfa; color: #0d9488; }
.pill-green { background: #e3faf0; color: #16a34a; }
.pill-indigo { background: #e9ecff; color: #4f46e5; }

/* Stack */
.stack-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 480px) { .stack-grid { grid-template-columns: 1fr; } }

.stack-card h4 { margin: 0 0 12px; font-size: 14px; font-weight: 700; }
.icon-strip { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; min-height: 26px; }
.tech-icon { width: 26px; height: 26px; }
.stack-desc { margin: 0; font-size: 12.5px; color: var(--text-muted); }

/* Education */
.edu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 480px) { .edu-grid { grid-template-columns: 1fr; } }
.edu-card h4 { margin: 0 0 6px; font-size: 15px; font-weight: 800; }
.edu-card p { margin: 0 0 10px; font-size: 13px; color: var(--text-muted); }
.year-badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: #eaf2ff;
  color: var(--blue-600);
}

/* Selected work */
.work-card {
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
}
.work-body h4 { margin: 0 0 4px; font-size: 15px; font-weight: 700; }
.work-body p { margin: 0 0 10px; font-size: 13.5px; color: var(--text-muted); line-height: 1.5; }
.note-text { font-size: 12px !important; color: var(--text-soft) !important; margin-top: 6px !important; }
.ext-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--blue-600);
  text-decoration: none;
}
.ext-link:hover { text-decoration: underline; }

/* Open source */
.os-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.os-head h4 { margin: 0; font-size: 16px; font-weight: 800; flex: 1; }
.os-card p { margin: 0; font-size: 13.5px; color: var(--text-muted); line-height: 1.6; }

/* Systems exploration */
.systems-wrap {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 14px;
}
@media (max-width: 700px) { .systems-wrap { grid-template-columns: 1fr; } }

.systems-flow { display: flex; flex-direction: column; }
.flow-step { display: flex; align-items: center; gap: 12px; }
.flow-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #eaf2ff;
  color: var(--blue-600);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.flow-title { margin: 0; font-size: 13px; font-weight: 800; letter-spacing: 0.5px; }
.flow-desc { margin: 2px 0 0; font-size: 12px; color: var(--text-muted); }
.flow-arrow { text-align: center; color: var(--text-soft); font-size: 16px; padding: 4px 0; margin-left: 19px; }

.systems-note {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px 20px;
  font-size: 13px;
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
}
.systems-note p { margin: 0 0 8px; }
.systems-note p:last-child { margin-bottom: 0; }
.note-strong { color: var(--navy-900); font-weight: 700; }

/* GitHub */
.gh-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 700px) { .gh-grid { grid-template-columns: 1fr; } }
.gh-card { color: var(--blue-600); }
.gh-card h4 { margin: 10px 0 4px; font-size: 13.5px; font-weight: 700; color: var(--navy-900); }
.gh-card p { margin: 0 0 8px; font-size: 12px; color: var(--text-muted); }
.gh-card-streak { display: flex; flex-direction: column; }
.gh-streak-img { width: 100%; height: auto; margin-bottom: 8px; border-radius: 8px; }

/* Footer */
.site-footer {
  text-align: center;
  padding: 32px 20px 40px;
  border-top: 1px solid var(--card-border);
  margin-top: 10px;
}
.footer-name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--navy-900);
  margin: 0 0 14px;
}
.footer-quote {
  font-style: italic;
  color: var(--text-muted);
  margin: 0 0 14px;
  font-size: 14px;
}
.footer-views {
  font-size: 12.5px;
  color: var(--text-soft);
  margin: 0;
}
