/* ===== DESIGN TOKENS ===== */
:root {
  --bg: #0a0e1a;
  --bg-alt: #0d1225;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --primary: #1560BD;
  --primary-light: #4A93EB;
  --primary-glow: rgba(21, 96, 189, 0.25);
  --accent: #00C896;
  --accent-glow: rgba(0, 200, 150, 0.2);
  --text: #E8EDF5;
  --text-muted: #8899B0;
  --text-dim: #5a6a80;
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.18);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  --glass: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.06);
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --font-heading: 'Manrope', system-ui, -apple-system, sans-serif;
  --font-body: 'Source Sans 3', system-ui, -apple-system, sans-serif;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --gradient-brand: linear-gradient(135deg, var(--primary), var(--accent));
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 700; line-height: 1.2; }

/* ===== LAYOUT ===== */
.container { width: min(1140px, 90%); margin-inline: auto; }
.section { padding: 80px 0; }
.section-alt { background: var(--bg-alt); }
.section-title {
  font-size: clamp(1.6rem, 3vw, 2rem);
  margin-bottom: 12px;
  position: relative;
  display: inline-block;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
}
.section-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 32px;
  max-width: 60ch;
}

/* ===== HEADER ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(10, 14, 26, 0.75);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--glass-border);
  transition: box-shadow var(--transition), background var(--transition);
}
.site-header.scrolled {
  background: rgba(10, 14, 26, 0.92);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.avatar-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: grid;
  place-items: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
  box-shadow: 0 4px 16px var(--primary-glow);
}
.brand-name { font-family: var(--font-heading); font-weight: 700; font-size: 1.15rem; display: block; }
.brand-title { font-size: 0.8rem; color: var(--text-muted); display: block; }
.nav { display: flex; gap: 24px; align-items: center; }
.nav a {
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  transition: color var(--transition);
  position: relative;
}
.nav a:hover { color: var(--text); }
.nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width var(--transition);
}
.nav a:hover::after { width: 100%; }
.nav-cta {
  background: var(--primary) !important;
  color: #fff !important;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px var(--primary-glow);
  transition: transform var(--transition), box-shadow var(--transition);
}
.nav-cta::after { display: none !important; }
.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 6px 24px var(--primary-glow); }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ===== HERO ===== */
.hero {
  padding: 100px 0 80px;
  position: relative;
  overflow: hidden;
  min-height: 80vh;
  display: flex;
  align-items: center;
}
.hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 100%);
  pointer-events: none;
}
.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
}
.hero-orb--1 {
  width: 600px;
  height: 600px;
  background: var(--primary-glow);
  top: -200px;
  left: -100px;
  animation: float 8s ease-in-out infinite;
}
.hero-orb--2 {
  width: 500px;
  height: 500px;
  background: var(--accent-glow);
  bottom: -200px;
  right: -100px;
  animation: float 10s ease-in-out infinite reverse;
}
@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(30px, -20px); }
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: center;
  position: relative;
  z-index: 1;
}
.hero-greeting {
  color: var(--primary-light);
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 12px;
  font-family: var(--font-heading);
}
.hero-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  margin-bottom: 16px;
  font-weight: 800;
}
.typing-wrapper { color: var(--primary-light); }
.cursor {
  animation: blink 0.8s step-end infinite;
  color: var(--primary-light);
  font-weight: 300;
}
@keyframes blink { 50% { opacity: 0; } }
.hero-subtitle {
  color: var(--text-muted);
  font-size: 1.15rem;
  max-width: 50ch;
  margin-bottom: 28px;
  line-height: 1.7;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  box-shadow: 0 4px 20px var(--primary-glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 32px var(--primary-glow); }
.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-hover);
}
.btn-outline:hover { background: var(--bg-card-hover); border-color: var(--primary); }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 12px 16px;
}
.btn-ghost:hover { color: var(--primary-light); }
.btn-icon { margin-right: 2px; }

/* Hero Right */
.hero-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}
/* Hero Stats */
.hero-stats { display: flex; flex-direction: column; gap: 16px; width: 100%; }
.stat-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px 24px;
  backdrop-filter: blur(12px);
  transition: all var(--transition);
}
.stat-card:hover { border-color: var(--border-hover); background: var(--bg-card-hover); transform: translateY(-2px); }
.stat-number {
  display: block;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--primary-light);
  margin-bottom: 2px;
}
.stat-label { color: var(--text-muted); font-size: 0.88rem; }

/* ===== ABOUT ===== */
.about-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 48px; margin-top: 28px; }
.about-text p { color: var(--text-muted); margin-bottom: 16px; font-size: 1.02rem; line-height: 1.75; }
.about-text strong { color: var(--text); font-weight: 600; }
.about-highlights { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-content: start; }
.highlight-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: all var(--transition);
}
.highlight-card:hover { border-color: var(--border-hover); background: var(--bg-card-hover); }
.highlight-icon { font-size: 1.4rem; flex-shrink: 0; }
.highlight-card strong { font-family: var(--font-heading); font-size: 0.85rem; color: var(--text); }
.highlight-card div { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; }

/* ===== SKILLS ===== */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-top: 28px; }
.skill-category {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all var(--transition);
}
.skill-category:hover { border-color: var(--border-hover); background: var(--bg-card-hover); }
.skill-header { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.skill-icon { font-size: 1.3rem; }
.skill-header h3 { font-size: 1rem; font-weight: 600; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  padding: 5px 14px;
  background: rgba(21, 96, 189, 0.12);
  border: 1px solid rgba(21, 96, 189, 0.2);
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--primary-light);
  transition: all var(--transition);
}
.tag:hover { background: rgba(21, 96, 189, 0.2); border-color: var(--primary); }

