/* ============================================
   VARIABLES & THEMES
   ============================================ */
:root {
  /* Layout */
  --max-width: 1100px;
  --nav-height: 64px;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;

  /* Transitions */
  --ease: cubic-bezier(.4, 0, .2, 1);
  --transition: .3s var(--ease);
  --transition-slow: .6s var(--ease);
}

/* ── Dark Theme (default) ── */
[data-theme="dark"] {
  --bg-primary: #0b0f1a;
  --bg-secondary: #111827;
  --bg-card: #1a2236;
  --bg-card-hover: #1f2b42;
  --bg-input: #1e293b;
  --bg-nav: rgba(11, 15, 26, .85);

  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-dark: #4f46e5;
  --accent-glow: rgba(99, 102, 241, .15);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-link: #818cf8;

  --border: rgba(148, 163, 184, .12);
  --border-accent: rgba(99, 102, 241, .3);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .2);
  --shadow: 0 4px 24px rgba(0, 0, 0, .3);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, .4);

  --gradient-hero: linear-gradient(135deg, #0b0f1a 0%, #1a1040 50%, #0b0f1a 100%);
  --gradient-accent: linear-gradient(135deg, var(--accent-dark), var(--accent-light));
}

/* ── Light Theme ── */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-input: #f1f5f9;
  --bg-nav: rgba(248, 250, 252, .85);

  --accent: #4f46e5;
  --accent-light: #6366f1;
  --accent-dark: #4338ca;
  --accent-glow: rgba(79, 70, 229, .08);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-link: #4f46e5;

  --border: rgba(15, 23, 42, .08);
  --border-accent: rgba(79, 70, 229, .2);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .06);
  --shadow: 0 4px 24px rgba(0, 0, 0, .08);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, .1);

  --gradient-hero: linear-gradient(135deg, #f8fafc 0%, #ede9fe 50%, #f8fafc 100%);
  --gradient-accent: linear-gradient(135deg, var(--accent-dark), var(--accent-light));
}


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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 1rem);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}

a { color: var(--text-link); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-light); }

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

::selection {
  background: var(--accent);
  color: #fff;
}

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

.text-accent { color: var(--accent); }


/* ============================================
   NAVIGATION
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--bg-nav);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: transform .35s var(--ease), box-shadow var(--transition);
}

.nav.hidden { transform: translateY(-100%); }
.nav.scrolled { box-shadow: var(--shadow-sm); }

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1001;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text-primary);
  text-decoration: none;
  position: relative;
  z-index: 1002;
}

.nav-logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--gradient-accent);
  color: #fff;
  font-size: .85rem;
  font-family: 'Courier New', monospace;
  font-weight: 700;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: .25rem;
}

.nav-link {
  display: block;
  padding: .5rem .75rem;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-xs);
  transition: color var(--transition), background var(--transition);
  position: relative;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--accent-glow);
}

.nav-link.active {
  color: var(--accent);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  position: relative;
  z-index: 1002;
}

/* Theme Toggle */
.theme-toggle {
  position: relative;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  overflow: hidden;
}

.theme-toggle:hover { background: var(--accent-glow); }

.theme-icon {
  position: absolute;
  font-size: 1.15rem;
  transition: transform .4s var(--ease), opacity .3s;
}

[data-theme="dark"] .theme-icon.moon { transform: translateY(0); opacity: 1; }
[data-theme="dark"] .theme-icon.sun { transform: translateY(-30px); opacity: 0; }
[data-theme="light"] .theme-icon.sun { transform: translateY(0); opacity: 1; }
[data-theme="light"] .theme-icon.moon { transform: translateY(30px); opacity: 0; }

/* Burger */
.nav-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}

.nav-burger:hover { background: var(--accent-glow); }

.nav-burger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: transform .3s var(--ease), opacity .3s;
}

.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 768px) {
  .nav-burger { display: flex; }

  /* Remove backdrop-filter on mobile to allow fixed children to escape nav */
  .nav {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--bg-primary);
  }

  .nav-links {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    background-color: #0b0f1a;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding-top: var(--nav-height);
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .3s var(--ease), visibility .3s;
  }

  [data-theme="light"] .nav-links {
    background-color: #f8fafc;
  }

  .nav-links.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .nav-link {
    font-size: 1.25rem;
    padding: 1rem 2rem;
    width: 100%;
    text-align: center;
  }
}


