/* ═══════════════════════════════════════════════════════════════════
   DESIGN TOKENS
═══════════════════════════════════════════════════════════════════ */
:root {
  /* Colors – Dark Theme */
  --bg:           #07080f;
  --bg2:          #0d0e1a;
  --bg3:          #12131f;
  --card:         #14152200;
  --card-solid:   #14152280;
  --border:       rgba(255,255,255,0.07);
  --border-hover: rgba(99,102,241,0.45);
  --text:         #f0f0f8;
  --muted:        #7a7a9a;
  --subtle:       #3a3a5c;

  --accent:   #6366f1;
  --accent2:  #a855f7;
  --green:    #22c55e;
  --yellow:   #eab308;
  --red:      #f87171;

  --grad: linear-gradient(135deg, var(--accent), var(--accent2));
  --shadow-sm: 0 4px 16px rgba(0,0,0,0.35);
  --shadow-md: 0 8px 40px rgba(0,0,0,0.5);
  --shadow-lg: 0 16px 64px rgba(0,0,0,0.6);

  --radius:   16px;
  --radius-sm: 10px;
  --ease:     cubic-bezier(.4,0,.2,1);
  --ease-spring: cubic-bezier(.16,1,.3,1);
  --trans:    0.3s var(--ease);
}

[data-theme="light"] {
  --bg:         #f7f7fd;
  --bg2:        #eeeef8;
  --bg3:        #e8e8f4;
  --card:       rgba(255,255,255,0);
  --card-solid: rgba(255,255,255,0.7);
  --border:     rgba(0,0,0,0.07);
  --border-hover: rgba(99,102,241,0.5);
  --text:       #0d0d18;
  --muted:      #5a5a7a;
  --subtle:     #c0c0dc;
  --shadow-sm:  0 4px 16px rgba(0,0,0,0.08);
  --shadow-md:  0 8px 40px rgba(0,0,0,0.12);
  --shadow-lg:  0 16px 64px rgba(0,0,0,0.15);
}

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

html {
  scroll-behavior: auto; /* Lenis handles smooth scroll */
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--bg2);
}
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  transition: background 0.5s var(--ease), color 0.5s var(--ease);
}

h1, h2, h3, h4, h5, h6, .nav-logo {
  font-family: 'Outfit', -apple-system, sans-serif;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { display: block; max-width: 100%; }
strong { font-weight: 700; }

/* ═══════════════════════════════════════════════════════════════════
   SCROLL PROGRESS BAR
═══════════════════════════════════════════════════════════════════ */
#progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: var(--grad);
  z-index: 9999;
  transition: width 0.1s linear;
  box-shadow: 0 0 12px rgba(99,102,241,0.6);
}

/* ═══════════════════════════════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════════════════════════════ */
.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 32px;
}

.section { padding: 140px 0; }
.section-alt { background: var(--bg2); }
.section-alt + .section-alt { background: var(--bg); }

/* ═══════════════════════════════════════════════════════════════════
   SCROLL REVEAL ANIMATIONS
═══════════════════════════════════════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(48px);
  transition:
    opacity 0.8s var(--ease-spring),
    transform 0.8s var(--ease-spring);
  will-change: opacity, transform;
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal.delay-1 { transition-delay: 0.1s; }
.reveal.delay-2 { transition-delay: 0.2s; }
.reveal.delay-3 { transition-delay: 0.3s; }

/* Hero items — appear immediately with animation */
.animate-in {
  opacity: 0;
  transform: translateY(32px);
  animation: fadeUp 0.8s var(--ease-spring) forwards;
}
.animate-in.delay-0 { animation-delay: 0.1s; }
.animate-in.delay-1 { animation-delay: 0.25s; }
.animate-in.delay-2 { animation-delay: 0.4s; }
.animate-in.delay-3 { animation-delay: 0.55s; }
.animate-in.delay-4 { animation-delay: 0.7s; }

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 14px 28px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.95rem;
  cursor: pointer; border: 1px solid transparent;
  transition: all var(--trans);
  position: relative; overflow: hidden;
  white-space: nowrap;
}
.btn::after {
  content: '';
  position: absolute; inset: 0;
  background: white;
  opacity: 0;
  transition: opacity 0.2s;
}
.btn:hover::after { opacity: 0.06; }

.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 4px 20px rgba(99,102,241,0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(99,102,241,0.5);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(99,102,241,0.07);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
  padding: 10px 20px;
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-sm { padding: 9px 18px; font-size: 0.88rem; }
.btn-full { width: 100%; justify-content: center; }

/* Icon-only button */
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--muted); font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--trans);
  flex-shrink: 0;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); box-shadow: 0 0 16px rgba(99,102,241,0.2); }

