/* ═══════════════════════════════════════════
   VARIABLES & RESET
═══════════════════════════════════════════ */

/* ── DARK THEME (default) ── */
:root, [data-theme="dark"] {
  --navy:       #0c1b33;
  --navy-mid:   #152848;
  --navy-light: #1d3461;
  --blue:       #1a56db;
  --blue-h:     #1744c0;
  --blue-pale:  #1e3a6e;
  --accent:     #06b6d4;
  --white:      #ffffff;
  --off-white:  #f8fafc;
  --gray-50:    #1a2235;
  --gray-100:   #243048;
  --gray-300:   #64748b;
  --gray-500:   #94a3b8;
  --text:       #e2e8f0;
  --text-light: #94a3b8;
  --border:     #243048;
  --red:        #ef4444;
  --yellow:     #f59e0b;
  --green:      #10b981;

  --bg-main:    #0b1628;
  --bg-section: #0f1e36;
  --bg-alt:     #111e35;
  --card-bg:    #13243d;
  --card-border:#1e3050;
  --nav-bg:     rgba(11, 22, 40, 0.96);

  --tag-bg:     rgba(26,86,219,0.15);
  --tag-color:  #60a5fa;
  --tag-border: rgba(59,130,246,0.3);

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Outfit', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  --r:   8px;
  --rl:  14px;
  --sh:  0 4px 16px rgba(0,0,0,.3);
  --shl: 0 12px 40px rgba(0,0,0,.5);
}

/* ── LIGHT THEME ── */
[data-theme="light"] {
  --navy:       #0c1b33;
  --navy-mid:   #152848;
  --navy-light: #1d3461;
  --blue:       #1a56db;
  --blue-h:     #1744c0;
  --blue-pale:  #eff6ff;
  --accent:     #06b6d4;
  --white:      #ffffff;
  --off-white:  #f8fafc;
  --gray-50:    #f1f5f9;
  --gray-100:   #e2e8f0;
  --gray-300:   #94a3b8;
  --gray-500:   #64748b;
  --text:       #0f172a;
  --text-light: #475569;
  --border:     #e2e8f0;
  --red:        #ef4444;
  --yellow:     #f59e0b;
  --green:      #10b981;

  --bg-main:    #ffffff;
  --bg-section: #ffffff;
  --bg-alt:     #f1f5f9;
  --card-bg:    #ffffff;
  --card-border:#e2e8f0;
  --nav-bg:     rgba(255,255,255,0.96);

  --tag-bg:     #eff6ff;
  --tag-color:  #1a56db;
  --tag-border: #bfdbfe;

  --sh:  0 4px 16px rgba(0,0,0,.08);
  --shl: 0 12px 40px rgba(0,0,0,.14);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg-main);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { font-family: var(--font-body); }

/* ═══════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════ */
.container { max-width: 1120px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 5rem 0; background: var(--bg-section); }
.section-alt { background: var(--bg-alt); }

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  color: var(--navy);
  margin-bottom: .5rem;
  letter-spacing: -.02em;
}
[data-theme="dark"] .section-title { color: #e2e8f0; }
.section-sub { color: var(--gray-500); font-size: .93rem; margin-bottom: 3rem; }

/* ═══════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .72rem 1.55rem; border-radius: var(--r);
  font-weight: 600; font-size: .9rem; cursor: pointer;
  border: 2px solid transparent;
  transition: background .18s, color .18s, border-color .18s, transform .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn-primary:hover { background: var(--blue-h); border-color: var(--blue-h); }
.btn-secondary { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.btn-secondary:hover { background: rgba(255,255,255,.12); }
.btn-full { width: 100%; justify-content: center; }

/* ═══════════════════════════════════════════
   TAGS
═══════════════════════════════════════════ */
.tags { display: flex; flex-wrap: wrap; gap: .45rem; }
.tag {
  background: var(--tag-bg);
  color: var(--tag-color);
  border: 1px solid var(--tag-border);
  padding: .3rem .75rem; border-radius: 99px;
  font-size: .83rem; font-weight: 500;
}
.tag-sm { padding: .2rem .6rem; font-size: .76rem; }

/* ═══════════════════════════════════════════
   NAVBAR
═══════════════════════════════════════════ */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  transition: box-shadow .3s, background .3s, border-color .3s;
}
.navbar.scrolled { box-shadow: var(--sh); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.nav-right { display: flex; align-items: center; gap: .75rem; }

.nav-logo { font-family: var(--font-mono); font-weight: 500; font-size: 1.1rem; color: var(--navy); }
[data-theme="dark"] .nav-logo { color: #e2e8f0; }
.nav-logo .dot { color: var(--blue); }

.nav-links { display: flex; align-items: center; gap: 1.75rem; }
.nav-links a { font-weight: 500; font-size: .88rem; color: var(--text-light); transition: color .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--blue); }

.nav-cta { background: var(--navy) !important; color: #fff !important; padding: .45rem 1.1rem; border-radius: var(--r); }
[data-theme="dark"] .nav-cta { background: var(--blue) !important; }
.nav-cta:hover { background: var(--blue) !important; }

/* ── Theme Toggle ── */
.theme-toggle {
  width: 42px; height: 24px;
  background: var(--gray-100);
  border: none; border-radius: 99px;
  cursor: pointer;
  position: relative;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  transition: background .3s;
  padding: 0;
  flex-shrink: 0;
}
[data-theme="dark"] .theme-toggle { background: var(--navy-light); }
.theme-icon {
  font-size: .85rem;
  position: absolute;
  transition: opacity .3s, transform .3s;
  line-height: 1;
}
.sun-icon { opacity: 0; transform: scale(.5) rotate(-90deg); }
.moon-icon { opacity: 1; transform: scale(1) rotate(0deg); }
[data-theme="light"] .sun-icon { opacity: 1; transform: scale(1) rotate(0deg); }
[data-theme="light"] .moon-icon { opacity: 0; transform: scale(.5) rotate(90deg); }

.hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 4px; }
.hamburger span { display: block; width: 24px; height: 2px; background: var(--navy); border-radius: 2px; transition: transform .25s, opacity .25s; }
[data-theme="dark"] .hamburger span { background: #e2e8f0; }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  display: none; flex-direction: column;
  padding: 1rem 1.5rem 1.5rem;
  border-top: 1px solid var(--border);
  gap: .9rem;
  background: var(--nav-bg);
}
.mobile-menu a { font-weight: 500; color: var(--text-light); font-size: .95rem; }
.mobile-menu.open { display: flex; }

/* ═══════════════════════════════════════════
   HERO
═══════════════════════════════════════════ */
.hero {
  padding: 9rem 0 6rem;
  background: var(--navy);
  position: relative; overflow: hidden;
}
[data-theme="light"] .hero { background: var(--navy); }

.hero-bg-pattern {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
}
.hero-grid { display: grid; grid-template-columns: 1fr 420px; gap: 4rem; align-items: center; position: relative; }

.hero-label { display: flex; align-items: center; gap: .6rem; font-size: .8rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--accent); margin-bottom: 1rem; }
.pulse-dot { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.4;transform:scale(1.4)} }