/* ============================================
   HERO
   ============================================ */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-hero);
  overflow: hidden;
  padding: calc(var(--nav-height) + 2rem) 1.5rem 4rem;
}

/* Background grid pattern */
.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  opacity: .5;
}

/* Particles */
.hero-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0;
  animation: particle-float linear infinite;
}

@keyframes particle-float {
  0% { opacity: 0; transform: translateY(100vh) scale(0); }
  10% { opacity: .6; }
  90% { opacity: .6; }
  100% { opacity: 0; transform: translateY(-10vh) scale(1); }
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 720px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem 1rem;
  background: var(--accent-glow);
  border: 1px solid var(--border-accent);
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 500;
  color: var(--accent-light);
  margin-bottom: 1.5rem;
}

.hero-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, .4); }
  50% { opacity: .7; box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

.hero-greeting {
  display: block;
  font-size: 1rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: .05em;
  margin-bottom: .5rem;
}

.hero-name {
  display: block;
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--text-primary), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-role {
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  color: var(--text-secondary);
  margin: 1rem 0 1.5rem;
  min-height: 2rem;
}

.typing-cursor {
  color: var(--accent);
  animation: blink .8s step-end infinite;
  font-weight: 300;
}

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

.hero-desc {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  gap: .75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.hero-social {
  display: flex;
  gap: .75rem;
  justify-content: center;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: var(--transition);
}

.social-link:hover {
  color: var(--accent);
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* Scroll indicator */
.hero-scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.scroll-indicator {
  width: 24px;
  height: 40px;
  border-radius: 12px;
  border: 2px solid var(--text-muted);
  display: flex;
  justify-content: center;
  padding-top: 8px;
  opacity: .5;
  transition: opacity var(--transition);
}

.scroll-indicator:hover { opacity: 1; }

.scroll-dot {
  width: 4px;
  height: 8px;
  background: var(--text-muted);
  border-radius: 2px;
  animation: scroll-bounce 2s infinite;
}

@keyframes scroll-bounce {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(12px); opacity: .3; }
}


/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-accent);
  color: #fff;
  box-shadow: 0 4px 16px rgba(99, 102, 241, .25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(99, 102, 241, .35);
  color: #fff;
}

.btn-primary:active { transform: translateY(0); }

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

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


/* ============================================
   SECTIONS
   ============================================ */
.section {
  padding: 6rem 0;
  position: relative;
}

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

.section-title {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  margin-bottom: 3rem;
  letter-spacing: -.02em;
}

.section-number {
  color: var(--accent);
  font-family: 'Courier New', monospace;
  font-size: .9em;
  margin-right: .3rem;
}


/* ============================================
   REVEAL ANIMATION (IntersectionObserver)
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered reveals */
.reveal-delay-1 { transition-delay: .1s; }
.reveal-delay-2 { transition-delay: .2s; }
.reveal-delay-3 { transition-delay: .3s; }
.reveal-delay-4 { transition-delay: .4s; }


/* ============================================
   ABOUT
   ============================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.about-text p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.8;
}

.about-text p:last-child { margin-bottom: 0; }

.info-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.5rem;
  transition: box-shadow var(--transition);
}

.info-card:hover { box-shadow: var(--shadow); }

.info-card-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
  padding-bottom: .8rem;
  border-bottom: 1px solid var(--border);
}

.info-list { list-style: none; }

.info-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .6rem 0;
  border-bottom: 1px solid var(--border);
}

.info-item:last-child { border-bottom: none; }

.info-icon {
  font-size: 1.1rem;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
  margin-top: .1rem;
}

.info-label {
  display: block;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: .1rem;
}

.info-value {
  display: block;
  font-size: .9rem;
  font-weight: 500;
}

.info-value a {
  color: var(--text-link);
  text-decoration: none;
}

.info-value a:hover { text-decoration: underline; }

@media (max-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}


/* ============================================
   TIMELINE (Experience)
   ============================================ */
.timeline {
  position: relative;
  padding-left: 2.5rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--border));
  border-radius: 1px;
}

.timeline-item {
  position: relative;
  padding-bottom: 2.5rem;
}

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

