@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@300;400;500&family=Syne:wght@400;500;600;700;800&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --bg: #0a0e1a;
  --bg2: #0f1525;
  --bg3: #141b2e;
  --card: #111827;
  --card2: #1a2235;
  --border: rgba(255,255,255,0.07);
  --accent: #3b82f6;
  --accent2: #06b6d4;
  --accent-glow: rgba(59,130,246,0.15);
  --text: #e2e8f0;
  --text2: #94a3b8;
  --text3: #64748b;
  --green: #10b981;
  --orange: #f59e0b;
  --red: #ef4444;
  --sidebar-w: 260px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0; left: 0;
  display: flex;
  flex-direction: column;
  padding: 28px 20px;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-profile { text-align: center; margin-bottom: 24px; }

.sidebar-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--bg3);
  border: 2px solid var(--accent);
  margin: 0 auto 12px;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  box-shadow: 0 0 0 0 rgba(59,130,246,0.2);
  transition: box-shadow 0.3s ease;
}

.sidebar-avatar:hover {
  box-shadow: 0 0 16px rgba(59,130,246,0.25);
}

.sidebar-avatar img { width: 100%; height: 100%; object-fit: cover; }

.sidebar-name {
  font-family: 'Syne', sans-serif;
  font-size: 15px; font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.sidebar-role {
  font-size: 11px;
  color: var(--accent2);
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.sidebar-tags {
  display: flex; flex-wrap: wrap; gap: 4px;
  justify-content: center;
  margin-top: 10px;
}

.sidebar-tag {
  font-size: 9px;
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 20px;
  background: var(--accent-glow);
  border: 1px solid rgba(59,130,246,0.3);
  color: var(--accent);
}

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

.sidebar-label {
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--text3);
  font-family: 'DM Mono', monospace;
  margin-bottom: 8px;
  padding-left: 4px;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s ease;
  color: var(--text2);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
  border: 1px solid transparent;
  position: relative;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 3px; height: 60%;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  transition: transform 0.25s ease;
}

.nav-item:hover { background: var(--bg3); color: var(--text); }

.nav-item.active {
  background: var(--accent-glow);
  border-color: rgba(59,130,246,0.3);
  color: var(--accent);
}

.nav-item.active::before {
  transform: translateY(-50%) scaleY(1);
}

.nav-icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-stats { margin-top: auto; }

.stat-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 0;
  font-size: 12px;
  color: var(--text2);
  border-bottom: 1px solid var(--border);
}

.stat-row:last-child { border-bottom: none; }
.stat-val { color: var(--text); font-weight: 600; font-family: 'DM Mono', monospace; }

/* ── MAIN CONTENT ── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
}

.tab-content {
  display: none;
  padding: 32px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.tab-content.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* ── TOP BAR (mobile) ── */
.topbar {
  display: none;
  align-items: center; justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 99;
}

.topbar-title {
  font-family: 'Syne', sans-serif;
  font-size: 16px; font-weight: 700;
}

.hamburger {
  background: none; border: none;
  color: var(--text); font-size: 22px;
  cursor: pointer;
}

/* ── SECTION HEADER ── */
.section-header {
  margin-bottom: 28px;
}

.section-title {
  font-family: 'Syne', sans-serif;
  font-size: 26px; font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.section-sub {
  color: var(--text2);
  font-size: 14px;
  margin-top: 4px;
}

/* ── HOME TAB ── */
.home-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

.hero-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
}

.hero-main {
  grid-column: 1 / -1;
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.hero-avatar {
  width: 88px; height: 88px;
  border-radius: 50%;
  background: var(--bg3);
  border: 2px solid var(--accent);
  flex-shrink: 0;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
}

.hero-avatar img { width: 100%; height: 100%; object-fit: cover; }

.hero-info { flex: 1; }

.hero-name {
  font-family: 'Syne', sans-serif;
  font-size: 28px; font-weight: 800;
  letter-spacing: -0.02em;
}

.hero-name span { color: var(--accent); }

.hero-meta {
  font-size: 13px;
  color: var(--text2);
  margin: 4px 0 10px;
  font-family: 'DM Mono', monospace;
}

.hero-title-badge {
  display: inline-block;
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.1em;
  color: var(--accent2);
  margin-bottom: 10px;
}

.hero-bio {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.6;
  max-width: 480px;
}

.hero-buttons {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 16px;
}

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
}