/* ═══════════════════════════════════════════════════════════════════
   NAVIGATION
═══════════════════════════════════════════════════════════════════ */
#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 900;
  padding: 20px 0;
  transition: all 0.4s var(--ease);
}
#nav.scrolled {
  padding: 12px 0;
  background: rgba(7,8,15,0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
}
[data-theme="light"] #nav.scrolled { background: rgba(247,247,253,0.88); }

.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.nav-logo {
  font-size: 1.6rem; font-weight: 900; letter-spacing: -0.04em;
  background: var(--grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.logo-dot { -webkit-text-fill-color: var(--accent2); }

.nav-links { display: flex; align-items: center; gap: 4px; flex: 1; justify-content: center; }
.nav-link {
  padding: 8px 16px; border-radius: 8px;
  font-size: 0.9rem; font-weight: 500; color: var(--muted);
  transition: all var(--trans);
}
.nav-link:hover { color: var(--text); background: var(--bg3); }
.nav-link.active { color: var(--accent); }

.nav-actions { display: flex; align-items: center; gap: 12px; }

.hamburger { display: none; }

/* Mobile Overlay */
.mobile-overlay {
  position: fixed; inset: 0; z-index: 950;
  background: var(--bg2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 32px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s var(--ease);
}
.mobile-overlay.open { opacity: 1; pointer-events: all; }
.mob-close { position: absolute; top: 24px; right: 24px; }
.mob-links { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.mob-link { font-size: 1.8rem; font-weight: 700; color: var(--text); transition: color var(--trans); }
.mob-link:hover { color: var(--accent); }

/* ═══════════════════════════════════════════════════════════════════
   GRADIENT TEXT UTIL
═══════════════════════════════════════════════════════════════════ */
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ═══════════════════════════════════════════════════════════════════
   SECTION HEADERS
═══════════════════════════════════════════════════════════════════ */
.sec-header { margin-bottom: 64px; max-width: 540px; }
.sec-tag {
  display: inline-block;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.25);
  padding: 5px 14px; border-radius: 100px; margin-bottom: 18px;
}
.sec-title {
  font-size: clamp(2.2rem, 3.5vw, 3.2rem);
  font-weight: 800; letter-spacing: -0.03em; line-height: 1.1;
  margin-bottom: 18px;
}
.sec-desc { color: var(--muted); font-size: 1.1rem; line-height: 1.75; }

/* ═══════════════════════════════════════════════════════════════════
   HERO
═══════════════════════════════════════════════════════════════════ */
.hero-section {
  min-height: 100vh;
  display: flex; align-items: center;
  padding: 130px 0 160px;
  position: relative; overflow: hidden;
}

/* Background Orbs */
.orb {
  position: absolute; border-radius: 50%;
  filter: blur(100px); pointer-events: none;
  animation: orbFloat 20s infinite alternate ease-in-out;
}
.orb-1 { width: 600px; height: 600px; background: rgba(99,102,241,0.18); top: -200px; left: -100px; }
.orb-2 { width: 500px; height: 500px; background: rgba(168,85,247,0.14); bottom: -150px; right: -100px; animation-delay: -8s; }
.orb-3 { width: 350px; height: 350px; background: rgba(34,197,94,0.06); top: 35%; left: 45%; animation-delay: -14s; }
.orb-4 { width: 700px; height: 700px; background: rgba(99,102,241,0.12); top: 50%; left: 50%; transform: translate(-50%,-50%); animation-delay: -6s; }

@keyframes orbFloat {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(60px, 80px) scale(1.15); }
}

/* Dot grid overlay */
.dot-grid {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 36px 36px;
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
}

.hero-grid {
  display: grid; grid-template-columns: 1fr auto;
  gap: 80px; align-items: center; position: relative; z-index: 1;
}

.hero-tag {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 18px; border-radius: 100px;
  border: 1px solid rgba(34,197,94,0.3);
  background: rgba(34,197,94,0.08);
  font-size: 0.85rem; font-weight: 600; color: var(--green);
  margin-bottom: 28px; width: fit-content;
}
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--green);
  animation: pulse 2s infinite;
  box-shadow: 0 0 8px var(--green);
}
@keyframes pulse { 0%,100% { opacity:1; transform:scale(1); } 50% { opacity:0.4; transform:scale(0.8); } }

