/* =============================================
   CORE VARIABLES
   ============================================= */
:root {
  --bg-body:        #FFF0F5;
  --text-main:      #130C1C;
  --accent:         #FFA6C9;
  --accent2:        #CDB4DB;
  --accent3:        #BDE0FE;
  --card-bg:        rgba(255,255,255,0.55);
  --card-border:    rgba(255,255,255,0.65);
  --shadow-accent:  rgba(255,166,201,0.15);
  --nav-bg:         rgba(255,240,245,0.6);
  --particle-color: #FFA6C9;
}

body.dark-mode {
  --bg-body:        #080410;
  --text-main:      #f8f0fc;
  --card-bg:        rgba(255,255,255,0.04);
  --card-border:    rgba(255,255,255,0.09);
  --shadow-accent:  rgba(205,180,219,0.1);
  --nav-bg:         rgba(8,4,16,0.6);
  --particle-color: #CDB4DB;
}

/* =============================================
   BASE
   ============================================= */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg-body);
  color: var(--text-main);
  overflow-x: hidden;
  transition: background-color 0.6s ease, color 0.6s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Hide default cursor on desktop */
@media (pointer: fine) { body { cursor: none; } }

/* Font fallback while loading — prevents layout shift */
body { font-family: 'Outfit', system-ui, sans-serif; }

/* =============================================
   PERFORMANCE: content-visibility
   Skips rendering off-screen sections entirely
   until they scroll near viewport — massive win
   ============================================= */
.cv-section {
  content-visibility: auto;
  contain-intrinsic-size: 0 900px; /* estimated height prevents scroll jump */
}

/* =============================================
   SCROLL PROGRESS BAR
   ============================================= */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2), var(--accent3));
  z-index: 100000;
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 10px var(--accent);
  /* Use transform instead of width for 120fps — but width here is fine
     since it's only updated in a throttled RAF callback */
}

/* =============================================
   GRAIN OVERLAY
   ============================================= */
.grain-overlay {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.025;
  pointer-events: none;
  z-index: 99998;
  animation: grain-shift 8s steps(10) infinite;
}
body.dark-mode .grain-overlay { opacity: 0.04; }

@keyframes grain-shift {
  0%,100%{transform:translate(0,0)}   10%{transform:translate(-2%,-3%)}
  20%{transform:translate(3%,2%)}     30%{transform:translate(-1%,4%)}
  40%{transform:translate(4%,-1%)}    50%{transform:translate(-3%,3%)}
  60%{transform:translate(2%,-4%)}    70%{transform:translate(-4%,1%)}
  80%{transform:translate(3%,-2%)}    90%{transform:translate(-2%,4%)}
}

/* =============================================
   AMBIENT BLOBS
   ============================================= */
.blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: -1;
  will-change: transform;
}
.blob-1 {
  width: clamp(300px,55vw,700px); height: clamp(300px,55vw,700px);
  top: -15%; left: -12%;
  background: radial-gradient(circle, rgba(255,166,201,0.22), transparent 70%);
  animation: blob-drift 18s ease-in-out infinite;
}
.blob-2 {
  width: clamp(250px,45vw,600px); height: clamp(250px,45vw,600px);
  bottom: -15%; right: -12%;
  background: radial-gradient(circle, rgba(189,224,254,0.2), transparent 70%);
  animation: blob-drift 22s ease-in-out infinite reverse;
  animation-delay: 3s;
}
.blob-3 {
  width: clamp(200px,35vw,450px); height: clamp(200px,35vw,450px);
  top: 40%; left: 50%;
  background: radial-gradient(circle, rgba(205,180,219,0.15), transparent 70%);
  animation: blob-drift 16s ease-in-out infinite;
  animation-delay: 6s;
}

@keyframes blob-drift {
  0%,100% { transform: translate(0,0) scale(1); }
  33%      { transform: translate(40px,-30px) scale(1.08); }
  66%      { transform: translate(-25px,35px) scale(0.94); }
}

