/* ===== CSS Variables ===== */
:root {
  --bg: #050510;
  --bg-alt: #0a0a1a;
  --surface: rgba(15, 15, 30, 0.6);
  --surface-solid: #0f0f1e;
  --surface-hover: #1a1a2e;
  --border: rgba(255, 255, 255, 0.06);
  --border-light: rgba(255, 255, 255, 0.1);
  --text: #e8e8f0;
  --text-muted: #8888a0;
  --text-dim: #5a5a72;
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-dark: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.15);
  --accent: #22d3ee;
  --accent-glow: rgba(34, 211, 238, 0.1);
  --pink: #f472b6;
  --green: #34d399;
  --gradient: linear-gradient(135deg, var(--primary), var(--accent));
  --gradient-pink: linear-gradient(135deg, var(--primary), var(--pink));
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
  --radius: 16px;
  --radius-sm: 10px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* Light-mode specific tokens (reused in overrides) */
  --nav-bg: rgba(5, 5, 16, 0.15);
  --nav-bg-scroll: rgba(5, 5, 16, 0.2);
  --code-bg: rgba(10, 10, 25, 0.8);
  --orb-opacity: 0.3;
  --grid-line: rgba(255,255,255,0.02);
  --card-shine-from: rgba(255,255,255,0.1);
  --card-shine-to: rgba(99,102,241,0.1);
  --card-hover-shadow: rgba(0, 0, 0, 0.3);
  --tag-bg: rgba(99, 102, 241, 0.08);
  --tag-border: rgba(99, 102, 241, 0.1);
  --accent-tag-bg: rgba(34, 211, 238, 0.08);
  --accent-tag-border: rgba(34, 211, 238, 0.08);
  --featured-bg: linear-gradient(135deg, rgba(34, 211, 238, 0.06), rgba(99, 102, 241, 0.06), rgba(244, 114, 182, 0.03));
  --featured-border: rgba(34, 211, 238, 0.2);
  --featured-tag-bg: rgba(34, 211, 238, 0.1);
  --featured-tag-border: rgba(34, 211, 238, 0.15);
  --timeline-marker-border: var(--bg);
  --code-kw: #c792ea;
  --code-cls: #82aaff;
  --code-str: #c3e88d;
  --code-fn: #82aaff;
  --code-typ: #ffcb6b;
  --hero-name-gradient: linear-gradient(135deg, #fff 0%, var(--primary-light) 50%, var(--accent) 100%);
  --nav-shine: rgba(255, 255, 255, 0.04);
  --toggle-track-bg: rgba(255, 255, 255, 0.08);
  --toggle-track-border: rgba(255, 255, 255, 0.12);
  --toggle-track-glow: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(34,211,238,0.1));
  --toggle-thumb-bg: linear-gradient(135deg, #6366f1, #4f46e5);
  --toggle-thumb-shadow: 0 1px 4px rgba(0,0,0,0.3), 0 0 8px rgba(99,102,241,0.3);
  --toggle-icon-color: #fff;
}