.hero-title {
  font-size: clamp(3.2rem, 6vw, 5.5rem);
  font-weight: 900; line-height: 1.06; letter-spacing: -0.04em;
  margin-bottom: 26px;
}

.typed-wrapper { display: inline-block; min-width: 200px; }
.typed-cursor {
  display: inline-block;
  animation: blink 0.8s infinite step-end;
  color: var(--accent);
}
@keyframes blink { 0%,100% { opacity:1; } 50% { opacity:0; } }

.hero-desc {
  font-size: 1.2rem; color: var(--muted);
  max-width: 560px; line-height: 1.75; margin-bottom: 40px;
}
.inline-link { color: var(--accent); font-weight: 600; border-bottom: 1px solid rgba(99,102,241,0.3); transition: border-color var(--trans); }
.inline-link:hover { border-color: var(--accent); }

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 60px; }

/* Stats */
.hero-stats {
  display: flex; align-items: center; gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-solid);
  backdrop-filter: blur(12px);
  overflow: hidden;
  width: fit-content;
}
.stat {
  padding: 20px 32px;
  display: flex; flex-direction: column; gap: 4px;
}
.stat-num {
  font-size: clamp(2.2rem, 4vw, 2.8rem); font-weight: 900;
  background: var(--grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  line-height: 1;
}
.stat-label { font-size: 0.78rem; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; }
.stat-divider { width: 1px; background: var(--border); align-self: stretch; }

/* Profile Photo */
.hero-photo-wrap { position: relative; flex-shrink: 0; }
.photo-glow {
  position: absolute; inset: -40px; border-radius: 50%; z-index: 0;
  background: radial-gradient(circle, rgba(99,102,241,0.3) 0%, transparent 70%);
  animation: photoGlow 4s alternate infinite;
}
@keyframes photoGlow { from { transform: scale(0.9); opacity:0.5; } to { transform: scale(1.1); opacity:1; } }

.photo-frame {
  width: 300px; height: 380px;
  border-radius: 28px; overflow: hidden;
  border: 1px solid var(--border);
  position: relative; z-index: 1;
  box-shadow: var(--shadow-lg);
}
.hero-photo { width: 100%; height: 100%; object-fit: cover; }

/* Floating badges */
.float-badge {
  position: absolute; z-index: 2;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 100px;
  background: var(--card-solid); backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  font-size: 0.82rem; font-weight: 700;
  box-shadow: var(--shadow-md);
  white-space: nowrap;
  cursor: grab;
  user-select: none;
  transition: box-shadow 0.3s, border-color 0.3s;
}
.badge-1 { bottom: 32px; left: -60px; animation: floatBadge 3s ease-in-out infinite alternate; }
.badge-2 { top: 40px; right: -55px; animation: floatBadge 3s ease-in-out 1.5s infinite alternate; }
.float-badge i { color: var(--accent); }
.float-badge:hover {
  border-color: var(--border-hover);
  box-shadow: 0 0 24px rgba(99,102,241,0.35), var(--shadow-md);
}

/* Orbiting state — badge is reparented to <body> as fixed overlay */
.float-badge.orbiting {
  position: fixed !important;
  z-index: 9998 !important;
  animation: none !important;
  cursor: grabbing;
  border-color: var(--accent);
  box-shadow: 0 0 32px rgba(99,102,241,0.55), var(--shadow-lg);
  transition: none;
  pointer-events: none;
}

/* Returning to original position */
.float-badge.returning {
  position: fixed !important;
  z-index: 9998 !important;
  animation: none !important;
  pointer-events: none;
  transition: left 0.55s var(--ease-spring), top 0.55s var(--ease-spring),
              opacity 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s;
}

/* Drag-hint tooltip shown on the photo wrap */
.photo-drag-hint {
  position: absolute;
  bottom: -36px; left: 50%; transform: translateX(-50%);
  font-size: 0.7rem; font-weight: 600;
  color: var(--muted); letter-spacing: 0.06em;
  white-space: nowrap; pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  z-index: 3;
}
.hero-photo-wrap:hover .photo-drag-hint { opacity: 1; }

/* Global orbit-active cursor override */
body.badge-orbiting, body.badge-orbiting * { cursor: grabbing !important; }

@keyframes floatBadge { from { transform: translateY(0); } to { transform: translateY(-8px); } }

/* Scroll cue */
.scroll-cue {
  position: absolute; bottom: 36px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 10;
  opacity: 0; animation: fadeUp 1s var(--ease-spring) 1.2s forwards;
}
@media (max-height: 750px) {
  .scroll-cue { display: none; }
}
.scroll-cue span { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.scroll-line {
  width: 1px; height: 48px;
  background: linear-gradient(to bottom, var(--muted), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse { 0%,100% { opacity:0.3; transform:scaleY(1); } 50% { opacity:1; transform:scaleY(1.1); } }

/* ═══════════════════════════════════════════════════════════════════
   ABOUT / EXPERIENCE
═══════════════════════════════════════════════════════════════════ */
.about-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 90px; align-items: start; }

/* Timeline */
.timeline { display: flex; flex-direction: column; }
.tl-item { display: grid; grid-template-columns: 28px 1fr; gap: 20px; }
.tl-marker { display: flex; flex-direction: column; align-items: center; }
.tl-dot {
  width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0;
  background: var(--border); border: 2px solid var(--subtle);
  margin-top: 6px; transition: all 0.4s;
}
.tl-item.current .tl-dot {
  background: var(--accent); border-color: var(--accent);
  box-shadow: 0 0 16px rgba(99,102,241,0.6);
}
.tl-line { width: 1px; flex: 1; background: var(--border); margin-top: 8px; min-height: 36px; }

.tl-body { padding-bottom: 48px; }
.tl-status {
  display: inline-block; font-size: 0.68rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.1em; padding: 3px 10px; border-radius: 100px;
  background: rgba(99,102,241,0.15); color: var(--accent);
  border: 1px solid rgba(99,102,241,0.25); margin-bottom: 8px;
}
.tl-status.past-tag { background: rgba(255,255,255,0.05); color: var(--muted); border-color: var(--border); }
.tl-role { font-size: 1.15rem; font-weight: 700; margin-bottom: 4px; }
.tl-org { font-size: 0.9rem; color: var(--accent); font-weight: 600; display: block; margin-bottom: 10px; }
.tl-desc { color: var(--muted); font-size: 0.92rem; line-height: 1.7; margin-bottom: 10px; }
.tl-link { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-size: 0.88rem; font-weight: 600; transition: gap var(--trans); }
.tl-link:hover { gap: 10px; }

/* Skills Panel */
.skills-panel { display: flex; flex-direction: column; gap: 32px; }
.skill-group { }
.skill-group-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); margin-bottom: 14px;
}
.skill-group-title i { color: var(--accent); }

.pills { display: flex; flex-wrap: wrap; gap: 9px; }
.pill {
  padding: 7px 15px; border-radius: 8px;
  background: var(--bg3); border: 1px solid var(--border);
  font-size: 0.88rem; font-weight: 500; color: var(--text);
  transition: all var(--trans); cursor: default;
}
.pill:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.pill.soft { border-style: dashed; background: transparent; }

/* Building card */
.building-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: relative; overflow: hidden;
}
.building-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--grad);
}
.building-header {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--muted); margin-bottom: 10px;
}
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 6px var(--green); animation: pulse 2s infinite; }
.building-name { font-size: 1.5rem; font-weight: 800; }
.building-desc { color: var(--muted); font-size: 0.88rem; margin-top: 4px; }

