/* ============================================================
   SHUBHAM BAKRE — PORTFOLIO v2
   Layout: fixed sidebar (desktop) + scrolling main
   Design: dark-navy, indigo accent, editorial typography
   ============================================================ */

/* === TOKENS ================================================= */
:root {
  /* Dark theme (default) */
  --bg:          #090912;
  --sidebar-bg:  #0D0D1A;
  --surface:     #111122;
  --surface-2:   #181830;
  --border:      #1E1E38;
  --border-mid:  #2A2A50;
  --text:        #E2E2F5;
  --text-2:      #8080A8;
  --text-3:      #45455E;
  --accent:      #818CF8;
  --accent-h:    #9AA5FF;
  --accent-sub:  rgba(129,140,248,0.10);
  --accent-glow: rgba(129,140,248,0.18);

  /* Spacing */
  --sidebar-w:   300px;
  --section-gap: 88px;
  --radius:      12px;
  --radius-sm:   8px;

  /* Type */
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', 'Courier New', monospace;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur:  180ms;
}

[data-theme="light"] {
  --bg:          #F7F7FB;
  --sidebar-bg:  #EFEFF8;
  --surface:     #FFFFFF;
  --surface-2:   #EBEBF5;
  --border:      #DCDCEA;
  --border-mid:  #C8C8DC;
  --text:        #0D0D1C;
  --text-2:      #52526A;
  --text-3:      #9090A8;
  --accent:      #4F46E5;
  --accent-h:    #6366F1;
  --accent-sub:  rgba(79,70,229,0.08);
  --accent-glow: rgba(79,70,229,0.14);
}

/* === RESET ================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; font: inherit; background: none; border: none; }

/* Subtle dot-grid background */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.028) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 0;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* === TWO-COLUMN LAYOUT ===================================== */
.layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* === SIDEBAR ================================================ */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar-inner {
  padding: 48px 36px;
  display: flex;
  flex-direction: column;
  gap: 40px;
  min-height: 100%;
}

/* Avatar */
.avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border-mid);
  background: var(--accent-sub);
  flex-shrink: 0;
  position: relative;
}
.avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center top;
}
.avatar--fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.05em;
}
.avatar--fallback::after { content: 'SB'; }
.avatar--fallback img { display: none; }

/* Identity */
.sidebar-identity { display: flex; flex-direction: column; gap: 8px; }
.sidebar-name {
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text);
}
.sidebar-role {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.02em;
}
.sidebar-bio {
  font-size: 0.875rem;
  color: var(--text-2);
  line-height: 1.6;
  margin-top: 4px;
}
.sidebar-location {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 4px;
}
.dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #22C55E;
  box-shadow: 0 0 6px #22C55E;
  flex-shrink: 0;
  animation: pulse 2s ease infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Sidebar nav */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.snav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-3);
  padding: 8px 0;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color var(--dur) var(--ease);
  position: relative;
}
.snav-link:hover { color: var(--text-2); }
.snav-link.active { color: var(--text); }
.snav-line {
  height: 1px;
  width: 24px;
  background: var(--border-mid);
  transition: width var(--dur) var(--ease), background var(--dur) var(--ease);
  flex-shrink: 0;
}
.snav-link:hover .snav-line { width: 40px; }
.snav-link.active .snav-line { width: 40px; background: var(--accent); }

/* Bottom actions */
.sidebar-bottom { display: flex; flex-direction: column; gap: 20px; }
.sidebar-social { display: flex; gap: 12px; }
.social-icon {
  width: 34px; height: 34px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  transition: all var(--dur) var(--ease);
}
.social-icon:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-sub); }

.sidebar-actions { display: flex; gap: 8px; align-items: center; }
.btn-resume {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-2);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  transition: all var(--dur) var(--ease);
}
.btn-resume:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-sub); }