.timeline-marker {
  position: absolute;
  left: -2.5rem;
  top: 6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 3px solid var(--accent);
  z-index: 1;
  transition: var(--transition);
}

.timeline-item:hover .timeline-marker {
  background: var(--accent);
  box-shadow: 0 0 0 6px var(--accent-glow);
}

.timeline-content {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.5rem;
  transition: var(--transition);
}

.timeline-content:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: .8rem;
  flex-wrap: wrap;
}

.timeline-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.timeline-company {
  font-size: .85rem;
  color: var(--accent);
  font-weight: 500;
  margin-top: .15rem;
}

.timeline-date {
  font-size: .78rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
  padding: .25rem .6rem;
  background: var(--accent-glow);
  border-radius: var(--radius-xs);
}

.timeline-desc {
  font-size: .9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: .8rem;
}

.timeline-tags { display: flex; flex-wrap: wrap; gap: .4rem; }

.tag {
  display: inline-block;
  padding: .2rem .6rem;
  font-size: .72rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-glow);
  border-radius: var(--radius-xs);
  letter-spacing: .02em;
}


/* ============================================
   EDUCATION
   ============================================ */
.education-grid {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.edu-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.5rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .5rem 1.5rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.edu-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background: var(--gradient-accent);
  border-radius: 0 2px 2px 0;
  opacity: 0;
  transition: opacity var(--transition);
}

.edu-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow);
}

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

.edu-year {
  grid-row: 1 / 4;
  font-size: .82rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  padding-top: .15rem;
}

.edu-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.edu-school {
  font-size: .85rem;
  color: var(--accent-light);
  font-weight: 500;
}

.edu-desc {
  font-size: .88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-top: .3rem;
}

@media (max-width: 600px) {
  .edu-card {
    grid-template-columns: 1fr;
    gap: .3rem;
  }
  .edu-year {
    grid-row: auto;
  }
}


/* ============================================
   SKILLS
   ============================================ */
.skills-tabs {
  display: flex;
  gap: .4rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  padding-bottom: .4rem;
  position: sticky;
  top: var(--nav-height);
  background: var(--bg-secondary);
  z-index: 10;
  padding-top: .5rem;
  transition: top .35s var(--ease);
}

/* Quand la nav est masquée, coller les tabs tout en haut */
.nav.hidden ~ #skills .skills-tabs {
  top: 0;
}

.skills-tab {
  padding: .55rem 1.2rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-xs) var(--radius-xs) 0 0;
  position: relative;
  transition: color var(--transition), background var(--transition);
}

.skills-tab:hover {
  color: var(--text-primary);
  background: var(--accent-glow);
}

.skills-tab.active {
  color: var(--accent);
}

.skills-tab.active::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px 1px 0 0;
}

.skills-panel {
  display: none;
}

.skills-panel.active {
  display: block;
  animation: panel-fade-in .35s var(--ease);
}

@keyframes panel-fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  transition: var(--transition);
}

.skill-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.skill-icon {
  font-size: 1.5rem;
  margin-bottom: .6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: var(--accent-glow);
}

.skill-icon svg {
  color: var(--accent);
}

.skill-name {
  font-size: .95rem;
  font-weight: 600;
  margin-bottom: .6rem;
}

.skill-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: .3rem;
}

.skill-fill {
  height: 100%;
  width: 0%;
  background: var(--gradient-accent);
  border-radius: 3px;
  transition: width 1.2s var(--ease);
}

.skill-fill.animated {
  /* width set by JS via data-level */
}

.skill-level-label {
  font-size: .7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.skill-card.soft {
  text-align: left;
}

.skill-soft-desc {
  font-size: .82rem;
  color: var(--text-secondary);
  line-height: 1.6;
}


/* ============================================
   PROJECTS
   ============================================ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
}

.project-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.project-image {
  position: relative;
  height: 180px;
  background: var(--bg-secondary);
  overflow: hidden;
}

.project-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
}

.project-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  opacity: 0;
  transition: opacity .3s var(--ease);
}

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

.project-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  transition: var(--transition);
  transform: translateY(10px);
}

.project-card:hover .project-link {
  transform: translateY(0);
}

.project-link:hover {
  background: var(--accent-light);
  color: #fff;
  transform: scale(1.1) !important;
}

.project-body {
  padding: 1.2rem;
}

.project-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: .4rem;
}

.project-desc {
  font-size: .85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: .8rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}


/* ============================================
   INTERESTS
   ============================================ */
.interests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.interest-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  transition: var(--transition);
}