/* =============================================
   ✨ CUTE PRELOADER — entirely CSS-animated,
   no GSAP dependency, works before any JS runs
   ============================================= */
#loader {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  /* Soft tri-tone gradient that matches the site palette */
  background: linear-gradient(135deg, #FFF0F5 0%, #F4EEFF 45%, #EDF5FF 100%);
  transition: opacity 0.85s cubic-bezier(0.76,0,0.24,1),
              transform 0.85s cubic-bezier(0.76,0,0.24,1);
}
body.dark-mode #loader {
  background: linear-gradient(135deg, #0d0818 0%, #080410 50%, #060a18 100%);
}

/* Morphing background glow blobs */
.ld-blob {
  position: absolute;
  width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(255,166,201,0.38) 0%, rgba(205,180,219,0.22) 45%, transparent 70%);
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  filter: blur(55px);
  pointer-events: none;
  animation: ld-morph 5s ease-in-out infinite;
  will-change: transform, border-radius;
}
.ld-blob-2 {
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(189,224,254,0.3) 0%, rgba(205,180,219,0.15) 50%, transparent 70%);
  animation: ld-morph 7s ease-in-out infinite reverse;
  animation-delay: 1.5s;
  filter: blur(40px);
}
body.dark-mode .ld-blob {
  background: radial-gradient(circle, rgba(205,180,219,0.35) 0%, rgba(189,224,254,0.15) 45%, transparent 70%);
}
body.dark-mode .ld-blob-2 {
  background: radial-gradient(circle, rgba(189,224,254,0.25) 0%, rgba(255,166,201,0.1) 50%, transparent 70%);
}

@keyframes ld-morph {
  0%,100% {
    transform: translate(-20%, -10%) scale(1);
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  }
  25% {
    transform: translate(10%, 15%) scale(1.1);
    border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
  }
  50% {
    transform: translate(25%, -5%) scale(0.9);
    border-radius: 50% 40% 60% 30% / 35% 60% 40% 65%;
  }
  75% {
    transform: translate(-10%, 20%) scale(1.05);
    border-radius: 40% 60% 40% 60% / 70% 30% 60% 40%;
  }
}

/* Sparkle elements (populated by JS) */
.ld-sparkle {
  position: absolute;
  pointer-events: none;
  user-select: none;
  line-height: 1;
  animation: ld-sparkle-float ease-in-out infinite;
  will-change: transform, opacity;
}

@keyframes ld-sparkle-float {
  0%,100% {
    transform: translateY(0) scale(1) rotate(-15deg);
    opacity: 0.5;
  }
  50% {
    transform: translateY(-18px) scale(1.25) rotate(15deg);
    opacity: 1;
  }
}

/* Center card */
.ld-card {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  padding: 2rem;
}

/* Bouncing icon */
.ld-icon {
  font-size: 3.8rem;
  line-height: 1;
  margin-bottom: 0.4rem;
  display: block;
  animation: ld-bounce 1.8s cubic-bezier(0.34,1.56,0.64,1) infinite;
  filter: drop-shadow(0 10px 24px rgba(255,166,201,0.55));
  will-change: transform;
}

@keyframes ld-bounce {
  0%,100% { transform: translateY(0) rotate(-6deg) scale(1);   }
  45%      { transform: translateY(-22px) rotate(6deg) scale(1.08); }
  65%      { transform: translateY(-8px) rotate(2deg) scale(1.04); }
}

/* Name — clip-path reveal from left, CSS-only */
.ld-name-wrap { overflow: hidden; }

