/* ========================================================
   DESIGN TOKENS
   ======================================================== */
@property --accent {
  syntax: '<color>';
  inherits: true;
  initial-value: #38bdf8;
}
@property --accent-2 {
  syntax: '<color>';
  inherits: true;
  initial-value: #818cf8;
}
@property --glow-1 {
  syntax: '<color>';
  inherits: true;
  initial-value: rgba(56,189,248,.12);
}
@property --glow-2 {
  syntax: '<color>';
  inherits: true;
  initial-value: rgba(129,140,248,.10);
}

:root {
  /* Palette — pure black base with cool-white text */
  --bg:          #000000;
  --bg-elevated: #0a0a0a;
  --bg-card:     #111111;
  --bg-card-hover: #1a1a1a;
  --border:      rgba(255,255,255,.08);
  --border-hover:rgba(255,255,255,.15);

  --text:        #e4e4e7;
  --text-muted:  #a1a1aa;
  --text-dim:    #52525b;
  --white:       #ffffff;

  /* Accent — cool cyan-blue */
  --accent:      #38bdf8;
  --accent-2:    #818cf8;
  --gradient:    linear-gradient(135deg, var(--accent), var(--accent-2));

  /* Spotlight glow */
  --glow-1:      rgba(56,189,248,.12);
  --glow-2:      rgba(129,140,248,.10);

  /* Typography */
  --font:        'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:   'JetBrains Mono', monospace;

  /* Spacing */
  --nav-h:       64px;
  --section-py:  120px;
  --container:   1120px;
  --radius:      12px;
  --radius-sm:   8px;
  --radius-xs:   6px;

  /* Transitions */
  --ease:        cubic-bezier(.4,0,.2,1);
  --duration:    .3s;
}

/* Dynamic Orange Theme for About Page */
body.theme-orange {
  --accent: #f97316;
  --accent-2: #fb923c;
  --gradient: linear-gradient(135deg, var(--accent), var(--accent-2));
  --glow-1: rgba(249, 115, 22, 0.15);
  --glow-2: rgba(251, 146, 60, 0.12);
}

/* Dynamic Deep Sea Theme for Education Page */
body.theme-deepsea {
  --accent: #0ea5e9;
  --accent-2: #2563eb;
  --gradient: linear-gradient(135deg, var(--accent), var(--accent-2));
  --glow-1: rgba(14, 165, 233, 0.15);
  --glow-2: rgba(37, 99, 235, 0.12);
}

/* Dynamic Neon Theme for Skills Page */
body.theme-neon {
  --accent: #d946ef;
  --accent-2: #8b5cf6;
  --gradient: linear-gradient(135deg, var(--accent), var(--accent-2));
  --glow-1: rgba(217, 70, 239, 0.15);
  --glow-2: rgba(139, 92, 246, 0.12);
}

/* Dynamic Emerald Theme for Projects Page */
body.theme-emerald {
  --accent: #10b981;
  --accent-2: #059669;
  --gradient: linear-gradient(135deg, var(--accent), var(--accent-2));
  --glow-1: rgba(16, 185, 129, 0.15);
  --glow-2: rgba(5, 150, 105, 0.12);
}

/* Dynamic Theme for Contact Page */
body.theme-contact {
  --accent: #e11d48; /* Crimson */
  --accent-2: #f59e0b; /* Amber */
  --gradient: linear-gradient(135deg, var(--accent), var(--accent-2));
  --glow-1: rgba(225, 29, 72, 0.15);
  --glow-2: rgba(245, 158, 11, 0.12);
}

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

/* Custom scrollbar — black for all browsers */
html {
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
  scrollbar-color: #222 #000;           /* Firefox */
  scrollbar-width: thin;                /* Firefox */
}
/* WebKit (Chrome, Edge, Safari) */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: #222; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #333; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: --accent 1s var(--ease), --accent-2 1s var(--ease), --glow-1 1s var(--ease), --glow-2 1s var(--ease), background-color 1s var(--ease);
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* ========================================================
   UTILITIES
   ======================================================== */