.interest-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.interest-icon {
  font-size: 2.5rem;
  margin-bottom: .8rem;
  display: block;
  transition: transform .4s var(--ease);
}

.interest-card:hover .interest-icon {
  transform: scale(1.2) rotate(-5deg);
}

.interest-name {
  font-size: .95rem;
  font-weight: 700;
  margin-bottom: .4rem;
}

.interest-desc {
  font-size: .82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}


/* ============================================
   CONTACT
   ============================================ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.contact-text h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.contact-text p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.contact-methods {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.contact-method {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .8rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: var(--transition);
}

.contact-method:hover {
  border-color: var(--border-accent);
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

.contact-method-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.contact-method-label {
  display: block;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin-bottom: .1rem;
}

.contact-method-value {
  display: block;
  font-size: .88rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* Form */
.contact-form-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: .4rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: .7rem .9rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: .9rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group textarea {
  min-height: 120px;
}

@media (max-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}


/* ============================================
   FOOTER
   ============================================ */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  background: var(--bg-secondary);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-copy {
  font-size: .82rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 1.2rem;
}

.footer-links a {
  font-size: .82rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

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


/* ============================================
   BACK TO TOP
   ============================================ */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  z-index: 100;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: var(--transition);
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  background: var(--accent-light);
  transform: translateY(-2px);
}


/* ============================================
   CUSTOM CURSOR TRAIL (desktop only)
   ============================================ */

/* Hide native cursor when custom cursor is active */
.custom-cursor-active,
.custom-cursor-active * {
  cursor: none !important;
}

.cursor-dot {
  position: fixed;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transition: opacity .3s;
  mix-blend-mode: difference;
}

.cursor-ring {
  position: fixed;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transition:
    opacity .3s,
    width .15s linear,
    height .15s linear,
    border-radius .15s linear,
    border-color .15s,
    background .15s;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
}

body:hover .cursor-dot,
body:hover .cursor-ring {
  opacity: .7;
}

/* Basic hover (when morph is disabled) */
.cursor-ring.hover {
  width: 48px;
  height: 48px;
  border-color: var(--accent-light);
}

/* Morphing state — ring takes shape of hovered element */
.cursor-ring.morphing {
  border-color: var(--accent-light);
  background: rgba(99, 102, 241, .06);
  opacity: .5;
}

@media (pointer: coarse) {
  .cursor-dot, .cursor-ring { display: none; }
  body { cursor: auto !important; }
  body * { cursor: auto !important; }
}


/* ============================================
   PROGRESS BAR
   ============================================ */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--gradient-accent);
  z-index: 1001;
  transition: none;
  transform-origin: left;
}


/* ============================================
   SMOOTH TRANSITIONS ON THEME CHANGE
   ============================================ */
.transitioning,
.transitioning * {
  transition-duration: .4s !important;
}


/* ============================================
   MEDIA QUERIES
   ============================================ */
@media (max-width: 480px) {
  .section { padding: 4rem 0; }
  .section-title { margin-bottom: 2rem; }
  .hero { padding: calc(var(--nav-height) + 1rem) 1rem 3rem; }
  .container { padding: 0 1rem; }
  .skills-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .interests-grid { grid-template-columns: repeat(2, 1fr); }
  .back-to-top { bottom: 1rem; right: 1rem; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .about-grid { gap: 2rem; }
}


/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  .nav, .hero-particles, .hero-bg-grid, .hero-scroll,
  .back-to-top, .cursor-dot, .cursor-ring, .progress-bar,
  .contact-form-wrapper, .hero-cta, .project-overlay { display: none !important; }
  
  body { background: #fff; color: #000; }
  .section, .section-alt { padding: 1.5rem 0; background: #fff; }
  .hero { min-height: auto; padding: 2rem 1rem; }
  .hero-name { -webkit-text-fill-color: #000; }
  
  .card, .info-card, .edu-card, .skill-card, .project-card,
  .interest-card, .timeline-content, .contact-method {
    box-shadow: none !important;
    border-color: #ddd !important;
    break-inside: avoid;
  }
}
