/* ═══════════════════════════════════════════════════════
   SATYAM NAYAK — Portfolio (main.css)
   Fonts: Space Grotesk (headings) + Plus Jakarta Sans (body)
   Layout: Fixed Left Sidebar + Scrollable Main + AI Panel
═══════════════════════════════════════════════════════ */

/* ── 1. DESIGN TOKENS ─────────────────────────────── */
:root {
  --sidebar-w: 240px;
  --sidebar-collapsed-w: 72px;
  --ai-panel-w: 380px;
  --mobile-topbar-h: 56px;

  /* Colors – Dark mode (default) */
  --bg:            #0a0a0f;
  --surface:       #111118;
  --surface-2:     #18181f;
  --card:          #1c1c26;
  --card-hover:    #22222e;
  --border:        rgba(255,255,255,0.07);
  --border-md:     rgba(255,255,255,0.12);

  --text:          #f0f0f6;
  --text-2:        #9898b0;
  --text-3:        #686888;

  --accent:        #8b5cf6;
  --accent-2:      #a78bfa;
  --accent-3:      #7c3aed;
  --accent-dim:    rgba(139,92,246,0.14);
  --accent-glow:   rgba(139,92,246,0.28);

  --green:         #4ade80;
  --green-dim:     rgba(74,222,128,0.13);

  --shadow-sm:     0 2px 12px rgba(0,0,0,0.35);
  --shadow:        0 6px 28px rgba(0,0,0,0.45);
  --shadow-lg:     0 16px 56px rgba(0,0,0,0.55);

  --radius-sm:     8px;
  --radius:        12px;
  --radius-lg:     18px;
  --radius-xl:     24px;

  /* Glass */
  --glass-bg:      rgba(17,17,26,0.72);
  --glass-border:  rgba(255,255,255,0.08);
  --glass-blur:    16px;
}

[data-theme="light"] {
  --bg:            #f3f3f8;
  --surface:       #eaeaf2;
  --surface-2:     #e2e2ee;
  --card:          #ffffff;
  --card-hover:    #f8f8ff;
  --border:        rgba(0,0,0,0.06);
  --border-md:     rgba(0,0,0,0.10);

  --text:          #111120;
  --text-2:        #5a5a72;
  --text-3:        #9898b0;

  --accent:        #7c3aed;
  --accent-2:      #6d28d9;
  --accent-3:      #8b5cf6;
  --accent-dim:    rgba(124,58,237,0.09);
  --accent-glow:   rgba(124,58,237,0.18);

  --green-dim:     rgba(22,163,74,0.10);

  --shadow-sm:     0 2px 12px rgba(0,0,0,0.06);
  --shadow:        0 6px 28px rgba(0,0,0,0.09);
  --shadow-lg:     0 16px 56px rgba(0,0,0,0.12);

  --glass-bg:      rgba(240,240,248,0.78);
  --glass-border:  rgba(0,0,0,0.07);
}

/* ── 2. RESET ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0 }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100% }

/* ── 2.1 MODERN CUSTOM SCROLLBARS ───────────────── */
/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}
[data-theme="light"] * {
  scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

/* Chrome, Edge, Safari, Opera */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: background .2s ease;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(168, 85, 247, 0.65);
}
::-webkit-scrollbar-corner {
  background: transparent;
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18);
  border: 2px solid transparent;
  background-clip: padding-box;
}
[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(124, 58, 237, 0.55);
}

body {
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  transition: background .25s, color .25s;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

a { color: inherit; text-decoration: none }
button { font-family: inherit; cursor: pointer; border: none; background: none }
img { display: block; max-width: 100% }
input, textarea { font-family: inherit }
ul { list-style: none }

/* ── 3. AMBIENT BACKGROUND ──────────────────────── */
.bg-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  animation: orb-drift 14s ease-in-out infinite alternate;
}
.bg-orb-1 {
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(139,92,246,0.5) 0%, transparent 70%);
  top: -200px; right: -150px;
}
.bg-orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(99,102,241,0.4) 0%, transparent 70%);
  bottom: -150px; left: 150px;
  animation-delay: -7s;
}
.bg-grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 60px 60px;
}
[data-theme="light"] .bg-grid-lines {
  background-image:
    linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px);
}
@keyframes orb-drift {
  from { transform: translate(0,0) scale(1) }
  to   { transform: translate(40px,30px) scale(1.08) }
}

/* ── 4. APP SHELL (Sidebar + Main) ──────────────── */
.app-shell {
  position: relative;
  display: flex;
  min-height: 100vh;
  z-index: 1;
}

/* ── 5. SIDEBAR ──────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  padding: 24px 16px 20px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-right: 1px solid var(--glass-border);
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width .3s cubic-bezier(.4,0,.2,1), transform .3s cubic-bezier(.4,0,.2,1), padding .3s cubic-bezier(.4,0,.2,1);
}

/* ── 5. SIDEBAR BRAND & CHATGPT-STYLE TOGGLE ─────── */
.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 22px;
  position: relative;
  min-height: 40px;
}