.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.section {
  padding: var(--section-py) 0;
  position: relative;
  scroll-snap-align: start;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-label {
  font-family: var(--font-mono);
  font-size: .8rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  color: var(--white);
  line-height: 1.2;
  margin-bottom: 40px;
}

/* Buttons */
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px;
  background: var(--gradient);
  color: #000; font-weight: 600; font-size: .875rem;
  border-radius: 999px; border: none; cursor: pointer;
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(56,189,248,.25); }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px;
  background: transparent;
  color: var(--text); font-weight: 500; font-size: .875rem;
  border: 1px solid var(--border); border-radius: 999px; cursor: pointer;
  transition: border-color var(--duration) var(--ease), color var(--duration) var(--ease);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--white); }

.btn-lg { padding: 14px 32px; font-size: .95rem; }
.btn-sm { padding: 8px 18px; font-size: .8rem; }

/* ========================================================
   NAVBAR
   ======================================================== */
#navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px;
  background: rgba(0,0,0,.85); /* Slightly darker instead of blur */
  border-bottom: 1px solid var(--border);
  transition: background var(--duration) var(--ease);
  transform: translate3d(0,0,0); /* Force GPU layer */
}

/* When menu is open, disable backdrop-filter to release stacking context */
body.menu-open #navbar {
  backdrop-filter: none; -webkit-backdrop-filter: none;
  background: #000;
}

.nav-logo { display: flex; align-items: center; gap: 10px; }
.logo-icon {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: var(--gradient);
  color: #000; font-weight: 800; font-size: .9rem;
  border-radius: var(--radius-xs);
}
.logo-text { font-weight: 700; font-size: 1rem; color: var(--white); }

.nav-pill {
  display: flex; gap: 4px;
  padding: 4px;
  background: rgba(255,255,255,.05);
  border-radius: 999px;
  border: 1px solid var(--border);
}
.nav-link {
  padding: 6px 16px; font-size: .85rem; font-weight: 500;
  color: var(--text-muted); border-radius: 999px;
  transition: color var(--duration) var(--ease), background var(--duration) var(--ease);
}
.nav-link:hover { color: var(--white); }
.nav-link.active { background: rgba(255,255,255,.1); color: var(--white); }

.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: color var(--duration) var(--ease), border-color var(--duration) var(--ease);
}
.nav-icon-btn:hover { color: var(--white); border-color: var(--border-hover); }

.mobile-menu-btn { display: none; }

/* ========================================================
   HERO
   ======================================================== */
.hero-section {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  text-align: center;
  padding-top: var(--nav-h);
  overflow: hidden;
}

/* Spotlight cone effect (like evervault) */
.hero-spotlight {
  position: absolute; top: -20%; left: 50%; transform: translateX(-50%);
  width: 800px; height: 800px;
  background: radial-gradient(ellipse at center, var(--glow-1) 0%, var(--glow-2) 30%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
  animation: spotlightPulse 6s ease-in-out infinite alternate;
}

@keyframes spotlightPulse {
  0%   { opacity: .6; transform: translateX(-50%) scale(1); }
  100% { opacity: 1;  transform: translateX(-50%) scale(1.15); }
}

/* Spline 3D — fixed full-screen background */
.spline-bg {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: 0;
  pointer-events: none;
}
.spline-bg canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  pointer-events: auto;
  cursor: default !important;
  opacity: 0; /* Start hidden for smooth fade-in */
  transition: opacity 1s var(--ease);
}
.spline-bg.loaded canvas { opacity: 1; }

/* Spline loading spinner */
.spline-loader {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 16px;
  background: var(--bg);
  z-index: 2;
  transition: opacity .6s var(--ease);
}
.spline-loader.hidden {
  opacity: 0;
  pointer-events: none;
}
.spline-spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(255,255,255,.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spline-loader span {
  font-size: .8rem; color: var(--text-muted);
  letter-spacing: .05em;
}

/* Cover the "Built with Spline" watermark (bottom-right of canvas) */
.spline-watermark-cover {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 250px;
  height: 70px;
  background: var(--bg);
  z-index: 3;
  pointer-events: none;
}

/* Gradient vignette overlay — keeps text readable over the 3D */
.hero-overlay {
  position: absolute; inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse at center, rgba(0,0,0,.25) 0%, rgba(0,0,0,.65) 70%),
    linear-gradient(to bottom, rgba(0,0,0,.3) 0%, transparent 30%, transparent 60%, rgba(0,0,0,.85) 100%);
  pointer-events: none;
}