.hero-name { font-family: var(--font-display); font-size: clamp(2.4rem, 4vw, 3.8rem); color: #fff; letter-spacing: -.03em; line-height: 1.1; margin-bottom: .5rem; }
.hero-title { font-size: clamp(1rem, 2vw, 1.3rem); font-weight: 400; color: #93c5fd; margin-bottom: 1.5rem; font-family: var(--font-mono); letter-spacing: .03em; display: inline-block; }
.hero-summary { color: #cbd5e1; font-size: 1rem; line-height: 1.8; max-width: 520px; margin-bottom: 2.25rem; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 2.25rem; }
.hero-socials { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.hero-socials a { display: flex; align-items: center; gap: .35rem; color: #94a3b8; font-size: .85rem; font-weight: 500; transition: color .2s; }
.hero-socials a:hover { color: #fff; }

/* ── HERO PHOTO ── */
.hero-photo-wrap {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1rem; position: relative;
}
.hero-photo-card {
  position: relative; border-radius: 24px; padding: 4px;
  background: linear-gradient(135deg, rgba(59,130,246,0.9) 0%, rgba(6,182,212,0.7) 40%, rgba(99,102,241,0.5) 80%, rgba(255,255,255,0.15) 100%);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 20px 60px rgba(0,0,0,0.45), 0 0 80px rgba(59,130,246,0.25);
  transition: box-shadow .35s ease, transform .35s ease;
}
.hero-photo-card:hover { transform: translateY(-6px) scale(1.01); box-shadow: 0 0 0 1px rgba(255,255,255,0.12), 0 28px 72px rgba(0,0,0,0.5), 0 0 100px rgba(59,130,246,0.38); }
.hero-photo-card::before { content: ''; position: absolute; inset: 4px; border-radius: 20px; background: var(--navy); z-index: 0; }
.hero-photo-img { position: relative; z-index: 1; width: 380px; max-width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: top center; border-radius: 20px; display: block; }
.hero-photo-fallback {
  position: relative; z-index: 1; width: 380px; max-width: 100%; aspect-ratio: 3 / 4;
  border-radius: 20px; background: var(--navy-light);
  display: none; flex-direction: column; align-items: center; justify-content: center;
  gap: 1rem; color: #93c5fd;
  font-family: var(--font-display); font-size: 3rem; font-weight: 700;
}
.hero-photo-fallback svg { opacity: .5; }
.hero-photo-wrap::before { content: ''; position: absolute; width: 400px; height: 500px; border-radius: 50%; background: radial-gradient(circle, rgba(59,130,246,0.22) 0%, transparent 70%); pointer-events: none; filter: blur(48px); z-index: 0; }

/* ═══════════════════════════════════════════
   SKILLS
═══════════════════════════════════════════ */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.4rem; }
.skill-group { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--rl); padding: 1.4rem; transition: box-shadow .2s; }
.skill-group:hover { box-shadow: var(--sh); }
.skill-group-title { font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--blue); margin-bottom: .9rem; padding-bottom: .45rem; border-bottom: 2px solid var(--card-border); }

/* ═══════════════════════════════════════════
   EXPERIENCE / TIMELINE
═══════════════════════════════════════════ */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; background: var(--border); border-radius: 2px; }
.timeline-item { position: relative; margin-bottom: 2.75rem; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-marker { position: absolute; left: -2.42rem; top: 8px; width: 12px; height: 12px; background: var(--blue); border: 3px solid var(--bg-alt); border-radius: 50%; box-shadow: 0 0 0 2px var(--blue); }
.timeline-body { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--rl); padding: 1.65rem 1.9rem; transition: box-shadow .2s; }
.timeline-body:hover { box-shadow: var(--sh); }

.exp-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.exp-role { font-size: 1.08rem; font-weight: 700; color: var(--text); }
.exp-company { font-size: .9rem; color: var(--blue); font-weight: 500; margin-top: .15rem; }
.exp-date { font-size: .8rem; color: var(--gray-500); white-space: nowrap; font-family: var(--font-mono); padding: .22rem .7rem; background: var(--gray-50); border: 1px solid var(--border); border-radius: 99px; }
.exp-bullets { margin-bottom: 1.2rem; }
.exp-bullets li { position: relative; padding-left: 1.2rem; margin-bottom: .55rem; font-size: .93rem; color: var(--text-light); line-height: 1.7; }
.exp-bullets li::before { content: '▸'; position: absolute; left: 0; color: var(--blue); font-size: .72rem; top: .32rem; }
.exp-bullets strong { color: var(--text); font-weight: 600; }
.exp-tags { display: flex; flex-wrap: wrap; gap: .38rem; }

/* ═══════════════════════════════════════════
   PROJECTS — ALTERNATING LAYOUT
═══════════════════════════════════════════ */
.projects-alt-list { display: flex; flex-direction: column; gap: 3rem; }

.proj-row {
  display: grid;
  grid-template-columns: 1fr 540px;
  gap: 3rem;
  align-items: center;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 2.5rem 2.75rem;
  position: relative; overflow: hidden;
  transition: box-shadow .3s, transform .3s;
}
.proj-row::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--blue) 0%, var(--accent) 100%); border-radius: 20px 20px 0 0; }
.proj-row:hover { box-shadow: 0 20px 60px rgba(0,0,0,.18); transform: translateY(-4px); }
[data-theme="dark"] .proj-row:hover { box-shadow: 0 20px 60px rgba(0,0,0,.4); }

