/* Fonts loaded via <link> in HTML head — no duplicate @import needed */

/* ===== CSS VARIABLES ===== */
:root {
  --primary: #8a2be2; /* Blue Violet for a vibrant premium look */
  --primary-light: #a855f7;
  --primary-dark: #6b21a8;
  --secondary: #00d2ff; /* Vibrant Cyan */
  --secondary-light: #67e8f9;
  --tertiary: #f43f5e; /* Rose */
  --tertiary-light: #fb7185;
  --surface: #0a0a0f; /* Deep dark background */
  --surface-dim: #12121a;
  --surface-card: #181824; /* Elevated cards */
  --surface-high: #242436;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --outline: #334155;
  --glow-primary: rgba(138, 43, 226, 0.3);
  --glow-sec: rgba(0, 210, 255, 0.3);
  --glow-tertiary: rgba(244, 63, 94, 0.3);
  --glass-bg: rgba(10, 10, 15, 0.65);
  --glass-border: rgba(255, 255, 255, 0.05);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: 'Manrope', sans-serif;
  background: var(--surface);
  color: var(--text-primary);
  overflow-x: hidden;
  max-width: 100vw;
  cursor: default;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* GPU optimization hints */
.exp-card, .skill-card, .bento-card, .polaroid, .contact-card, .bio-card,
.nav-link, .btn-primary, .fab, .blob, .sidebar-avatar-ring {
  will-change: transform;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}



/* ===== LOADING SCREEN ===== */
.loader {
  position: fixed; inset: 0;
  background: var(--surface);
  z-index: 100000;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  transition: opacity 0.8s ease, visibility 0.8s;
}
.loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-text {
  font-family: 'Epilogue', sans-serif;
  font-size: 3rem; font-weight: 900;
  background: linear-gradient(90deg, var(--primary-light), var(--secondary), var(--tertiary), var(--primary-light));
  background-size: 300% 100%;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 2s linear infinite;
}
.loader-bar {
  width: 200px; height: 3px;
  background: rgba(255,255,255,0.1);
  border-radius: 99px; margin-top: 24px; overflow: hidden;
}
.loader-bar-inner {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--secondary), var(--primary));
  border-radius: 99px;
  animation: loadBar 2s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
@keyframes loadBar {
  0% { width: 0; }
  100% { width: 100%; }
}

/* ===== STARFIELD CANVAS ===== */
#particles-canvas {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 1; pointer-events: none;
}

/* ===== GRAPH PAPER BG ===== */
.graph-paper {
  background-image:
    radial-gradient(circle, var(--surface-dim) 1px, transparent 1px),
    linear-gradient(to right, var(--surface-high) 1px, transparent 1px),
    linear-gradient(to bottom, var(--surface-high) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* ===== GLASSMORPHISM NAV ===== */
.glass-nav {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 4px 30px rgba(0,0,0,0.05);
}

/* ===== SIDEBAR ===== */
.sidebar {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(14,14,22,0.92) 0%, rgba(10,10,15,0.97) 100%);
  backdrop-filter: blur(32px) saturate(150%);
  -webkit-backdrop-filter: blur(32px) saturate(150%);
  border-right: 1px solid rgba(255,255,255,0.04);
  box-shadow: 4px 0 48px rgba(0,0,0,0.5);
}

/* Sidebar profile ring animation */
.sidebar-avatar-ring {
  width: 88px; height: 88px;
  border-radius: 50%;
  padding: 3px;
  background: conic-gradient(from var(--ring-angle, 0deg), var(--primary), var(--secondary), var(--tertiary), var(--primary));
  box-shadow: 0 0 24px var(--glow-primary), 0 0 48px rgba(138,43,226,0.12);
  margin-bottom: 18px;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s;
}
.sidebar-avatar-ring:hover {
  transform: scale(1.08);
  box-shadow: 0 0 32px var(--glow-primary), 0 0 64px rgba(0,210,255,0.15);
}
.sidebar-avatar-ring img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--surface);
  display: block;
}
@keyframes ringRotate {
  to { transform: rotate(360deg); }
}