/* ═══════════════════════════════════════════════════════════════════
/* ═══════════════════════════════════════════════════════════════════
   SKILLS MARQUEE  —  Two-row bi-directional design
═══════════════════════════════════════════════════════════════════ */
.marquee-section {
  padding: 40px 0;
  overflow: hidden;
  background: var(--bg);
  position: relative;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
/* fade edges */
.marquee-section::before, .marquee-section::after {
  content: '';
  position: absolute; top: 0; bottom: 0; width: 120px; z-index: 2;
  pointer-events: none;
}
.marquee-section::before { left: 0;  background: linear-gradient(to right, var(--bg), transparent); }
.marquee-section::after  { right: 0; background: linear-gradient(to left,  var(--bg), transparent); }

.marquee-row {
  overflow: hidden;
  user-select: none;
}
.mq-track {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
  animation: mq-left 32s linear infinite;
  white-space: nowrap;
}
.mq-track:hover      { animation-play-state: paused; }
.mq-track.mq-reverse { animation: mq-right 38s linear infinite; }
.mq-track.mq-reverse:hover { animation-play-state: paused; }

@keyframes mq-left  { from { transform: translateX(0); }    to { transform: translateX(-50%); } }
@keyframes mq-right { from { transform: translateX(-50%); } to { transform: translateX(0);    } }

.mq-pill {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 10px 20px;
  border-radius: 100px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 600; font-size: 0.9rem;
  white-space: nowrap;
  cursor: default;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: all 0.3s var(--ease);
  flex-shrink: 0;
}
.mq-pill i { font-size: 1rem; flex-shrink: 0; }
.mq-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 20px rgba(99,102,241,0.2);
}
[data-theme="light"] .mq-pill {
  background: rgba(255,255,255,0.85);
  border-color: rgba(0,0,0,0.1);
  box-shadow: 0 2px 10px rgba(0,0,0,0.07);
}
/* dot separator between pill groups */
.mq-sep {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  opacity: 0.5;
}