.ld-name {
  display: block;
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 800;
  font-size: clamp(2.4rem, 9vw, 4.8rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #FFA6C9 0%, #CDB4DB 50%, #BDE0FE 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  /* Slide up from overflow-hidden parent */
  transform: translateY(105%);
  animation: ld-name-rise 0.9s cubic-bezier(0.16,1,0.3,1) 0.15s forwards;
}

@keyframes ld-name-rise {
  to { transform: translateY(0); }
}

/* Role text */
.ld-role {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(205,180,219,0.9);
  opacity: 0;
  transform: translateY(10px);
  animation: ld-role-appear 0.6s ease 0.75s forwards;
  margin-top: 4px;
}
body.dark-mode .ld-role { color: rgba(189,224,254,0.7); }

@keyframes ld-role-appear {
  to { opacity: 1; transform: translateY(0); }
}

/* Cute bouncing dot progress */
.ld-dots {
  display: flex;
  gap: 7px;
  margin-top: 1.8rem;
  align-items: center;
}

.ld-dot {
  display: block;
  width: 8px; height: 8px;
  border-radius: 50%;
  animation: ld-dot-jump 1.3s ease-in-out infinite;
}
.ld-dot:nth-child(1) { background: #FFA6C9; animation-delay: 0s; }
.ld-dot:nth-child(2) { background: #e8a4e0; animation-delay: 0.15s; }
.ld-dot:nth-child(3) { background: #CDB4DB; animation-delay: 0.30s; }
.ld-dot:nth-child(4) { background: #a9cef0; animation-delay: 0.45s; }
.ld-dot:nth-child(5) { background: #BDE0FE; animation-delay: 0.60s; }

@keyframes ld-dot-jump {
  0%,60%,100% { transform: translateY(0) scale(1);     }
  30%          { transform: translateY(-13px) scale(1.2); }
}

/* =============================================
   CUSTOM CURSOR — transform-based (no layout)
   Using translate() instead of left/top
   eliminates layout recalc on every mousemove
   ============================================= */
#cursor-glow, #cursor-dot, #cursor-label {
  position: fixed;
  top: 0; left: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  /* Base offset so translate(x,y) centers the element */
  will-change: transform;
}

#cursor-dot {
  width: 8px; height: 8px;
  background: var(--accent);
  margin-left: -4px; margin-top: -4px; /* center offset */
  transition: width 0.25s ease, height 0.25s ease,
              margin 0.25s ease, opacity 0.25s ease;
}

#cursor-glow {
  width: 44px; height: 44px;
  margin-left: -22px; margin-top: -22px;
  background: radial-gradient(circle, rgba(255,166,201,0.45) 0%, transparent 70%);
  mix-blend-mode: multiply;
  transition: width 0.45s cubic-bezier(0.34,1.56,0.64,1),
              height 0.45s cubic-bezier(0.34,1.56,0.64,1),
              margin 0.45s cubic-bezier(0.34,1.56,0.64,1);
}
body.dark-mode #cursor-glow {
  background: radial-gradient(circle, rgba(205,180,219,0.5) 0%, transparent 70%);
  mix-blend-mode: screen;
}

#cursor-label {
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.05em;
  padding: 5px 11px;
  white-space: nowrap;
  opacity: 0;
  margin-left: 0; margin-top: 0;
  /* position above cursor */
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.34,1.56,0.64,1);
}

body.hovering  #cursor-dot  { width: 0; height: 0; margin: 0; opacity: 0; }
body.hovering  #cursor-glow { width: 70px; height: 70px; margin-left: -35px; margin-top: -35px; }
body.cursor-labeled #cursor-label {
  opacity: 1;
  /* translate-Y pulls it above the cursor; combine with JS translate for position */
}

/* =============================================
   NAVIGATION
   ============================================= */
#navbar {
  background: transparent;
  transition: background 0.4s ease, backdrop-filter 0.4s ease,
              padding 0.4s ease, box-shadow 0.4s ease;
}
#navbar.scrolled {
  background: var(--nav-bg);
  backdrop-filter: blur(24px) saturate(1.8);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  box-shadow: 0 1px 0 var(--card-border), 0 8px 32px rgba(0,0,0,0.06);
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