/* Contact section avatar ring */
.contact-avatar-ring {
  width: 120px; height: 120px;
  border-radius: 50%;
  padding: 3px;
  background: conic-gradient(from 0deg, var(--primary), var(--secondary), var(--tertiary), var(--primary));
  box-shadow: 0 0 20px var(--glow-primary), 0 8px 24px rgba(0,0,0,0.5);
  flex-shrink: 0;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.contact-avatar-ring:hover {
  transform: scale(1.08);
}
.contact-avatar-ring img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--surface);
  display: block;
}

/* Sidebar profile info */
.sidebar-name {
  font-family: 'Epilogue', sans-serif;
  font-size: 1.25rem; font-weight: 900;
  background: linear-gradient(135deg, var(--primary-light), var(--secondary-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}
.sidebar-role {
  font-size: 0.68rem;
  color: var(--text-secondary);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 6px;
  font-weight: 600;
  opacity: 0.7;
}

/* Sidebar separator */
.sidebar-sep {
  width: 40px; height: 2px;
  background: linear-gradient(90deg, var(--primary), transparent);
  border-radius: 2px;
  margin: 8px auto 4px;
  opacity: 0.5;
}

/* Nav links */
.nav-link {
  display: flex; align-items: center; gap: 14px;
  padding: 11px 18px; border-radius: 12px;
  font-weight: 500; font-size: 0.9rem;
  color: var(--text-secondary);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  margin: 1px 0;
}
.nav-link .material-symbols-outlined {
  font-size: 1.25rem;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Active / Hover side indicator */
.nav-link::before {
  content: '';
  position: absolute; left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 0;
  background: linear-gradient(180deg, var(--primary-light), var(--secondary));
  border-radius: 0 3px 3px 0;
  transition: height 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 8px var(--glow-primary);
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  background: rgba(138,43,226,0.08);
}
.nav-link:hover::before, .nav-link.active::before {
  height: 55%;
}
.nav-link:hover .material-symbols-outlined {
  color: var(--primary-light);
  transform: scale(1.12);
}
.nav-link.active {
  font-weight: 700;
  color: #fff;
  background: linear-gradient(90deg, rgba(138,43,226,0.14) 0%, transparent 100%);
}
.nav-link.active .material-symbols-outlined {
  color: var(--primary-light);
  font-variation-settings: 'FILL' 1;
}

/* Sidebar CTA button */
.sidebar-cta {
  padding: 16px 20px;
  margin-top: auto;
}
.sidebar-cta .btn-primary {
  width: 100%;
  justify-content: center;
  font-size: 0.85rem;
  padding: 13px 0;
  border-radius: 14px;
  letter-spacing: 0.02em;
}

/* ===== SCROLL REVEAL ===== */
.reveal {
  opacity: 0; transform: translateY(40px);
  transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.active { opacity: 1; transform: translateY(0); }
.reveal-left {
  opacity: 0; transform: translateX(-40px);
  transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-left.active { opacity: 1; transform: translateX(0); }
.reveal-right {
  opacity: 0; transform: translateX(40px);
  transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-right.active { opacity: 1; transform: translateX(0); }
.reveal-scale {
  opacity: 0; transform: scale(0.95);
  transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-scale.active { opacity: 1; transform: scale(1); }

/* ===== HERO ===== */
.hero-title {
  font-family: 'Epilogue', sans-serif;
  font-size: clamp(2.8rem, 6vw, 5rem);
  font-weight: 900;
  line-height: 1.1;
  color: var(--primary);
}
.hero-title .accent { color: var(--tertiary); }
.hero-title .highlight {
  position: relative; display: inline-block;
}
.hero-title .highlight::after {
  content: '';
  position: absolute; bottom: 4px; left: -4px;
  width: 0; height: 14px;
  background: var(--secondary-light);
  opacity: 0.3; z-index: -1;
  border-radius: 2px;
  transform: rotate(-1deg);
  animation: highlightGrow 1s 2.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes highlightGrow {
  to { width: calc(100% + 8px); }
}

/* Hero badge bounce in */
.hero-badge {
  animation: badgeBounce 0.8s 2.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes badgeBounce {
  from { opacity: 0; transform: rotate(-1deg) scale(0.5) translateY(-20px); }
  to { opacity: 1; transform: rotate(-1deg) scale(1) translateY(0); }
}

/* Hero text lines stagger in */
.hero-stagger > * {
  opacity: 0;
  transform: translateY(30px);
  animation: staggerUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.hero-stagger > *:nth-child(1) { animation-delay: 2.3s; }
.hero-stagger > *:nth-child(2) { animation-delay: 2.5s; }
.hero-stagger > *:nth-child(3) { animation-delay: 2.7s; }
.hero-stagger > *:nth-child(4) { animation-delay: 2.9s; }
@keyframes staggerUp {
  to { opacity: 1; transform: translateY(0); }
}

.typing-cursor {
  display: inline-block; width: 3px; height: 1em;
  background: var(--tertiary);
  margin-left: 4px;
  animation: blink 0.8s infinite;
  vertical-align: text-bottom;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* ===== POLAROID PHOTO ===== */
.polaroid {
  background: var(--surface-card);
  padding: 12px 12px 48px 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 4px 12px rgba(0,0,0,0.3);
  transform: rotate(-3deg);
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  border: 1px solid var(--glass-border);
  z-index: 5;
}
.polaroid:hover {
  transform: rotate(2deg) translateY(-12px) scale(1.03);
  box-shadow: 0 30px 80px var(--glow-primary);
}
.polaroid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; }
.polaroid-label {
  position: absolute; bottom: 12px; left: 0; right: 0;
  text-align: center;
  font-family: 'Epilogue', sans-serif;
  font-size: 1.3rem; color: var(--text-primary); opacity: 0.9;
}
/* Tape effect */
.tape {
  position: absolute; top: -14px; left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 80px; height: 28px;
  background: rgba(255, 217, 125, 0.25);
  backdrop-filter: blur(2px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  z-index: 2;
}

/* ===== FLOATING DECORATIONS ===== */
.float { animation: floatY 4s ease-in-out infinite; }
.float-delay { animation: floatY 4s ease-in-out infinite 2s; }
@keyframes floatY {
  0%, 100% { transform: translateY(0) rotate(var(--rot, 12deg)); }
  50% { transform: translateY(-16px) rotate(calc(var(--rot, 12deg) + 5deg)); }
}

.blob {
  position: absolute; border-radius: 50%;
  filter: blur(60px); opacity: 0.15;
  animation: blobMove 8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes blobMove {
  0% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -40px) scale(1.1); }
  66% { transform: translate(-20px, 20px) scale(0.9); }
  100% { transform: translate(0, 0) scale(1); }
}

/* ===== SECTION TITLES ===== */
.section-title {
  font-family: 'Epilogue', sans-serif;
  font-size: 2.5rem; font-weight: 900;
  color: var(--primary-light);
  position: relative; display: inline-block;
}
.section-title::before {
  content: ''; position: absolute;
  bottom: -6px; left: 0; width: 0; height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 2px;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.section-title.active::before, .section-title:hover::before { width: 100%; }

/* ===== BIO CARD ===== */
.bio-card {
  background: var(--surface-card);
  padding: 48px; border-radius: 24px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.05);
  position: relative; overflow: hidden;
}
.bio-card .quote-icon {
  position: absolute; top: 16px; right: 24px;
  font-size: 6rem; opacity: 0.06;
  transform: rotate(-12deg);
  font-family: 'Epilogue', sans-serif;
}

.info-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  background: var(--surface-high);
  border-radius: 12px;
  border: 2px dashed rgba(255,255,255,0.06);
  transition: all 0.3s;
  cursor: default;
}
.info-chip:hover {
  transform: scale(1.05) rotate(-1deg);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

/* ===== EXPERIENCE GRID ===== */
.exp-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

/* ===== EXPERIENCE CARDS ===== */
.exp-card {
  background: var(--surface-card);
  padding: 32px 32px 32px 38px;
  position: relative;
  box-shadow: 0 6px 24px rgba(0,0,0,0.2);
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.04);
  overflow: hidden;
}
/* Left accent gradient bar */
.exp-card-accent {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--primary), var(--secondary));
  border-radius: 4px 0 0 4px;
  transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.exp-card:hover .exp-card-accent { width: 6px; }

/* Nth-child accent colors */
.exp-card:nth-child(2) .exp-card-accent { background: linear-gradient(180deg, var(--tertiary), var(--primary)); }
.exp-card:nth-child(3) .exp-card-accent { background: linear-gradient(180deg, var(--secondary), var(--tertiary)); }
.exp-card:nth-child(4) .exp-card-accent { background: linear-gradient(180deg, var(--secondary-light), var(--primary)); }

.exp-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
  border-color: rgba(255,255,255,0.08);
}
.exp-card .pin {
  position: absolute; top: 12px; right: 16px;
  color: var(--outline); opacity: 0.3;
  font-size: 1.2rem;
  transition: all 0.3s;
}
.exp-card:hover .pin {
  color: var(--primary-light); opacity: 0.8;
  transform: rotate(-15deg) scale(1.1);
}

.exp-date {
  font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--primary-light);
}
.exp-card:nth-child(2) .exp-date { color: var(--tertiary-light); }
.exp-card:nth-child(3) .exp-date { color: var(--secondary); }
.exp-card:nth-child(4) .exp-date { color: var(--secondary-light); }

.tag {
  background: rgba(255,255,255,0.08);
  padding: 5px 12px; border-radius: 99px;
  font-size: 0.7rem; font-weight: 700;
  color: #cbd5e1; /* improved contrast */
  border: 1px solid rgba(255,255,255,0.08);
  transition: all 0.3s;
  letter-spacing: 0.02em;
}
.tag:hover {
  background: rgba(138,43,226,0.15);
  border-color: var(--primary);
  color: var(--primary-light);
  transform: translateY(-1px);
}

/* ===== SKILLS ===== */
.skill-card {
  background: var(--surface-card);
  padding: 24px; border-radius: 16px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.05);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}
.skill-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px var(--glow-primary);
  border-color: rgba(255,255,255,0.1);
}
.skill-icon {
  width: 50px; height: 50px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s;
  color: white; font-size: 1.5rem;
}
.skill-card:hover .skill-icon {
  transform: scale(1.15) rotate(8deg);
}

.progress-bar {
  background: rgba(0, 0, 0, 0.6);
  height: 14px;
  border-radius: 99px;
  box-shadow: inset 0 3px 8px rgba(0,0,0,0.8), 0 1px 1px rgba(255,255,255,0.06);
  position: relative;
  overflow: visible;
  margin-top: 12px;
}
.progress-fill {
  height: 100%; border-radius: 99px;
  width: 0;
  transition: width 1.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  box-shadow: none;
}
.progress-fill.animated {
  width: var(--target-width);
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.4), 0 0 16px var(--skill-c);
}
.progress-fill::after {
  content: '';
  position: absolute; right: -8px; top: 50%;
  transform: translateY(-50%);
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 5px solid var(--skill-c);
  box-shadow: 0 0 12px var(--skill-c), 0 0 8px rgba(255,255,255,0.8);
  opacity: 0;
  transition: opacity 0.3s 1.2s;
}
.progress-fill.animated::after {
  opacity: 1;
  animation: pulseKnob 2s infinite ease-in-out;
}
@keyframes pulseKnob {
  0%, 100% { transform: translateY(-50%) scale(1); }
  50% { transform: translateY(-50%) scale(1.15); box-shadow: 0 0 24px var(--skill-c), 0 0 12px rgba(255,255,255,1); }
}

.soft-skill-label {
  font-family: 'Epilogue', sans-serif;
  font-weight: 800; font-size: 0.95rem;
  letter-spacing: 0.05em; text-transform: uppercase;
}
.soft-skill-pct {
  font-family: 'Epilogue', sans-serif;
  font-weight: 900; font-size: 1.1rem;
  text-shadow: 0 2px 12px var(--skill-c);
}

/* ===== EDUCATION BENTO ===== */
.bento-card {
  background: var(--surface-card);
  padding: 32px; border-radius: 24px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.03);
  transition: all 0.4s;
  cursor: pointer; overflow: hidden; position: relative;
}
.bento-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px var(--glow-sec);
  border-color: rgba(255,255,255,0.1);
}
.bento-card .bg-icon {
  position: absolute; right: -20px; bottom: -20px;
  font-size: 10rem; opacity: 0.04;
  transition: all 0.7s;
  pointer-events: none;
}
.bento-card:hover .bg-icon {
  transform: scale(1.4);
  opacity: 0.08;
}

/* ===== CONTACT CARD ===== */
.contact-card {
  background: var(--surface-card);
  padding: 48px; border-radius: 32px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.05);
  transition: all 0.5s;
  position: relative;
}
.contact-card:hover {
  box-shadow: 0 30px 100px var(--glow-primary);
}
.contact-glow {
  position: absolute; inset: 0;
  background: radial-gradient(circle at center, var(--glow-primary), transparent 70%);
  border-radius: 50%; filter: blur(60px);
  opacity: 0.3; transform: scale(0.7);
  transition: all 0.7s;
  pointer-events: none; z-index: 0;
}
.contact-card:hover .contact-glow { transform: scale(1.2); opacity: 0.5; }