/* ═══════════════════════════════════════════════════════════════════
   PROJECTS
═══════════════════════════════════════════════════════════════════ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.proj-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  display: flex; flex-direction: column;
  position: relative; overflow: hidden;
  transition: all 0.4s var(--ease-spring);
  cursor: pointer;
  transform-style: preserve-3d;
}
.proj-card::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--grad);
  opacity: 0;
  transition: opacity 0.4s;
}
.proj-card:hover {
  border-color: transparent;
  transform: translateY(-10px) scale(1.02);
  animation: proj-border-glow 2.5s linear infinite;
}
.proj-card:hover::before { opacity: 0.05; }

.proj-card.featured {
  grid-column: span 2;
  background: linear-gradient(135deg, rgba(99,102,241,0.05) 0%, rgba(168,85,247,0.05) 100%);
  border-color: rgba(99,102,241,0.2);
}

.proj-num {
  font-size: 0.7rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--muted); margin-bottom: 20px; display: block;
}

.proj-icon {
  width: 52px; height: 52px;
  background: rgba(99,102,241,0.1); border: 1px solid rgba(99,102,241,0.2);
  border-radius: 14px; font-size: 1.4rem; color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px; transition: all 0.3s;
}
.proj-card:hover .proj-icon { background: var(--accent); color: #fff; border-color: var(--accent); }

.proj-name { font-size: 1.2rem; font-weight: 700; margin-bottom: 10px; }
.proj-desc { color: var(--muted); font-size: 0.9rem; line-height: 1.7; flex: 1; margin-bottom: 24px; }

.proj-footer { display: flex; align-items: center; justify-content: space-between; }
.proj-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.proj-tags span {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted); background: var(--bg2); padding: 4px 10px; border-radius: 6px;
}
.proj-arrow { font-size: 1rem; color: var(--muted); transition: all 0.3s; }
.proj-card:hover .proj-arrow { color: var(--accent); transform: translate(4px, -4px); }

/* Python showcase */
.py-showcase {
  background: var(--bg3); border: 1px dashed var(--border);
  border-radius: var(--radius); padding: 32px;
  display: flex; align-items: center; gap: 40px;
  transition: border-color var(--trans);
}
.py-showcase:hover { border-color: #3776ab; }
.py-left { display: flex; align-items: center; gap: 20px; }
.py-big-icon { font-size: 3rem; color: #3776ab; flex-shrink: 0; }
.py-left h4 { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }
.py-left p { color: var(--muted); font-size: 0.9rem; }
.py-items { display: flex; flex-direction: column; gap: 12px; }
.py-items li {
  display: flex; align-items: center; gap: 10px;
  color: var(--muted); font-size: 0.92rem;
}
.py-items i { color: var(--green); font-size: 0.6rem; }

/* ═══════════════════════════════════════════════════════════════════
   ACHIEVEMENTS
═══════════════════════════════════════════════════════════════════ */
.ach-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: start; }
.col-label {
  font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); margin-bottom: 28px;
}

/* Hackathon cards */
.hack-col { display: flex; flex-direction: column; gap: 0; }
.hack-col > * + * { margin-top: 16px; }
.hack-card {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
  position: relative; overflow: hidden;
  transition: all var(--trans);
}
.hack-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--grad);
}
.hack-card.top::before { background: linear-gradient(90deg, var(--yellow), var(--accent2)); }

.hack-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--border-hover); }

.hack-rank-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em;
  background: var(--grad); color: #fff;
  padding: 5px 14px; border-radius: 100px; margin-bottom: 14px;
}
.hack-rank-badge.muted { background: var(--bg2); color: var(--muted); border: 1px solid var(--border); }
.hack-card h4 { font-size: 1.15rem; font-weight: 700; margin-bottom: 8px; }
.hack-card p { color: var(--muted); font-size: 0.9rem; line-height: 1.65; }