.theme-toggle {
  width: 34px; height: 34px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  transition: all var(--dur) var(--ease);
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun  { display: none; }

/* === MOBILE BAR (hidden on desktop) ======================== */
.mobile-bar {
  display: none;
  position: sticky;
  top: 0; z-index: 100;
  background: rgba(9,9,18,0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  height: 56px;
  align-items: center;
  justify-content: space-between;
  transition: background var(--dur) var(--ease);
}
[data-theme="light"] .mobile-bar { background: rgba(247,247,251,0.92); }
.mobile-brand { font-weight: 600; font-size: 0.9rem; }
.mobile-actions { display: flex; gap: 8px; align-items: center; }

.hamburger {
  width: 34px; height: 34px;
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
}
.hamburger span {
  display: block; width: 16px; height: 1.5px;
  background: var(--text-2);
  transition: all 0.25s var(--ease);
  transform-origin: center;
}
.hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.mobile-nav {
  display: none;
  flex-direction: column;
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s var(--ease);
}
.mobile-nav.open { max-height: 400px; }
.mnav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-2);
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.mnav-link:hover { color: var(--accent); background: var(--accent-sub); }
.mnav-link--accent { color: var(--accent); }

/* === MAIN CONTENT =========================================== */
.main {
  flex: 1;
  min-width: 0;
}

/* === SECTIONS =============================================== */
.section {
  padding: var(--section-gap) 52px;
  border-bottom: 1px solid var(--border);
}
.section:last-of-type { border-bottom: none; }

.section-head { margin-bottom: 40px; }
.section-label {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

/* === CARDS ================================================== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: bottom;
  border-radius: 0 2px 2px 0;
  transition: transform 0.3s var(--ease);
}
.card:hover { border-color: var(--border-mid); transform: translateY(-2px); }
.card:hover::before { transform: scaleY(1); }

/* Featured card */
.card--featured {
  background: var(--surface);
  border-color: var(--border-mid);
  margin-bottom: 16px;
}
.card--featured::before { background: var(--accent); transform: scaleY(1); }
.card-featured-inner { display: flex; gap: 40px; align-items: flex-start; }
.card-main { flex: 1; min-width: 0; }
.card-stats { flex-shrink: 0; width: 200px; }

/* Card elements */
.card-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.card-org { font-family: var(--mono); font-size: 0.68rem; color: var(--accent); letter-spacing: 0.06em; text-transform: uppercase; }
.card-badge { font-size: 0.7rem; color: var(--text-3); font-family: var(--mono); }
.card-title { font-size: 1.15rem; font-weight: 600; color: var(--text); margin-bottom: 12px; letter-spacing: -0.02em; line-height: 1.3; }
.card-desc { font-size: 0.875rem; color: var(--text-2); line-height: 1.7; margin-bottom: 16px; }
.card-foot { display: flex; flex-direction: column; gap: 10px; }
.card-note { font-size: 0.75rem; color: var(--text-3); font-style: italic; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.card-links { display: flex; gap: 14px; margin-bottom: 12px; }
.card-link { font-size: 0.82rem; font-weight: 500; color: var(--accent); transition: color var(--dur) var(--ease); }
.card-link:hover { color: var(--accent-h); }

/* Stat blocks inside featured card */
.card-stats {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.stat {}
.stat-num {
  display: block;
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.04em;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}
.stat-label { font-size: 0.72rem; color: var(--text-3); line-height: 1.4; }

/* Tags */
.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: var(--accent-sub);
  border-radius: 4px;
  padding: 3px 8px;
}
[data-theme="light"] .tag { border: 1px solid rgba(79,70,229,0.15); }

/* Cards grid */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.cards-grid .card:last-child { grid-column: 1 / -1; }

/* === EXPERIENCE TIMELINE ==================================== */
.timeline { display: flex; flex-direction: column; }
.tl-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  padding: 32px 0;
  border-bottom: 1px solid var(--border);
}
.tl-item:first-child { padding-top: 0; }
.tl-item:last-child { border-bottom: none; padding-bottom: 0; }

.tl-period { font-size: 0.68rem; letter-spacing: 0.06em; color: var(--text-3); text-transform: uppercase; margin-bottom: 4px; }
.tl-location { font-size: 0.78rem; color: var(--text-3); }

.tl-header { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.tl-header h3 { font-size: 1rem; font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
.tl-company { font-size: 0.82rem; font-weight: 500; color: var(--accent); }

.tl-list { margin-bottom: 14px; }
.tl-list li {
  font-size: 0.875rem;
  color: var(--text-2);
  line-height: 1.7;
  padding: 4px 0 4px 16px;
  position: relative;
}
.tl-list li::before {
  content: '';
  position: absolute; left: 0; top: 13px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--border-mid);
}
.tl-tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* === SKILLS ================================================= */
.skills-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}
.skill-group {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 24px;
  transition: background var(--dur) var(--ease);
}
.skill-group:hover { background: var(--surface-2); }
.skill-group:nth-child(1) { border-radius: var(--radius) 0 0 0; }
.skill-group:nth-child(2) { border-radius: 0 var(--radius) 0 0; }
.skill-group:nth-child(3) { border-radius: 0 0 0 var(--radius); }
.skill-group:nth-child(4) { border-radius: 0 0 var(--radius) 0; }

.sg-title { font-size: 0.8rem; font-weight: 600; color: var(--text); margin-bottom: 14px; letter-spacing: -0.01em; }
.sg-list li {
  font-size: 0.82rem;
  color: var(--text-2);
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.5;
}
.sg-list li:last-child { border-bottom: none; }

/* === ABOUT ================================================== */
.about-wrap { display: flex; gap: 48px; align-items: flex-start; }
.about-text { flex: 1; }
.about-text p {
  font-size: 0.9rem;
  color: var(--text-2);
  line-height: 1.8;
  margin-bottom: 16px;
}
.about-text p:last-child { margin-bottom: 0; }

.about-edu {
  flex-shrink: 0;
  width: 220px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.edu-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.edu-icon {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.04em;
  background: var(--accent-sub);
  border-radius: 4px;
  padding: 3px 7px;
  flex-shrink: 0;
  margin-top: 2px;
}
.edu-degree { font-size: 0.82rem; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.edu-school  { font-size: 0.72rem; color: var(--text-3); }

/* === CONTACT ================================================ */
.contact-wrap { max-width: 560px; }
.contact-heading {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 16px;
}
.contact-sub {
  font-size: 0.9rem;
  color: var(--text-2);
  line-height: 1.75;
  margin-bottom: 8px;
}
.contact-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.btn-contact {
  display: inline-flex;
  align-items: center;
  background: var(--accent);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 11px 24px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent);
  transition: background var(--dur) var(--ease);
}
.btn-contact:hover { background: var(--accent-h); border-color: var(--accent-h); }
.btn-outline {
  display: inline-flex;
  align-items: center;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 11px 24px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-mid);
  transition: all var(--dur) var(--ease);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* === FOOTER ================================================= */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 52px;
  border-top: 1px solid var(--border);
}
.footer-copy { font-size: 0.78rem; color: var(--text-3); }
.footer-links { display: flex; gap: 20px; }
.footer-links a { font-size: 0.78rem; color: var(--text-3); transition: color var(--dur) var(--ease); }
.footer-links a:hover { color: var(--accent); }

/* === ANIMATIONS ============================================= */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* === RESPONSIVE ============================================= */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .mobile-bar,
  .mobile-nav { display: flex; }

  .section { padding: var(--section-gap) 24px; }
  .footer   { padding: 20px 24px; }

  .card-featured-inner { flex-direction: column; gap: 24px; }
  .card-stats { width: 100%; flex-direction: row; justify-content: space-around; gap: 10px; padding: 16px; }
  .stat-num { font-size: 1.5rem; }

  .cards-grid { grid-template-columns: 1fr; }
  .cards-grid .card:last-child { grid-column: auto; }

  .tl-item { grid-template-columns: 1fr; gap: 6px; }
  .tl-left { display: flex; gap: 12px; align-items: baseline; }

  .skills-wrap { grid-template-columns: 1fr; gap: 2px; }
  .skill-group:nth-child(1) { border-radius: var(--radius) var(--radius) 0 0; }
  .skill-group:nth-child(2) { border-radius: 0; }
  .skill-group:nth-child(3) { border-radius: 0; }
  .skill-group:nth-child(4) { border-radius: 0 0 var(--radius) var(--radius); }

  .about-wrap { flex-direction: column; gap: 28px; }
  .about-edu  { width: 100%; }
}

@media (max-width: 560px) {
  :root { --section-gap: 60px; }
  .card-stats { flex-direction: column; gap: 16px; }
  .contact-actions { flex-direction: column; }
  .btn-contact, .btn-outline { justify-content: center; }
  .footer { flex-direction: column; gap: 12px; text-align: center; }
}
