/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
html { scroll-behavior: smooth; }

/* ── Body bg ───────────────────────────────────────────── */
body {
  font-family: "Inter", system-ui, sans-serif;
  position: relative;
  background-color: #f0f6ff;
  background-image: radial-gradient(rgba(9,105,218,0.11) 1px, transparent 1px);
  background-size: 28px 28px;
}
.dark body {
  background-color: #0d1117;
  background-image: radial-gradient(rgba(88,166,255,0.09) 1px, transparent 1px);
}

/* light mode ambient mesh */
body::after {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 10% 0%,   rgba(9,105,218,0.07)  0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 100%,  rgba(88,166,255,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 40% 30% at 50% 50%,   rgba(120,90,255,0.03) 0%, transparent 70%);
}
.dark body::after { display: none; }

header, main, footer { position: relative; z-index: 1; }

/* sections: offset for sticky header */
section[id] { scroll-margin-top: 80px; }

/* ── Particles canvas ──────────────────────────────────── */
#heroParticles {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0; opacity: 0.45;
}

/* ── Header / Brand ────────────────────────────────────── */
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 0.95rem; }
.brand-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #0969da, #58a6ff);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700; color: #fff;
  box-shadow: 0 0 12px rgba(9,105,218,0.4); flex-shrink: 0;
}

.nav-link {
  padding: 5px 10px; border-radius: 6px; font-size: 0.75rem; font-weight: 500;
  opacity: 0.6; transition: opacity 0.2s, background 0.2s;
}
.nav-link:hover, .nav-link.active { opacity: 1; background: rgba(9,105,218,0.1); }
.dark .nav-link:hover, .dark .nav-link.active { background: rgba(88,166,255,0.12); }