.sidebar-brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  position: relative;
  border-radius: var(--radius-sm);
  transition: opacity .2s ease;
  min-width: 0;
}

.brand-logo-wrap {
  width: 38px;
  height: 38px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  flex-shrink: 0;
  transition: background .2s ease, border-color .2s ease;
}

.brand-logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;
  transition: opacity .18s ease, transform .18s ease;
}

.brand-hover-toggle {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.85);
  transition: opacity .18s ease, transform .18s ease;
  color: var(--text);
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--border-md);
}

.brand-hover-toggle svg {
  width: 20px;
  height: 20px;
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.brand-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.brand-tagline {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

/* ChatGPT-Style Sidebar Toggle Button */
.sidebar-collapse-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--text-2);
  background: transparent;
  border: 1px solid transparent;
  transition: all .2s ease;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
}

.sidebar-collapse-btn:hover {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--border-md);
}

.collapse-icon {
  width: 19px;
  height: 19px;
  display: block;
}

/* ── Collapsed Sidebar Rules (Icon-Only Rail) ─────── */
.sidebar.collapsed {
  width: var(--sidebar-collapsed-w);
  padding: 20px 10px;
}

.sidebar.collapsed .sidebar-brand {
  justify-content: center;
  margin-bottom: 24px;
}

.sidebar.collapsed .sidebar-brand-text {
  display: none;
}

.sidebar.collapsed .sidebar-collapse-btn {
  display: none;
}

.sidebar.collapsed .sidebar-brand-link {
  width: 100%;
  justify-content: center;
  cursor: pointer;
}

.sidebar.collapsed .brand-logo-wrap {
  width: 42px;
  height: 42px;
}

.sidebar.collapsed .brand-logo-img {
  width: 32px;
  height: 32px;
}

/* In collapsed state: hovering logo smoothly swaps to toggle icon */
.sidebar.collapsed .sidebar-brand-link:hover .brand-logo-img {
  opacity: 0;
  transform: scale(0.8);
}

.sidebar.collapsed .sidebar-brand-link:hover .brand-hover-toggle {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.sidebar.collapsed .nav-link {
  justify-content: center;
  padding: 11px 0;
  gap: 0;
}
.sidebar.collapsed .nav-link span {
  display: none;
}
.sidebar.collapsed .nav-link svg {
  width: 20px;
  height: 20px;
}

/* AI Twin Button in Collapsed Sidebar */
.sidebar.collapsed .sidebar-ai-cta {
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 16px auto 0 auto;
  justify-content: center;
  align-items: center;
  border-radius: 12px;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(28, 24, 43, 0.9), rgba(18, 16, 28, 0.98));
  border: 1px solid rgba(168, 85, 247, 0.32);
}
.sidebar.collapsed .sidebar-ai-cta:hover {
  background: linear-gradient(135deg, rgba(38, 30, 60, 0.95), rgba(24, 20, 42, 0.98));
  border-color: rgba(192, 132, 252, 0.6);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), 0 0 18px rgba(147, 51, 234, 0.25);
}
.sidebar.collapsed .sidebar-ai-cta span {
  display: none;
}
.sidebar.collapsed .sidebar-ai-cta .ai-cta-badge {
  display: none;
}
.sidebar.collapsed .sidebar-ai-cta-logo {
  width: 24px;
  height: 24px;
}

/* Hide everything at the bottom in collapsed state EXCEPT the AI Twin button */
.sidebar.collapsed .sidebar-sep,
.sidebar.collapsed .sidebar-footer {
  display: none !important;
}

.app-shell.sidebar-collapsed .main-content {
  margin-left: var(--sidebar-collapsed-w);
}

/* Nav links */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  transition: all .2s;
  position: relative;
}
.nav-link svg { width: 17px; height: 17px; flex-shrink: 0; transition: color .2s }
.nav-link:hover {
  background: var(--accent-dim);
  color: var(--text);
}
.nav-link.active {
  background: var(--accent-dim);
  color: var(--accent-2);
  font-weight: 600;
}
.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 20px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}
.nav-link.active svg { color: var(--accent) }