/* ===== Light Mode ===== */
[data-theme="light"] {
  --bg: #f8f9fc;
  --bg-alt: #f0f1f5;
  --surface: rgba(255, 255, 255, 0.7);
  --surface-solid: #ffffff;
  --surface-hover: #eef0f5;
  --border: rgba(0, 0, 0, 0.08);
  --border-light: rgba(0, 0, 0, 0.12);
  --text: #1a1a2e;
  --text-muted: #555570;
  --text-dim: #888899;
  --primary: #4f46e5;
  --primary-light: #6366f1;
  --primary-dark: #3730a3;
  --primary-glow: rgba(79, 70, 229, 0.1);
  --accent: #0891b2;
  --accent-glow: rgba(8, 145, 178, 0.08);
  --pink: #db2777;
  --green: #059669;

  --nav-bg: rgba(248, 249, 252, 0.15);
  --nav-bg-scroll: rgba(248, 249, 252, 0.25);
  --code-bg: #1e1e2e;
  --orb-opacity: 0.12;
  --grid-line: rgba(0,0,0,0.03);
  --card-shine-from: rgba(255,255,255,0.6);
  --card-shine-to: rgba(79,70,229,0.08);
  --card-hover-shadow: rgba(0, 0, 0, 0.08);
  --tag-bg: rgba(79, 70, 229, 0.08);
  --tag-border: rgba(79, 70, 229, 0.15);
  --accent-tag-bg: rgba(8, 145, 178, 0.08);
  --accent-tag-border: rgba(8, 145, 178, 0.12);
  --featured-bg: linear-gradient(135deg, rgba(8, 145, 178, 0.06), rgba(79, 70, 229, 0.06), rgba(219, 39, 119, 0.03));
  --featured-border: rgba(8, 145, 178, 0.25);
  --featured-tag-bg: rgba(8, 145, 178, 0.1);
  --featured-tag-border: rgba(8, 145, 178, 0.2);
  --timeline-marker-border: var(--bg);
  --code-kw: #c792ea;
  --code-cls: #82aaff;
  --code-str: #c3e88d;
  --code-fn: #82aaff;
  --code-typ: #ffcb6b;
  --hero-name-gradient: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--accent) 100%);
  --nav-shine: rgba(255, 255, 255, 0.5);
  --toggle-track-bg: rgba(0, 0, 0, 0.06);
  --toggle-track-border: rgba(0, 0, 0, 0.1);
  --toggle-track-glow: linear-gradient(135deg, rgba(79,70,229,0.08), rgba(8,145,178,0.06));
  --toggle-thumb-bg: linear-gradient(135deg, #fbbf24, #f59e0b);
  --toggle-thumb-shadow: 0 1px 4px rgba(0,0,0,0.15), 0 0 8px rgba(251,191,36,0.3);
  --toggle-icon-color: #fff;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent);
}

img {
  max-width: 100%;
  display: block;
}

/* ===== Ambient background ===== */
.ambient-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: var(--orb-opacity);
  animation: float-orb 20s ease-in-out infinite;
}

.ambient-orb:nth-child(1) {
  width: 600px;
  height: 600px;
  background: var(--primary);
  top: -200px;
  right: -100px;
  animation-delay: 0s;
}

.ambient-orb:nth-child(2) {
  width: 500px;
  height: 500px;
  background: var(--accent);
  bottom: -150px;
  left: -100px;
  animation-delay: -7s;
}

.ambient-orb:nth-child(3) {
  width: 400px;
  height: 400px;
  background: var(--pink);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -14s;
  opacity: 0.15;
}

@keyframes float-orb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -40px) scale(1.05); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(40px, 30px) scale(1.02); }
}

.ambient-orb:nth-child(3) {
  animation-name: float-orb-center;
}

@keyframes float-orb-center {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  25% { transform: translate(-45%, -55%) scale(1.05); }
  50% { transform: translate(-55%, -45%) scale(0.95); }
  75% { transform: translate(-48%, -52%) scale(1.02); }
}

/* Grid pattern overlay */
.grid-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 20%, transparent 70%);
}

/* ===== Layout ===== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 100px 0;
  position: relative;
}

.section-alt {
  background: var(--bg-alt);
}

.section-title {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 16px;
  text-align: center;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 48px;
}

/* ===== Glassmorphism card base ===== */
.glass-card {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--card-shine-from), transparent, var(--card-shine-to));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.glass-card:hover::before {
  opacity: 1;
}

.glass-card:hover {
  transform: translateY(-6px);
  box-shadow:
    0 20px 40px var(--card-hover-shadow),
    0 0 40px var(--primary-glow);
  border-color: rgba(99, 102, 241, 0.2);
}

/* ===== Navigation — Liquid Glass ===== */
.nav {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: calc(100% - 32px);
  max-width: 1100px;
  border-radius: 16px;
  /* Transparent at top — no background, no border, no shadow */
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid transparent;
  box-shadow: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Glass effect appears only on scroll */
.nav.scrolled {
  background: var(--nav-bg-scroll);
  backdrop-filter: blur(22px) saturate(1.4);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  border-color: var(--border-light);
  box-shadow:
    0 8px 32px rgba(0,0,0,0.1),
    inset 0 1px 0 var(--nav-shine);
}

/* Gradient shimmer border on hover */
.nav::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--primary-glow) 25%,
    rgba(34,211,238,0.15) 50%,
    var(--primary-glow) 75%,
    transparent 100%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.nav.scrolled:hover::before {
  opacity: 1;
}