.hero-content { position: relative; z-index: 3; max-width: 720px; padding: 0 24px; }

.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px;
  background: rgba(56,189,248,.08);
  border: 1px solid rgba(56,189,248,.2);
  border-radius: 999px;
  font-size: .8rem; font-weight: 500;
  color: var(--accent);
  margin-bottom: 28px;
  animation: fadeInUp .8s var(--ease) both;
}
.badge-dot {
  width: 8px; height: 8px;
  background: #22c55e; border-radius: 50%;
  animation: blink 2s ease-in-out infinite;
}
@keyframes blink {
  0%,100% { opacity: 1; }
  50%     { opacity: .3; }
}

.hero-title {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 900; line-height: 1.1;
  color: var(--white);
  margin-bottom: 20px;
}
.hero-title .line { display: block; }
.hero-title em {
  font-style: normal;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-title .line-1 { animation: fadeInUp .8s .15s var(--ease) both; }
.hero-title .line-2 { animation: fadeInUp .8s .3s var(--ease) both; }

.hero-subtitle {
  font-size: clamp(.95rem, 1.8vw, 1.15rem);
  color: var(--text-muted); max-width: 560px; margin: 0 auto 36px;
  animation: fadeInUp .8s .45s var(--ease) both;
}

.hero-cta-group {
  display: flex; gap: 16px; justify-content: center; flex-wrap: wrap;
  animation: fadeInUp .8s .6s var(--ease) both;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--text-dim); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase;
  z-index: 3;
  animation: fadeInUp .8s .9s var(--ease) both;
}
.scroll-line {
  width: 1px; height: 40px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%,100% { opacity: 1; height: 40px; }
  50%     { opacity: .3; height: 24px; }
}

/* ========================================================
   ABOUT
   ======================================================== */
.about-section {
  background: var(--bg);
  position: relative;
  z-index: 5;
  overflow: hidden;
  justify-content: flex-start;
  height: 100vh;
  padding: 0;
}

/* Orange Smoke for About Section */
.about-section::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 45vh;
  background: radial-gradient(120% 100% at 50% 0%, rgba(249, 115, 22, 0.35) 0%, rgba(249, 115, 22, 0.05) 50%, transparent 100%);
  filter: blur(24px);
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 1s var(--ease);
}
body.theme-orange .about-section::after {
  opacity: 1;
}

/* 3D canvas covers the entire about section */
.about-3d-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.about-3d-bg canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  cursor: default !important;
  opacity: 0;
  transition: opacity 1s var(--ease);
}
.about-3d-bg.loaded canvas { opacity: 1; }
.about-3d-bg .spline-loader {
  position: absolute;
  inset: 0;
}

/* Text content overlaid — pointer-events pass through to canvas */
.about-overlay-content {
  position: relative;
  z-index: 2;
  pointer-events: none;
  width: 100%;
  max-width: 44%;
  align-self: flex-end;
  padding-bottom: 40px;
  padding-left: 40px;
}
/* Re-enable clicks on interactive elements */
.about-overlay-content a,
.about-overlay-content button {
  pointer-events: auto;
}

.about-text {
  background: transparent;
  border: none;
  border-radius: var(--radius);
  padding: 24px 28px;
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 24px;
  font-size: 1rem;
  line-height: 1.7;
}

.about-cta {
  display: flex; gap: 14px; flex-wrap: wrap;
  margin-top: 8px;
}

/* ========================================================
   EDUCATION
   ======================================================== */
.education-section {
  background: var(--bg);
  position: relative; z-index: 5;
  overflow: hidden;
  padding: 120px 0;
  min-height: 100vh;
  height: auto;
  justify-content: center;
}
.education-section > .container { width: 100%; }