.btn:hover {
  background: var(--card2);
  border-color: var(--accent);
  color: var(--accent);
  transform: scale(1.02);
  box-shadow: 0 0 12px rgba(59,130,246,0.15);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: #2563eb;
  border-color: #2563eb;
  color: white;
  transform: scale(1.02);
  box-shadow: 0 0 16px rgba(59,130,246,0.3);
}

/* Highlights */
.highlights-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.highlight-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
}

.highlight-card:hover {
  border-color: rgba(59,130,246,0.4);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25), 0 0 0 1px rgba(59,130,246,0.1);
}

.highlight-thumb {
  height: 100px;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
}

.highlight-body { padding: 12px 14px; }

.highlight-label {
  font-size: 13px; font-weight: 600;
  color: var(--text);
}

.highlight-sub {
  font-size: 11px;
  color: var(--accent);
  margin-top: 2px;
}

/* Focus section */
.focus-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
}

.focus-title {
  font-size: 14px; font-weight: 600;
  color: var(--text2);
  margin-bottom: 14px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 11px;
  font-family: 'DM Mono', monospace;
}

.focus-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  border-radius: 8px;
  transition: background 0.2s ease;
}

.focus-item:hover { background: rgba(59,130,246,0.04); }

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

.focus-icon {
  width: 32px; height: 32px;
  background: var(--accent-glow);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.focus-text { font-size: 14px; color: var(--text2); line-height: 1.5; padding-top: 6px; }

/* ── GROWTH TAB ── */
.semester-section { margin-bottom: 32px; }

.sem-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px;
}

.sem-badge {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  padding: 4px 12px;
  background: var(--accent-glow);
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: 20px;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.sem-line { flex: 1; height: 1px; background: var(--border); }

.course-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.course-card:hover {
  border-color: rgba(59,130,246,0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.course-card.open {
  border-color: rgba(59,130,246,0.4);
  background: var(--card2);
}

.course-top {
  display: flex; align-items: center; justify-content: space-between;
}

.course-left { display: flex; align-items: center; gap: 12px; }

.course-code {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--text3);
  letter-spacing: 0.05em;
}

.course-name { font-size: 14px; font-weight: 500; color: var(--text); }

.course-right { display: flex; align-items: center; gap: 10px; }

.grade-badge {
  font-family: 'DM Mono', monospace;
  font-size: 13px; font-weight: 600;
  color: var(--accent2);
}

.chevron {
  color: var(--text3);
  font-size: 12px;
  transition: transform 0.2s;
}

.course-card.open .chevron { transform: rotate(180deg); }

.course-body {
  max-height: 0;
  overflow: hidden;
  padding-top: 0;
  margin-top: 0;
  border-top: 1px solid transparent;
  transition: max-height 0.35s ease, padding-top 0.35s ease, margin-top 0.35s ease, border-color 0.35s ease;
}

.course-card.open .course-body {
  max-height: 200px;
  padding-top: 12px;
  margin-top: 12px;
  border-top-color: var(--border);
}

.skill-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }

.skill-tag {
  font-size: 10px;
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
}

.course-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid rgba(59,130,246,0.3);
  background: var(--accent-glow);
  transition: all 0.2s;
  margin-top: 4px;
}

.course-link:hover { background: rgba(59,130,246,0.25); }

/* ── PROJECTS TAB ── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
  gap: 20px;
}

.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.project-card:hover {
  border-color: rgba(59,130,246,0.35);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.3), 0 0 0 1px rgba(59,130,246,0.08);
}

.project-card.featured { border-color: rgba(16,185,129,0.3); grid-column: 1 / -1; }

.project-thumb {
  height: 140px;
  background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
  display: flex; align-items: center; justify-content: center;
  font-size: 48px;
  position: relative;
  overflow: hidden;
}

.project-thumb-riceroute {
  background: linear-gradient(135deg, #0a1628, #0d2137, #0f3460);
}

/* RiceRoute mini viz */
.sccs-mini {
  display: flex; gap: 24px; align-items: center;
}