/* Sidebar separator */
.sidebar-sep {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* AI Twin CTA in sidebar */
.sidebar-ai-cta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  background: linear-gradient(135deg, rgba(28, 24, 43, 0.88), rgba(18, 16, 28, 0.96));
  border: 1px solid rgba(168, 85, 247, 0.28);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45), 0 0 16px rgba(124, 58, 237, 0.12);
  position: relative;
  overflow: hidden;
  transition: all .22s cubic-bezier(.4, 0, .2, 1);
  margin-bottom: 16px;
  cursor: pointer;
}
.sidebar-ai-cta:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(38, 30, 60, 0.95), rgba(24, 20, 42, 0.98));
  border-color: rgba(192, 132, 252, 0.55);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), 0 0 24px rgba(147, 51, 234, 0.25);
  color: #ffffff;
}
[data-theme="light"] .sidebar-ai-cta {
  background: linear-gradient(135deg, #ffffff, #f5f3ff);
  border-color: rgba(147, 51, 234, 0.22);
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.08);
  color: var(--text);
}
[data-theme="light"] .sidebar-ai-cta:hover {
  background: linear-gradient(135deg, #ffffff, #ede9fe);
  border-color: rgba(147, 51, 234, 0.45);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.16);
}
.sidebar-ai-cta-logo {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(168, 85, 247, 0.4));
  transition: transform .22s ease;
}
.sidebar-ai-cta:hover .sidebar-ai-cta-logo {
  transform: scale(1.08);
}
.sidebar-ai-cta svg { width: 16px; height: 16px; flex-shrink: 0 }
.ai-cta-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.08), transparent);
  animation: shimmer 2.5s infinite;
}
.ai-cta-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-2);
  background: var(--accent-dim);
  border: 1px solid rgba(168, 85, 247, 0.3);
  padding: 2px 7px;
  border-radius: 20px;
  letter-spacing: 0.05em;
}
@keyframes shimmer {
  from { transform: translateX(-100%) }
  to   { transform: translateX(200%) }
}

/* Sidebar footer: unified action row (Resume, Theme, GitHub, LinkedIn, Email) */
.sidebar-footer {
  margin-top: auto;
}
.sidebar-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
}
.footer-action-icon {
  flex: 1;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: all .2s ease;
  cursor: pointer;
  text-decoration: none;
}
.footer-action-icon svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: block;
}
.footer-action-icon:hover {
  color: var(--accent);
  border-color: rgba(168, 85, 247, 0.45);
  background: var(--accent-dim);
  transform: translateY(-1px);
}

/* Theme toggle icons */
.icon-sun, .icon-moon { display: block }
[data-theme="dark"]  .icon-sun  { display: block }
[data-theme="dark"]  .icon-moon { display: none }
[data-theme="light"] .icon-sun  { display: none }
[data-theme="light"] .icon-moon { display: block }

/* ── 6. MOBILE TOP BAR ────────────────────────────── */
.mobile-topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--mobile-topbar-h);
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
  z-index: 150;
}
.hamburger-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  transition: all .2s;
  background: transparent;
  border: none;
  cursor: pointer;
}
.hamburger-btn:hover { background: var(--accent-dim); color: var(--accent) }
.hamburger-btn svg { width: 20px; height: 20px }
.mobile-brand-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.accent-dot { color: var(--accent) }
.mobile-actions { display: flex; gap: 8px }

.icon-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  transition: all .2s;
  background: transparent;
  border: none;
  cursor: pointer;
}
.icon-btn svg { width: 17px; height: 17px }
.icon-btn:hover { background: var(--accent-dim); color: var(--accent) }

.ai-mobile-trigger {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(139,92,246,0.3);
}

.mobile-sidebar-close {
  display: none;
}

body.menu-open {
  overflow: hidden;
}

.mobile-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 240;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.mobile-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* ── 7. MAIN CONTENT ──────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  overflow-x: hidden;
  transition: margin-left .3s cubic-bezier(.4,0,.2,1);
}

/* ── 8. SECTIONS ──────────────────────────────────── */
.section {
  padding: 80px 0;
  border-bottom: 1px solid var(--border);
}
.section:last-of-type { border-bottom: none }
.section-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 48px;
}

/* Section headers */
.sec-header { margin-bottom: 40px }
.sec-eyebrow {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 10px;
  font-family: 'JetBrains Mono', monospace;
}
.sec-title {
  font-size: clamp(28px, 3.5vw, 38px);
  color: var(--text);
  font-weight: 700;
}

/* Reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .55s ease, transform .55s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── 9. HERO ──────────────────────────────────────── */
.hero-section { padding: 80px 0 72px }
.hero-inner {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 56px;
  align-items: center;
}
.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.eyebrow-tag {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  font-family: 'JetBrains Mono', monospace;
}
.avail-badge-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--green);
  background: var(--green-dim);
  border: 1px solid rgba(74,222,128,0.2);
  padding: 4px 10px;
  border-radius: 20px;
}
.avail-dot-sm {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: pulse-dot 2s ease-in-out infinite;
}

.hero-headline {
  font-size: clamp(34px, 4.5vw, 54px);
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}
.grad-text {
  background: linear-gradient(135deg, var(--accent) 0%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 16px;
  color: var(--text-2);
  line-height: 1.75;
  margin-bottom: 28px;
  max-width: 520px;
}
.hero-sub strong { color: var(--text); font-weight: 600 }

/* Hero CTAs */
.hero-cta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap }

/* Profile card */
.profile-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transition: transform .3s, box-shadow .3s;
}
.profile-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 72px rgba(0,0,0,0.5);
}
.profile-img-wrap { aspect-ratio: 3/3.5; overflow: hidden; background: var(--surface-2) }
.profile-img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s }
.profile-card:hover .profile-img { transform: scale(1.03) }
.profile-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 48px; font-weight: 800; color: var(--accent-2);
  background: var(--accent-dim);
}
.profile-info { padding: 16px 18px; display: flex; flex-direction: column; gap: 8px }
.profile-info-row { display: flex; justify-content: space-between; align-items: center }
.pi-key { font-size: 11.5px; color: var(--text-3); font-weight: 500 }
.pi-val { font-size: 12.5px; color: var(--text); font-weight: 600 }

/* ── 10. BUTTONS ─────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: -0.01em;
  transition: all .22s;
  cursor: pointer;
  border: none;
  text-decoration: none;
  white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; flex-shrink: 0 }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  color: white;
  box-shadow: 0 4px 18px var(--accent-glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px var(--accent-glow);
}

.btn-ai {
  background: var(--card);
  color: var(--accent-2);
  border: 1px solid rgba(139,92,246,0.35);
  position: relative;
  overflow: hidden;
}
.btn-ai:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
  transform: translateY(-2px);
}
.btn-ai-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, var(--accent-glow), transparent);
  animation: shimmer 2.5s infinite;
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border-md);
}
.btn-ghost:hover { background: var(--card); color: var(--text); border-color: var(--border-md) }

.btn-sm { padding: 8px 16px; font-size: 13px }

/* ── 11. TAGS / PILLS ────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: all .2s;
}
.tag:hover { color: var(--accent-2); border-color: rgba(139,92,246,0.3); background: var(--accent-dim) }

.tag-row, .tag-cluster { display: flex; flex-wrap: wrap; gap: 7px }

.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.pill-accent { color: var(--accent-2); background: var(--accent-dim); border-color: rgba(139,92,246,0.3) }
.pill-green { color: var(--green); background: var(--green-dim); border-color: rgba(74,222,128,0.25) }

/* ── 12. FLAGSHIP PROJECT ────────────────────────── */
.flagship {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
  transition: border-color .25s;
}
.flagship::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), #ec4899, var(--accent));
}
.flagship:hover { border-color: rgba(139,92,246,0.4) }

.flagship-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px }
.flagship-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}
.flagship-desc {
  font-size: 14.5px;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 24px;
  max-width: 680px;
}

.flagship-metrics {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 18px 20px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.f-metric { display: flex; flex-direction: column; gap: 3px }
.f-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--accent-2);
  letter-spacing: -0.02em;
}
.f-lbl { font-size: 12px; color: var(--text-3); font-weight: 500 }

/* Code window */
.code-window {
  background: #0d0d14;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 20px 0 24px;
  font-family: 'JetBrains Mono', monospace;
}
[data-theme="light"] .code-window { background: #1a1a2e; border-color: rgba(255,255,255,0.1) }
.cw-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.cw-dots { display: flex; gap: 5px }
.cw-dots span {
  width: 10px; height: 10px;
  border-radius: 50%;
}
.cw-dots span:nth-child(1) { background: #ff5f57 }
.cw-dots span:nth-child(2) { background: #ffbd2e }
.cw-dots span:nth-child(3) { background: #28ca41 }
.cw-file { font-size: 11.5px; color: rgba(255,255,255,0.4); margin-left: 4px }
.cw-code {
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.7;
  color: #c9d1d9;
}
.ck { color: #ff79c6; font-weight: 600 }
.ct { color: #8be9fd }
.cs { color: #f1fa8c }

/* ── 13. PROJECT CARDS GRID ──────────────────────── */
.proj-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.proj-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all .25s;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.proj-card:hover {
  border-color: rgba(139,92,246,0.35);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.pc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.pc-type { font-size: 11.5px; font-weight: 600; color: var(--accent); letter-spacing: 0.03em }
.pc-links { display: flex; gap: 6px }
.link-icon {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  color: var(--text-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: all .18s;
}
.link-icon svg { width: 13px; height: 13px }
.link-icon:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-dim) }

.pc-name { font-size: 16px; font-weight: 700; color: var(--text) }
.pc-desc { font-size: 13.5px; color: var(--text-2); line-height: 1.65; flex: 1 }

.flagship-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}
/* ── 13.1 VIEW ALL PROJECTS ON GITHUB CARD ───────── */
.projects-cta-card {
  margin-top: 24px;
  padding: 26px 30px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
  transition: border-color .25s ease, transform .25s ease, box-shadow .25s ease;
}
.projects-cta-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), #ec4899);
}
.projects-cta-card:hover {
  border-color: rgba(139, 92, 246, 0.4);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.p-cta-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 560px;
}
.p-cta-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
}
.p-cta-badge svg {
  width: 14px;
  height: 14px;
}
.p-cta-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.p-cta-desc {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.6;
}

.skill-card-wide {
  grid-column: 1 / -1;
}
.tag-learning {
  color: #ec4899;
  border-color: rgba(236, 72, 153, 0.4);
  background: rgba(236, 72, 153, 0.08);
}
.tag-learning:hover {
  color: #f472b6;
  border-color: #ec4899;
  background: rgba(236, 72, 153, 0.16);
}

/* ── 14. TIMELINE ────────────────────────────────── */
.timeline { position: relative; padding-left: 28px }
.timeline::before {
  content: '';
  position: absolute;
  left: 7px; top: 8px; bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), transparent);
}
.tl-item {
  position: relative;
  margin-bottom: 32px;
}
.tl-item:last-child { margin-bottom: 0 }
.tl-dot {
  position: absolute;
  left: -24px; top: 18px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 10px var(--accent-glow);
}
.tl-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  transition: border-color .2s, transform .2s;
}
.tl-card:hover { border-color: rgba(139,92,246,0.3); transform: translateX(3px) }
.tl-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap }
.tl-period { font-size: 12px; font-weight: 600; color: var(--accent); font-family: 'JetBrains Mono', monospace }
.tl-role { font-size: 16.5px; font-weight: 700; color: var(--text); margin-bottom: 4px }
.tl-company { font-size: 13px; color: var(--text-2); font-weight: 500; margin-bottom: 14px }
.tl-points { display: flex; flex-direction: column; gap: 6px }
.tl-points li {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.6;
  padding-left: 14px;
  position: relative;
}
.tl-points li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 10px;
  top: 3px;
}