.nav-container {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-logo {
  font-size: 1.4rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
  margin-right: auto;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 28px;
  margin-right: 16px;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  transition: color var(--transition);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient);
  transition: width var(--transition);
  border-radius: 1px;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* ===== Theme Toggle — Fancy Pill Switch ===== */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  outline: none;
}

.theme-toggle-track {
  width: 52px;
  height: 28px;
  border-radius: 14px;
  background: var(--toggle-track-bg);
  border: 1px solid var(--toggle-track-border);
  position: relative;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.theme-toggle-track::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--toggle-track-glow);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.theme-toggle:hover .theme-toggle-track::before {
  opacity: 1;
}

.theme-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--toggle-thumb-bg);
  box-shadow: var(--toggle-thumb-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark mode (default): show moon icon, thumb on left */
.icon-moon {
  display: block;
  color: var(--toggle-icon-color);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  animation: icon-enter 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.icon-sun {
  display: none;
  color: var(--toggle-icon-color);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

/* Light mode: show sun icon, thumb slides right */
[data-theme="light"] .theme-toggle-thumb {
  left: 27px;
}

[data-theme="light"] .icon-moon {
  display: none;
}

[data-theme="light"] .icon-sun {
  display: block;
  animation: icon-enter 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes icon-enter {
  from { transform: rotate(-90deg) scale(0.5); opacity: 0; }
  to { transform: rotate(0) scale(1); opacity: 1; }
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: var(--transition);
}

/* ===== Hero ===== */
.hero-wrapper {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

#particles-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 24px 60px;
  gap: 60px;
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero-content {
  flex: 1;
  max-width: 520px;
}

.hero-greeting {
  color: var(--accent);
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 8px;
  font-family: var(--mono);
  opacity: 0;
  animation: slideUp 0.6s ease forwards 0.2s;
}

.hero-name {
  font-size: 4rem;
  font-weight: 800;
  line-height: 1.05;
  margin-bottom: 12px;
  background: var(--hero-name-gradient);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 6s ease-in-out infinite, slideUp 0.6s ease forwards 0.3s;
  opacity: 0;
  letter-spacing: -1px;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  opacity: 0;
  animation: slideUp 0.6s ease forwards 0.4s;
}

.hero-title-typed {
  display: inline;
}

.hero-cursor {
  display: inline-block;
  width: 2px;
  height: 1.2em;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.hero-desc {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 32px;
  line-height: 1.8;
  opacity: 0;
  animation: slideUp 0.6s ease forwards 0.5s;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
  opacity: 0;
  animation: slideUp 0.6s ease forwards 0.6s;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 14px 32px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
}

.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 4px 20px var(--primary-glow);
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255,255,255,0.2), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.btn-primary:hover::after {
  transform: translateX(100%);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(99, 102, 241, 0.35);
  color: #fff;
}

.btn-outline {
  border: 1px solid var(--border-light);
  color: var(--text);
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(10px);
}

.btn-outline:hover {
  border-color: var(--primary);
  background: var(--primary-glow);
  color: var(--text);
  transform: translateY(-3px);
}

.hero-social {
  display: flex;
  gap: 12px;
  opacity: 0;
  animation: slideUp 0.6s ease forwards 0.7s;
}

.hero-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  transition: all var(--transition);
  background: rgba(255,255,255,0.02);
}

.hero-social a:hover {
  border-color: var(--primary);
  color: var(--primary-light);
  background: var(--primary-glow);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px var(--primary-glow);
}

/* Code block in hero */
.hero-visual {
  flex: 1;
  max-width: 480px;
  opacity: 0;
  animation: slideUp 0.8s ease forwards 0.5s;
}

.code-block {
  background: var(--code-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow:
    0 30px 80px var(--card-hover-shadow),
    inset 0 1px 0 rgba(255,255,255,0.05);
  position: relative;
  text-align: left;
}

.code-block::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(99,102,241,0.3), transparent 40%, transparent 60%, rgba(34,211,238,0.3));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.code-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }

.code-filename {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}

.code-body {
  padding: 22px;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.8;
  overflow-x: auto;
  color: var(--text-muted);
  text-align: left;
}

.code-body code {
  font-family: inherit;
}

.code-body .kw { color: var(--code-kw); }
.code-body .cls { color: var(--code-cls); }
.code-body .str { color: var(--code-str); }
.code-body .fn { color: var(--code-fn); }
.code-body .typ { color: var(--code-typ); }

/* Code line highlight animation */
.code-line {
  display: block;
  transition: background 0.3s ease;
  padding: 0 4px;
  margin: 0 -4px;
  border-radius: 4px;
}

.code-line:hover {
  background: rgba(99, 102, 241, 0.08);
}

/* ===== About ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 48px;
  align-items: start;
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.about-text strong {
  color: var(--text);
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.stat-card {
  background: var(--surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.stat-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px var(--primary-glow);
  border-color: rgba(99, 102, 241, 0.2);
}

.stat-card:hover::after {
  opacity: 1;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-plus {
  font-size: 1.8rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  display: block;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ===== Skills ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.skill-category {
  background: var(--surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.skill-category::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--card-shine-from), transparent, var(--card-shine-to));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.skill-category:hover::before {
  opacity: 1;
}

.skill-category:hover {
  transform: translateY(-6px);
  box-shadow:
    0 20px 40px var(--card-hover-shadow),
    0 0 30px var(--primary-glow);
  border-color: rgba(99, 102, 241, 0.2);
}

/* Featured AI card */
.skill-featured {
  border-color: var(--featured-border);
  background: var(--featured-bg);
  grid-column: span 1;
}

.skill-featured::before {
  background: linear-gradient(135deg, var(--featured-border), transparent, rgba(99,102,241,0.3));
  opacity: 0.5;
}

.skill-featured:hover {
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.2),
    0 0 50px rgba(34, 211, 238, 0.15),
    0 0 100px rgba(99, 102, 241, 0.05);
  border-color: rgba(34, 211, 238, 0.3);
}

.skill-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.skill-trending-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  animation: pulse-glow 2s ease-in-out infinite;
  box-shadow: 0 2px 12px rgba(34, 211, 238, 0.3);
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 2px 12px rgba(34, 211, 238, 0.3); }
  50% { box-shadow: 0 2px 24px rgba(34, 211, 238, 0.5), 0 0 40px rgba(34, 211, 238, 0.1); }
}

