:root {
  --bg-color-light: #f8fafc;
  --bg-alt-light: #f1f5f9;
  --text-main-light: #0f172a;
  --text-muted-light: #475569;
  --primary-light: #3b82f6;
  --primary-hover-light: #2563eb;
  --card-bg-light: #ffffff;
  --border-light: #e2e8f0;
  --shadow-light: 0 4px 6px -1px rgba(0, 0, 0, 0.05);

  --bg-color-dark: #0f172a;
  --bg-alt-dark: #1e293b;
  --text-main-dark: #f8fafc;
  --text-muted-dark: #94a3b8;
  --primary-dark: #3b82f6;
  --primary-hover-dark: #60a5fa;
  --card-bg-dark: #1e293b;
  --border-dark: #334155;
  --shadow-dark: 0 10px 15px -3px rgba(0, 0, 0, 0.3);

  --font-body: 'Inter', sans-serif;
  --font-heading: 'Poppins', sans-serif;
  
  --transition: all 0.3s ease;
}

[data-theme="dark"] {
  --bg-color: var(--bg-color-dark);
  --bg-alt: var(--bg-alt-dark);
  --text-main: var(--text-main-dark);
  --text-muted: var(--text-muted-dark);
  --primary: var(--primary-dark);
  --primary-hover: var(--primary-hover-dark);
  --card-bg: var(--card-bg-dark);
  --border: var(--border-dark);
  --shadow: var(--shadow-dark);
}