.contact-link {
  display: flex; align-items: center; gap: 12px;
  font-weight: 600;
  transition: all 0.3s;
}
.contact-link:hover { color: var(--primary); transform: translateX(4px); }
.contact-link .icon {
  font-size: 1.4rem;
  transition: transform 0.3s;
}
.contact-link:hover .icon { transform: scale(1.2); }

/* ===== BUTTONS ===== */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white; padding: 14px 32px;
  border-radius: 9999px; border: none;
  font-weight: 700; font-size: 1rem;
  font-family: 'Manrope', sans-serif;
  cursor: pointer;
  box-shadow: 0 8px 24px var(--glow-primary);
  transition: all 0.3s;
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none;
  position: relative; overflow: hidden;
}
.btn-primary::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255,255,255,0.2));
  opacity: 0; transition: opacity 0.3s;
}
.btn-primary:hover::before { opacity: 1; }
.btn-primary:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 16px 40px var(--glow-primary);
}
.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
  background: transparent;
  color: var(--secondary); padding: 12px 28px;
  border-radius: 9999px; border: 2px solid var(--secondary);
  font-weight: 700; font-size: 1rem;
  font-family: 'Manrope', sans-serif;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 210, 255, 0.1);
  transition: all 0.3s;
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none;
  position: relative; overflow: hidden;
  z-index: 1;
}
.btn-secondary::before {
  content: ''; position: absolute; inset: 0;
  background: var(--secondary);
  opacity: 0; z-index: -1;
  transition: opacity 0.3s;
}
.btn-secondary:hover::before { opacity: 1; }
.btn-secondary:hover {
  color: var(--surface);
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 16px 40px var(--glow-sec);
}
.btn-secondary:active { transform: scale(0.97); }
/* ===== FAB ===== */
.fab {
  position: fixed; bottom: 100px; right: 24px;
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white; border: 2px solid rgba(255,255,255,0.1);
  border-radius: 50%; cursor: pointer;
  box-shadow: 0 10px 30px var(--glow-primary);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s; z-index: 50;
  font-size: 1.5rem;
  animation: fabPulse 3s ease-in-out infinite;
}
.fab:hover { transform: scale(1.15); animation: none; }
@media (min-width: 1024px) { .fab { bottom: 32px; right: 32px; width: 64px; height: 64px; } }
@keyframes fabPulse {
  0%, 100% { box-shadow: 0 10px 30px var(--glow-primary); }
  50% { box-shadow: 0 10px 50px var(--glow-primary), 0 0 20px var(--glow-primary); }
}