.sccs-item {
  text-align: center;
}

.sccs-label {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}

.sccs-value {
  font-family: 'Syne', sans-serif;
  font-size: 22px;
  font-weight: 800;
}

.sccs-sub { font-size: 9px; color: var(--text3); }

.india-score { color: var(--green); }
.pak-score { color: var(--red); }

.project-body { padding: 20px; }

.project-status {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
}

.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.pulse {
  animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74,158,255,0.4); }
  50% { box-shadow: 0 0 0 4px rgba(74,158,255,0); }
}

.project-name {
  font-family: 'Syne', sans-serif;
  font-size: 18px; font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.project-desc {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.6;
  margin-bottom: 14px;
}

.project-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }

.project-tag {
  font-size: 10px;
  font-family: 'DM Mono', monospace;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
}

.project-footer {
  display: flex; justify-content: flex-end;
}

/* ── DASHBOARD TAB ── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.dash-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.dash-card:hover {
  border-color: rgba(59,130,246,0.25);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.dash-card.full { grid-column: 1 / -1; }

.dash-card-title {
  font-family: 'Syne', sans-serif;
  font-size: 16px; font-weight: 700;
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 8px;
}

/* CGPA Chart */
.cgpa-big {
  font-family: 'Syne', sans-serif;
  font-size: 52px; font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.cgpa-trend {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 20px;
  background: rgba(239,68,68,0.15);
  color: var(--red);
  margin-left: 12px;
  font-family: 'DM Mono', monospace;
}

.chart-area {
  margin-top: 20px;
  height: 100px;
  position: relative;
}

.chart-svg { width: 100%; height: 100%; }

.sem-chart-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
}

.sem-chart-labels span {
  font-size: 11px;
  color: var(--text3);
  font-family: 'DM Mono', monospace;
}

/* Grades */
.sem-tabs {
  display: flex; gap: 6px;
  margin-bottom: 16px;
}

.sem-tab {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px; font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  transition: all 0.2s;
  font-family: 'DM Mono', monospace;
}

.sem-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.grade-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.grade-row:last-child { border-bottom: none; }

.grade-subject { font-size: 13px; color: var(--text2); flex: 1; }

.grade-val {
  font-family: 'DM Mono', monospace;
  font-size: 13px; font-weight: 600;
  color: var(--accent2);
  margin-right: 12px;
  width: 28px; text-align: right;
}

.grade-bar-wrap { width: 100px; height: 4px; background: var(--bg3); border-radius: 2px; }
.grade-bar {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  width: 0;
}

/* Career metrics */
.career-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 0;
}

.career-item { text-align: center; }

.career-val {
  font-family: 'Syne', sans-serif;
  font-size: 32px; font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.career-val.accent { color: var(--accent); }

.career-label {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--text3);
  margin-top: 4px;
}

.career-divider { width: 1px; background: var(--border); }

/* Competitions */
.comp-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.comp-item { text-align: center; }

.comp-val {
  font-family: 'Syne', sans-serif;
  font-size: 36px; font-weight: 800;
}

.comp-val.green { color: var(--green); }

.comp-label {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--text3);
  margin-top: 4px;
}

/* Skill metrics */
.skill-metric-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; margin-bottom: 16px;
}

.skill-metric-item {
  background: var(--bg3);
  border-radius: 10px;
  padding: 16px;
  display: flex; align-items: center; gap: 12px;
}

.skill-metric-icon {
  width: 36px; height: 36px;
  background: var(--accent-glow);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}

.skill-metric-val {
  font-family: 'Syne', sans-serif;
  font-size: 22px; font-weight: 700;
}

.skill-metric-label { font-size: 11px; color: var(--text3); }