/* =============================================
   HERO — CSS PARTICLE SYSTEM
   Replaces Three.js entirely. GPU-composited
   via transform + opacity only.
   ============================================= */
#canvas-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  /* Subtle parallax container — transform applied by JS on mousemove */
  will-change: transform;
  transition: transform 1s cubic-bezier(0.33,1,0.68,1);
}

/* Individual particles — all animation via transform+opacity (compositor-only) */
.hero-particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: var(--particle-color);
  will-change: transform, opacity;
  /* Each particle gets its own animation via nth-child alternation */
  animation: p-drift-a ease-in-out infinite alternate;
}
/* Alternate animation for visual variety without extra CSS */
.hero-particle:nth-child(even) {
  animation-name: p-drift-b;
}
.hero-particle:nth-child(3n) {
  animation-name: p-drift-c;
}

@keyframes p-drift-a {
  0%   { transform: translate(0, 0) scale(1);      opacity: 0.6; }
  100% { transform: translate(18px, -45px) scale(0.7); opacity: 0.1; }
}
@keyframes p-drift-b {
  0%   { transform: translate(0, 0) scale(1);       opacity: 0.5; }
  100% { transform: translate(-22px, -38px) scale(0.85); opacity: 0.15; }
}
@keyframes p-drift-c {
  0%   { transform: translate(0, 0) scale(1);        opacity: 0.7; }
  100% { transform: translate(10px, -55px) scale(0.6);  opacity: 0.05; }
}

/* Role cycling text */
#role-text {
  display: inline-block;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
#role-text.fade-out { opacity: 0; transform: translateY(-8px); }

/* Hero decorations */
.sparkle-badge {
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,166,201,0.3);
  color: #130C1C;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 7px 14px;
  border-radius: 999px;
  box-shadow: 0 4px 20px rgba(255,166,201,0.2);
  white-space: nowrap;
}
body.dark-mode .sparkle-badge { background: rgba(255,255,255,0.08); color: #fff; }

.cute-badge {
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.5);
  color: #130C1C;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 11px;
  padding: 6px 12px;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  white-space: nowrap;
}
body.dark-mode .cute-badge { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.1); color: #fff; }

.deco-ring {
  width: 80px; height: 80px;
  border: 1.5px dashed rgba(255,166,201,0.35);
  border-radius: 50%;
  animation: spin-slow 30s linear infinite;
  will-change: transform;
}
@keyframes spin-slow { to { transform: rotate(360deg); } }

/* =============================================
   MARQUEE
   ============================================= */
.marquee-strip {
  background: rgba(255,255,255,0.5);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--card-border);
  border-bottom: 1px solid var(--card-border);
  box-shadow: 0 4px 30px rgba(0,0,0,0.04);
  position: relative; z-index: 10;
}
body.dark-mode .marquee-strip { background: rgba(0,0,0,0.3); }

.marquee-content {
  display: inline-flex;
  gap: 2.5rem;
  animation: marquee-scroll 28s linear infinite;
  white-space: nowrap;
  will-change: transform;
}
@keyframes marquee-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.marquee-strip:hover .marquee-content { animation-play-state: paused; }

/* =============================================
   SECTION HELPERS
   ============================================= */