/* ===== MOBILE TOP HEADER ===== */
.mobile-header {
  display: none; /* hidden on desktop */
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 70;
  padding: 12px 16px;
  background: rgba(10, 10, 15, 0.75);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  align-items: center;
  justify-content: space-between;
}

/* ===== MOBILE BOTTOM NAV ===== */
.mobile-nav {
  display: none; /* hidden on desktop */
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-top: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.3);
  z-index: 70;
  /* Mobile scroll stability and safe area */
  padding: 8px 0 calc(10px + env(safe-area-inset-bottom, 0px));
}
.mobile-nav-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; color: var(--outline);
  text-decoration: none; font-size: 0.65rem; font-weight: 700;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  padding: 6px 12px;
}
.mobile-nav-item .material-symbols-outlined {
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.mobile-nav-item.active {
  color: var(--primary);
  transform: scale(1.1);
}
.mobile-nav-item.active .material-symbols-outlined {
  font-variation-settings: 'FILL' 1;
}
.mobile-nav-item::after {
  content: '';
  position: absolute; bottom: 0; left: 50%;
  transform: translateX(-50%) scale(0);
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--primary);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.mobile-nav-item.active::after {
  transform: translateX(-50%) scale(1);
}

/* Disable sticky hover effects on touch devices */
@media (hover: hover) {
  .mobile-nav-item:hover { color: var(--primary-light); }
  .mobile-nav-item:hover:not(.active) { transform: translateY(-3px); }
}

/* ===== FOOTER ===== */
footer {
  position: relative;
}
footer::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 200px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), var(--secondary), var(--tertiary), transparent);
  border-radius: 2px;
  opacity: 0.6;
}
footer a {
  color: var(--text-secondary);
  text-decoration: none; font-size: 0.85rem;
  transition: all 0.3s;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
}
footer a:hover {
  color: var(--primary-light);
  background: rgba(138,43,226,0.08);
  border-color: rgba(138,43,226,0.15);
  transform: translateY(-2px);
}
.footer-heart {
  display: inline-block;
  animation: heartbeat 1.5s ease-in-out infinite;
  color: var(--tertiary);
}
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* ===== MAGNETIC EFFECT ===== */
.magnetic { transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* ===== STAGGER CHILDREN ===== */
.stagger > * { transition-delay: calc(var(--i, 0) * 100ms); }

/* ===== SMOOTH SCROLL INDICATOR ===== */
.scroll-indicator {
  position: fixed; top: 0; left: 0; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--tertiary));
  width: 100%;
  transform: scaleX(0);
  transform-origin: left;
  z-index: 100;
}