/* ── 15. SKILLS GRID ─────────────────────────────── */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.skill-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  transition: all .25s;
}
.skill-card:hover { border-color: rgba(139,92,246,0.3); transform: translateY(-2px) }
.skill-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.skill-icon {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--accent-dim);
  border: 1px solid rgba(139,92,246,0.2);
  color: var(--accent-2);
  flex-shrink: 0;
}
.skill-icon svg { width: 18px; height: 18px }
.skill-name { font-size: 15px; font-weight: 700; color: var(--text) }

/* ── 16. ACHIEVEMENTS ────────────────────────────── */
.ach-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.ach-card {
  display: flex;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  transition: all .25s;
}
.ach-card:hover { border-color: rgba(139,92,246,0.3); transform: translateY(-2px) }
.ach-icon {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--accent-dim);
  border: 1px solid rgba(139,92,246,0.2);
  color: var(--accent-2);
  flex-shrink: 0;
}
.ach-icon svg { width: 18px; height: 18px }
.ach-body { display: flex; flex-direction: column; gap: 6px }
.ach-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
}
.ach-name { font-size: 14.5px; font-weight: 700; color: var(--text) }
.ach-desc { font-size: 13px; color: var(--text-2); line-height: 1.6 }

/* ── 17. CONTACT ─────────────────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: stretch;
}
.contact-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: border-color .25s, transform .25s;
  height: 100%;
}
.contact-card:hover {
  border-color: rgba(139,92,246,0.3);
}
.contact-card-header {
  margin-bottom: 24px;
}
.contact-card-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.contact-lead {
  font-size: 14.5px;
  color: var(--text-2);
  line-height: 1.65;
  margin-bottom: 0;
}
.contact-channels {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}
.contact-card-footer {
  margin-top: auto;
  padding-top: 24px;
}
.contact-card-footer .btn,
.contact-form button[type="submit"],
.btn-block {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.ch-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: all .2s;
}
.ch-link:hover { border-color: rgba(139,92,246,0.35); background: var(--card-hover) }
.ch-icon {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--accent-dim);
  color: var(--accent-2);
  flex-shrink: 0;
}
.ch-icon svg { width: 16px; height: 16px }
.ch-label { font-size: 11.5px; color: var(--text-3); font-weight: 500 }
.ch-val { font-size: 13.5px; color: var(--text); font-weight: 600 }

/* Contact form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
}
.fg { display: flex; flex-direction: column; gap: 6px }
.fl { font-size: 13px; font-weight: 600; color: var(--text) }
.fi, .ft {
  width: 100%;
  padding: 11px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  transition: border-color .2s, box-shadow .2s;
  resize: none;
}
.fi:focus, .ft:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.fi::placeholder, .ft::placeholder { color: var(--text-3) }
.form-msg {
  font-size: 13px;
  text-align: center;
  min-height: 20px;
  border-radius: var(--radius-sm);
  padding: 4px;
  transition: all .3s;
}

/* ── 18. FOOTER ──────────────────────────────────── */
.site-footer {
  padding: 40px 48px;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
  color: var(--text-3);
  font-size: 13.5px;
}
.footer-sub { font-size: 12.5px; margin-top: 4px }
.footer-sub a { color: var(--accent-2); transition: color .2s }
.footer-sub a:hover { color: var(--accent) }