.skill-featured .skill-tags span {
  background: var(--featured-tag-bg);
  color: var(--accent);
  border: 1px solid var(--featured-tag-border);
}

.skill-icon {
  color: var(--primary-light);
  margin-bottom: 16px;
}

.skill-category h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.skill-category p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 16px;
  line-height: 1.7;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tags span {
  background: var(--tag-bg);
  color: var(--primary-light);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.73rem;
  font-weight: 500;
  border: 1px solid var(--tag-border);
  transition: all 0.3s ease;
}

.skill-category:hover .skill-tags span {
  border-color: rgba(99, 102, 241, 0.2);
}

/* ===== Timeline ===== */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary), var(--accent), var(--pink), transparent);
}

.timeline-item {
  position: relative;
  padding-left: 36px;
  padding-bottom: 40px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: -6px;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid var(--timeline-marker-border);
  box-shadow: 0 0 0 3px var(--primary-glow), 0 0 12px var(--primary-glow);
  transition: all 0.3s ease;
}

.timeline-item:hover .timeline-marker {
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.4), 0 0 20px rgba(99, 102, 241, 0.3);
  transform: scale(1.2);
}

.timeline-content {
  background: var(--surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
}

.timeline-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.timeline-content:hover {
  border-color: rgba(99, 102, 241, 0.2);
  box-shadow: 0 12px 40px var(--card-hover-shadow), 0 0 30px var(--primary-glow);
  transform: translateX(4px);
}

.timeline-content:hover::before {
  opacity: 1;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 4px;
}

.timeline-header h3 {
  font-size: 1.05rem;
  font-weight: 600;
}

.timeline-date {
  white-space: nowrap;
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 500;
  font-family: var(--mono);
  background: var(--accent-tag-bg);
  padding: 2px 10px;
  border-radius: 20px;
  border: 1px solid var(--accent-tag-border);
}

.timeline-company {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 12px;
}

.timeline-content p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 12px;
}

