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

:root {
  --bg: #0d1117;
  --bg-alt: #161b22;
  --surface: #1c2128;
  --border: #30363d;
  --accent: #58a6ff;
  --accent-dim: rgba(88, 166, 255, 0.12);
  --text: #e6edf3;
  --text-muted: #8b949e;
  --text-dim: #6e7681;
  --green: #3fb950;
  --nav-bg: rgba(13, 17, 23, 0.85);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --transition: 0.25s ease;
  --max-w: 1100px;
}

[data-theme="light"] {
  --bg: #ffffff;
  --bg-alt: #f6f8fa;
  --surface: #ffffff;
  --border: #d0d7de;
  --accent: #0969da;
  --accent-dim: rgba(9, 105, 218, 0.08);
  --text: #1f2328;
  --text-muted: #656d76;
  --text-dim: #9198a1;
  --green: #1a7f37;
  --nav-bg: rgba(255, 255, 255, 0.85);
  --shadow: 0 4px 24px rgba(0,0,0,0.1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: #79c0ff; }

strong { color: var(--text); font-weight: 600; }

/* ===== THEME TOGGLE ===== */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 42px;
  height: 24px;
  cursor: pointer;
  position: relative;
  transition: all var(--transition);
  flex-shrink: 0;
}

.theme-toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  transition: transform var(--transition);
}

[data-theme="light"] .theme-toggle::after {
  transform: translateX(18px);
}

.theme-icon {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ===== NAV ===== */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition);
}

#navbar.scrolled { border-bottom-color: var(--border); }

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: 'Fira Code', monospace;
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(88,166,255,0.2);
}

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

.nav-links a {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

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

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-muted);
  border-radius: 2px;
  transition: all var(--transition);
}

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

.mobile-menu {
  display: none;
  flex-direction: column;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 0.5rem 0;
}

.mobile-menu.open { display: flex; }

.mobile-link {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  transition: all var(--transition);
}

.mobile-link:hover { color: var(--text); background: var(--surface); }

/* ===== HERO ===== */
#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1.5rem 4rem;
  position: relative;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(88,166,255,0.07) 0%, transparent 70%);
}

.hero-greeting {
  font-family: 'Fira Code', monospace;
  color: var(--accent);
  font-size: 1rem;
  margin-bottom: 0.75rem;
  letter-spacing: 0.05em;
}

.hero-name {
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

.hero-title {
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  font-weight: 400;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  font-family: 'Fira Code', monospace;
}

.hero-bio {
  max-width: 560px;
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 2rem;
}

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

.btn {
  padding: 0.7rem 1.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: #0d1117;
}

.btn-primary:hover {
  background: #79c0ff;
  color: #0d1117;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(88,166,255,0.3);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(88,166,255,0.4);
}

.btn-outline:hover {
  background: var(--accent-dim);
  transform: translateY(-2px);
}

.hero-socials {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.hero-socials a {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 1.1rem;
  transition: all var(--transition);
}

.hero-socials a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
  transform: translateY(-3px);
}

.hero-scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
}

.hero-scroll a {
  color: var(--text-dim);
  font-size: 1.1rem;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* ===== SECTIONS ===== */
.section { padding: 5rem 1.5rem; }
.section-alt { background: var(--bg-alt); }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
}

.section-title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  margin-bottom: 3rem;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 40px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

/* ===== INTERESTS ===== */
.interests-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.interest-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  transition: border-color var(--transition), transform var(--transition);
}

.interest-card:hover {
  border-color: rgba(88,166,255,0.4);
  transform: translateY(-4px);
}

.interest-icon {
  width: 48px;
  height: 48px;
  background: var(--accent-dim);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.interest-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.6rem;
}

.interest-card p {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.65;
}

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

.about-text p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: 0.975rem;
}

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

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

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

.stat-card:hover { border-color: var(--accent); }

.stat-number {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.4rem;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ===== TIMELINE ===== */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: 2rem;
}

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

.timeline-dot {
  position: absolute;
  left: -1.75rem;
  top: 1.25rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-alt);
  box-shadow: 0 0 0 3px rgba(88,166,255,0.2);
}

.timeline-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color var(--transition), transform var(--transition);
}

.timeline-card:hover {
  border-color: rgba(88,166,255,0.4);
  transform: translateX(4px);
}

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

