*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --navy: #0A0F1E;
  --navy-light: #111827;
  --accent: #4F9CF9;
  --accent2: #38BDF8;
  --accent-glow: rgba(79,156,249,0.15);
  --text: #F1F5F9;
  --text-muted: #94A3B8;
  --border: rgba(255,255,255,0.08);
  --card-bg: rgba(255,255,255,0.04);
  --card-border: rgba(255,255,255,0.1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--navy);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

#particleCanvas {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.65;
  mix-blend-mode: normal;
  filter: blur(1.2px);
  transform: translateZ(0);
}

body.light-theme #particleCanvas {
  opacity: 0.75;
  filter: blur(0.9px);
}

body.dark-theme #particleCanvas {
  opacity: 0.38;
  filter: blur(1.8px);
}

.hero,
section,
footer,
nav {
  background: transparent;
}

#main-content,
nav,
.hero,
section,
footer {
  position: relative;
  z-index: 1;
}


.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 10% 25%, rgba(79,156,249,0.18), transparent 45%),
              radial-gradient(circle at 75% 10%, rgba(56,189,248,0.12), transparent 45%),
              radial-gradient(circle at 90% 80%, rgba(99,102,241,0.14), transparent 55%);
  mix-blend-mode: screen;
  opacity: 0.65;
  pointer-events: none;
}

body.dark-theme .hero::before,
body.dark-theme .hero::after {
  opacity: 0.42;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(10,15,30,0.42), rgba(7,10,20,0.82));
  pointer-events: none;
}


body.light-theme {
  --navy: #f8fafc;
  --navy-light: #e2e8f0;
  --accent: #4f46e5;
  --accent2: #6366f1;
  --accent-glow: rgba(79,156,249,0.08);
  --text: #0f172a;
  --text-muted: #475569;
  --border: rgba(15,23,42,0.12);
  --card-bg: rgba(255,255,255,0.95);
  --card-border: rgba(15,23,42,0.08);
}

body.dark-theme {
  --navy: #0A0F1E;
  --navy-light: #111827;
  --accent: #4F9CF9;
  --accent2: #38BDF8;
  --accent-glow: rgba(79,156,249,0.15);
  --text: #F1F5F9;
  --text-muted: #94A3B8;
  --border: rgba(255,255,255,0.08);
  --card-bg: rgba(255,255,255,0.04);
  --card-border: rgba(255,255,255,0.1);
}

body.light-theme .stat-card,
body.light-theme .skill-chip,
body.light-theme .project-card,
body.light-theme .contact-inner {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.progress-container {
  position: fixed; top: 0; left: 0; width: 100%; height: 4px; background: rgba(255,255,255,0.15); z-index: 150;
}
.progress-bar {
  width: 0%; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); transform-origin: left;
  transition: width 0.14s ease;
}

nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.25rem 3rem;
  background: rgba(10,15,30,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
body.light-theme nav {
  background: rgba(255,255,255,0.92);
  border-bottom-color: rgba(15,23,42,0.14);
}
body.light-theme .nav-logo,
body.light-theme .nav-links a,
body.light-theme .theme-toggle,
body.light-theme .nav-cta {
  color: #0f172a;
}
body.light-theme .nav-links a:hover,
body.light-theme .nav-cta:hover {
  color: var(--accent);
}
body.light-theme .nav-cta {
  background: var(--accent);
  color: #ffffff;
}
body.light-theme .theme-toggle {
  background: rgba(15,23,42,0.08);
  border: 1px solid rgba(15,23,42,0.16);
}
.nav-logo { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 1.1rem; letter-spacing: -0.02em; color: var(--text); }
.nav-logo span { color: var(--accent); }
.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a { text-decoration: none; color: var(--text-muted); font-size: 0.875rem; font-weight: 400; transition: color 0.2s; }
.nav-links a:hover { color: var(--accent); }
.nav-cta { background: var(--accent); color: #0A0F1E; padding: 0.5rem 1.25rem; border-radius: 6px; font-size: 0.875rem; font-weight: 500; text-decoration: none; transition: opacity 0.2s; }
.nav-cta:hover { opacity: 0.85; }

.nav-actions { display: flex; align-items: center; gap: 0.75rem; }
.theme-toggle {
  background: rgba(255,255,255,0.08); color: var(--text); border: 1px solid var(--card-border); border-radius: 999px; width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  font-size: 1rem; transition: background 0.2s, transform 0.2s;
}
.theme-toggle:hover { transform: translateY(-1px); background: rgba(255,255,255,0.12); }

.hero { min-height: 100vh; display: flex; align-items: center; padding: 6rem 3rem 4rem; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; top: -30%; right: -10%; width: 600px; height: 600px; background: radial-gradient(circle, rgba(79,156,249,0.12) 0%, transparent 70%); pointer-events: none; }
.hero::after { content: ''; position: absolute; bottom: -20%; left: -10%; width: 400px; height: 400px; background: radial-gradient(circle, rgba(56,189,248,0.08) 0%, transparent 70%); pointer-events: none; }
.hero-content { max-width: 700px; animation: fadeUp 0.8s ease both; }
.hero-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-glow); border: 1px solid rgba(79,156,249,0.3); color: var(--accent); font-size: 0.78rem; font-weight: 500; padding: 0.35rem 0.85rem; border-radius: 50px; margin-bottom: 1.5rem; letter-spacing: 0.04em; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; }
.hero h1 { font-family: 'Syne', sans-serif; font-size: clamp(2.5rem, 6vw, 4rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; margin-bottom: 0.5rem; }
.hero h1 .highlight { color: var(--accent); }
.hero-sub { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 2rem; font-weight: 300; max-width: 500px; line-height: 1.7; }
.hero-buttons { display: flex; gap: 1rem; flex-wrap: wrap; }
.btn-primary { position: relative; overflow: hidden; background: var(--accent); color: #0A0F1E; padding: 0.75rem 1.75rem; border-radius: 8px; font-weight: 500; font-size: 0.9rem; text-decoration: none; transition: opacity 0.2s, transform 0.2s; }
.btn-primary::after { content: ''; position: absolute; left: 50%; top: 50%; width: 0; height: 0; background: rgba(255,255,255,0.5); border-radius: 50%; transform: translate(-50%, -50%); opacity: 0; transition: width 0.4s ease, height 0.4s ease, opacity 0.3s ease; }
.btn-primary:hover::after { width: 220px; height: 220px; opacity: 0.15; }
.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-outline { border: 1px solid var(--card-border); color: var(--text); padding: 0.75rem 1.75rem; border-radius: 8px; font-weight: 400; font-size: 0.9rem; text-decoration: none; background: transparent; transition: border-color 0.2s, transform 0.2s; }
.btn-outline:hover { border-color: var(--accent); transform: translateY(-1px); }

section { padding: 5rem 3rem; }
.section-label { font-size: 0.75rem; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.5rem; }
.section-title { font-family: 'Syne', sans-serif; font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 700; letter-spacing: -0.02em; margin-bottom: 3rem; color: var(--text); }
.divider { width: 100%; height: 1px; background: var(--border); }

#timeline { padding: 4rem 3rem; position: relative; }
#timeline .container { position: relative; max-width: 1200px; margin: auto; }
#timeline h2 { font-family: 'Syne', sans-serif; font-size: clamp(2rem, 5vw, 2.8rem); margin-bottom: 0.4rem; }
#timeline .timeline-subtitle { color: var(--text-muted); margin-bottom: 2rem; }
#timeline .timeline-controls { display: flex; gap: 0.75rem; margin-bottom: 2rem; justify-content: center; }
#timeline .timeline-control-btn { background: transparent; border: 1px solid var(--accent); color: var(--accent); cursor: pointer; padding: 0.5rem 1rem; border-radius: 8px; font-size: 0.9rem; transition: all 0.25s ease; }
#timeline .timeline-control-btn:hover,
#timeline .timeline-control-btn.active { background: var(--accent); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79,156,249,0.3); }
#timeline .timeline-line { position: absolute; left: 50%; top: 4rem; bottom: 2rem; width: 4px; background: linear-gradient(to bottom, var(--accent), var(--accent2)); transform: translateX(-50%); border-radius: 999px; z-index: 0; }
#timeline .timeline-items { display: grid; gap: 2rem; position: relative; }
#timeline .timeline-item { position: relative; display: flex; align-items: flex-start; gap: 1rem; z-index: 1; }
#timeline .timeline-item:nth-child(odd) { flex-direction: row; }
#timeline .timeline-item:nth-child(even) { flex-direction: row-reverse; }
#timeline .timeline-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; box-shadow: 0 0 0 rgba(0,0,0,0.15); transition: transform 0.25s ease, box-shadow 0.25s ease; margin: 0.3rem 0; flex-shrink: 0; }
#timeline .timeline-item.active .timeline-dot,
#timeline .timeline-item:hover .timeline-dot { transform: scale(1.3); box-shadow: 0 0 18px rgba(79,156,249,0.6); }
#timeline .timeline-content { background: var(--card-bg); border: 1px solid var(--card-border); padding: 1.1rem 1.2rem; border-radius: 12px; width: min(50ch, 460px); position: relative; transition: transform 0.27s ease, box-shadow 0.27s ease; }
#timeline .timeline-item:hover .timeline-content { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(0,0,0,0.12); }
#timeline .timeline-content h3 { margin-bottom: 0.35rem; margin-top: 0; color: var(--text); }
#timeline .timeline-content p { margin: 0.35rem 0; color: var(--text-muted); }
#timeline .timeline-toggle { background: transparent; border: 1px solid var(--accent); color: var(--accent); cursor: pointer; padding: 0.35rem 0.75rem; border-radius: 7px; font-size: 0.82rem; margin-top: 0.5rem; }
#timeline .timeline-details { max-height: 0; overflow: hidden; transition: max-height 0.4s ease, opacity 0.4s ease; opacity: 0; }
#timeline .timeline-item.open .timeline-details { max-height: 160px; opacity: 1; margin-top: 0.45rem; color: var(--text); }
#timeline .timeline-item.open .timeline-toggle { background: var(--accent); color: #fff; }

#timeline .timeline-item.not-visible { opacity: 0; transform: translateY(20px); }
#timeline .timeline-item.fade-in { opacity: 1; transform: translateY(0); transition: opacity 0.6s ease, transform 0.6s ease; }

@media (max-width: 860px) {
  #timeline .timeline-line { left: 12px; top: 3.75rem; bottom: 1.5rem; }
  #timeline .timeline-items { padding-left: 1.5rem; }
  #timeline .timeline-item { flex-direction: row !important; }
  #timeline .timeline-content { width: auto; }
}

@media (max-width: 520px) {
  #timeline h2 { font-size: 1.8rem; }
  #timeline .timeline-content { padding: 1rem; }
  #timeline .timeline-toggle { font-size: 0.78rem; }
}

.about-grid { display: flex; flex-direction: column; align-items: center; text-align: center; }
.about-text { max-width: 65ch; margin: 0 auto; }
.about-text p { color: var(--text-muted); font-size: 1rem; line-height: 1.8; margin-bottom: 1rem; }
.about-text p strong { color: var(--text); font-weight: 500; }
.about-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; max-width: 600px; margin-top: 2rem; }
.stat-card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 12px; padding: 1.25rem 1.5rem; }
.stat-num { font-family: 'Syne', sans-serif; font-size: 2rem; font-weight: 800; color: var(--accent); }
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; }