.primary-skills-label {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--text3);
  margin-bottom: 8px;
  text-transform: uppercase;
}

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

.primary-tag {
  padding: 6px 14px;
  background: var(--accent-glow);
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: 20px;
  font-size: 12px;
  font-family: 'DM Mono', monospace;
  color: var(--accent);
  letter-spacing: 0.05em;
}

/* ── MOBILE ── */
@media (max-width: 768px) {

  /* Reset layout — sidebar hidden, main takes full width */
  body { display: block; }
  .sidebar { transform: translateX(-100%); width: min(280px, 85vw); }
  .sidebar.open { transform: translateX(0); }
  .topbar { display: flex; }
  .main { margin-left: 0; width: 100%; max-width: 100vw; padding-top: 0; }

  /* ── Global spacing ── */
  .tab-content {
    /* Extra bottom padding = bottom nav (~65px) + safe area + breathing room */
    padding: 20px 14px calc(72px + env(safe-area-inset-bottom, 0px) + 16px);
  }

  /* ── Section headers ── */
  .section-title {
    font-size: 20px;
  }

  .section-sub {
    font-size: 13px;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  /* ── HOME TAB mobile ── */
  .home-hero {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 20px;
  }

  .hero-main {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 18px;
    gap: 16px;
  }

  .hero-avatar {
    width: 80px;
    height: 80px;
    font-size: 28px;
  }

  .hero-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  .hero-name {
    font-size: 24px;
    line-height: 1.2;
  }

  .hero-title-badge {
    font-size: 10px;
    letter-spacing: 0.08em;
  }

  .hero-meta {
    font-size: 11px;
    margin: 4px 0 8px;
  }

  .hero-bio {
    font-size: 13px;
    max-width: 100%;
    text-align: center;
    line-height: 1.55;
  }

  .hero-buttons {
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
    width: 100%;
  }

  /* Make buttons wrap into two rows cleanly */
  .hero-buttons .btn {
    flex: 1 1 auto;
    min-width: calc(50% - 8px);
    max-width: calc(50% - 4px);
    justify-content: center;
    font-size: 12px;
    padding: 9px 10px;
  }

  /* Resume button gets full width on its own row */
  .hero-buttons .btn-primary {
    flex: 1 1 100%;
    max-width: 100%;
    justify-content: center;
  }

  /* Highlights */
  .highlights-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
  }

  .highlight-thumb {
    height: 70px;
    font-size: 28px;
  }

  .highlight-body {
    padding: 10px 12px;
  }

  .highlight-label {
    font-size: 12px;
  }

  .highlight-sub {
    font-size: 10px;
  }

  /* Focus card */
  .focus-card {
    padding: 16px;
  }

  .focus-text {
    font-size: 13px;
  }

  .focus-icon {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  /* ── GROWTH TAB mobile ── */
  .semester-section {
    margin-bottom: 24px;
  }

  .course-top {
    gap: 6px;
    flex-wrap: nowrap;
    align-items: center;
  }

  .course-left {
    gap: 8px;
    min-width: 0;
    flex: 1;
  }

  .course-left > div {
    min-width: 0;
  }

  .course-name {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .course-code {
    font-size: 9px;
  }

  .course-right {
    flex-shrink: 0;
    gap: 8px;
  }

  .grade-badge {
    font-size: 12px;
  }

  .course-card {
    padding: 12px 12px;
  }

  /* Give course body enough room for wrapped skill tags */
  .course-card.open .course-body {
    max-height: 400px;
  }

  .skill-tag {
    font-size: 9px;
    padding: 3px 8px;
  }

  .course-link {
    font-size: 11px;
    padding: 5px 10px;
  }

  /* ── PROJECTS TAB mobile ── */
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .project-card.featured {
    grid-column: auto;
  }

  .project-thumb {
    height: 110px;
  }

  .project-body {
    padding: 14px 16px;
  }

  .project-name {
    font-size: 16px;
  }

  .project-desc {
    font-size: 12px;
    line-height: 1.5;
    margin-bottom: 10px;
  }

  .project-tag {
    font-size: 9px;
    padding: 3px 8px;
  }

  .project-tags {
    margin-bottom: 12px;
  }

  .sccs-mini {
    gap: 20px;
  }

  .sccs-value {
    font-size: 18px;
  }

  .sccs-label {
    font-size: 8px;
  }

  /* ── DASHBOARD TAB mobile ── */
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .dash-card {
    padding: 18px 14px;
  }

  .dash-card-title {
    font-size: 14px;
    margin-bottom: 14px;
  }

  /* CGPA */
  .cgpa-big {
    font-size: 40px;
  }

  .cgpa-trend {
    font-size: 10px;
    padding: 2px 6px;
    margin-left: 8px;
  }

  .chart-area {
    height: 80px;
    margin-top: 12px;
  }

  .sem-chart-labels {
    margin-top: 6px;
  }

  .sem-chart-labels span {
    font-size: 9px;
  }

  /* Grades */
  .sem-tabs {
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
  }

  .sem-tab {
    padding: 6px 12px;
    font-size: 11px;
  }

  .grade-row {
    padding: 8px 0;
    gap: 6px;
  }

  /* Grade subject: allow wrapping, remove ellipsis that cuts text on mobile */
  .grade-subject {
    font-size: 11px;
    flex: 1;
    min-width: 0;
    line-height: 1.4;
    white-space: normal;
    word-break: break-word;
  }

  .grade-val {
    font-size: 12px;
    margin-right: 6px;
    flex-shrink: 0;
    width: auto;
    min-width: 24px;
  }

  .grade-bar-wrap {
    width: 48px;
    flex-shrink: 0;
  }

  /* Career metrics */
  .career-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .career-val {
    font-size: 28px;
  }

  .career-label {
    font-size: 8px;
  }

  /* Competitions */
  .comp-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .comp-val {
    font-size: 30px;
  }

  .comp-label {
    font-size: 8px;
  }

  /* Skill metrics */
  .skill-metric-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
  }

  .skill-metric-item {
    padding: 12px;
    gap: 10px;
  }

  .skill-metric-icon {
    width: 30px;
    height: 30px;
    font-size: 15px;
    flex-shrink: 0;
  }

  .skill-metric-val {
    font-size: 18px;
  }

  .skill-metric-label {
    font-size: 10px;
  }

  .primary-tags {
    gap: 6px;
  }

  .primary-tag {
    font-size: 10px;
    padding: 5px 10px;
  }

  /* ── Mobile bottom nav ── */
  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: rgba(15, 21, 37, 0.95);
    border-top: 1px solid var(--border);
    z-index: 100;
    padding: 6px 0;
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  .mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 7px 4px;
    cursor: pointer;
    color: var(--text3);
    font-size: 9px;
    font-family: 'DM Mono', monospace;
    letter-spacing: 0.05em;
    transition: color 0.2s;
    border: none;
    background: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

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

  .mobile-nav-icon {
    font-size: 18px;
    line-height: 1;
  }

  /* Hero card */
  .hero-card {
    padding: 20px 16px;
    border-radius: 12px;
  }
}

/* ── SMALL PHONES (≤ 380px) ── */
@media (max-width: 380px) {
  .hero-name { font-size: 20px; }
  .hero-buttons { gap: 6px; }
  .hero-buttons .btn { padding: 8px 8px; font-size: 11px; }
  .cgpa-big { font-size: 34px; }
  .career-val { font-size: 24px; }
  .comp-val { font-size: 26px; }
  .section-title { font-size: 18px; }
  .project-name { font-size: 15px; }
  .tab-content { padding: 16px 12px calc(72px + env(safe-area-inset-bottom, 0px) + 12px); }
  .highlights-grid { grid-template-columns: 1fr; gap: 10px; }
  .skill-metric-grid { grid-template-columns: 1fr; }
  .course-name { font-size: 12px; }
  .grade-bar-wrap { width: 36px; }
}

@media (min-width: 769px) {
  .mobile-nav { display: none; }
  .topbar { display: none; }
}

/* Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}

.sidebar-overlay.show { display: block; }

/* Animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Staggered entrance for tab children */
.tab-content.active > * {
  animation: fadeUp 0.4s ease both;
}

.tab-content.active > *:nth-child(1) { animation-delay: 0.05s; }
.tab-content.active > *:nth-child(2) { animation-delay: 0.1s; }
.tab-content.active > *:nth-child(3) { animation-delay: 0.15s; }
.tab-content.active > *:nth-child(4) { animation-delay: 0.2s; }
.tab-content.active > *:nth-child(5) { animation-delay: 0.25s; }

/* Dashboard card stagger */
.dashboard-grid > .dash-card {
  animation: fadeUp 0.4s ease both;
}
.dashboard-grid > .dash-card:nth-child(1) { animation-delay: 0.05s; }
.dashboard-grid > .dash-card:nth-child(2) { animation-delay: 0.12s; }
.dashboard-grid > .dash-card:nth-child(3) { animation-delay: 0.19s; }
.dashboard-grid > .dash-card:nth-child(4) { animation-delay: 0.26s; }
.dashboard-grid > .dash-card:nth-child(5) { animation-delay: 0.33s; }

/* Project card stagger */
.projects-grid > .project-card {
  animation: fadeUp 0.4s ease both;
}
.projects-grid > .project-card:nth-child(1) { animation-delay: 0.05s; }
.projects-grid > .project-card:nth-child(2) { animation-delay: 0.12s; }
.projects-grid > .project-card:nth-child(3) { animation-delay: 0.19s; }
.projects-grid > .project-card:nth-child(4) { animation-delay: 0.26s; }

/* Semester card stagger */
.semester-section .course-card {
  animation: fadeUp 0.35s ease both;
}
.semester-section .course-card:nth-child(2) { animation-delay: 0.04s; }
.semester-section .course-card:nth-child(3) { animation-delay: 0.08s; }
.semester-section .course-card:nth-child(4) { animation-delay: 0.12s; }
.semester-section .course-card:nth-child(5) { animation-delay: 0.16s; }
.semester-section .course-card:nth-child(6) { animation-delay: 0.20s; }
.semester-section .course-card:nth-child(7) { animation-delay: 0.24s; }
.semester-section .course-card:nth-child(8) { animation-delay: 0.28s; }

/* CGPA chart draw animation */
.chart-svg path.chart-line {
  stroke-dasharray: var(--path-length, 400);
  stroke-dashoffset: var(--path-length, 400);
  animation: drawLine 1.2s ease-out 0.3s forwards;
}

.chart-svg path.chart-area {
  opacity: 0;
  animation: fadeIn 0.6s ease 1s forwards;
}

@keyframes drawLine {
  to { stroke-dashoffset: 0; }
}

/* ── PROJECT MODAL ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-overlay.active { display: flex; }

.modal {
  background: var(--card);
  border: 1px solid rgba(59,130,246,0.25);
  border-radius: 20px;
  padding: 32px;
  max-width: 640px;
  width: 100%;
  max-height: 82vh;
  overflow-y: auto;
  position: relative;
  animation: fadeUp 0.3s ease;
}

.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  width: 32px; height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}

.modal-close:hover { color: var(--text); border-color: var(--accent); }

.modal-status {
  font-family: 'DM Mono', monospace;
  font-size: 10px; letter-spacing: 0.08em;
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 6px;
}

.modal-name {
  font-family: 'Syne', sans-serif;
  font-size: 22px; font-weight: 800;
  margin-bottom: 6px; letter-spacing: -0.01em;
}

.modal-tagline {
  font-size: 12px;
  color: var(--accent2);
  margin-bottom: 20px;
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.03em;
}

.modal-detail {
  font-size: 14px; color: var(--text2);
  line-height: 1.7; margin-bottom: 20px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.modal-detail p { margin-bottom: 12px; }
.modal-detail p:last-child { margin-bottom: 0; }
.modal-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; }

@media (max-width: 768px) {
  .modal { padding: 24px 16px; max-height: 90vh; }
  .modal-name { font-size: 18px; }
}