/* Deep Sea Smoke for Education Section */
.education-section::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 45vh;
  background: radial-gradient(120% 100% at 50% 0%, rgba(14, 165, 233, 0.35) 0%, rgba(14, 165, 233, 0.05) 50%, transparent 100%);
  filter: blur(24px);
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 1s var(--ease);
}
body.theme-deepsea .education-section::after {
  opacity: 1;
}

/* Overlay content */
.education-overlay-content {
  position: relative;
  z-index: 2;
  pointer-events: none;
  width: 100%;
}
.education-overlay-content a,
.education-overlay-content button,
.info-card {
  pointer-events: auto;
}

.edu-grid {
  display: flex;
  justify-content: center;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 40px;
  max-width: 1000px;
  margin: 0 auto;
}

/* Glassy 3D Cards with Image Background */
.info-card {
  background-color: var(--bg-card);
  background-image: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('assets/edu/card-bg.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  /* Removed expensive backdrop-filter */
  border: 1px solid rgba(56, 189, 248, 0.15);
  /* Simplified shadow */
  box-shadow: 0 10px 30px rgba(0,0,0,0.5); 
  border-radius: var(--radius);
  padding: 32px;
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: border-color 0.4s var(--ease), box-shadow 0.4s var(--ease), transform 0.5s var(--ease);
  width: 100%;
  flex: 1 1 400px;
  max-width: 480px;
  transform: translate3d(0,0,0); /* Force GPU layer */
}

/* Dark curtain overlay for cards */
.info-card::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0;
  width: 100%; height: 80%;
  background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.6) 60%, transparent 100%);
  z-index: 1;
  pointer-events: none;
}

/* Ensure text content is above the background curtain */
.info-card > * {
  position: relative;
  z-index: 2;
}
.info-card::before {
  content: "";
  position: absolute;
  top: 0; left: -100%;
  width: 50%; height: 100%;
  background: linear-gradient(to right, transparent, rgba(56, 189, 248, 0.1), transparent);
  transform: skewX(-20deg);
  transition: left 0.7s ease;
  pointer-events: none;
  z-index: 3;
}
.info-card:hover::before {
  left: 200%;
}
.info-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 20px 40px rgba(0,0,0,0.7), 0 0 20px rgba(56, 189, 248, 0.2);
}

/* 3D Text Effect */
.card-icon, .info-card h3, .education-list, .cert-list {
  transform: translateZ(30px);
}
.card-icon { font-size: 1.6rem; margin-bottom: 12px; }
.info-card h3 { font-size: 1rem; font-weight: 700; color: var(--white); margin-bottom: 16px; }

.education-list li { margin-bottom: 14px; }
.education-list strong { display: block; font-size: .9rem; color: var(--white); }
.education-list span { display: block; font-size: .8rem; color: var(--text-muted); }
.tag {
  display: inline-block; padding: 2px 10px; margin-top: 4px;
  font-size: .7rem; font-weight: 600;
  background: rgba(56,189,248,.1); color: var(--accent);
  border-radius: 999px;
}

.cert-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: .85rem; color: var(--text-muted);
}
.cert-list li:last-child { border-bottom: none; }

.projects-section { 
  background: var(--bg-elevated); 
  position: relative; 
  z-index: 5; 
  padding-top: 80px; /* Reduced to fit on one screen */
  padding-bottom: 60px;
}

/* Emerald Smoke for Projects Section */
.projects-section::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 60vh;
  background: radial-gradient(120% 100% at 50% 0%, rgba(16, 185, 129, 0.25) 0%, rgba(16, 185, 129, 0.05) 50%, transparent 100%);
  filter: blur(32px);
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 1s var(--ease);
}
body.theme-emerald .projects-section::after {
  opacity: 1;
}

.projects-section .section-title { 
  margin-bottom: 24px; 
  font-size: clamp(1.5rem, 3vw, 2.2rem); 
}
.projects-section .container { max-width: 1400px; } /* Expand container for more screen size */

.project-showcase {
  display: grid; grid-template-columns: 2fr 1fr; gap: 32px; align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 32px; /* Reduced vertical padding */
  transition: border-color var(--duration) var(--ease);
}
.project-showcase:hover { border-color: var(--border-hover); }