/* ── 19. AI TWIN PANEL ───────────────────────────── */
.ai-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: var(--ai-panel-w);
  min-width: 320px;
  max-width: 92vw;
  display: flex;
  flex-direction: column;
  background: var(--glass-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-left: 1px solid var(--glass-border);
  z-index: 300;
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.4,0,.2,1), width .3s cubic-bezier(.4,0,.2,1);
  box-shadow: -12px 0 56px rgba(0,0,0,0.45);
}
.ai-panel.open {
  transform: translateX(0);
}
.ai-panel.expanded {
  width: min(680px, 92vw);
}
.ai-panel.is-resizing {
  transition: none !important;
  user-select: none;
}

/* Left edge resizer handle */
.ai-panel-resizer {
  position: absolute;
  top: 0;
  left: -4px;
  width: 8px;
  height: 100%;
  cursor: ew-resize;
  z-index: 310;
  background: transparent;
  transition: background .2s ease;
}
.ai-panel-resizer:hover,
.ai-panel.is-resizing .ai-panel-resizer {
  background: rgba(139, 92, 246, 0.45);
}

[data-theme="light"] .ai-panel {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-left: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.08);
}

/* Header */
.ai-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: rgba(18, 18, 26, 0.4);
}
[data-theme="light"] .ai-panel-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.85);
}

.ai-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ai-expand-btn {
  color: var(--text-2);
}
.ai-expand-btn:hover {
  color: var(--accent);
}
.ai-expand-btn .icon-minimize {
  display: none;
}
.ai-expand-btn .icon-maximize {
  display: block;
}
.ai-panel.expanded .ai-expand-btn .icon-minimize {
  display: block;
}
.ai-panel.expanded .ai-expand-btn .icon-maximize {
  display: none;
}

.ai-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ai-avatar-mini {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(139,92,246,0.18), rgba(99,102,241,0.08));
  border: 1.5px solid rgba(139,92,246,0.3);
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
[data-theme="light"] .ai-avatar-mini {
  background: #ffffff;
  border: 1.5px solid rgba(124,58,237,0.22);
  box-shadow: 0 2px 12px rgba(124,58,237,0.1);
}
.ai-avatar-svg-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.ai-online-dot {
  position: absolute;
  bottom: -2px; right: -2px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--surface-2);
  box-shadow: 0 0 6px var(--green);
  animation: pulse-dot 2s ease-in-out infinite;
  transition: background .3s ease, box-shadow .3s ease;
}
[data-theme="light"] .ai-online-dot {
  border-color: #ffffff;
}
.ai-online-dot.offline {
  background: #f87171;
  box-shadow: 0 0 6px rgba(248, 113, 113, 0.6);
  animation: none;
}
.ai-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.ai-status-text {
  font-size: 11.5px;
  color: var(--green);
  font-weight: 600;
  transition: color .3s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
[data-theme="light"] .ai-status-text {
  color: #16a34a;
}
.ai-status-text.offline {
  color: #f87171;
}
[data-theme="light"] .ai-status-text.offline {
  color: #dc2626;
}

/* Quick chips with horizontal side scroll */
.ai-chips {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  background: rgba(14, 14, 21, 0.4);
}
[data-theme="light"] .ai-chips {
  background: rgba(248, 248, 252, 0.85);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.ai-chips::-webkit-scrollbar {
  display: none;
}
.ai-chip {
  flex-shrink: 0;
  white-space: nowrap;
  padding: 5px 13px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-2);
  background: rgba(139,92,246,0.1);
  border: 1px solid rgba(139,92,246,0.24);
  transition: all .2s cubic-bezier(.4, 0, .2, 1);
  cursor: pointer;
}
[data-theme="light"] .ai-chip {
  color: #6d28d9;
  background: #ffffff;
  border: 1px solid rgba(124, 58, 237, 0.18);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}
.ai-chip:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  transform: translateY(-1.5px);
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
}
[data-theme="light"] .ai-chip:hover {
  background: #7c3aed;
  color: #ffffff;
  border-color: #7c3aed;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.25);
}

/* Messages Area */
.ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}
.ai-messages::-webkit-scrollbar { width: 4px }
.ai-messages::-webkit-scrollbar-track { background: transparent }
.ai-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
[data-theme="light"] .ai-messages::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
}

.ai-msg {
  display: flex;
  animation: msg-in .25s ease;
  width: 100%;
}