/* Certifications list */
.cert-list { display: flex; flex-direction: column; gap: 8px; }
.cert {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; border-radius: 12px; border: 1px solid transparent;
  font-size: 0.95rem; color: var(--text); background: var(--bg3);
  transition: all var(--trans);
  box-shadow: var(--shadow-sm);
}
.cert i { width: 24px; text-align: center; flex-shrink: 0; font-size: 1.1rem; }
.cert:hover { 
  background: rgba(99,102,241,0.05); 
  border-color: var(--border-hover); 
  transform: translateX(6px);
  box-shadow: var(--shadow-md);
}
.cert.win { font-weight: 700; background: linear-gradient(135deg, rgba(234,179,8,0.1), rgba(234,179,8,0.02)); border-color: rgba(234,179,8,0.3); }
.cert.win:hover { background: linear-gradient(135deg, rgba(234,179,8,0.15), rgba(234,179,8,0.05)); border-color: rgba(234,179,8,0.5); }

/* ═══════════════════════════════════════════════════════════════════
   GALLERY
═══════════════════════════════════════════════════════════════════ */
.gallery-masonry {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  min-height: 200px;
}
.gallery-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all 0.4s var(--ease-spring);
  cursor: pointer;
  background: var(--bg2);  /* visible for letterboxed images */
  height: 280px;           /* consistent card height */
}
.gallery-item:hover {
  transform: scale(1.03) translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}

.gallery-masonry img {
  width: 100%;
  height: 100%;            /* fill the fixed height */
  object-fit: contain;     /* show full image, no cropping */
  display: block;
  padding: 8px;            /* slight breathing room */
  transition: transform 0.4s var(--ease-spring);
}
.gallery-item:hover img { transform: scale(1.05); }

.gallery-caption {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 10px 14px;
  background: linear-gradient(to top, rgba(0,0,0,0.75), transparent);
  color: #fff; font-size: 0.82rem; font-weight: 500;
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  pointer-events: none;
}
.gallery-item:hover .gallery-caption { opacity: 1; transform: translateY(0); }

.gallery-loading {
  grid-column: 1/-1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 16px; padding: 60px; color: var(--muted);
}

/* ═══════════════════════════════════════════════════════════════════
   SPINNER
═══════════════════════════════════════════════════════════════════ */
.spinner {
  width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════════════
   CONTACT
═══════════════════════════════════════════════════════════════════ */
.contact-section { position: relative; overflow: hidden; }
.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 80px; }
.contact-info { }

.socials { display: flex; flex-direction: column; gap: 10px; margin-top: 36px; }
.soc-card {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px; background: var(--bg3);
  border: 1px solid var(--border); border-radius: 14px;
  transition: all var(--trans); color: var(--text);
}
.soc-card:hover {
  border-color: var(--border-hover); background: rgba(99,102,241,0.07);
  transform: translateX(4px);
}
.soc-card > i:first-child { font-size: 1.3rem; color: var(--muted); width: 26px; text-align: center; transition: color var(--trans); }
.soc-card:hover > i:first-child { color: var(--accent); }
.soc-card div { flex: 1; }
.soc-card strong { display: block; font-size: 0.95rem; margin-bottom: 2px; }
.soc-card span { font-size: 0.82rem; color: var(--muted); }
.soc-arrow { font-size: 0.85rem; color: var(--muted); transition: all var(--trans); }
.soc-card:hover .soc-arrow { color: var(--accent); transform: translateX(3px); }