/* Custom Device Mockup (MacBook Pro) */
.device-mockup {
  position: relative;
  background: #1a1a1a;
  border-radius: 12px 12px 0 0;
  padding: 6px 6px 18px 6px; /* Thinner bezels */
  width: 100%;
  aspect-ratio: 16/9.5; /* Reduced height by ~5% */
  box-shadow: 0 20px 40px rgba(0,0,0,0.5), inset 0 0 0 1px #333;
  display: flex;
  flex-direction: column;
  transition: all 0.5s var(--ease);
}

.device-screen {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  border-radius: 4px;
  overflow: hidden;
  z-index: 2;
  overscroll-behavior: contain; /* Prevent scrolling from bleeding to the main page */
}

.device-screen iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
  pointer-events: auto;
}

/* MacBook Notch */
.device-notch {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 16px;
  background: #1a1a1a;
  border-radius: 0 0 8px 8px;
  z-index: 10;
  transition: all 0.5s var(--ease);
}

/* MacBook Base / Lip */
.device-base {
  position: absolute;
  bottom: -12px;
  left: -5%;
  width: 110%;
  height: 12px;
  background: linear-gradient(to bottom, #444, #111);
  border-radius: 0 0 12px 12px;
  z-index: 1;
  box-shadow: 0 10px 20px rgba(0,0,0,0.6);
}

.project-tag {
  font-family: var(--font-mono); font-size: .75rem;
  color: var(--accent); letter-spacing: .05em;
  margin-bottom: 12px;
}
.project-title { font-size: 1.8rem; font-weight: 800; color: var(--white); margin-bottom: 14px; }
.project-desc { font-size: .9rem; color: var(--text-muted); margin-bottom: 20px; line-height: 1.7; }
.project-desc strong { color: var(--accent); font-weight: 600; }

.project-highlights {
  margin-bottom: 24px;
  padding-left: 18px;
  list-style: disc;
}
.project-highlights li {
  font-size: .82rem; color: var(--text-muted);
  margin-bottom: 8px; line-height: 1.5;
}

.project-links { display: flex; gap: 12px; flex-wrap: wrap; }

/* ========================================================
   SKILLS (3D Curve Slider)
   ======================================================== */
.skills-section {
  background: var(--bg);
  position: relative;
  z-index: 5;
  overflow: hidden;
}

/* Neon Smoke for Skills Section */
.skills-section::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 45vh;
  background: radial-gradient(120% 100% at 50% 0%, rgba(217, 70, 239, 0.3) 0%, rgba(217, 70, 239, 0.05) 50%, transparent 100%);
  filter: blur(24px);
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 1s var(--ease);
}
body.theme-neon .skills-section::after {
  opacity: 1;
}

.skills-slider-wrapper {
  position: relative;
  width: 100%;
  height: 55vh;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1200px;
  margin-top: 40px;
  cursor: grab;
}
.skills-slider-wrapper:active {
  cursor: grabbing;
}

.skills-slider-inner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 220px;
  height: 320px;
  transform-style: preserve-3d;
  transform: translate(-50%, -50%);
}

.skill-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  /* Card Reflection */
  -webkit-box-reflect: below 5px linear-gradient(transparent, transparent 50%, rgba(0,0,0,0.5));
}

/* ========================================================
   CONTACT
   ======================================================== */
/* ========================================================
   SPATIAL UI CONTACT
   ======================================================== */
.spatial-contact { 
  background: #050505; 
  position: relative; 
  z-index: 5; 
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 0;
}

/* Dynamic CSS Mesh Background */
.spatial-mesh-bg {
  position: absolute; inset: 0; z-index: 0;
  overflow: hidden; pointer-events: none;
}
.mesh-blob {
  position: absolute;
  filter: blur(80px);
  opacity: 0.6;
  animation: floatMesh 12s infinite ease-in-out alternate;
}
.blob-1 { top: -10%; left: -10%; width: 50vw; height: 50vw; background: var(--accent); animation-delay: 0s; }
.blob-2 { bottom: -10%; right: -10%; width: 60vw; height: 60vw; background: var(--accent-2); animation-delay: -4s; }
.blob-3 { top: 40%; left: 40%; width: 40vw; height: 40vw; background: #000; animation-delay: -8s; }

@keyframes floatMesh {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(5%, 10%) scale(1.2); }
}