.timeline-header h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.company {
  display: block;
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 0.2rem;
}

.timeline-date {
  font-size: 0.8rem;
  color: var(--text-dim);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.timeline-points {
  list-style: none;
  margin-bottom: 1rem;
}

.timeline-points li {
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 0.3rem 0 0.3rem 1.25rem;
  position: relative;
}

.timeline-points li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.75rem;
  top: 0.35rem;
}

/* ===== TAGS ===== */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(88,166,255,0.2);
  border-radius: 20px;
  padding: 0.2rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 500;
  font-family: 'Fira Code', monospace;
  white-space: nowrap;
}

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

.skill-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color var(--transition);
}

.skill-group:hover { border-color: rgba(88,166,255,0.3); }

.skill-group h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.skill-group h3 i { color: var(--accent); font-size: 0.85rem; }

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

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color var(--transition), transform var(--transition);
}

.project-card:hover {
  border-color: rgba(88,166,255,0.4);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

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

.project-icon {
  font-size: 1.5rem;
  color: var(--accent);
}

.project-links {
  display: flex;
  gap: 0.75rem;
}

.project-links a {
  color: var(--text-dim);
  font-size: 1.1rem;
  transition: color var(--transition);
}

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

.project-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.project-card p {
  color: var(--text-muted);
  font-size: 0.875rem;
  flex: 1;
}

/* ===== EDUCATION ===== */
.education-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 1.25rem;
}

.edu-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  transition: border-color var(--transition);
}

.edu-card:hover { border-color: rgba(88,166,255,0.4); }

.edu-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  background: var(--accent-dim);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 1.25rem;
}

.edu-info h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.3rem;
}

.edu-school {
  display: block;
  color: var(--accent);
  font-size: 0.875rem;
  margin-bottom: 0.6rem;
}

.edu-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.edu-meta span {
  font-size: 0.8rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.edu-cgpa { color: var(--green) !important; }
.edu-cgpa i { color: var(--green); }

/* ===== ACHIEVEMENTS ===== */
.achieve-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 1.5rem;
}

.achieve-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.achieve-group h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.achieve-group h3 i { color: var(--accent); }

.achieve-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.achieve-list li {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.achieve-list a {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.achieve-list a:hover {
  color: var(--accent);
  background: var(--accent-dim);
}

.achieve-list a i { font-size: 0.75rem; color: var(--accent); }

.achieve-list.plain li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.4rem 0;
}

.achieve-list.plain li i {
  color: var(--accent);
  margin-top: 0.2rem;
  font-size: 0.85rem;
  min-width: 14px;
}

/* ===== CONTACT ===== */
.contact-sub {
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  font-size: 1rem;
}

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

.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  transition: all var(--transition);
}

.contact-card:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--accent-dim);
  transform: translateY(-3px);
}

.contact-card i {
  font-size: 1.25rem;
  color: var(--accent);
  min-width: 20px;
}

/* ===== SCROLL TO TOP ===== */
#scrollTop {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(88,166,255,0.5);
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition), background var(--transition);
  z-index: 99;
}

[data-theme="light"] #scrollTop {
  box-shadow: 0 4px 20px rgba(9,105,218,0.35);
}

#scrollTop.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#scrollTop:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
  transform: translateY(-3px);
}

/* ===== FOOTER ===== */
footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 1.5rem;
  color: var(--text-dim);
  font-size: 0.85rem;
}

footer strong { color: var(--text-muted); }

/* ===== FADE-IN ANIMATION ===== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 1023px) {
  .interests-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
  .education-grid { grid-template-columns: 1fr; }
  .achieve-grid { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }

  .section { padding: 3.5rem 1.25rem; }

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

  .timeline { padding-left: 1.5rem; }
  .timeline-dot { left: -1.25rem; }
  .timeline-header { flex-direction: column; gap: 0.4rem; }

  .skills-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }

  .edu-card { flex-direction: column; gap: 1rem; }
  .edu-meta { flex-direction: column; gap: 0.4rem; }
}

@media (max-width: 480px) {
  .hero-cta { flex-direction: column; align-items: center; }
  .about-stats { grid-template-columns: 1fr 1fr; }
  .stat-card { padding: 1rem 0.75rem; }
  .stat-number { font-size: 1.4rem; }
}