/* ===== PROJECTS ===== */
.filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.filter-btn {
  padding: 8px 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  border-radius: 24px;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.filter-btn:hover { border-color: var(--border-hover); color: var(--text); }
.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 16px var(--primary-glow);
}
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.project-card {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
}
.project-card.hidden {
  display: none;
}
.project-card {
  animation: fadeInUp 0.4s ease both;
}
.project-card-inner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  height: 100%;
  transition: all var(--transition);
}
.project-card:hover .project-card-inner {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.project-type-badge {
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-heading);
}
.project-type-badge.ml { background: rgba(138, 43, 226, 0.15); color: #b47eff; border: 1px solid rgba(138, 43, 226, 0.25); }
.project-type-badge.python { background: rgba(0, 200, 150, 0.12); color: var(--accent); border: 1px solid rgba(0, 200, 150, 0.2); }
.project-type-badge.web { background: rgba(21, 96, 189, 0.12); color: var(--primary-light); border: 1px solid rgba(21, 96, 189, 0.2); }
.project-type-badge.dataviz { background: rgba(255, 165, 0, 0.12); color: #ffb347; border: 1px solid rgba(255, 165, 0, 0.2); }
.project-stars { color: var(--text-dim); font-size: 0.85rem; }
.project-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
  font-family: var(--font-heading);
}
.project-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 16px;
  min-height: 72px;
}
.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.project-tech span {
  padding: 3px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ===== EDUCATION TIMELINE ===== */
.timeline {
  position: relative;
  margin-top: 32px;
  padding-left: 32px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary), var(--accent));
  border-radius: 2px;
}
.timeline-item {
  position: relative;
  margin-bottom: 32px;
}
.timeline-item:last-child { margin-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: -29px;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid var(--bg-alt);
  box-shadow: 0 0 0 2px var(--primary);
}
.timeline-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  transition: all var(--transition);
}
.timeline-content:hover { border-color: var(--border-hover); background: var(--bg-card-hover); }
.timeline-date {
  color: var(--primary-light);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-heading);
}
.timeline-content h3 {
  font-size: 1.05rem;
  margin: 6px 0 4px;
}
.timeline-content p {
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* ===== CERTIFICATIONS ===== */
.certs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin-top: 28px; }
.cert-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all var(--transition);
}
.cert-card:hover { border-color: var(--border-hover); background: var(--bg-card-hover); }
.cert-icon { font-size: 2rem; flex-shrink: 0; }
.cert-info h3 { font-size: 1rem; margin-bottom: 4px; }
.cert-org { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 6px; }
.cert-year {
  display: inline-block;
  padding: 2px 10px;
  background: rgba(21, 96, 189, 0.12);
  border-radius: 12px;
  font-size: 0.78rem;
  color: var(--primary-light);
  font-weight: 600;
}

/* ===== CONTACT ===== */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 28px;
}
.contact-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 20px;
  transition: all var(--transition);
}
.contact-card:hover {
  border-color: var(--primary);
  background: var(--bg-card-hover);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px var(--primary-glow);
}
.contact-icon { font-size: 1.8rem; }
.contact-card strong { font-family: var(--font-heading); font-size: 0.95rem; }
.contact-card span:last-child { color: var(--text-muted); font-size: 0.88rem; word-break: break-all; }

/* ===== FOOTER ===== */
.site-footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-inner p { color: var(--text-muted); font-size: 0.88rem; }
.footer-links { display: flex; gap: 20px; }
.footer-links a {
  color: var(--text-dim);
  font-size: 0.88rem;
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--text); }

/* ===== BACK TO TOP ===== */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 20px var(--primary-glow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all var(--transition);
  z-index: 999;
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px var(--primary-glow);
}

/* ===== FADE IN UP ANIMATION ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== SCROLL REVEAL ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== SELECTION COLOR ===== */
::selection {
  background: var(--primary);
  color: #fff;
}

/* ===== FOCUS VISIBLE ===== */
:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--text-dim); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 32px; }
  .hero-right { flex-direction: row; align-items: center; gap: 24px; }
  .hero-stats { flex-direction: row; flex-wrap: wrap; flex: 1; }
  .stat-card { flex: 1; min-width: 140px; }
  .about-grid { grid-template-columns: 1fr; gap: 28px; }
  .about-highlights { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .nav { 
    display: none; 
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: rgba(10, 14, 26, 0.95);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 24px;
    gap: 16px;
    border-bottom: 1px solid var(--border);
  }
  .nav.open { display: flex; }
  .nav a { font-size: 1.05rem; padding: 8px 0; }
  .nav-cta { text-align: center; }
  .hamburger { display: flex; }
  .hero { padding: 60px 0 40px; min-height: auto; }
  .hero-grid-bg { display: none; }
  .hero-right { flex-direction: column; }
  .hero-title { font-size: clamp(1.6rem, 4vw, 2.4rem); }
  .section { padding: 56px 0; }
  .projects-grid { grid-template-columns: 1fr; }
  .filter-tabs { gap: 6px; }
  .filter-btn { padding: 6px 14px; font-size: 0.8rem; }
  .footer-inner { flex-direction: column; gap: 12px; text-align: center; }
}

@media (max-width: 480px) {
  .about-highlights { grid-template-columns: 1fr; }
  .hero-stats { flex-direction: column; }
  .hero-actions { flex-direction: column; }
  .btn { justify-content: center; }
  .contact-grid { grid-template-columns: 1fr; }
}