.timeline-content ul {
  list-style: none;
  margin-bottom: 16px;
}

.timeline-content ul li {
  color: var(--text-muted);
  font-size: 0.85rem;
  padding-left: 16px;
  position: relative;
  margin-bottom: 4px;
}

.timeline-content ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 6px rgba(99, 102, 241, 0.4);
}

.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.timeline-tags span {
  background: var(--tag-bg);
  color: var(--primary-light);
  padding: 3px 12px;
  border-radius: 16px;
  font-size: 0.72rem;
  font-weight: 500;
  border: 1px solid var(--tag-border);
}

/* ===== Projects ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.project-card {
  background: var(--surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  color: var(--text);
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--card-shine-from), transparent, var(--card-shine-to));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.project-card:hover::before {
  opacity: 1;
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow:
    0 20px 40px var(--card-hover-shadow),
    0 0 40px var(--accent-glow);
  border-color: rgba(34, 211, 238, 0.15);
  color: var(--text);
}

.project-card-link {
  text-decoration: none;
  cursor: pointer;
}

.project-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.project-github-badge {
  color: var(--text-dim);
  transition: all var(--transition);
}

.project-card-link:hover .project-github-badge {
  color: var(--accent);
  filter: drop-shadow(0 0 6px rgba(34, 211, 238, 0.4));
}

.project-icon {
  color: var(--primary-light);
  margin-bottom: 16px;
}

.project-header-row .project-icon {
  margin-bottom: 16px;
}

.project-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.project-card p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 16px;
  line-height: 1.7;
  flex: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-tags span {
  background: var(--accent-tag-bg);
  color: var(--accent);
  padding: 3px 12px;
  border-radius: 16px;
  font-size: 0.72rem;
  font-weight: 500;
  border: 1px solid var(--accent-tag-border);
}

/* ===== Contact ===== */
.contact-desc {
  text-align: center;
  color: var(--text-muted);
  max-width: 500px;
  margin: -24px auto 40px;
  font-size: 0.95rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
}

.contact-grid-5 {
  grid-template-columns: repeat(5, 1fr);
  max-width: 1000px;
}

.contact-card {
  background: var(--surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  transition: all 0.4s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text);
  position: relative;
  overflow: hidden;
}

.contact-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.contact-card:hover {
  border-color: rgba(99, 102, 241, 0.2);
  transform: translateY(-6px);
  box-shadow: 0 16px 40px var(--primary-glow);
  color: var(--text);
}

.contact-card:hover::after {
  opacity: 1;
}

.contact-card svg {
  color: var(--primary-light);
  transition: all 0.3s ease;
}

.contact-card:hover svg {
  color: var(--accent);
  filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.3));
}

.contact-card h3 {
  font-size: 0.9rem;
  font-weight: 600;
}

.contact-card p {
  color: var(--text-muted);
  font-size: 0.78rem;
}

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  text-align: center;
  background: var(--bg-alt);
}

.footer p {
  color: var(--text-dim);
  font-size: 0.82rem;
}

/* ===== Animations ===== */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Tilt effect on cards */
.tilt-card {
  transform-style: preserve-3d;
  perspective: 1000px;
}

/* ===== Responsive ===== */