/* Form */
.contact-form-wrap {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 24px; padding: 40px;
  box-shadow: var(--shadow-md);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.fg { margin-bottom: 20px; }
.fg label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.fg input, .fg textarea {
  width: 100%; background: var(--bg2);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 13px 16px; color: var(--text);
  font-family: 'Inter', sans-serif; font-size: 0.95rem;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.fg input:focus,
.fg textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.fg textarea { resize: vertical; }
.form-msg { margin-top: 14px; font-size: 0.9rem; text-align: center; min-height: 20px; }
.msg-ok  { color: var(--green); }
.msg-err { color: var(--red); }

/* ═══════════════════════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════════════════════ */
.site-footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; }
.footer-left { display: flex; flex-direction: column; gap: 6px; }
.footer-left p { font-size: 0.85rem; color: var(--muted); }
.footer-right { display: flex; gap: 4px; }
.foot-icon { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 1.1rem; transition: all var(--trans); }
.foot-icon:hover { color: var(--accent); background: var(--bg3); }

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════════════ */
@media (max-width: 1080px) {
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .proj-card.featured { grid-column: span 2; }
}

@media (max-width: 900px) {
  .section { padding: 100px 0; }
  .hero-grid, .about-grid, .ach-layout, .contact-grid { grid-template-columns: 1fr; gap: 56px; }
  .hero-grid { text-align: center; }
  .hero-tag, .hero-actions, .hero-stats { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .hero-photo-wrap { margin: 0 auto; }
  .badge-1, .badge-2 { display: none; }
  .py-showcase { flex-direction: column; text-align: center; }
  .py-items { align-items: flex-start; width: 100%; }
  .form-row { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .hero-stats { flex-wrap: wrap; justify-content: center; }
  .contact-form-wrap { padding: 28px; }
}

@media (max-width: 600px) {
  .container { padding: 0 20px; }
  .hero-title { font-size: 2.8rem; }
  .projects-grid { grid-template-columns: 1fr; }
  .proj-card.featured { grid-column: span 1; }
  .section { padding: 80px 0; }
}

/* ═══════════════════════════════════════════════════════════════════
   LIGHTBOX
═══════════════════════════════════════════════════════════════════ */
.lightbox {
  position: fixed; inset: 0; z-index: 9998;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s var(--ease);
}
.lightbox.open { opacity: 1; pointer-events: all; }
.lb-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: zoom-out;
}
.lb-inner {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  max-width: 90vw; max-height: 90vh;
}
.lb-img {
  max-width: 90vw; max-height: 80vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.8);
  transform: scale(0.88);
  transition: transform 0.35s var(--ease-spring);
}
.lightbox.open .lb-img { transform: scale(1); }
.lb-caption {
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem; font-weight: 500;
  text-align: center; max-width: 560px;
}
.lb-close {
  position: fixed; top: 24px; right: 28px; z-index: 2;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff; font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.2s;
}
.lb-close:hover { background: rgba(255,255,255,0.22); transform: scale(1.1); }
.gallery-item { cursor: zoom-in; }


/* ═══════════════════════════════════════════════════════════════════
   CUSTOM CURSOR
═══════════════════════════════════════════════════════════════════ */
#cursor-dot {
  position: fixed;
  top: 0; left: 0;
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  will-change: transform;
  box-shadow: 0 0 12px var(--accent), 0 0 24px rgba(99,102,241,0.5);
  transition: width 0.2s var(--ease), height 0.2s var(--ease), opacity 0.3s;
}
#cursor-ring {
  position: fixed;
  top: 0; left: 0;
  width: 36px; height: 36px;
  border: 2px solid rgba(99,102,241,0.65);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99998;
  will-change: transform;
  transition: width 0.35s var(--ease-spring), height 0.35s var(--ease-spring),
              border-color 0.25s, background 0.25s, opacity 0.3s;
}
#cursor-ring.hovered {
  width: 58px; height: 58px;
  border-color: rgba(168,85,247,0.8);
  background: rgba(99,102,241,0.05);
}
@media (pointer: coarse) {
  #cursor-dot, #cursor-ring { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════
   PARTICLE CANVAS
═══════════════════════════════════════════════════════════════════ */
#particle-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
  opacity: 0.75;
}

/* ═══════════════════════════════════════════════════════════════════
   ENHANCED HERO TAG — NEON HALO BADGE
═══════════════════════════════════════════════════════════════════ */
.hero-tag { position: relative; }
.pulse-ring {
  position: absolute;
  left: 22px; top: 50%;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--green);
  transform: translate(-50%, -50%);
  animation: halo-expand 2s ease-out infinite;
  pointer-events: none;
}
@keyframes halo-expand {
  0%   { transform: translate(-50%,-50%) scale(1); opacity: 0.85; }
  100% { transform: translate(-50%,-50%) scale(3.2); opacity: 0; }
}