.proj-row-reverse { grid-template-columns: 540px 1fr; }
.proj-row-reverse .proj-media { order: -1; }
.proj-row-reverse::before { background: linear-gradient(90deg, var(--accent) 0%, #818cf8 100%); }

.proj-row-featured { border-color: rgba(26,86,219,.35); }
[data-theme="light"] .proj-row-featured { background: linear-gradient(135deg, #eff6ff 0%, #fff 55%); }
[data-theme="dark"] .proj-row-featured { background: linear-gradient(135deg, rgba(26,86,219,.08) 0%, var(--card-bg) 55%); }
.proj-row-featured::before { background: linear-gradient(90deg, #6366f1 0%, var(--blue) 100%); }

.proj-meta-row { display: flex; align-items: center; gap: .85rem; margin-bottom: 1rem; }
.proj-num-badge { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; color: #fff; background: var(--navy); width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
[data-theme="dark"] .proj-num-badge { background: var(--navy-light); }
.num-featured { background: linear-gradient(135deg, var(--blue) 0%, #6366f1 100%) !important; }

.proj-status-row { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.proj-status-pill { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .7rem; border-radius: 99px; font-size: .75rem; font-weight: 700; letter-spacing: .04em; }
.live-pill { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
[data-theme="dark"] .live-pill { background: rgba(16,185,129,.15); color: #34d399; border-color: rgba(52,211,153,.3); }
.local-pill { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
[data-theme="dark"] .local-pill { background: rgba(245,158,11,.12); color: #fbbf24; border-color: rgba(251,191,36,.25); }

.status-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.green-dot { background: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,.2); animation: dot-pulse 2s ease-in-out infinite; }
@keyframes dot-pulse { 0%,100% { box-shadow: 0 0 0 2px rgba(16,185,129,.2); } 50% { box-shadow: 0 0 0 4px rgba(16,185,129,.08); } }

.proj-tech-chip { font-size: .7rem; font-weight: 600; color: var(--tag-color); background: var(--tag-bg); border: 1px solid var(--tag-border); padding: .2rem .6rem; border-radius: 99px; }
.chip-featured { color: #818cf8; background: rgba(99,102,241,.12); border-color: rgba(99,102,241,.3); }
[data-theme="light"] .chip-featured { color: #4338ca; background: #eef2ff; border-color: #c7d2fe; }

.proj-title { font-size: 1.35rem; font-weight: 700; color: var(--text); line-height: 1.25; margin-bottom: .85rem; letter-spacing: -.02em; }
.proj-desc { font-size: .915rem; color: var(--text-light); line-height: 1.8; margin-bottom: .6rem; }
.proj-desc strong { color: var(--text); font-weight: 600; }

.proj-stats { display: flex; align-items: center; gap: 0; background: var(--gray-50); border: 1px solid var(--border); border-radius: 12px; padding: .85rem 1.25rem; margin: 1.1rem 0; }
.proj-stat { flex: 1; text-align: center; }
.proj-stat-val { display: block; font-family: var(--font-mono); font-size: 1rem; font-weight: 700; color: var(--blue); line-height: 1.2; }
.proj-stat-key { display: block; font-size: .68rem; color: var(--gray-500); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; margin-top: .2rem; }
.proj-stat-div { width: 1px; height: 36px; background: var(--border); flex-shrink: 0; }

.proj-tag-row { display: flex; flex-wrap: wrap; gap: .38rem; margin-bottom: 1.25rem; }

.proj-btn-row { display: flex; gap: .6rem; flex-wrap: wrap; }
.proj-btn { display: inline-flex; align-items: center; gap: .4rem; padding: .55rem 1.15rem; border-radius: 10px; font-size: .85rem; font-weight: 600; cursor: pointer; border: none; font-family: var(--font-body); text-decoration: none; transition: all .18s; }
.proj-btn:hover { transform: translateY(-1px); }
.proj-btn:active { transform: translateY(0); }
.proj-btn-ghost { background: var(--card-bg); color: var(--text); border: 1.5px solid var(--card-border); }
.proj-btn-ghost:hover { border-color: var(--text); }
.proj-btn-live { background: #065f46; color: #fff; border: 1.5px solid #065f46; }
.proj-btn-live:hover { background: #047857; border-color: #047857; box-shadow: 0 4px 14px rgba(16,185,129,.35); }
.proj-btn-demo { background: var(--blue); color: #fff; border: 1.5px solid var(--blue); }
.proj-btn-demo:hover { background: var(--blue-h); border-color: var(--blue-h); box-shadow: 0 4px 14px rgba(26,86,219,.35); }

/* ─── PROJECT VIDEO CARD ─── */
.proj-media { position: relative; }

.proj-video-card {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  background: #1a2235;
  box-shadow: 0 4px 20px rgba(0,0,0,.2), 0 12px 40px rgba(0,0,0,.15);
  cursor: pointer;
  transition: box-shadow .3s, transform .3s;
  position: relative; z-index: 1;
}
.proj-video-card:hover { box-shadow: 0 8px 32px rgba(0,0,0,.3), 0 20px 60px rgba(0,0,0,.2); transform: scale(1.015) translateY(-3px); }
[data-theme="light"] .proj-video-card { background: #1a2235; }

.proj-video-card-featured { border-color: rgba(99,102,241,.4); }

.browser-bar { display: flex; align-items: center; gap: .5rem; padding: .6rem .85rem; background: #252b3a; border-bottom: 1px solid rgba(255,255,255,.07); flex-shrink: 0; }
.browser-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.browser-dot.r { background: #ff5f57; }
.browser-dot.y { background: #febc2e; }
.browser-dot.g { background: #28c840; }
.browser-url { flex: 1; background: rgba(255,255,255,.07); border-radius: 5px; padding: .25rem .6rem; font-size: .7rem; color: rgba(255,255,255,.45); font-family: var(--font-mono); display: flex; align-items: center; gap: .3rem; margin-left: .35rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* VIDEO SCREEN — proper aspect ratio, no cropping */
.proj-video-screen {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0b1628;
  overflow: hidden;
}
.proj-video-screen video {
  width: 100%;
  height: 100%;
  object-fit: contain;  /* contain = no cropping, full video visible */
  display: block;
  background: #0b1628;
}

/* Play overlay on hover */
.video-play-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.45);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: .6rem;
  opacity: 0;
  transition: opacity .25s;
}
.proj-video-card:hover .video-play-overlay { opacity: 1; }
.play-btn-big {
  width: 60px; height: 60px;
  background: rgba(255,255,255,.15);
  border: 2px solid rgba(255,255,255,.4);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
  color: #fff;
  transition: background .2s, transform .2s;
}
.proj-video-card:hover .play-btn-big { background: rgba(26,86,219,.7); border-color: var(--blue); transform: scale(1.1); }
.video-play-overlay span { color: rgba(255,255,255,.9); font-size: .82rem; font-weight: 600; letter-spacing: .04em; }

/* Glow */
.proj-media-glow { position: absolute; inset: 10% -8%; border-radius: 50%; filter: blur(50px); opacity: .18; pointer-events: none; z-index: 0; }
[data-theme="light"] .proj-media-glow { opacity: .1; }
.glow-blue { background: #3b82f6; }
.glow-cyan { background: #06b6d4; }
.glow-amber { background: #f59e0b; }

/* ═══════════════════════════════════════════
   VIDEO MODAL — FULL SIZE
═══════════════════════════════════════════ */
.video-modal-overlay {
  position: fixed; inset: 0; z-index: 600;
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center;
  padding: 1rem;
}
.video-modal-overlay.open { display: flex; }

.video-modal-box {
  background: #111827;
  border-radius: 16px;
  width: 100%;
  max-width: 1000px;
  max-height: 92vh;
  display: flex; flex-direction: column;
  box-shadow: 0 32px 100px rgba(0,0,0,.7);
  overflow: hidden;
  animation: modalIn .22s ease;
  border: 1px solid rgba(255,255,255,.1);
}
@keyframes modalIn { from { opacity:0; transform:scale(.94) translateY(16px); } to { opacity:1; transform:none; } }

.video-modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: .85rem 1.25rem;
  background: #1a2235;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.video-modal-title-wrap { display: flex; align-items: center; gap: .6rem; }
.video-modal-dot { width: 8px; height: 8px; background: #10b981; border-radius: 50%; animation: pulse 2s ease-in-out infinite; }
#videoModalTitle { color: #fff; font-weight: 600; font-size: .95rem; }
.video-modal-close { background: rgba(255,255,255,.1); border: none; color: #fff; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: .9rem; display: flex; align-items: center; justify-content: center; transition: background .2s; }
.video-modal-close:hover { background: rgba(255,255,255,.2); }

.video-modal-body {
  flex: 1; overflow: hidden;
  background: #000;
  display: flex; align-items: center; justify-content: center;
}
.video-modal-body video {
  width: 100%;
  max-height: calc(92vh - 60px);
  object-fit: contain; /* never crops the video */
  display: block;
  background: #000;
}

/* ═══════════════════════════════════════════
   EDUCATION
═══════════════════════════════════════════ */
.edu-card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--rl); padding: 2.25rem; display: flex; align-items: flex-start; gap: 1.75rem; transition: box-shadow .2s; }
.edu-card:hover { box-shadow: var(--shl); }
.edu-icon { width: 60px; height: 60px; background: var(--tag-bg); border: 1px solid var(--tag-border); border-radius: var(--rl); display: flex; align-items: center; justify-content: center; color: var(--blue); flex-shrink: 0; }
.edu-content { flex: 1; }
.edu-degree { font-size: 1.15rem; font-weight: 700; color: var(--text); margin-bottom: .3rem; }
.edu-uni { font-size: .95rem; color: var(--blue); font-weight: 500; margin-bottom: .35rem; }
.edu-meta { font-size: .87rem; color: var(--gray-500); margin-bottom: .7rem; font-family: var(--font-mono); }
.edu-meta strong { color: var(--text); }
.edu-details { font-size: .86rem; color: var(--text-light); background: var(--gray-50); padding: .7rem .95rem; border-radius: var(--r); border: 1px solid var(--border); }
.edu-cgpa { text-align: center; background: var(--navy); border-radius: var(--rl); padding: 1.15rem 1.6rem; flex-shrink: 0; }
.cgpa-num { display: block; font-family: var(--font-display); font-size: 2.4rem; color: #fff; line-height: 1; }
.cgpa-label { font-size: .72rem; color: #93c5fd; text-transform: uppercase; letter-spacing: .05em; font-weight: 500; }

/* ═══════════════════════════════════════════
   ACHIEVEMENTS — ADVANCED
═══════════════════════════════════════════ */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.ach-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 0;
  overflow: hidden;
  transition: transform .3s cubic-bezier(.25,.8,.25,1), box-shadow .3s cubic-bezier(.25,.8,.25,1), border-color .3s;
}

/* Top accent stripe */
.ach-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 18px 18px 0 0;
}

.ach-card-inner {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem 1.5rem 1rem;
}

.ach-meta {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: .55rem 1.5rem .7rem;
  border-top: 1px solid var(--card-border);
  color: var(--gray-500);
  margin-top: auto;
}

/* Color variants */
.ach-card--gold::before   { background: linear-gradient(90deg, #f59e0b, #fbbf24, #f59e0b); }
.ach-card--blue::before   { background: linear-gradient(90deg, #1a56db, #06b6d4); }
.ach-card--green::before  { background: linear-gradient(90deg, #10b981, #34d399); }
.ach-card--orange::before { background: linear-gradient(90deg, #f97316, #fb923c); }
.ach-card--purple::before { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.ach-card--cyan::before   { background: linear-gradient(90deg, #06b6d4, #22d3ee); }

/* Dark mode glow wash */
[data-theme="dark"] .ach-card--gold::after   { content:''; position:absolute; inset:0; background:radial-gradient(ellipse at top left, rgba(245,158,11,.07) 0%, transparent 70%); pointer-events:none; }
[data-theme="dark"] .ach-card--blue::after   { content:''; position:absolute; inset:0; background:radial-gradient(ellipse at top left, rgba(26,86,219,.07) 0%, transparent 70%); pointer-events:none; }
[data-theme="dark"] .ach-card--green::after  { content:''; position:absolute; inset:0; background:radial-gradient(ellipse at top left, rgba(16,185,129,.07) 0%, transparent 70%); pointer-events:none; }
[data-theme="dark"] .ach-card--orange::after { content:''; position:absolute; inset:0; background:radial-gradient(ellipse at top left, rgba(249,115,22,.07) 0%, transparent 70%); pointer-events:none; }
[data-theme="dark"] .ach-card--purple::after { content:''; position:absolute; inset:0; background:radial-gradient(ellipse at top left, rgba(139,92,246,.07) 0%, transparent 70%); pointer-events:none; }
[data-theme="dark"] .ach-card--cyan::after   { content:''; position:absolute; inset:0; background:radial-gradient(ellipse at top left, rgba(6,182,212,.07) 0%, transparent 70%); pointer-events:none; }

/* Hover states */
.ach-card:hover { transform: translateY(-6px); }
.ach-card--gold:hover   { box-shadow: 0 12px 36px rgba(245,158,11,.18), 0 24px 56px rgba(0,0,0,.14); border-color: rgba(245,158,11,.3); }
.ach-card--blue:hover   { box-shadow: 0 12px 36px rgba(26,86,219,.18), 0 24px 56px rgba(0,0,0,.14); border-color: rgba(59,130,246,.35); }
.ach-card--green:hover  { box-shadow: 0 12px 36px rgba(16,185,129,.18), 0 24px 56px rgba(0,0,0,.14); border-color: rgba(52,211,153,.3); }
.ach-card--orange:hover { box-shadow: 0 12px 36px rgba(249,115,22,.18), 0 24px 56px rgba(0,0,0,.14); border-color: rgba(251,146,60,.3); }
.ach-card--purple:hover { box-shadow: 0 12px 36px rgba(139,92,246,.18), 0 24px 56px rgba(0,0,0,.14); border-color: rgba(167,139,250,.3); }
.ach-card--cyan:hover   { box-shadow: 0 12px 36px rgba(6,182,212,.18), 0 24px 56px rgba(0,0,0,.14); border-color: rgba(34,211,238,.3); }

/* Icon wrap */
.ach-icon-wrap {
  width: 46px; height: 46px;
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform .3s cubic-bezier(.25,.8,.25,1);
}
.ach-card:hover .ach-icon-wrap { transform: scale(1.12) rotate(-5deg); }

.ach-icon--gold   { background: rgba(245,158,11,.14); color: #fbbf24; border: 1px solid rgba(245,158,11,.25); }
.ach-icon--blue   { background: rgba(26,86,219,.14);  color: #60a5fa; border: 1px solid rgba(59,130,246,.25); }
.ach-icon--green  { background: rgba(16,185,129,.12); color: #34d399; border: 1px solid rgba(52,211,153,.22); }
.ach-icon--orange { background: rgba(249,115,22,.12); color: #fb923c; border: 1px solid rgba(251,146,60,.22); }
.ach-icon--purple { background: rgba(139,92,246,.12); color: #c4b5fd; border: 1px solid rgba(167,139,250,.22); }
.ach-icon--cyan   { background: rgba(6,182,212,.12);  color: #22d3ee; border: 1px solid rgba(34,211,238,.22); }

[data-theme="light"] .ach-icon--gold   { background: #fffbeb; color: #b45309; border-color: #fde68a; }
[data-theme="light"] .ach-icon--blue   { background: #eff6ff; color: #1a56db; border-color: #bfdbfe; }
[data-theme="light"] .ach-icon--green  { background: #ecfdf5; color: #059669; border-color: #a7f3d0; }
[data-theme="light"] .ach-icon--orange { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
[data-theme="light"] .ach-icon--purple { background: #f5f3ff; color: #6d28d9; border-color: #ddd6fe; }
[data-theme="light"] .ach-icon--cyan   { background: #ecfeff; color: #0891b2; border-color: #a5f3fc; }

/* Badge pill */
.ach-badge {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .7rem; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase;
  padding: .2rem .65rem;
  border-radius: 99px;
  margin-bottom: .35rem;
}
.ach-badge--gold   { background: rgba(245,158,11,.12); color: #fbbf24; border: 1px solid rgba(245,158,11,.22); }
.ach-badge--blue   { background: rgba(26,86,219,.12);  color: #60a5fa; border: 1px solid rgba(59,130,246,.22); }
.ach-badge--green  { background: rgba(16,185,129,.12); color: #34d399; border: 1px solid rgba(52,211,153,.2); }
.ach-badge--orange { background: rgba(249,115,22,.12); color: #fb923c; border: 1px solid rgba(251,146,60,.2); }
.ach-badge--purple { background: rgba(139,92,246,.12); color: #c4b5fd; border: 1px solid rgba(167,139,250,.2); }
.ach-badge--cyan   { background: rgba(6,182,212,.12);  color: #22d3ee; border: 1px solid rgba(34,211,238,.2); }

[data-theme="light"] .ach-badge--gold   { background: #fffbeb; color: #b45309; border-color: #fde68a; }
[data-theme="light"] .ach-badge--blue   { background: #eff6ff; color: #1a56db; border-color: #bfdbfe; }
[data-theme="light"] .ach-badge--green  { background: #ecfdf5; color: #059669; border-color: #a7f3d0; }
[data-theme="light"] .ach-badge--orange { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
[data-theme="light"] .ach-badge--purple { background: #f5f3ff; color: #6d28d9; border-color: #ddd6fe; }
[data-theme="light"] .ach-badge--cyan   { background: #ecfeff; color: #0891b2; border-color: #a5f3fc; }

.ach-body { flex: 1; }
.ach-title { font-size: .97rem; font-weight: 700; color: var(--text); line-height: 1.35; margin-bottom: .4rem; }
.ach-desc  { font-size: .855rem; color: var(--text-light); line-height: 1.7; }
.ach-desc strong { color: var(--text); font-weight: 600; }

/* ═══════════════════════════════════════════
   CONTACT
═══════════════════════════════════════════ */
.contact-section { background: var(--navy); }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5rem; align-items: start; }
.contact-left { padding-top: .5rem; }
.section-title.light { color: #fff; }
.contact-sub { color: #94a3b8; margin-bottom: 2rem; font-size: .97rem; line-height: 1.75; }

.contact-profiles { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; }
.contact-profile-box { display: flex; align-items: center; gap: .85rem; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); border-radius: 14px; padding: .9rem 1.1rem; transition: background .2s, border-color .2s, transform .18s; color: inherit; text-decoration: none; cursor: pointer; pointer-events: all; position: relative; z-index: 1; }
.contact-profile-box:hover { background: rgba(255,255,255,.1); border-color: rgba(59,130,246,.5); transform: translateY(-2px); }
.cpb-icon { width: 40px; height: 40px; background: rgba(59,130,246,.2); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 700; color: #93c5fd; flex-shrink: 0; }
.cpb-label { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: #94a3b8; }
.cpb-handle { font-size: .84rem; color: #fff; font-weight: 500; margin-top: .06rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ═══════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════ */
.footer { background: var(--navy-mid); border-top: 1px solid rgba(255,255,255,.06); padding: 1.4rem 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; font-size: .8rem; color: #64748b; }

/* ═══════════════════════════════════════════
   SCROLL REVEAL
═══════════════════════════════════════════ */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .5s ease, transform .5s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ═══════════════════════════════════════════
   RIBBON CURSOR
═══════════════════════════════════════════ */
#ribbonCanvas {
  pointer-events: none;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.4s ease;
}
body.ribbon-active #ribbonCanvas { opacity: 1; }
@media (prefers-reduced-motion: reduce) { #ribbonCanvas { display: none; } }
@media (max-width: 768px) { #ribbonCanvas { display: none; } }

/* ═══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */
@media (max-width: 1100px) {
  .proj-row { grid-template-columns: 1fr 400px; gap: 2rem; padding: 2rem; }
  .proj-row-reverse { grid-template-columns: 400px 1fr; }
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-photo-img, .hero-photo-fallback { width: 240px; }
  .contact-grid { grid-template-columns: 1fr; gap: 3rem; }
  .contact-profiles { grid-template-columns: 1fr; }
  .edu-card { flex-direction: column; }
  .edu-cgpa { align-self: flex-start; display: flex; gap: .6rem; align-items: baseline; }
  .cgpa-num { font-size: 1.8rem; }
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .proj-row, .proj-row-reverse { grid-template-columns: 1fr; gap: 1.5rem; padding: 1.65rem 1.5rem; }
  .proj-row-reverse .proj-media { order: 0; }
  .proj-media { order: -1; }
  .proj-row:hover { transform: none; }
  .proj-video-card:hover { transform: none; }
  .proj-media-glow { display: none; }
}

@media (max-width: 640px) {
  .section { padding: 3.5rem 0; }
  .hero { padding: 7rem 0 4rem; }
  .skills-grid, .achievements-grid { grid-template-columns: 1fr; }
  .exp-header { flex-direction: column; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .footer-inner { flex-direction: column; text-align: center; }
  .hero-photo-img, .hero-photo-fallback { width: 200px; }
  .hero-photo-wrap::before { display: none; }
  .proj-btn-row { gap: .45rem; }
  .proj-btn { padding: .48rem .9rem; font-size: .8rem; }
  .proj-title { font-size: 1.15rem; }
  .video-modal-box { border-radius: 10px; }
}
/* ═══════════════════════════════════════════
   AI CHAT WIDGET
═══════════════════════════════════════════ */

/* ── FAB Button ── */
.ai-chat-widget {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1rem;
}

.ai-chat-fab {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a56db 0%, #06b6d4 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(26,86,219,.45), 0 0 0 0 rgba(26,86,219,.3);
  transition: transform .25s cubic-bezier(.25,.8,.25,1), box-shadow .25s ease;
  animation: fab-pulse 3s ease-in-out infinite;
}
@keyframes fab-pulse {
  0%,100% { box-shadow: 0 4px 20px rgba(26,86,219,.45), 0 0 0 0 rgba(26,86,219,.25); }
  50%      { box-shadow: 0 4px 24px rgba(26,86,219,.55), 0 0 0 10px rgba(26,86,219,.0); }
}
.ai-chat-fab:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 8px 28px rgba(26,86,219,.55);
  animation: none;
}

.ai-fab-icon {
  position: absolute;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .2s ease, transform .2s ease;
}
.ai-fab-close { opacity: 0; transform: scale(.6) rotate(-90deg); }
.ai-chat-widget.open .ai-fab-open  { opacity: 0; transform: scale(.6) rotate(90deg); }
.ai-chat-widget.open .ai-fab-close { opacity: 1; transform: scale(1) rotate(0deg); }

.ai-fab-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: #10b981;
  color: #fff;
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .04em;
  padding: .12rem .32rem;
  border-radius: 99px;
  border: 2px solid var(--bg-main, #0b1628);
  line-height: 1.3;
  transition: opacity .2s;
}
.ai-chat-widget.open .ai-fab-badge { opacity: 0; }

/* ── Chat Panel ── */
.ai-chat-panel {
  width: 360px;
  max-height: 520px;
  background: #0f1e36;
  border: 1px solid rgba(59,130,246,.25);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.04);
  transform: scale(.92) translateY(16px);
  opacity: 0;
  pointer-events: none;
  transform-origin: bottom right;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1), opacity .25s ease;
}
[data-theme="light"] .ai-chat-panel {
  background: #ffffff;
  border-color: rgba(26,86,219,.18);
  box-shadow: 0 24px 64px rgba(0,0,0,.15), 0 0 0 1px rgba(26,86,219,.08);
}
.ai-chat-widget.open .ai-chat-panel {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* ── Header ── */
.ai-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.1rem .9rem;
  background: linear-gradient(135deg, #152848 0%, #1a2e50 100%);
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
[data-theme="light"] .ai-chat-header {
  background: linear-gradient(135deg, #1a56db 0%, #1e6fd9 100%);
  border-bottom-color: rgba(255,255,255,.15);
}
.ai-chat-header-left { display: flex; align-items: center; gap: .7rem; }
.ai-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #1a56db, #06b6d4);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.ai-chat-name { font-size: .9rem; font-weight: 700; color: #fff; line-height: 1.2; }
.ai-chat-status {
  font-size: .72rem;
  color: rgba(255,255,255,.65);
  display: flex; align-items: center; gap: .35rem;
  margin-top: .08rem;
}
.ai-online-dot {
  width: 6px; height: 6px;
  background: #10b981;
  border-radius: 50%;
  animation: dot-pulse 2s ease-in-out infinite;
}
.ai-chat-minimize {
  background: rgba(255,255,255,.12);
  border: none;
  color: #fff;
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.ai-chat-minimize:hover { background: rgba(255,255,255,.22); }

/* ── Messages ── */
.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  scroll-behavior: smooth;
}
.ai-chat-messages::-webkit-scrollbar { width: 4px; }
.ai-chat-messages::-webkit-scrollbar-track { background: transparent; }
.ai-chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }

.ai-msg { display: flex; }
.ai-msg-bot { justify-content: flex-start; }
.ai-msg-user { justify-content: flex-end; }

.ai-msg-bubble {
  max-width: 82%;
  padding: .65rem .9rem;
  border-radius: 16px;
  font-size: .875rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.ai-msg-bot .ai-msg-bubble {
  background: rgba(255,255,255,.07);
  color: #e2e8f0;
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(255,255,255,.08);
}
[data-theme="light"] .ai-msg-bot .ai-msg-bubble {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #e2e8f0;
}
.ai-msg-user .ai-msg-bubble {
  background: linear-gradient(135deg, #1a56db, #0ea5e9);
  color: #fff;
  border-bottom-right-radius: 4px;
}

/* Typing indicator */
.ai-typing-dots {
  display: flex; align-items: center; gap: 4px;
  padding: .55rem .75rem;
}
.ai-typing-dots span {
  width: 7px; height: 7px;
  background: #60a5fa;
  border-radius: 50%;
  animation: ai-dot-bounce 1.2s ease-in-out infinite;
}
.ai-typing-dots span:nth-child(2) { animation-delay: .2s; }
.ai-typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes ai-dot-bounce {
  0%,80%,100% { transform: translateY(0); opacity: .5; }
  40%          { transform: translateY(-6px); opacity: 1; }
}

/* Suggestion chips */
.ai-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: .25rem;
}
.ai-suggestion-chip {
  background: rgba(26,86,219,.12);
  border: 1px solid rgba(59,130,246,.25);
  color: #93c5fd;
  font-size: .76rem;
  font-weight: 500;
  padding: .35rem .75rem;
  border-radius: 99px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background .18s, border-color .18s, transform .18s;
  white-space: nowrap;
}
.ai-suggestion-chip:hover {
  background: rgba(26,86,219,.25);
  border-color: rgba(59,130,246,.5);
  transform: translateY(-1px);
}
[data-theme="light"] .ai-suggestion-chip {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1a56db;
}

/* ── Input row ── */
.ai-chat-input-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1rem;
  border-top: 1px solid rgba(255,255,255,.07);
  background: rgba(0,0,0,.15);
  flex-shrink: 0;
}
[data-theme="light"] .ai-chat-input-row {
  border-top-color: #e2e8f0;
  background: #f8fafc;
}
.ai-chat-input {
  flex: 1;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  color: #e2e8f0;
  font-family: var(--font-body);
  font-size: .875rem;
  padding: .55rem .85rem;
  outline: none;
  transition: border-color .2s, background .2s;
}
[data-theme="light"] .ai-chat-input {
  background: #fff;
  border-color: #e2e8f0;
  color: #0f172a;
}
.ai-chat-input::placeholder { color: rgba(255,255,255,.3); }
[data-theme="light"] .ai-chat-input::placeholder { color: #94a3b8; }
.ai-chat-input:focus { border-color: rgba(59,130,246,.6); background: rgba(255,255,255,.1); }
[data-theme="light"] .ai-chat-input:focus { border-color: #1a56db; background: #fff; }

.ai-chat-send {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #1a56db, #06b6d4);
  border: none;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform .18s, box-shadow .18s, opacity .18s;
}
.ai-chat-send:hover { transform: scale(1.08); box-shadow: 0 4px 14px rgba(26,86,219,.4); }
.ai-chat-send:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* ── Footer ── */
.ai-chat-footer {
  text-align: center;
  font-size: .68rem;
  color: rgba(255,255,255,.25);
  padding: .45rem 1rem .6rem;
  flex-shrink: 0;
}
[data-theme="light"] .ai-chat-footer { color: #94a3b8; }

/* ── Bot message formatting ── */
.ai-msg-bot .ai-msg-bubble p { margin: 0 0 .3rem 0; line-height: 1.6; }
.ai-msg-bot .ai-msg-bubble p:last-child { margin-bottom: 0; }
.ai-msg-bot .ai-msg-bubble br { display: block; content: ''; margin: .1rem 0; }
.ai-msg-bot .ai-msg-bubble .ai-header-line { font-weight: 700; color: #93c5fd; margin-bottom: .45rem !important; font-size: .9rem; }
[data-theme="light"] .ai-msg-bot .ai-msg-bubble .ai-header-line { color: #1a56db; }
.ai-msg-bot .ai-msg-bubble .ai-num-item { color: var(--text-light, #94a3b8); padding-left: .5rem; }
.ai-msg-bot .ai-msg-bubble .ai-list { padding-left: 1.1rem; margin: .25rem 0 .4rem; list-style: disc; }
.ai-msg-bot .ai-msg-bubble .ai-list li { margin-bottom: .22rem; font-size: .86rem; line-height: 1.55; }
.ai-msg-bot .ai-msg-bubble strong { color: #e2e8f0; font-weight: 700; }
[data-theme="light"] .ai-msg-bot .ai-msg-bubble strong { color: #0f172a; }
.ai-msg-bot .ai-msg-bubble em { color: #93c5fd; font-style: italic; }
[data-theme="light"] .ai-msg-bot .ai-msg-bubble em { color: #1a56db; }

/* ── Mobile ── */
@media (max-width: 480px) {
  .ai-chat-widget { bottom: 1.25rem; right: 1.25rem; }
  .ai-chat-panel { width: calc(100vw - 2.5rem); max-height: 72vh; }
}