/* Tablet */
@media (max-width: 900px) {
  .hero {
    flex-direction: column;
    text-align: center;
    padding-top: 100px;
    padding-bottom: 40px;
    gap: 32px;
    min-height: auto;
  }

  .hero-wrapper {
    min-height: auto;
  }

  .hero-content {
    max-width: 100%;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-social {
    justify-content: center;
  }

  .hero-visual {
    max-width: 420px;
    width: 100%;
  }

  .hero-name {
    font-size: 2.8rem;
  }

  .hero-desc {
    font-size: 0.95rem;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .about-stats {
    grid-template-columns: repeat(4, 1fr);
  }

  .skills-grid,
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-grid,
  .contact-grid-5 {
    grid-template-columns: repeat(3, 1fr);
    max-width: 600px;
  }
}

/* Mobile */
@media (max-width: 640px) {
  .nav {
    top: 8px;
    width: calc(100% - 16px);
    border-radius: 14px;
  }

  .nav-container {
    padding: 0 14px;
    height: 50px;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--nav-bg-scroll);
    backdrop-filter: blur(22px) saturate(1.4);
    -webkit-backdrop-filter: blur(22px) saturate(1.4);
    flex-direction: column;
    padding: 20px;
    gap: 16px;
    border: 1px solid var(--border-light);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: flex;
    order: 3;
  }

  .theme-toggle {
    order: 2;
  }

  /* Hero mobile */
  .hero {
    padding-top: 88px;
    padding-bottom: 32px;
    gap: 24px;
    min-height: auto;
  }

  .hero-wrapper {
    min-height: auto;
  }

  .hero-greeting {
    font-size: 0.9rem;
  }

  .hero-name {
    font-size: 2.2rem;
    letter-spacing: -0.5px;
  }

  .hero-title {
    font-size: 1rem;
    margin-bottom: 4px;
  }

  .hero-desc {
    font-size: 0.88rem;
    margin-bottom: 24px;
    line-height: 1.7;
  }

  .hero-actions {
    gap: 12px;
    margin-bottom: 24px;
  }

  .btn {
    padding: 12px 24px;
    font-size: 0.85rem;
  }

  .hero-social a {
    width: 38px;
    height: 38px;
  }

  /* Code block: compact on mobile */
  .hero-visual {
    max-width: 100%;
  }

  .code-block {
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
  }

  .code-body {
    padding: 14px;
    font-size: 0.68rem;
    line-height: 1.7;
  }

  .code-header {
    padding: 10px 14px;
  }

  .dot {
    width: 10px;
    height: 10px;
  }

  /* Sections */
  .section {
    padding: 60px 0;
  }

  .section-title {
    font-size: 1.5rem;
    margin-bottom: 8px;
  }

  .section-subtitle {
    font-size: 0.8rem;
    margin-bottom: 32px;
  }

  /* Skills & Projects */
  .skills-grid,
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .skill-category,
  .project-card {
    padding: 22px;
  }

  /* About */
  .about-stats {
    grid-template-columns: 1fr 1fr;
  }

  .stat-card {
    padding: 20px 14px;
  }

  .stat-number {
    font-size: 2rem;
  }

  /* Contact */
  .contact-grid,
  .contact-grid-5 {
    grid-template-columns: repeat(2, 1fr);
    max-width: 400px;
  }

  .contact-card {
    padding: 20px 12px;
  }

  .contact-card p {
    font-size: 0.7rem;
    word-break: break-all;
  }

  /* Timeline */
  .timeline-header {
    flex-direction: column;
    gap: 4px;
  }

  .timeline-content {
    padding: 20px;
  }

  /* Ambient effects */
  .ambient-orb {
    opacity: 0.12;
  }

  .ambient-orb:nth-child(1) {
    width: 300px;
    height: 300px;
  }

  .ambient-orb:nth-child(2) {
    width: 250px;
    height: 250px;
  }

  .ambient-orb:nth-child(3) {
    width: 200px;
    height: 200px;
  }
}

/* Small phones */
@media (max-width: 380px) {
  .hero-name {
    font-size: 1.8rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .contact-grid,
  .contact-grid-5 {
    grid-template-columns: 1fr;
    max-width: 280px;
  }

  .about-stats {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
}