/* 3D Container */
.spatial-container {
  position: relative; z-index: 10;
  display: grid; grid-template-columns: 1fr 1.2fr; gap: 40px;
  perspective: 1400px; /* 3D Depth */
  width: 100%; max-width: 1200px;
  align-items: center;
}

.spatial-left {
  display: flex; flex-direction: column; gap: 24px;
  transform: rotateY(15deg) translateZ(0);
  transform-origin: right center;
  transition: transform 0.5s var(--ease);
}

.spatial-right {
  transform: rotateY(-10deg) translateZ(50px);
  transform-origin: left center;
  transition: transform 0.5s var(--ease);
}

/* Glass Panels */
.glass-panel {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.1);
  padding: 32px;
}

.panel-header { padding: 24px 32px; display: flex; align-items: center; justify-content: center; }
.spatial-title { font-size: 2.2rem; font-weight: 700; color: #fff; margin: 0; text-align: center;}

/* Circular Socials */
.panel-socials {
  display: flex; justify-content: center; gap: 24px; padding: 24px;
}
.social-circle {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; text-decoration: none; color: #fff;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.social-circle:hover {
  background: var(--accent);
  transform: translateZ(30px) scale(1.1);
  box-shadow: 0 10px 20px rgba(0,0,0,0.4), 0 0 20px var(--glow-1);
}

/* Form Styles with Floating Labels */
.spatial-form {
  display: flex; flex-direction: column; gap: 28px;
}

.floating-group {
  position: relative;
}

.floating-group input,
.floating-group textarea {
  width: 100%;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 16px 16px;
  color: #fff;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s var(--ease);
}
.floating-group textarea { resize: vertical; }

.floating-group input:focus,
.floating-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(0,0,0,0.4);
}

/* The label acts as the placeholder, except for textarea which has a real placeholder */
.floating-group label {
  position: absolute;
  left: 16px;
  top: 16px;
  color: var(--text-muted);
  pointer-events: none;
  transition: all 0.3s var(--ease);
  font-size: 1rem;
}

/* Hide label visually if using placeholder, or float it up if input is not empty/focused */
.floating-group input:focus ~ label,
.floating-group input:not(:placeholder-shown) ~ label {
  top: -10px;
  left: 12px;
  font-size: 0.75rem;
  background: #111; /* Matching dark bg to break line cleanly */
  padding: 0 8px;
  color: var(--accent);
  border-radius: 4px;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Button */
.btn-glass-submit {
  padding: 16px 32px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  margin-top: 12px;
}
.btn-glass-submit:hover {
  background: var(--gradient);
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.4);
}

/* ========================================================
   FOOTER
   ======================================================== */
#footer {
  padding: 24px 0;
  border-top: 1px solid var(--border);
  font-size: .8rem; color: var(--text-dim);
  position: relative; z-index: 5;
  background: var(--bg);
  scroll-snap-align: none;
  min-height: auto;
}
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--text-muted); transition: color var(--duration) var(--ease); }
.footer-links a:hover { color: var(--white); }

/* ========================================================
   SCROLL REVEAL (applied by JS)
   ======================================================== */