.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; }
.skill-chip { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 10px; padding: 1rem 1.25rem; transition: border-color 0.2s, background 0.2s; }
.skill-chip:hover { border-color: var(--accent); background: var(--accent-glow); }
.skill-icon { font-size: 1.4rem; margin-bottom: 0.5rem; }
.skill-name { font-size: 0.875rem; font-weight: 500; color: var(--text); }
.skill-level { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }

.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; perspective: 1100px; }
.project-card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 14px; padding: 1.75rem; transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s; position: relative; overflow: hidden; transform-style: preserve-3d; will-change: transform; }
.project-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, var(--accent), var(--accent2)); opacity: 0; transition: opacity 0.3s; }
.project-card:hover { border-color: rgba(79,156,249,0.4); transform: translateY(-3px) rotateX(2deg) rotateY(2deg); box-shadow: 0 14px 30px rgba(0,0,0,0.3); }
.project-card:hover::before { opacity: 1; }
.project-tag { display: inline-block; font-size: 0.7rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); background: var(--accent-glow); border: 1px solid rgba(79,156,249,0.2); padding: 0.25rem 0.65rem; border-radius: 50px; margin-bottom: 1rem; }
.project-title { font-family: 'Syne', sans-serif; font-size: 1.2rem; font-weight: 700; margin-bottom: 0.75rem; }
.project-desc { color: var(--text-muted); font-size: 0.9rem; line-height: 1.7; margin-bottom: 1.25rem; }
.project-tech { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tech-badge { font-size: 0.72rem; color: var(--text-muted); background: rgba(255,255,255,0.06); border: 1px solid var(--border); padding: 0.2rem 0.6rem; border-radius: 4px; }

.contact-inner { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 16px; padding: 3rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 2rem; position: relative; overflow: hidden; }
.contact-inner::before { content: ''; position: absolute; top: -50%; right: -10%; width: 300px; height: 300px; background: radial-gradient(circle, rgba(79,156,249,0.1) 0%, transparent 70%); pointer-events: none; }
.contact-text h2 { font-family: 'Syne', sans-serif; font-size: 1.75rem; font-weight: 700; margin-bottom: 0.5rem; }
.contact-text p { color: var(--text-muted); font-size: 0.95rem; }
.contact-links { display: flex; gap: 1rem; flex-wrap: wrap; }
.contact-link { display: flex; align-items: center; gap: 0.5rem; background: rgba(255,255,255,0.06); border: 1px solid var(--card-border); color: var(--text); text-decoration: none; padding: 0.65rem 1.25rem; border-radius: 8px; font-size: 0.875rem; transition: border-color 0.2s, background 0.2s; }
.contact-link:hover { border-color: var(--accent); background: var(--accent-glow); }
.contact-link.primary { background: var(--accent); color: #0A0F1E; border-color: transparent; font-weight: 500; }
.contact-link.primary:hover { opacity: 0.88; }

footer { padding: 2rem 3rem; text-align: center; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 0.8rem; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.fade-in { animation: fadeUp 0.7s ease both; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

@media (max-width: 768px) {
  nav { padding: 1rem 1.5rem; }
  .nav-links { display: none; }
  .hero { padding: 5rem 1.5rem 3rem; }
  section { padding: 3.5rem 1.5rem; }
  .about-grid { grid-template-columns: 1fr; }
  .contact-inner { padding: 2rem; flex-direction: column; }
}

.back-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1.2rem;
  display: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #ffffff;
  border: 2px solid rgba(255,255,255,0.5);
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(0,0,0,0.35);
  transition: transform 0.18s ease, opacity 0.2s ease, filter 0.2s ease;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
}
.back-to-top:hover,
.back-to-top:focus {
  transform: translateY(-4px) scale(1.04);
  opacity: 1;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,0.45));
}
.back-to-top:active {
  transform: translateY(0) scale(0.98);
}