/* ═══════════════════════════════════════════════════════════════════
   GLASSMORPHISM CARD UPGRADES
═══════════════════════════════════════════════════════════════════ */
/* Project cards */
.proj-card {
  background: rgba(18,20,34,0.7) !important;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.07) !important;
}
[data-theme="light"] .proj-card {
  background: rgba(255,255,255,0.58) !important;
  border: 1px solid rgba(0,0,0,0.07) !important;
}
.proj-card.featured {
  background: rgba(99,102,241,0.07) !important;
  border: 1px solid rgba(99,102,241,0.2) !important;
}
[data-theme="light"] .proj-card.featured {
  background: rgba(99,102,241,0.05) !important;
}
/* Hackathon cards */
.hack-card {
  background: rgba(18,20,34,0.65) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
[data-theme="light"] .hack-card {
  background: rgba(255,255,255,0.55) !important;
}
/* Building card */
.building-card {
  background: rgba(18,20,34,0.62) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
[data-theme="light"] .building-card {
  background: rgba(255,255,255,0.55) !important;
}
/* Contact form */
.contact-form-wrap {
  background: rgba(18,20,34,0.62) !important;
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}
[data-theme="light"] .contact-form-wrap {
  background: rgba(255,255,255,0.65) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   ANIMATED CYCLING GLOW BORDER — PROJECT CARD HOVER
═══════════════════════════════════════════════════════════════════ */
@keyframes proj-border-glow {
  0%, 100% {
    box-shadow:
      0 20px 48px rgba(0,0,0,0.45),
      0 0 0 1.5px #6366f1,
      0 0 28px rgba(99,102,241,0.4),
      inset 0 0 28px rgba(99,102,241,0.04);
  }
  33% {
    box-shadow:
      0 20px 48px rgba(0,0,0,0.45),
      0 0 0 1.5px #a855f7,
      0 0 28px rgba(168,85,247,0.4),
      inset 0 0 28px rgba(168,85,247,0.04);
  }
  66% {
    box-shadow:
      0 20px 48px rgba(0,0,0,0.45),
      0 0 0 1.5px #38bdf8,
      0 0 28px rgba(56,189,248,0.4),
      inset 0 0 28px rgba(56,189,248,0.04);
  }
}

/* ═══════════════════════════════════════════════════════════════════
   SKILL PROFICIENCY RINGS
═══════════════════════════════════════════════════════════════════ */
.skill-rings-wrap { margin-top: 4px; }
.skill-rings {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-top: 14px;
}
.ring-item {
  display: flex; flex-direction: column;
  align-items: center; gap: 7px;
}
.ring-item-inner {
  position: relative;
  width: 70px; height: 70px;
}
.ring-svg {
  width: 70px; height: 70px;
  transform: rotate(-90deg);
  display: block;
}
.ring-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 7;
}
.ring-fill {
  fill: none;
  stroke-width: 7;
  stroke-linecap: round;
  stroke: url(#ringGrad);
  stroke-dasharray: 201.1;
  stroke-dashoffset: 201.1;
  transition: stroke-dashoffset 1.4s var(--ease-spring);
  filter: drop-shadow(0 0 4px rgba(99,102,241,0.55));
}
.ring-pct-label {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.72rem; font-weight: 800;
  color: var(--text); pointer-events: none;
  white-space: nowrap;
}
.ring-label {
  font-size: 0.68rem; font-weight: 700;
  color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ═══════════════════════════════════════════════════════════════════
   BACK TO TOP BUTTON
═══════════════════════════════════════════════════════════════════ */
#back-to-top {
  position: fixed;
  bottom: 36px; right: 36px;
  z-index: 800;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--grad);
  border: none;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 22px rgba(99,102,241,0.5), 0 0 50px rgba(99,102,241,0.15);
  opacity: 0;
  transform: translateY(24px) scale(0.85);
  pointer-events: none;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease-spring), box-shadow 0.25s;
}
#back-to-top.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}
#back-to-top:hover {
  box-shadow: 0 8px 32px rgba(99,102,241,0.65), 0 0 80px rgba(99,102,241,0.25);
  transform: translateY(-5px) scale(1.08);
}
#back-to-top i { transition: transform 0.2s; }
#back-to-top:hover i { transform: translateY(-2px); }

/* ═══════════════════════════════════════════════════════════════════
   SOCIAL BRAND COLOURS ON HOVER
═══════════════════════════════════════════════════════════════════ */
/* Contact social cards */
.soc-card[data-brand="email"]:hover    > i:first-child { color: #ea4335; }
.soc-card[data-brand="linkedin"]:hover > i:first-child { color: #0a66c2; }
.soc-card[data-brand="github"]:hover   > i:first-child { color: #e6edf3; }
.soc-card[data-brand="instagram"]:hover > i:first-child { color: #e1306c; }
.soc-card[data-brand="youtube"]:hover  > i:first-child { color: #ff0000; }
.soc-card[data-brand="hackerrank"]:hover > i:first-child { color: #39c06e; }
/* Footer icons */
.foot-icon[data-brand="github"]:hover   { color: #e6edf3 !important; }
.foot-icon[data-brand="linkedin"]:hover { color: #0a66c2 !important; }
.foot-icon[data-brand="email"]:hover    { color: #ea4335 !important; }