/* ===== TEXT GRADIENT ===== */
.text-gradient {
  background: linear-gradient(135deg, var(--primary), var(--tertiary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== RESPONSIVE ===== */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* -- Bio card inner grid -- */
.bio-grid {
  display: grid; grid-template-columns: 2fr 1fr; gap: 48px;
}
/* -- Hero flex wrapper -- */
.hero-flex {
  display: flex; flex-wrap: wrap; align-items: center; gap: 48px; position: relative;
}
/* -- Skills flex wrapper -- */
.skills-flex {
  display: flex; flex-wrap: wrap; gap: 48px;
}
.skills-flex > div { flex: 1; min-width: 280px; }
/* -- Contact inner flex -- */
.contact-inner {
  display: flex; flex-wrap: wrap; gap: 32px; align-items: center;
}

@media (min-width: 1024px) {
  .sidebar-layout { margin-left: 260px; }
  .mobile-nav { display: none; }
}
@media (max-width: 1023px) {
  .sidebar { display: none !important; }
  .sidebar-layout { margin-left: 0; padding-top: 70px !important; }
  .mobile-header, .mobile-nav { display: flex; }
}

/* === TABLET & BELOW === */
@media (max-width: 768px) {
  .container { padding: 0 16px; }

  /* Loader */
  .loader-text { font-size: 1.8rem; }
  .loader-bar { width: 150px; }

  /* Hero */
  .hero-flex { flex-direction: column; gap: 32px; padding: 32px 0 48px; }
  .hero-flex > div:first-child { max-width: 260px; margin: 0 auto; min-width: unset; }
  .hero-flex > div:last-child { min-width: unset; text-align: center; }
  .hero-flex > div:last-child > div:last-child { justify-content: center; }
  .hero-flex > div:last-child p { font-size: 1rem; margin-left: auto; margin-right: auto; }
  .hero-title { font-size: 2.2rem; }
  .hero-title br { display: none; }
  .polaroid { padding: 8px 8px 36px 8px; }
  .polaroid-label { font-size: 1rem; bottom: 8px; }

  /* Floating decorations — keep inside on mobile */
  .float, .float-delay { font-size: 2rem !important; }

  /* Section titles */
  .section-title { font-size: 1.6rem; }
  .section-title::before { bottom: -4px; height: 3px; }

  /* Section spacing */
  section { padding: 40px 0 !important; }

  /* Bio / About */
  .bio-card { padding: 24px; border-radius: 20px; }
  .bio-grid { grid-template-columns: 1fr; gap: 24px; }
  .bio-grid > div:last-child { transform: none !important; }
  .bio-card .quote-icon { font-size: 4rem; top: 8px; right: 12px; }
  .bio-card p { font-size: 0.95rem !important; }

  /* Experience */
  .exp-grid { grid-template-columns: 1fr; gap: 16px; }
  .exp-card { padding: 24px 24px 24px 28px; }
  .exp-card ul { font-size: 0.82rem !important; line-height: 1.8 !important; }
  .exp-card h3 { font-size: 1.05rem !important; }

  /* Skills */
  .skills-flex { flex-direction: column; gap: 28px; }
  .skills-flex > div { min-width: unset; width: 100%; }
  .grid-2 { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .skill-card {
    padding: 20px 14px;
    gap: 12px;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .skill-card > div:last-child p:first-child { font-size: 0.9rem; font-weight: 800; }
  .skill-card > div:last-child p:last-child { font-size: 0.7rem; }
  .skill-icon { width: 48px; height: 48px; border-radius: 14px; }
  .skill-icon .material-symbols-outlined { font-size: 1.3rem; }
  .progress-fill::after { width: 12px; height: 12px; }
  /* Soft skills panel responsive */
  .skills-flex > div:last-child { padding: 24px !important; border-radius: 20px !important; }

  /* Education bento */
  .grid-bento { grid-template-columns: 1fr; gap: 16px; }
  .grid-bento > * { grid-column: span 1 !important; }
  .bento-card { padding: 24px; border-radius: 20px; }
  .bento-card h3 { font-size: 1.5rem !important; }
  .bento-card .bg-icon { font-size: 6rem; }

  /* Contact */
  .contact-card { padding: 24px; border-radius: 24px; }
  .contact-inner { flex-direction: column; gap: 24px; text-align: center; }
  .contact-avatar-ring { width: 100px; height: 100px; margin: 0 auto; }
  .contact-inner > div:last-child { min-width: unset; width: 100%; }
  .contact-inner > div:last-child > div { align-items: center; }
  .contact-inner h2 { font-size: 1.6rem !important; }
  .contact-link { justify-content: center; font-size: 0.85rem; word-break: break-all; overflow-wrap: break-word; }

  /* Footer */
  footer { padding: 40px 0 0 !important; }
  footer > div:first-child { flex-wrap: wrap; gap: 16px; }

  /* FAB position above mobile nav */
  .fab { bottom: 80px; right: 16px; width: 50px; height: 50px; }

  /* Blobs smaller on mobile */
  .blob { opacity: 0.08; }

  /* Bottom safe area for mobile nav */
  .sidebar-layout { padding-bottom: 80px !important; }

  /* Reveal — reduce distance on mobile */
  .reveal { transform: translateY(30px); }
  .reveal-left { transform: translateX(-40px); }
  .reveal-right { transform: translateX(40px); }
}

/* === VERY SMALL PHONES === */
@media (max-width: 380px) {
  .hero-title { font-size: 1.8rem; }
  .section-title { font-size: 1.4rem; }
  .bio-card { padding: 18px; }
  .contact-card { padding: 18px; }
  .btn-primary, .btn-secondary { padding: 12px 24px; font-size: 0.9rem; }
  .exp-card { padding: 18px; }
  .loader-text { font-size: 1.4rem; }
}

/* ===== UTILITY ===== */
@media (min-width: 769px) {
  .grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 28px; }
  .grid-bento { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
}
/* Base styles for the grids that should apply everywhere */
.grid-2, .grid-3, .grid-bento { display: grid; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-sm { gap: 8px; } .gap-md { gap: 16px; } .gap-lg { gap: 32px; }
a { text-decoration: none; color: inherit; }

/* ===== MATERIAL SYMBOLS ===== */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
}

/* ===== BUTTON SHINE EFFECT ===== */
.btn-primary::after {
  content: '';
  position: absolute; top: -50%; left: -60%;
  width: 40%; height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transform: skewX(-20deg);
  animation: btnShine 4s ease-in-out infinite;
}
@keyframes btnShine {
  0%, 100% { left: -60%; }
  50% { left: 120%; }
}

/* ===== CARD GLOW HOVER EFFECT ===== */
.exp-card::after, .bento-card::after {
  content: '';
  position: absolute; inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--glow-primary), transparent 40%, transparent 60%, var(--glow-sec));
  opacity: 0;
  z-index: -1;
  transition: opacity 0.5s;
}
.exp-card:hover::after, .bento-card:hover::after { opacity: 1; }

/* ===== ACCESSIBILITY: REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal, .reveal-left, .reveal-right, .reveal-scale {
    opacity: 1 !important;
    transform: none !important;
  }
  .hero-stagger > * { opacity: 1 !important; transform: none !important; }
  .hero-badge { opacity: 1 !important; }
  #cursorGlow { display: none; }
}

/* ===== SKILLS PANEL (GLASSMORPHISM) ===== */
.skills-panel {
  background: rgba(255, 255, 255, 0.02);
  padding: 36px;
  border-radius: 24px;
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
  transition: all 0.4s ease;
}

.skills-panel:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 2px 20px rgba(0,0,0,0.3), 0 0 40px rgba(138,43,226,0.05);
}

/* Subtle background glow for panels */
.skills-panel::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -20%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, var(--glow-primary), transparent 70%);
  opacity: 0.1;
  pointer-events: none;
  z-index: 0;
  filter: blur(40px);
}

.skills-panel.reveal-right::before {
  left: -20%;
  right: auto;
  background: radial-gradient(circle, var(--glow-tertiary), transparent 70%);
}

.skills-panel > * {
  position: relative;
  z-index: 1;
}

/* Enhance title glow within skills panels */
.skills-panel .section-title {
  text-shadow: 0 0 15px rgba(138, 43, 226, 0.4);
}

.skills-panel.reveal-right .section-title {
  text-shadow: 0 0 15px rgba(244, 63, 94, 0.4);
}