[data-theme="light"] {
  --bg-color: var(--bg-color-light);
  --bg-alt: var(--bg-alt-light);
  --text-main: var(--text-main-light);
  --text-muted: var(--text-muted-light);
  --primary: var(--primary-light);
  --primary-hover: var(--primary-hover-light);
  --card-bg: var(--card-bg-light);
  --border: var(--border-light);
  --shadow: var(--shadow-light);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body); background-color: var(--bg-color);
  color: var(--text-main); line-height: 1.6;
  transition: background-color 0.3s, color 0.3s; overflow-x: hidden;
}
h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); font-weight: 600; line-height: 1.2; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 2rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.section { padding: 6rem 0; }
.bg-alt { background-color: var(--bg-alt); }
.section-title {
  font-size: 2.5rem; margin-bottom: 3rem; text-align: center;
  position: relative; display: block;
}
.section-title::after {
  content: ''; position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%);
  width: 50px; height: 4px; background-color: var(--primary); border-radius: 2px;
}
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 0.5rem; }
.me-1 { margin-right: 0.25rem; }
.w-100 { width: 100%; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.8rem 1.8rem; border-radius: 50px; font-weight: 500;
  cursor: pointer; transition: var(--transition); font-family: var(--font-heading); gap: 0.5rem;
}
.btn-primary { background-color: var(--primary); color: #fff; border: 2px solid var(--primary); }
.btn-primary:hover { background-color: transparent; color: var(--primary); }
.btn-outline { background-color: transparent; color: var(--text-main); border: 2px solid var(--text-main); }
.btn-outline:hover { background-color: var(--text-main); color: var(--bg-color); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.9rem; }

.header {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
  background-color: var(--bg-color); border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
.header.scrolled { box-shadow: var(--shadow); padding: 0.5rem 0; }
.nav-container { display: flex; justify-content: space-between; align-items: center; height: 80px; }
.logo { font-family: var(--font-heading); font-size: 1.8rem; font-weight: 700; color: var(--text-main); }
.logo span { color: var(--primary); }
.nav-links { display: flex; gap: 2rem; }
.nav-link { font-weight: 500; font-size: 1rem; color: var(--text-main); transition: var(--transition); position: relative; }
.nav-link:hover, .nav-link.active { color: var(--primary); }
.nav-actions { display: flex; align-items: center; gap: 1rem; }
.theme-btn { background: transparent; border: none; font-size: 1.2rem; color: var(--text-main); cursor: pointer; transition: var(--transition); }
.theme-btn:hover { color: var(--primary); }
.menu-btn { display: none; cursor: pointer; flex-direction: column; gap: 5px; }
.menu-btn .bar { width: 25px; height: 3px; background-color: var(--text-main); transition: var(--transition); }

.hero { min-height: 100vh; display: flex; align-items: center; padding-top: 80px; }
.greeting { font-size: 1.2rem; color: var(--primary); font-weight: 500; margin-bottom: 0.5rem; }
.hero-title {
  font-size: 4rem; font-weight: 800; margin-bottom: 1rem; line-height: 1.1;
  background: linear-gradient(to right, var(--text-main), var(--primary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; color: transparent;
}
.hero-subtitle { font-size: 1.5rem; color: var(--text-muted); font-weight: 500; margin-bottom: 1.5rem; }
.hero-desc { font-size: 1.1rem; color: var(--text-muted); max-width: 600px; margin-bottom: 2rem; }
.hero-btns { display: flex; gap: 1rem; }

.img-placeholder {
  width: 100%; max-width: 400px; aspect-ratio: 1 / 1; height: auto; margin: 0 auto;
  background: linear-gradient(45deg, var(--primary), #8b5cf6);
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 3rem; font-family: var(--font-heading); font-weight: 700; box-shadow: var(--shadow);
  animation: blob-bounce 8s infinite alternate both;
  overflow: hidden;
}
.img-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  border-radius: inherit;
}
@keyframes blob-bounce {
  0% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
  50% { border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%; }
  100% { border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
}

.img-wrapper { position: relative; width: 100%; max-width: 400px; aspect-ratio: 1 / 1; height: auto; margin: 0 auto; }
.photo-placeholder {
  width: 100%; height: 100%; background-color: var(--card-bg); border: 2px solid var(--border); border-radius: 1rem;
  display: flex; align-items: center; justify-content: center; font-size: 6rem; color: var(--text-muted); box-shadow: var(--shadow);
  overflow: hidden;
}
.photo-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.img-wrapper::after {
  content: ''; position: absolute; top: 20px; left: 20px; width: 100%; height: 100%;
  border: 4px solid var(--primary); border-radius: 1rem; z-index: -1;
}
.about-text p { color: var(--text-muted); margin-bottom: 1.5rem; font-size: 1.05rem; }
.interests h3 { margin-bottom: 1rem; color: var(--text-main); }
.interest-list { display: flex; flex-direction: column; gap: 0.8rem; }
.interest-list li { display: flex; align-items: center; gap: 0.8rem; color: var(--text-muted); }
.interest-list i { color: var(--primary); font-size: 1.2rem; }

.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; }
.skill-card {
  background-color: var(--card-bg); border: 1px solid var(--border); border-radius: 1rem; padding: 2rem;
  text-align: center; transition: var(--transition);
}
.skill-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: var(--primary); }
.skill-icon {
  width: 60px; height: 60px; background-color: rgba(59, 130, 246, 0.1); color: var(--primary);
  display: flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 1.5rem; margin: 0 auto 1.5rem;
}
.skill-card h3 { margin-bottom: 1rem; font-size: 1.2rem; }
.skill-card ul li { color: var(--text-muted); margin-bottom: 0.5rem; }

.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; }
.project-card { background-color: var(--card-bg); border: 1px solid var(--border); border-radius: 1rem; overflow: hidden; transition: var(--transition); }
.project-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.project-img { height: 200px; background: var(--bg-alt); display: flex; align-items: center; justify-content: center; font-size: 4rem; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.project-info { padding: 2rem; }
.project-info h3 { margin-bottom: 1rem; font-size: 1.3rem; }
.project-info p { color: var(--text-muted); margin-bottom: 1.5rem; font-size: 0.95rem; }
.project-features { margin-bottom: 1.5rem; }
.project-features li { display: flex; align-items: center; gap: 0.5rem; color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.5rem; }
.project-features i { color: #10b981; }

.column-title { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1.5rem; font-size: 1.4rem; }
.column-title i { color: var(--primary); }
.timeline { position: relative; padding-left: 1.5rem; border-left: 2px solid var(--border); }
.timeline-item { position: relative; margin-bottom: 2rem; }
.timeline-item::before {
  content: ''; position: absolute; left: -1.5rem; top: 5px; width: 14px; height: 14px;
  background-color: var(--primary); border-radius: 50%; transform: translateX(-50%); border: 3px solid var(--bg-color);
}
.timeline-item h4 { font-size: 1.1rem; margin-bottom: 0.2rem; }
.timeline-item h5 { font-size: 0.95rem; color: var(--text-muted); font-weight: 400; margin-bottom: 0.5rem; }
.badge {
  display: inline-block; padding: 0.2rem 0.6rem; background-color: rgba(59, 130, 246, 0.1);
  color: var(--primary); border-radius: 50px; font-size: 0.8rem; font-weight: 500; margin-bottom: 0.8rem;
}
.cert-tags { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.tag { background-color: var(--card-bg); border: 1px solid var(--border); padding: 0.3rem 0.8rem; border-radius: 4px; font-size: 0.9rem; color: var(--text-muted); }

.cp-card { background-color: var(--card-bg); border: 1px solid var(--border); padding: 1.5rem; border-radius: 1rem; }
.cp-card p { color: var(--text-muted); font-size: 0.95rem; }
.contest-list li { display: flex; flex-direction: column; margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.contest-list li:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.contest-list strong { color: var(--text-main); font-family: var(--font-heading); }
.contest-list span { color: var(--text-muted); font-size: 0.9rem; }

.skills-bar { background-color: var(--card-bg); border: 1px solid var(--border); padding: 1.5rem; border-radius: 1rem; }
.lang-item span { font-size: 0.95rem; font-weight: 500; display: block; margin-bottom: 0.5rem; }
.bar-container { width: 100%; height: 8px; background-color: var(--border); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background-color: var(--primary); border-radius: 4px; }

.contact-info p { color: var(--text-muted); margin-bottom: 1.5rem; }
.social-links { display: flex; gap: 1rem; }
.social-links a {
  width: 45px; height: 45px; background-color: var(--card-bg); border: 1px solid var(--border);
  border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
  color: var(--text-main); transition: var(--transition);
}
.social-links a:hover { background-color: var(--primary); color: white; border-color: var(--primary); transform: translateY(-3px); }

.contact-form { background-color: var(--card-bg); border: 1px solid var(--border); padding: 2rem; border-radius: 1rem; }
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 500; }
.form-group input, .form-group textarea {
  width: 100%; padding: 0.8rem 1rem; background-color: var(--bg-alt); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text-main); font-family: var(--font-body); transition: var(--transition);
}
.form-group input:focus, .form-group textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.footer { background-color: var(--bg-alt); padding: 2rem 0; border-top: 1px solid var(--border); }
.footer-container { display: flex; justify-content: space-between; align-items: center; }
.footer-bottom p { color: var(--text-muted); font-size: 0.95rem; }
.scroll-top {
  width: 40px; height: 40px; background-color: var(--primary); color: white;
  display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: var(--transition);
}
.scroll-top:hover { transform: translateY(-3px); background-color: var(--primary-hover); }

.fade-in { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease, transform 0.8s ease; }
.fade-in.appear { opacity: 1; transform: translateY(0); }
.delay-1 { transition-delay: 0.2s; }

@media screen and (max-width: 992px) {
  .hero-title { font-size: 3rem; } .grid-2 { gap: 2rem; }
}
@media screen and (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .menu-btn { display: flex; }
  .navbar {
    position: fixed; top: 80px; left: -100%; width: 100%; height: calc(100vh - 80px);
    background-color: var(--bg-color); flex-direction: column; padding: 2rem; transition: 0.4s ease; border-top: 1px solid var(--border);
  }
  .navbar.active { left: 0; }
  .nav-links { flex-direction: column; gap: 1.5rem; align-items: center; }
  .menu-btn.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .menu-btn.active .bar:nth-child(2) { opacity: 0; }
  .menu-btn.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
  .hero { text-align: center; }
  .hero-btns { justify-content: center; }
  .hero-container { grid-template-columns: 1fr; flex-direction: column-reverse; display: flex; }
  
  /* Remove fancy image offset outlines on tablet to save space */
  .img-wrapper::after { display: none; }
  .about-text { text-align: center; }
  .about-text .interest-list { align-items: center; }
  .contact-info { text-align: center; }
  .social-links { justify-content: center; }
  .footer-container { flex-direction: column; gap: 1rem; text-align: center; }
}
@media screen and (max-width: 480px) {
  .hero-title { font-size: 2.2rem; }
  .section { padding: 4rem 0; }
  .container { padding: 0 1.2rem; }
  .skills-grid, .projects-grid, .edu-grid { grid-template-columns: 1fr; }
  .hero-btns { flex-direction: column; width: 100%; }
  .hero-btns .btn { width: 100%; }
  .img-placeholder, .img-wrapper { max-width: 250px; }
  
  /* Fix timelines & bars on very small screens */
  .timeline { padding-left: 1rem; }
  .contact-form { padding: 1.5rem; }
}