.reveal {
  opacity: 0; transform: translateY(32px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.reveal.visible {
  opacity: 1; transform: translateY(0);
}

/* ========================================================
   MOBILE RESPONSIVE
   ======================================================== */
@media (max-width: 900px) {
  .nav-pill { display: none; }
  .nav-actions .btn-primary { display: none; }
  .mobile-menu-btn {
    display: flex; flex-direction: column; gap: 5px;
    background: none; border: none; cursor: pointer; padding: 4px;
    position: relative;
    z-index: 201;
  }
  .mobile-menu-btn span {
    display: block; width: 22px; height: 2px; background: var(--white);
    border-radius: 2px; transition: all var(--duration) var(--ease);
  }
  .mobile-menu-btn.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
  .mobile-menu-btn.open span:nth-child(2) { opacity: 0; }
  .mobile-menu-btn.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

  /* Mobile nav overlay */
  .nav-pill.mobile-open {
    display: flex; flex-direction: column;
    position: fixed; inset: 0;
    background: #000000 !important;
    padding: 100px 32px 40px; gap: 8px;
    border-radius: 0; border: none;
    z-index: 200;
    animation: fadeInUp .3s var(--ease);
  }
  .nav-pill.mobile-open .nav-link {
    font-size: 1.2rem; padding: 14px 20px;
    border-bottom: 1px solid var(--border);
  }

  /* Hide fixed Spline canvas when mobile menu is open */
  body.menu-open .spline-bg,
  body.menu-open .hero-overlay,
  body.menu-open .hero-spotlight,
  body.menu-open .hero-content,
  body.menu-open .scroll-indicator {
    visibility: hidden;
  }
  body.menu-open {
    overflow: hidden;
  }

  .about-overlay-content { max-width: 100%; padding: 0 16px; }
  .about-text { padding: 28px; }
  
  /* Education Mobile */
  .education-3d-bg {
    top: 50%; left: 50%;
    right: auto; bottom: auto;
    width: 100%; height: 55vh;
    transform: translate(-50%, -50%);
    border-radius: 0;
    overflow: hidden;
  }
  .edu-grid {
    flex-direction: row;
    align-items: stretch;
    gap: 12px;
    flex-wrap: nowrap;
  }
  .info-card {
    width: 50%;
    padding: 12px 10px;
  }
  .info-card h3 { font-size: 0.8rem; margin-bottom: 6px; }
  .education-list li { margin-bottom: 8px; line-height: 1.3; }
  .education-list li strong { font-size: 0.7rem; }
  .education-list li span, .cert-list li { font-size: 0.65rem; padding: 2px 0; line-height: 1.3; }
  .card-icon { font-size: 1rem; margin-bottom: 6px; }

  .project-showcase { grid-template-columns: 1fr; }
  .project-visual { order: -1; }
  
  /* Convert MacBook to iPhone 17 */
  .device-mockup {
    aspect-ratio: 9 / 18; /* Slightly shorter height */
    max-width: 350px;
    margin: 0 auto;
    border-radius: 40px;
    padding: 6px; /* Thinner bezels */
    box-shadow: 0 20px 40px rgba(0,0,0,0.5), inset 0 0 0 4px #222;
  }
  .device-base { display: none; } /* Hide MacBook base */
  .device-screen { border-radius: 32px; }
  
  /* Dynamic Island */
  .device-notch {
    top: 24px;
    width: 90px;
    height: 24px;
    border-radius: 20px;
    background: #000;
  }
  .skills-slider-wrapper { height: 40vh; min-height: 280px; margin-top: 20px; }
  .skills-slider-inner { width: 110px; height: 160px; }
  
  /* Spatial UI Mobile Overrides */
  .spatial-contact { padding: 60px 0; }
  .spatial-container { grid-template-columns: 1fr; gap: 24px; perspective: none; }
  .spatial-left, .spatial-right { transform: none !important; }
  .spatial-title { font-size: 1.6rem; }
  
  .glass-panel { padding: 20px; border-radius: 16px; }
  .panel-header { padding: 16px; }
  .panel-socials { gap: 16px; padding: 16px; }
  .social-circle { width: 48px; height: 48px; font-size: 1.2rem; }
  
  .spatial-form { gap: 20px; }
  .floating-group input, .floating-group textarea { padding: 12px; font-size: 0.9rem; border-radius: 8px; }
  .floating-group label { left: 12px; top: 12px; font-size: 0.9rem; }
  .floating-group input:focus ~ label, .floating-group input:not(:placeholder-shown) ~ label { top: -8px; left: 8px; font-size: 0.7rem; }
  .btn-glass-submit { padding: 12px 24px; font-size: 0.9rem; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 2rem; }
  #navbar { padding: 0 16px; }
}