.section-padding { padding-top: 90px; padding-bottom: 90px; }
@media (min-width: 768px) { .section-padding { padding-top: 130px; padding-bottom: 130px; } }

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(255,166,201,0.1);
  border: 1px solid rgba(255,166,201,0.22);
  color: var(--accent);
  font-family: 'Outfit', sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.section-title {
  font-family: 'Fraunces', serif;
  font-size: clamp(2.4rem,5.5vw,5rem);
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.section-subtitle { font-family: 'Outfit', sans-serif; font-size: 1rem; color: #9ca3af; font-weight: 500; }

/* =============================================
   CARDS (SHARED)
   ============================================= */
.badge-card {
  background: white;
  border: 1px solid rgba(255,255,255,0.6);
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}
body.dark-mode .badge-card {
  background: var(--bg-body);
  border-color: rgba(255,255,255,0.1);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.tilt-card { transform-style: preserve-3d; }

/* =============================================
   ABOUT
   ============================================= */
.about-blob-bg {
  position: absolute;
  inset: -20px;
  background: linear-gradient(135deg, rgba(255,166,201,0.25), rgba(205,180,219,0.2));
  border-radius: 3rem;
  filter: blur(30px);
  z-index: -1;
}

/* CSS-driven image reveal */
.reveal-wrap { overflow: hidden; position: relative; }

.reveal-overlay {
  position: absolute;
  inset: 0;
  background-color: var(--bg-body);
  z-index: 2;
  transform-origin: bottom center;
  transition: transform 1.1s cubic-bezier(0.76,0,0.24,1);
}
.reveal-wrap.in-view .reveal-overlay { transform: scaleY(0); }

.reveal-img {
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(1.08);
  transition: transform 1.4s cubic-bezier(0.33,1,0.68,1), filter 1.4s ease;
  filter: blur(4px);
}
.reveal-wrap.in-view .reveal-img { transform: scale(1); filter: blur(0); }

.contact-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 1.5rem;
  padding: 12px 18px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
  transition: background 0.3s ease, box-shadow 0.3s ease;
  flex: 1; min-width: 0;
}
.contact-pill:hover { background: rgba(255,166,201,0.15); box-shadow: 0 6px 24px rgba(255,166,201,0.15); }

/* =============================================
   STATS
   ============================================= */
.stat-card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  box-shadow: 0 4px 30px var(--shadow-accent);
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.4s ease;
}
.stat-card:hover { transform: translateY(-6px) scale(1.02); box-shadow: 0 20px 50px var(--shadow-accent); }

/* =============================================
   SKILL CARDS
   ============================================= */
.skill-card {
  background: var(--card-bg);
  backdrop-filter: blur(24px);
  border: 1px solid var(--card-border);
  box-shadow: 0 4px 30px var(--shadow-accent);
  transition: transform 0.5s cubic-bezier(0.34,1.56,0.64,1),
              box-shadow 0.5s ease, border-color 0.4s ease;
  will-change: transform;
}
.skill-card:hover { transform: translateY(-12px); box-shadow: 0 30px 60px var(--shadow-accent); border-color: rgba(255,166,201,0.35); }

.skill-icon {
  width: 60px; height: 60px;
  border-radius: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (min-width: 768px) { .skill-icon { width: 70px; height: 70px; border-radius: 1.5rem; } }

/* =============================================
   PROJECT CARDS
   ============================================= */
.project-card {
  background: var(--card-bg);
  backdrop-filter: blur(24px);
  border: 1px solid var(--card-border);
  box-shadow: 0 4px 40px var(--shadow-accent);
  transition: transform 0.5s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.5s ease;
}
.project-card:hover { transform: translateY(-8px); box-shadow: 0 30px 70px var(--shadow-accent); }

.project-img-wrap { min-height: 220px; }
@media (min-width: 768px) { .project-img-wrap { min-height: auto; } }

.project-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 600;
  color: var(--accent); letter-spacing: 0.1em;
}

.code-window {
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 16px 20px;
  width: clamp(200px,80%,280px);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; line-height: 1.7;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}
.code-dots { display: flex; gap: 6px; margin-bottom: 12px; }
.code-dots span { width: 8px; height: 8px; border-radius: 50%; }
.code-dots span:nth-child(1) { background: #FF5F57; }
.code-dots span:nth-child(2) { background: #FFBD2E; }
.code-dots span:nth-child(3) { background: #28CA41; }

.chart-window { width: clamp(160px,75%,240px); background: rgba(0,0,0,0.3); backdrop-filter: blur(10px); border-radius: 12px; padding: 16px; box-shadow: 0 10px 40px rgba(0,0,0,0.3); }
.chart-bars { display: flex; align-items: flex-end; gap: 8px; height: 80px; }
.chart-bar { flex: 1; background: rgba(255,255,255,0.25); border-radius: 4px 4px 0 0; }
.chart-bar.active { background: rgba(255,255,255,0.7); }

.vision-box { position: relative; width: 120px; height: 120px; display: flex; align-items: center; justify-content: flex-start; padding: 8px; }
.detect-ring { width: 100%; height: 100%; border: 2px solid rgba(52,211,153,0.8); border-radius: 8px; position: absolute; animation: detect-pulse 2s ease-in-out infinite; }
@keyframes detect-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(52,211,153,0.4); }
  50%      { box-shadow: 0 0 0 8px rgba(52,211,153,0); }
}
.detect-label { position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%); white-space: nowrap; }
.detect-corner { position: absolute; width: 10px; height: 10px; border-color: rgba(52,211,153,0.9); border-style: solid; }
.detect-corner.tl { top: -2px; left: -2px; border-width: 2px 0 0 2px; }
.detect-corner.tr { top: -2px; right: -2px; border-width: 2px 2px 0 0; }
.detect-corner.bl { bottom: -2px; left: -2px; border-width: 0 0 2px 2px; }
.detect-corner.br { bottom: -2px; right: -2px; border-width: 0 2px 2px 0; }

.project-btn-primary {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px;
  background: var(--text-main); color: var(--bg-body);
  border-radius: 999px;
  font-family: 'Outfit', sans-serif; font-size: 11px; font-weight: 800;
  letter-spacing: 0.08em; text-transform: uppercase;
  transition: all 0.3s ease;
}
.project-btn-primary:hover { background: var(--accent); color: white; transform: scale(1.05); }

.project-btn-ghost {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px;
  border: 1.5px solid var(--card-border);
  border-radius: 999px; color: var(--text-main);
  font-family: 'Outfit', sans-serif; font-size: 11px; font-weight: 800;
  letter-spacing: 0.08em; text-transform: uppercase;
  transition: all 0.3s ease;
}
.project-btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: rgba(255,166,201,0.07); }