.ai-msg.bot {
  justify-content: flex-start;
}
.ai-msg.bot .ai-msg-bubble {
  background: rgba(24, 24, 34, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px 16px 16px 4px;
  color: #e5e5f0;
  max-width: 90%;
  padding: 12px 16px;
  font-size: 13.5px;
  line-height: 1.65;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
[data-theme="light"] .ai-msg.bot .ai-msg-bubble {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.07);
  color: #1e293b;
  box-shadow: 0 4px 18px rgba(124, 58, 237, 0.04), 0 1px 3px rgba(0, 0, 0, 0.03);
}

/* Bot bubble typography polish */
.ai-msg.bot .ai-msg-bubble p {
  margin-bottom: 8px;
}
.ai-msg.bot .ai-msg-bubble p:last-child {
  margin-bottom: 0;
}
.ai-msg.bot .ai-msg-bubble strong,
.ai-msg.bot .ai-msg-bubble b {
  color: #ffffff;
  font-weight: 700;
}
[data-theme="light"] .ai-msg.bot .ai-msg-bubble strong,
[data-theme="light"] .ai-msg.bot .ai-msg-bubble b {
  color: #0f172a;
}
.ai-msg.bot .ai-msg-bubble ul,
.ai-msg.bot .ai-msg-bubble ol {
  margin: 6px 0 8px 18px;
  padding: 0;
}
.ai-msg.bot .ai-msg-bubble li {
  margin-bottom: 4px;
}
.ai-msg.bot .ai-msg-bubble a {
  color: var(--accent-2);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity .15s ease;
}
[data-theme="light"] .ai-msg.bot .ai-msg-bubble a {
  color: #7c3aed;
}
.ai-msg.bot .ai-msg-bubble a:hover {
  opacity: 0.8;
}
.ai-msg.bot .ai-msg-bubble code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent-2);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
[data-theme="light"] .ai-msg.bot .ai-msg-bubble code {
  background: #f1f5f9;
  color: #7c3aed;
  border-color: rgba(0, 0, 0, 0.06);
}

.ai-msg.user {
  justify-content: flex-end;
}
.ai-msg.user .ai-msg-bubble {
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
  color: #ffffff;
  border-radius: 16px 16px 4px 16px;
  max-width: 85%;
  padding: 10px 15px;
  font-size: 13.5px;
  line-height: 1.55;
  box-shadow: 0 4px 18px rgba(124, 58, 237, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
[data-theme="light"] .ai-msg.user .ai-msg-bubble {
  background: linear-gradient(135deg, #7c3aed 0%, #6366f1 100%);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.25);
}

/* Typing bubble */
.ai-typing-row .ai-msg-bubble {
  padding: 8px 14px;
  max-width: 70px;
}
.ai-typing { display: flex; gap: 4px; align-items: center; padding: 4px 0 }
.ai-typing span {
  width: 6.5px; height: 6.5px;
  border-radius: 50%;
  background: var(--accent);
  animation: typing-bounce .9s ease-in-out infinite;
}
.ai-typing span:nth-child(2) { animation-delay: .18s }
.ai-typing span:nth-child(3) { animation-delay: .36s }

/* ── QUICK QUESTIONS (Aesthetic 2-Column Grid) ── */
.ai-faq-section {
  padding: 10px 16px 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: rgba(18, 18, 27, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: all .25s ease;
}
[data-theme="light"] .ai-faq-section {
  background: rgba(246, 246, 252, 0.95);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.ai-faq-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.ai-faq-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 5px;
}
[data-theme="light"] .ai-faq-label {
  color: #64748b;
}

.ai-faq-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 3px 9px;
  border-radius: 12px;
  cursor: pointer;
  transition: all .18s ease;
}
[data-theme="light"] .ai-faq-toggle {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #6d28d9;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}
.ai-faq-toggle:hover {
  color: var(--text);
  border-color: rgba(139,92,246,0.35);
  background: var(--accent-dim);
  transform: translateY(-1px);
}
[data-theme="light"] .ai-faq-toggle:hover {
  background: #fdfcff;
  border-color: rgba(124, 58, 237, 0.35);
  color: #7c3aed;
}

.faq-toggle-icon {
  width: 12px;
  height: 12px;
  transition: transform .25s ease;
}
.ai-faq-section.collapsed .faq-toggle-icon {
  transform: rotate(-90deg);
}

/* 2-Column Responsive Card Grid for Quick Questions */
.ai-faq-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  max-height: 200px;
  overflow: hidden;
  transition: max-height .3s cubic-bezier(.4,0,.2,1), opacity .25s ease, margin .25s ease;
  opacity: 1;
}
.ai-faq-section.collapsed .ai-faq-list {
  max-height: 0;
  opacity: 0;
  margin: 0;
  pointer-events: none;
}

.ai-faq-q {
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 7px 9px;
  border-radius: 9px;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: all .2s cubic-bezier(.4, 0, .2, 1);
  cursor: pointer;
  position: relative;
}
.ai-faq-q::before {
  content: '✦';
  font-size: 9px;
  color: var(--accent-2);
  margin-right: 5px;
  flex-shrink: 0;
  opacity: 0.75;
}
[data-theme="light"] .ai-faq-q {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #334155;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}
[data-theme="light"] .ai-faq-q::before {
  color: #7c3aed;
}

.ai-faq-q:hover {
  color: #ffffff;
  border-color: rgba(139, 92, 246, 0.45);
  background: rgba(139, 92, 246, 0.14);
  transform: translateY(-1px);
  box-shadow: 0 3px 12px rgba(139, 92, 246, 0.18);
}
[data-theme="light"] .ai-faq-q:hover {
  background: #ffffff;
  border-color: rgba(124, 58, 237, 0.45);
  color: #7c3aed;
  box-shadow: 0 3px 12px rgba(124, 58, 237, 0.12);
  transform: translateY(-1px);
}

/* AI Input Floating Capsule */
.ai-input-area {
  padding: 12px 16px 14px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: rgba(14, 14, 21, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
[data-theme="light"] .ai-input-area {
  background: rgba(250, 250, 255, 0.98);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.ai-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(24, 24, 34, 0.95);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 5px 6px 5px 14px;
  transition: all .2s ease;
}
[data-theme="light"] .ai-input-row {
  background: #ffffff;
  border: 1.5px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}
.ai-input-row:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.22);
}
[data-theme="light"] .ai-input-row:focus-within {
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.ai-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  min-width: 0;
}
[data-theme="light"] .ai-input {
  color: #0f172a;
}
.ai-input::placeholder {
  color: var(--text-3);
  font-size: 13px;
}
[data-theme="light"] .ai-input::placeholder {
  color: #94a3b8;
}

.ai-send {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: white;
  flex-shrink: 0;
  transition: all .2s ease;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.35);
  cursor: pointer;
  border: none;
}
[data-theme="light"] .ai-send {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.35);
}
.ai-send svg { width: 14px; height: 14px }
.ai-send:hover {
  transform: scale(1.06);
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.5);
}
.ai-send:active {
  transform: scale(0.96);
}

.ai-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(3px);
  z-index: 299;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.ai-backdrop.open { opacity: 1; pointer-events: all }

/* Markdown in AI messages */
.ai-msg-bubble p { margin-bottom: 6px }
.ai-msg-bubble p:last-child { margin-bottom: 0 }
.ai-msg-bubble ul { padding-left: 16px; margin: 4px 0 }
.ai-msg-bubble li { margin-bottom: 3px }
.ai-msg-bubble strong { font-weight: 700 }
.ai-msg-bubble code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88em;
  background: rgba(139,92,246,0.15);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ── 20. SKILL INSTALL MODAL (optional notice) ─── */

/* ── 21. RESPONSIVE ──────────────────────────────── */
@media (max-width: 1100px) {
  :root { --ai-panel-w: 340px }
  .section-inner { padding: 0 32px }
  .hero-inner { grid-template-columns: 1fr 300px; gap: 40px }
}

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { display: none }
  .proj-grid { grid-template-columns: 1fr }
  .skills-grid { grid-template-columns: 1fr }
  .ach-grid { grid-template-columns: 1fr }
  .contact-grid { grid-template-columns: 1fr }
  .flagship-metrics { gap: 18px }
}