.theme-btn {
  padding: 6px 10px; border-radius: 8px; font-size: 0.85rem;
  border: 1px solid #d0d7de; background: #f6f8fa;
  transition: background 0.2s, transform 0.15s;
}
.dark .theme-btn { border-color: #30363d; background: #1f242c; }
.theme-btn:hover { transform: scale(1.06); }
.dark .theme-btn .sun { display: none; }
.dark .theme-btn .moon { display: inline; }
.theme-btn .moon { display: none; }
.theme-btn .sun { display: inline; }

/* ── Tabs ──────────────────────────────────────────────── */
.tab-btn {
  position: relative; padding: 12px 0; font-size: 0.875rem; font-weight: 500;
  opacity: 0.6; transition: opacity 0.2s; background: none; border: none;
  color: inherit;
}
.tab-btn.active, .tab-btn:hover { opacity: 1; }
.tab-underline {
  position: absolute; bottom: -1px; left: 0; height: 2px;
  background: #0969da; transition: transform 0.3s ease, width 0.3s ease;
}

/* ── Section header ────────────────────────────────────── */
.section-header {
  display: flex; align-items: center; gap: 8px;
  font-size: 1rem; font-weight: 600;
}

/* ── Panels ────────────────────────────────────────────── */
.panel {
  border: 1px solid rgba(9,105,218,0.18); border-radius: 16px;
  background: #fff;
  padding: 24px; box-shadow: 0 2px 16px rgba(9,105,218,0.06);
}
.dark .panel { border-color: #30363d; background: #0d1117; box-shadow: none; }

/* ── Profile card ──────────────────────────────────────── */
.profile-card {
  border: 1px solid rgba(9,105,218,0.18); border-radius: 16px;
  background: #fff;
  padding: 20px; box-shadow: 0 2px 16px rgba(9,105,218,0.06);
}
.dark .profile-card { border-color: #30363d; background: #0d1117; box-shadow: none; }

.avatar-ring {
  position: relative; width: 72px; height: 72px; border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, #0969da, #58a6ff, #0969da);
}
.avatar-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 2px solid #fff; }
.dark .avatar-img { border-color: #0d1117; }
.avatar-status {
  position: absolute; bottom: 2px; right: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #3fb950; border: 2px solid #fff;
}
.dark .avatar-status { border-color: #0d1117; }

.social-link { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; opacity: 0.6; transition: opacity 0.2s; }
.social-link:hover { opacity: 1; }

/* ── Buttons ───────────────────────────────────────────── */
.btn-primary {
  display: inline-block; padding: 9px 18px; border-radius: 8px; font-size: 0.85rem;
  font-weight: 600; transition: transform 0.15s, box-shadow 0.15s;
  background: linear-gradient(135deg, #0969da, #0550ae);
  color: #fff; border: none; box-shadow: 0 2px 8px rgba(9,105,218,0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(9,105,218,0.4); }

.btn-secondary {
  display: inline-block; padding: 9px 18px; border-radius: 8px; font-size: 0.85rem;
  font-weight: 500; transition: transform 0.15s, border-color 0.15s;
  border: 1px solid rgba(9,105,218,0.3); background: rgba(9,105,218,0.04); color: inherit;
}
.dark .btn-secondary { border-color: #30363d; background: #161b22; }
.btn-secondary:hover { transform: translateY(-2px); border-color: #0969da; }

.btn-ghost {
  display: inline-block; padding: 9px 18px; border-radius: 8px; font-size: 0.85rem;
  font-weight: 500; transition: background 0.15s, opacity 0.15s; opacity: 0.7;
}
.btn-ghost:hover { opacity: 1; background: rgba(9,105,218,0.08); }

/* ── Hero block ────────────────────────────────────────── */
.hero-block {
  position: relative; padding: 36px 32px; border-radius: 20px;
  border: 1px solid rgba(9,105,218,0.22); overflow: hidden;
  background: linear-gradient(135deg, #fff, #f0f6ff 55%, #fff);
  box-shadow: 0 4px 32px rgba(9,105,218,0.08);
  transform-style: preserve-3d;
}
.dark .hero-block {
  border-color: #30363d;
  background: linear-gradient(135deg, #0d1117, #161b22 55%, #0d1117);
  box-shadow: none;
}

.hero-glow {
  position: absolute; inset: -120px; pointer-events: none;
  background: radial-gradient(circle at var(--mx,50%) var(--my,50%), rgba(9,105,218,0.15), transparent 55%);
  opacity: 0.8;
}
.dark .hero-glow {
  background: radial-gradient(circle at var(--mx,50%) var(--my,50%), rgba(88,166,255,0.2), transparent 55%);
}
.hero-grid-lines {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(9,105,218,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(9,105,218,0.05) 1px, transparent 1px);
  background-size: 32px 32px;
}
.dark .hero-grid-lines {
  background-image:
    linear-gradient(rgba(88,166,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(88,166,255,0.04) 1px, transparent 1px);
}

.hero-name { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; line-height: 1.1; }
.text-gradient {
  background: linear-gradient(135deg, #0969da 0%, #58a6ff 50%, #0969da 100%);
  background-size: 200%;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  animation: shimmer 4s ease infinite;
}
@keyframes shimmer { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

.cursor-blink {
  display: inline-block; animation: blink 1s step-end infinite;
  color: #0969da; font-weight: 300;
}
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }

.stat-item { text-align: center; }
.stat-number {
  font-size: 1.75rem; font-weight: 800; font-family: "Geist Mono", monospace;
  color: #0969da; line-height: 1;
}
.stat-label { font-size: 0.7rem; opacity: 0.5; margin-top: 4px; text-transform: uppercase; letter-spacing: 0.05em; }

/* ── Timeline ──────────────────────────────────────────── */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: "";
  position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px;
  background: linear-gradient(to bottom, #0969da, transparent); border-radius: 2px;
}
.dark .timeline::before { background: linear-gradient(to bottom, #58a6ff, transparent); }

.timeline-item { position: relative; margin-bottom: 28px; }
.timeline-item:last-child { margin-bottom: 0; }

.timeline-dot {
  position: absolute; left: -28px; top: 4px;
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid #d0d7de; background: #fff; transition: all 0.2s;
}
.dark .timeline-dot { border-color: #30363d; background: #0d1117; }
.timeline-dot.active {
  border-color: #0969da; background: #0969da;
  box-shadow: 0 0 0 4px rgba(9,105,218,0.15);
}

.timeline-content {
  background: #fff; border: 1px solid rgba(9,105,218,0.15);
  border-radius: 12px; padding: 16px;
  box-shadow: 0 2px 12px rgba(9,105,218,0.05);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.timeline-content:hover { border-color: rgba(9,105,218,0.35); box-shadow: 0 6px 20px rgba(9,105,218,0.1); }
.dark .timeline-content { background: #161b22; border-color: #30363d; backdrop-filter: none; box-shadow: none; }
.dark .timeline-content:hover { border-color: #58a6ff; box-shadow: none; }

.timeline-badge {
  font-size: 0.7rem; font-family: "Geist Mono", monospace;
  padding: 2px 8px; border-radius: 999px;
  border: 1px solid rgba(9,105,218,0.2); background: rgba(9,105,218,0.05);
  color: #0550ae; white-space: nowrap;
}
.dark .timeline-badge { border-color: #30363d; background: #0d1117; color: inherit; opacity: 0.7; }

/* ── Skills ────────────────────────────────────────────── */
.skill-group { display: grid; gap: 10px; }
.skill-group-label { font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.4; }
.skill-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 13px; border-radius: 999px; font-size: 0.78rem; font-weight: 500;
  border: 1px solid; transition: transform 0.15s, box-shadow 0.15s;
}
.skill-badge:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(9,105,218,0.15); }
.skill-badge.level-5 { border-color: rgba(9,105,218,0.5); background: rgba(9,105,218,0.08); color: #0550ae; }
.skill-badge.level-4 { border-color: rgba(9,105,218,0.28); background: rgba(9,105,218,0.04); }
.skill-badge.level-3 { border-color: rgba(9,105,218,0.18); background: rgba(9,105,218,0.02); }
.skill-badge.level-2 { border-color: rgba(9,105,218,0.12); background: transparent; opacity: 0.8; }
.dark .skill-badge.level-5 { border-color: rgba(88,166,255,0.5); background: rgba(88,166,255,0.1); color: #58a6ff; }
.dark .skill-badge.level-4 { border-color: rgba(88,166,255,0.25); background: rgba(88,166,255,0.05); color: inherit; }
.dark .skill-badge.level-3, .dark .skill-badge.level-2 { border-color: #30363d; background: transparent; color: inherit; }

.learning-tag {
  font-size: 0.6rem; padding: 1px 5px; border-radius: 4px;
  background: rgba(210,153,34,0.15); color: #d29922;
  border: 1px solid rgba(210,153,34,0.3);
}

/* ── Tech chips ────────────────────────────────────────── */
.tech-chip {
  display: inline-flex; padding: 3px 10px; border-radius: 999px; font-size: 0.72rem;
  border: 1px solid rgba(9,105,218,0.25); background: rgba(9,105,218,0.06); color: #0550ae;
}
.dark .tech-chip { border-color: #30363d; background: #161b22; color: inherit; }

.tech-chip-sm {
  display: inline-flex; padding: 2px 8px; border-radius: 999px; font-size: 0.68rem;
  border: 1px solid rgba(9,105,218,0.3); background: rgba(9,105,218,0.06); color: #0969da;
}
.dark .tech-chip-sm { border-color: rgba(88,166,255,0.3); background: rgba(88,166,255,0.08); color: #58a6ff; }

/* ── Project cards ─────────────────────────────────────── */
/* NO magnetic, NO conflicting transform — tilt only via JS */
.project-card {
  position: relative; border: 1px solid rgba(9,105,218,0.18); border-radius: 16px;
  background: #fff;
  overflow: hidden; display: grid;
  transition: box-shadow 0.25s, border-color 0.25s;
  transform-style: preserve-3d;
}
.dark .project-card { border-color: #30363d; background: #0d1117; backdrop-filter: none; }
.project-card:hover { box-shadow: 0 16px 40px rgba(9,105,218,0.16); border-color: rgba(9,105,218,0.4); }
.dark .project-card:hover { box-shadow: 0 16px 40px rgba(0,0,0,0.4); border-color: #58a6ff; }

/* spotlight glow follows mouse */
.project-card::after {
  content: ""; position: absolute; inset: 0; border-radius: 16px; pointer-events: none;
  background: radial-gradient(circle at var(--mx,50%) var(--my,50%), rgba(9,105,218,0.09), transparent 55%);
  opacity: 0; transition: opacity 0.3s;
}
.dark .project-card::after {
  background: radial-gradient(circle at var(--mx,50%) var(--my,50%), rgba(88,166,255,0.12), transparent 55%);
}
.project-card:hover::after { opacity: 1; }

.project-media { position: relative; aspect-ratio: 16/9; overflow: hidden; }
.project-media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.03); transition: transform 0.4s ease; }
.project-card:hover .project-media img { transform: scale(1.1); }
.project-overlay {
  position: absolute; inset: 0; background: rgba(9,105,218,0.78);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.25s;
}
.project-card:hover .project-overlay { opacity: 1; }
.view-label { color: #fff; font-size: 0.85rem; font-weight: 600; letter-spacing: 0.02em; }
.project-body { padding: 16px; display: grid; gap: 8px; font-size: 0.85rem; }
.project-title { font-weight: 700; font-size: 0.95rem; }

/* ── Repo cards ────────────────────────────────────────── */
.repo-card {
  position: relative; border: 1px solid rgba(9,105,218,0.15); border-radius: 12px;
  background: #fff;
  padding: 14px; font-size: 0.85rem; display: block;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  transform-style: preserve-3d;
}
.dark .repo-card { border-color: #30363d; background: #0d1117; backdrop-filter: none; }
.repo-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(9,105,218,0.12); border-color: #0969da; }
.dark .repo-card:hover { border-color: #58a6ff; box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
.repo-title { font-weight: 600; font-size: 0.875rem; }

/* ── Service cards ─────────────────────────────────────── */
.service-card {
  position: relative; border: 1px solid rgba(9,105,218,0.15); border-radius: 14px;
  background: #fff; padding: 20px;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
}
.dark .service-card { border-color: #30363d; background: #0d1117; backdrop-filter: none; }
.service-card:hover { box-shadow: 0 10px 28px rgba(9,105,218,0.1); border-color: rgba(9,105,218,0.4); transform: translateY(-2px); }
.dark .service-card:hover { border-color: #58a6ff; box-shadow: 0 10px 28px rgba(0,0,0,0.3); }
.service-icon { font-size: 1.6rem; margin-bottom: 10px; }
.service-title { font-weight: 600; font-size: 0.9rem; }

/* ── Info cards ────────────────────────────────────────── */
.info-card {
  border: 1px solid rgba(9,105,218,0.15); border-radius: 12px;
  background: #fff; padding: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.dark .info-card { border-color: #30363d; background: #0d1117; backdrop-filter: none; }
.info-card:hover { border-color: rgba(9,105,218,0.5); box-shadow: 0 4px 16px rgba(9,105,218,0.08); }
.dark .info-card:hover { border-color: #58a6ff; box-shadow: none; }

/* ── Contact form ──────────────────────────────────────── */
.contact-form {
  border: 1px solid rgba(9,105,218,0.15); border-radius: 14px;
  background: #fff; padding: 20px;
  box-shadow: 0 2px 16px rgba(9,105,218,0.05);
}
.dark .contact-form { border-color: #30363d; background: #0d1117; backdrop-filter: none; box-shadow: none; }

input, textarea {
  width: 100%; background: transparent;
  border: 1px solid rgba(9,105,218,0.2); border-radius: 8px;
  padding: 10px 12px; font-size: 0.875rem; color: inherit; font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, textarea:focus { outline: none; border-color: #0969da; box-shadow: 0 0 0 3px rgba(9,105,218,0.12); }
.dark input, .dark textarea { border-color: #30363d; }
.dark input:focus, .dark textarea:focus { border-color: #58a6ff; box-shadow: 0 0 0 3px rgba(88,166,255,0.1); }

/* ── Tilt ──────────────────────────────────────────────── */
/* JS sets --rx,--ry,--mx,--my. No --tx/--ty (avoids magnetic conflict). */
.tilt-el {
  transform-style: preserve-3d;
  transform: perspective(900px) rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg));
  transition: transform 0.18s ease;
}

/* ── Reveal ────────────────────────────────────────────── */
.reveal {
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* ── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(9,105,218,0.25); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(9,105,218,0.5); }

aside::-webkit-scrollbar { width: 0; }