/* =============================================
   TECH GRID
   ============================================= */
.tech-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
@media (min-width: 480px) { .tech-grid { grid-template-columns: repeat(4,1fr); } }
@media (min-width: 768px) { .tech-grid { grid-template-columns: repeat(6,1fr); gap: 14px; } }

.tech-item {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 1.5rem;
  padding: 1.4rem 0.75rem;
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  transition: all 0.4s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 2px 16px rgba(0,0,0,0.04);
}
.tech-item span { font-family: 'Outfit', sans-serif; font-size: 11px; font-weight: 700; color: var(--text-main); letter-spacing: 0.03em; }
.tech-item:hover { transform: translateY(-8px) scale(1.04); box-shadow: 0 16px 40px var(--shadow-accent); border-color: rgba(255,166,201,0.3); }

/* =============================================
   CONTACT
   ============================================= */
.contact-email-box {
  background: var(--card-bg);
  backdrop-filter: blur(24px);
  border: 1.5px solid var(--card-border);
  border-radius: 2rem;
  box-shadow: 0 8px 40px var(--shadow-accent);
  transition: transform 0.5s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.5s ease;
  width: 100%; max-width: 680px;
}
.contact-email-box:hover { transform: scale(1.025); box-shadow: 0 30px 70px var(--shadow-accent); border-color: rgba(255,166,201,0.4); }
@media (min-width: 640px) { .contact-email-box { border-radius: 3rem; } }

.social-btn {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-main);
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  transition: all 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
.social-btn:hover { background: var(--accent); color: white; transform: translateY(-5px) scale(1.1); box-shadow: 0 12px 30px rgba(255,166,201,0.35); border-color: var(--accent); }

/* =============================================
   PILL TAGS
   ============================================= */