@media (max-width: 768px) {
  :root {
    --sidebar-w: 290px;
    --mobile-topbar-h: 56px;
  }

  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 290px;
    max-width: 85vw;
    z-index: 250; /* Sits cleanly ABOVE the mobile topbar (150) and backdrop (240) */
    transform: translateX(-100%);
    box-shadow: 12px 0 48px rgba(0, 0, 0, 0.55);
    background: var(--surface);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-right: 1px solid var(--border-md);
    padding: 18px 16px;
    padding-bottom: max(20px, env(safe-area-inset-bottom, 20px));
    transition: transform .32s cubic-bezier(.4, 0, .2, 1);
  }
  [data-theme="light"] .sidebar {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.12);
  }
  .sidebar.open {
    transform: translateX(0);
  }

  /* Sidebar header on mobile */
  .sidebar-brand {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
  }
  .sidebar-collapse-btn {
    display: none !important;
  }
  .mobile-sidebar-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    color: var(--text-2);
    background: var(--surface-2);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all .2s ease;
    flex-shrink: 0;
  }
  .mobile-sidebar-close:hover {
    color: var(--text);
    background: var(--accent-dim);
    border-color: rgba(139, 92, 246, 0.4);
  }
  .mobile-sidebar-close svg {
    width: 17px;
    height: 17px;
  }

  /* Nav links on mobile: comfortable touch targets */
  .sidebar-nav {
    gap: 4px;
  }
  .nav-link {
    padding: 11px 14px;
    font-size: 14.5px;
    border-radius: 10px;
  }
  .nav-link svg {
    width: 19px;
    height: 19px;
  }

  .mobile-topbar { display: flex }

  .main-content {
    margin-left: 0;
    padding-top: var(--mobile-topbar-h);
  }

  .section { padding: 56px 0 }
  .section-inner { padding: 0 20px }

  .hero-section { padding: 48px 0 }
  .hero-headline { font-size: 32px }
  .hero-cta { flex-direction: column; align-items: flex-start }
  .btn { width: 100%; justify-content: center }

  .flagship { padding: 24px 20px }
  .flagship-metrics { flex-direction: column; gap: 14px }
  .code-window { display: none }

  .tl-card { padding: 18px }

  .ai-panel { width: 100%; max-width: 400px; right: 0; z-index: 300 }

  .site-footer { padding: 32px 20px }
}

@media (max-width: 480px) {
  :root { --sidebar-w: 285px }
  .hero-headline { font-size: 28px }
  .sec-title { font-size: 26px }
}