.pill-tag {
  padding: 4px 11px;
  background: rgba(255,166,201,0.1);
  color: var(--text-main);
  border-radius: 999px;
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  border: 1px solid rgba(255,166,201,0.25);
  letter-spacing: 0.03em;
  transition: background 0.3s ease;
}
.pill-tag:hover { background: rgba(255,166,201,0.22); }
body.dark-mode .pill-tag { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.12); color: rgba(255,255,255,0.8); }

/* =============================================
   FLOATING ANIMATIONS  — transform-only = GPU
   ============================================= */
@keyframes float      { 0%,100% { transform: translateY(0); }    50% { transform: translateY(-10px); } }
@keyframes float-slow { 0%,100% { transform: translateY(0); }    50% { transform: translateY(-6px); } }

.floating      { animation: float 5s ease-in-out infinite; will-change: transform; }
.floating-slow { animation: float-slow 7s ease-in-out infinite; will-change: transform; }

/* =============================================
   SCROLL-TRIGGERED ENTRANCE
   ============================================= */
.fade-up {
  opacity: 0;
  transform: translateY(35px);
  transition: opacity 0.8s cubic-bezier(0.33,1,0.68,1),
              transform 0.8s cubic-bezier(0.33,1,0.68,1);
}
.fade-up.in-view { opacity: 1; transform: translateY(0); }

/* Staggered children */
.fade-up:nth-child(1) { transition-delay: 0s; }
.fade-up:nth-child(2) { transition-delay: 0.08s; }
.fade-up:nth-child(3) { transition-delay: 0.16s; }
.fade-up:nth-child(4) { transition-delay: 0.24s; }
.fade-up:nth-child(5) { transition-delay: 0.32s; }
.fade-up:nth-child(6) { transition-delay: 0.40s; }

/* =============================================
   THEME SWITCH
   ============================================= */
.theme-switch-container { position: fixed; bottom: 22px; right: 22px; z-index: 100; transform: scale(0.82); }
@media (min-width: 768px) { .theme-switch-container { bottom: 28px; right: 28px; transform: scale(0.92); } }

.switch { font-size: 17px; position: relative; display: inline-block; width: 4em; height: 2.2em; border-radius: 30px; box-shadow: 0 5px 20px rgba(0,0,0,0.15); }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background-color: #130c1c; transition: 0.4s; border-radius: 30px; overflow: hidden; }
.slider:before { position: absolute; content: ""; height: 1.2em; width: 1.2em; border-radius: 20px; left: 0.5em; bottom: 0.5em; transition: 0.5s cubic-bezier(0.81,-0.04,0.38,1.5); box-shadow: inset 8px -4px 0px 0px #fff; }
.switch input:checked + .slider { background-color: #FFA6C9; }
.switch input:checked + .slider:before { transform: translateX(1.8em); box-shadow: inset 15px -4px 0px 15px #FFF9C4; }
.star { background: #fff; border-radius: 50%; position: absolute; width: 5px; height: 5px; transition: all 0.4s; }
.star_1 { left: 2.5em; top: 0.5em; }
.star_2 { left: 2.2em; top: 1.2em; }
.star_3 { left: 3em;   top: 0.9em; }
.switch input:checked ~ .slider .star { opacity: 0; transform: scale(0); }
.cloud { width: 3.5em; position: absolute; bottom: -1.4em; left: -1.1em; opacity: 0; transition: all 0.4s; }
.switch input:checked ~ .slider .cloud { opacity: 1; }

/* =============================================
   PERFORMANCE: MOBILE OPTIMIZATIONS
   backdrop-filter is GPU-expensive on mobile,
   creating new compositing layers for every card.
   Disable it on touch devices.
   ============================================= */
@media (pointer: coarse) {
  .skill-card,
  .stat-card,
  .tech-item,
  .project-card,
  .contact-pill,
  .contact-email-box {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  /* Simplify blob filter on mobile */
  .blob { filter: blur(60px); }
}

/* =============================================
   REDUCED MOTION — respect user preference
   ============================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  #loader { display: none !important; }
}
