@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@300;400;500&display=swap');

:root {
  /* Colors */
  --bg-deep: #060212;
  --bg-dark: #120524;
  --violet-dark: #1a0b2e;
  --violet: #4c1d95;
  --violet-light: #7c3aed;
  --cyan-dark: #0891b2;
  --cyan: #22d3ee;
  --cyan-light: #67e8f9;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  
  /* Fonts */
  --font-display: 'Orbitron', sans-serif;
  --font-body: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Misc */
  --glow-cyan: 0 0 10px rgba(34, 211, 238, 0.5), 0 0 20px rgba(34, 211, 238, 0.3);
  --glow-violet: 0 0 10px rgba(124, 58, 237, 0.5), 0 0 20px rgba(124, 58, 237, 0.3);
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  cursor: none; /* Custom cursor */
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg-deep);
  color: var(--text-main);
}

body {
  font-family: var(--font-body);
  overflow-x: hidden;
  background-color: transparent;
}

body.loading {
  overflow: hidden;
}

a, button {
  text-decoration: none;
  color: inherit;
  background: none;
  border: none;
  outline: none;
  cursor: none;
}

ul {
  list-style: none;
}

/* ==========================================================================
   CUSTOM CURSOR
   ========================================================================== */
#cursorDot {
  position: fixed;
  top: 0; left: 0;
  width: 6px; height: 6px;
  background-color: var(--cyan);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 8px var(--cyan);
  transition: width 0.2s, height 0.2s, background-color 0.2s;
}

#cursorRing {
  position: fixed;
  top: 0; left: 0;
  width: 30px; height: 30px;
  border: 1px solid rgba(34, 211, 238, 0.4);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s, border-color 0.3s;
  box-shadow: 0 0 15px rgba(34, 211, 238, 0.1) inset;
}

#cursorDot.hover {
  width: 10px; height: 10px;
  background-color: var(--violet-light);
  box-shadow: var(--glow-violet);
}

#cursorRing.hover {
  width: 50px; height: 50px;
  border-color: var(--violet-light);
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.2) inset;
}

/* ==========================================================================
   PRELOADER
   ========================================================================== */
#preloader {
  position: fixed;
  inset: 0;
  background-color: var(--bg-deep);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.pre-inner {
  text-align: center;
  width: 100%;
  max-width: 400px;
  padding: 20px;
}

.pre-logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 4px;
  color: var(--cyan);
  text-shadow: var(--glow-cyan);
  margin-bottom: 20px;
  animation: pulseOpacity 2s infinite;
}

.pre-status {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 2px;
  margin-bottom: 15px;
}

.pre-bar-wrap {
  width: 100%;
  height: 2px;
  background-color: rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
  border-radius: 2px;
}

.pre-bar {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--violet-light), var(--cyan));
  box-shadow: var(--glow-cyan);
  transition: width 0.3s ease;
}

.pre-pct {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--cyan-light);
  margin-top: 15px;
  letter-spacing: 1px;
}

@keyframes pulseOpacity {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ==========================================================================
   3D CANVAS BACKGROUND
   ========================================================================== */
#galaxyCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
}

/* ==========================================================================
   HUD OVERLAY
   ========================================================================== */
#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: rgba(34, 211, 238, 0.6);
  letter-spacing: 2px;
}

.hud-tl, .hud-tr, .hud-bl, .hud-br {
  position: absolute;
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hud-tl { top: 0; left: 0; }
.hud-tr { top: 0; right: 0; align-items: flex-end; }
.hud-bl { bottom: 0; left: 0; }
.hud-br { bottom: 0; right: 0; align-items: flex-end; }

.hud-corner-line {
  width: 30px; height: 30px;
  border: 1px solid rgba(34, 211, 238, 0.3);
  margin-bottom: 15px;
}

.hud-tl .hud-corner-line { border-right: none; border-bottom: none; }
.hud-tr .hud-corner-line { border-left: none; border-bottom: none; margin-bottom: 15px; align-self: flex-end; }
.hud-bl .hud-corner-line { border-right: none; border-top: none; margin-top: 15px; margin-bottom: 0;}
.hud-br .hud-corner-line { border-left: none; border-top: none; margin-top: 15px; margin-bottom: 0; align-self: flex-end;}

.hud-item {
  text-shadow: 0 0 5px rgba(34, 211, 238, 0.3);
}

.hud-green {
  color: #10b981;
  text-shadow: 0 0 5px rgba(16, 185, 129, 0.5);
}

/* Hide HUD on small screens */
@media (max-width: 768px) {
  #hud { display: none; }
}

/* ==========================================================================
   SCROLL PROGRESS
   ========================================================================== */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 2px;
  background: rgba(255, 255, 255, 0.05);
  z-index: 1000;
}
.scroll-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--violet-light), var(--cyan));
  box-shadow: var(--glow-cyan);
}

/* ==========================================================================
   HEADER
   ========================================================================== */
#header {
  position: fixed;
  top: 0; left: 0; width: 100%;
  padding: 20px 40px;
  z-index: 200;
  transition: background-color 0.4s ease, backdrop-filter 0.4s ease, padding 0.4s ease;
}

#header.scrolled {
  padding: 15px 40px;
  background-color: rgba(6, 2, 18, 0.7);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(124, 58, 237, 0.2);
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.bracket { color: var(--cyan); }
.logo-sub {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 3px;
  border: 1px solid rgba(124, 58, 237, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
}

.desktop-nav .nav-links {
  display: flex;
  gap: 40px;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  position: relative;
  padding: 5px 0;
  transition: color 0.3s ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0%; height: 1px;
  background: var(--cyan);
  transition: width 0.3s ease;
  box-shadow: var(--glow-cyan);
}

.nav-links a:hover, .nav-links a.active {
  color: var(--text-main);
}

.nav-links a:hover::after, .nav-links a.active::after {
  width: 100%;
}

.nav-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.status-dot {
  width: 8px; height: 8px;
  background-color: var(--cyan);
  border-radius: 50%;
  box-shadow: var(--glow-cyan);
  animation: blink 2s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 30px;
  z-index: 201;
}

.menu-toggle span {
  width: 100%; height: 2px;
  background-color: var(--text-main);
  transition: all 0.3s ease;
}

@media (max-width: 992px) {
  .nav-status, .desktop-nav { display: none; }
  .menu-toggle { display: flex; }
  
  /* Fix: Remove backdrop filter when menu is open so it doesn't clip fixed children */
  #header.menu-open {
    backdrop-filter: none !important;
    background: transparent !important;
    border-bottom: none !important;
  }
  
  .desktop-nav.open {
    display: flex;
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(6, 2, 18, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 200;
  }
  
  .desktop-nav.open .nav-links {
    flex-direction: column;
    align-items: center;
    gap: 40px;
  }
  
  .desktop-nav.open .nav-links a {
    font-size: 1.8rem;
    font-family: var(--font-display);
    letter-spacing: 4px;
  }
  
  .menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); background-color: var(--cyan); }
  .menu-toggle.open span:nth-child(2) { opacity: 0; }
  .menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); background-color: var(--cyan); }
}

/* ==========================================================================
   TYPOGRAPHY & UTILITIES
   ========================================================================== */
.section {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  min-height: 100vh;
  height: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  z-index: 10;
  overflow-y: auto;
  overflow-x: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.8s ease, visibility 0.8s ease;
  box-sizing: border-box;
}

.section.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.sec-pad {
  padding: 100px 40px;
}

.sec-inner {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.sec-dark {
  background: linear-gradient(180deg, rgba(6,2,18,0) 0%, rgba(18,5,36,0.6) 50%, rgba(6,2,18,0) 100%);
  backdrop-filter: blur(5px);
  border-top: 1px solid rgba(124, 58, 237, 0.1);
  border-bottom: 1px solid rgba(124, 58, 237, 0.1);
}

.sec-tag {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--cyan);
  letter-spacing: 3px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sec-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.1;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.sec-body {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 600px;
  margin-bottom: 30px;
}

.accent-text {
  background: linear-gradient(90deg, var(--cyan-light), var(--violet-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px rgba(124, 58, 237, 0.3);
}

.cyan { color: var(--cyan); text-shadow: var(--glow-cyan); }
.violet { color: var(--violet-light); text-shadow: var(--glow-violet); }
.text-center { text-align: center; }

/* Buttons */
.hero-actions { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 30px; }

.btn-primary, .btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 30px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.btn-primary {
  background: linear-gradient(135deg, var(--violet), var(--cyan-dark));
  color: #fff;
  border: 1px solid rgba(34, 211, 238, 0.3);
  box-shadow: 0 5px 15px rgba(76, 29, 149, 0.4);
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.btn-primary:hover::before { left: 100%; }
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(34, 211, 238, 0.4);
  border-color: var(--cyan);
}

.btn-ghost {
  background: rgba(124, 58, 237, 0.05);
  color: var(--text-main);
  border: 1px solid rgba(124, 58, 237, 0.3);
  backdrop-filter: blur(5px);
}

.btn-ghost:hover {
  background: rgba(124, 58, 237, 0.15);
  border-color: var(--cyan);
  box-shadow: var(--glow-cyan);
  transform: translateY(-3px);
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
#hero {
  align-items: center;
  text-align: center;
}

.hero-content {
  max-width: 900px;
  padding: 0 20px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: 30px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 2px;
  margin-bottom: 30px;
  background: rgba(18, 5, 36, 0.5);
  backdrop-filter: blur(5px);
}

.eyebrow-dot {
  width: 6px; height: 6px;
  background: var(--cyan);
  border-radius: 50%;
  box-shadow: var(--glow-cyan);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 7vw, 6rem);
  font-weight: 900;
  line-height: 1.05;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
}

.hero-tagline {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  color: var(--text-main);
  margin-bottom: 15px;
  font-weight: 300;
}

.hero-tagline em {
  font-style: normal;
  color: var(--cyan);
  text-shadow: var(--glow-cyan);
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 650px;
  margin-bottom: 20px;
}

.hero-metrics {
  display: flex;
  gap: 40px;
  margin-top: 50px;
  padding-top: 30px;
  border-top: 1px solid rgba(124, 58, 237, 0.2);
  justify-content: center;
}

.metric { display: flex; flex-direction: column; align-items: center; }
.m-num { font-family: var(--font-display); font-size: 2.5rem; font-weight: 700; color: var(--text-main); }
.m-unit { font-family: var(--font-mono); font-size: 1rem; color: var(--cyan); }
.m-label { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-muted); letter-spacing: 2px; margin-top: 5px; }
.metric-sep { color: rgba(124, 58, 237, 0.3); font-size: 2rem; font-weight: 300; }

@media (max-width: 768px) {
  .hero-metrics { gap: 20px; }
  .metric-sep { display: none; }
}

/* ==========================================================================
   MARQUEE
   ========================================================================== */
.marquee-wrap {
  width: 100%;
  padding: 20px 0;
  background: rgba(18, 5, 36, 0.6);
  border-top: 1px solid rgba(124, 58, 237, 0.1);
  border-bottom: 1px solid rgba(124, 58, 237, 0.1);
  overflow: hidden;
  display: flex;
  white-space: nowrap;
}

.marquee-track {
  display: flex;
  width: fit-content;
  animation: scrollMarquee 30s linear infinite;
}

.marquee-inner {
  display: flex;
  gap: 50px;
  padding-right: 50px;
}

.marquee-inner span {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 3px;
  color: var(--text-muted);
}

@keyframes scrollMarquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ==========================================================================
   ABOUT
   ========================================================================== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: center;
}

.about-stats {
  display: flex;
  gap: 20px;
  margin-top: 40px;
}

.astat {
  padding: 20px;
  background: rgba(18, 5, 36, 0.5);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 8px;
  min-width: 120px;
  text-align: center;
  transition: var(--transition);
}

.astat:hover {
  border-color: var(--cyan);
  box-shadow: 0 5px 15px rgba(34, 211, 238, 0.1);
  transform: translateY(-5px);
}

.astat-num { font-family: var(--font-display); font-size: 2rem; font-weight: 700; margin-bottom: 5px; }
.astat-label { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

.about-right {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.profile-frame {
  position: relative;
  width: 350px; height: 350px;
  border-radius: 50%;
  display: flex; justify-content: center; align-items: center;
}

.profile-img {
  width: 100%; height: 100%;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  z-index: 2;
  border: 2px solid rgba(124, 58, 237, 0.4);
}

.profile-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(80%) contrast(1.1);
  transition: var(--transition);
}

.profile-frame:hover .profile-img img {
  filter: grayscale(0%) contrast(1.1);
}

.profile-ring {
  position: absolute;
  inset: -15px;
  border-radius: 50%;
  border: 1px dashed rgba(34, 211, 238, 0.4);
  animation: spin 20s linear infinite;
  z-index: 1;
}

.profile-glow {
  position: absolute;
  inset: -30px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.2) 0%, transparent 70%);
  z-index: 0;
  animation: pulseGlow 4s alternate infinite;
}

.about-badge {
  margin-top: 30px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: rgba(18, 5, 36, 0.8);
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: 30px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 2px;
}

.badge-dot {
  width: 8px; height: 8px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
}

@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes pulseGlow {
  0% { transform: scale(0.95); opacity: 0.5; }
  100% { transform: scale(1.05); opacity: 1; }
}

@media (max-width: 992px) {
  .about-grid { grid-template-columns: 1fr; }
  .profile-frame { width: 280px; height: 280px; }
  .about-left { text-align: center; }
  .sec-body { margin: 0 auto 30px auto; }
  .about-stats { justify-content: center; flex-wrap: wrap; }
}

/* ==========================================================================
   SKILLS
   ========================================================================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 25px;
  margin-bottom: 50px;
}

.skill-card {
  padding: 30px 25px;
  background: rgba(18, 5, 36, 0.6);
  border: 1px solid rgba(124, 58, 237, 0.15);
  border-radius: 12px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.skill-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 150px; height: 150px;
  background: radial-gradient(circle at top right, rgba(34, 211, 238, 0.1), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
}

.skill-card:hover {
  transform: translateY(-10px);
  border-color: rgba(34, 211, 238, 0.4);
  box-shadow: 0 10px 30px rgba(18, 5, 36, 0.8), inset 0 0 20px rgba(34, 211, 238, 0.05);
}

.skill-card:hover::before { opacity: 1; }

.skill-icon {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  color: var(--cyan);
  margin-bottom: 20px;
}

.skill-card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 15px;
  letter-spacing: 1px;
}

.skill-card p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.tech-cat {
  background: rgba(18, 5, 36, 0.4);
  border: 1px solid rgba(124, 58, 237, 0.1);
  padding: 20px;
  border-radius: 8px;
}

.tcat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.tcat-head span { color: var(--violet-light); font-size: 1.2rem; }
.tcat-head h4 { font-family: var(--font-mono); font-size: 0.85rem; letter-spacing: 2px; text-transform: uppercase; }

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tech-tags span {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 5px 10px;
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 4px;
  color: var(--text-muted);
  transition: var(--transition);
}

.tech-tags span:hover {
  background: var(--violet-light);
  color: #fff;
  border-color: var(--violet-light);
  box-shadow: var(--glow-violet);
}

/* ==========================================================================
   PORTFOLIO
   ========================================================================== */
.filter-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 40px;
}

.filter-btn {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 10px 20px;
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: 30px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  transition: var(--transition);
}

.filter-btn:hover {
  color: var(--text-main);
  border-color: var(--cyan);
}

.filter-btn.active {
  background: linear-gradient(135deg, var(--violet), var(--cyan-dark));
  color: #fff;
  border-color: var(--cyan);
  box-shadow: 0 5px 15px rgba(34, 211, 238, 0.2);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: 30px;
  width: 100%;
}

.portfolio-card {
  background: rgba(18, 5, 36, 0.6);
  border: 1px solid rgba(124, 58, 237, 0.15);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  transition: all 0.4s ease;
}

.portfolio-card:hover {
  transform: translateY(-10px) scale(1.02);
  border-color: var(--cyan);
  box-shadow: 0 15px 35px rgba(6, 2, 18, 0.8), 0 0 15px rgba(34, 211, 238, 0.2);
}

.card-img {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
}

.card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(40%);
  transition: transform 0.6s ease, filter 0.6s ease;
}

.portfolio-card:hover .card-img img {
  transform: scale(1.05);
  filter: grayscale(0%);
}

.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(6, 2, 18, 0.9), transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.portfolio-card:hover .card-overlay { opacity: 1; }

.card-overlay span {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 10px 20px;
  background: rgba(34, 211, 238, 0.2);
  border: 1px solid var(--cyan);
  color: #fff;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
  transform: translateY(20px);
  transition: transform 0.4s ease;
  backdrop-filter: blur(5px);
}

.portfolio-card:hover .card-overlay span { transform: translateY(0); }

.card-body {
  padding: 25px;
  position: relative;
}

.card-num {
  position: absolute;
  top: -35px; right: 20px;
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 900;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.1);
  transition: -webkit-text-stroke 0.4s;
  z-index: 10;
}

.portfolio-card:hover .card-num {
  -webkit-text-stroke: 1px var(--cyan);
}

.card-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--cyan);
  letter-spacing: 2px;
  margin-bottom: 10px;
  display: block;
}

.card-body h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 10px;
  transition: color 0.3s;
}

.portfolio-card:hover .card-body h3 { color: var(--cyan-light); }

.card-body p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================================================
   CONTACT
   ========================================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: center;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 25px;
  margin-top: 40px;
}

.cinfo {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-left: 20px;
  border-left: 2px solid rgba(124, 58, 237, 0.3);
  transition: border-color 0.3s;
}

.cinfo:hover { border-color: var(--cyan); }
.cinfo-label { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); letter-spacing: 2px; text-transform: uppercase; }
.cinfo-val { font-size: 1.1rem; font-weight: 500; }
a.cinfo-val { transition: var(--transition); }
a.cinfo-val:hover { color: var(--cyan-light); text-shadow: var(--glow-cyan); }

.contact-form {
  background: rgba(18, 5, 36, 0.5);
  padding: 40px;
  border-radius: 12px;
  border: 1px solid rgba(124, 58, 237, 0.2);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  gap: 25px;
  box-shadow: 0 20px 40px rgba(6, 2, 18, 0.5);
}

.input-group { position: relative; }

.input-group input, .input-group textarea {
  width: 100%;
  padding: 12px 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 1.05rem;
  outline: none;
  transition: border-color 0.3s;
  resize: none;
}

.input-group input:focus, .input-group textarea:focus { border-bottom-color: var(--cyan); }

.input-group label {
  position: absolute;
  top: 12px; left: 0;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  pointer-events: none;
  transition: all 0.3s ease;
}

.input-group input:focus ~ label, .input-group input:not(:placeholder-shown) ~ label,
.input-group textarea:focus ~ label, .input-group textarea:not(:placeholder-shown) ~ label {
  top: -15px;
  font-size: 0.75rem;
  color: var(--cyan);
  letter-spacing: 1px;
}

.input-group::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0%; height: 2px;
  background: var(--cyan);
  box-shadow: var(--glow-cyan);
  transition: width 0.4s ease;
}

.input-group:focus-within::after { width: 100%; }

.contact-form .btn-primary { width: 100%; padding: 15px; margin-top: 10px; }

@media (max-width: 992px) {
  .contact-grid { grid-template-columns: 1fr; }
  .contact-form { padding: 30px 20px; }
}

/* ==========================================================================
   FOOTER & EXTRAS
   ========================================================================== */
footer {
  padding: 40px 20px;
  background: var(--bg-dark);
  border-top: 1px solid rgba(124, 58, 237, 0.15);
  position: relative;
  z-index: 10;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-logo { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; letter-spacing: 2px; }
.footer-copy { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted); }
.footer-social { display: flex; gap: 15px; }

.footer-social a {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: 50%;
  font-family: var(--font-display); font-size: 0.9rem;
  transition: var(--transition);
}

.footer-social a:hover {
  border-color: var(--cyan);
  color: var(--bg-deep);
  background: var(--cyan);
  box-shadow: var(--glow-cyan);
  transform: translateY(-3px);
}

.floating-dock {
  position: fixed;
  bottom: 30px; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 15px;
  padding: 10px 20px;
  background: rgba(6, 2, 18, 0.75);
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: 50px;
  backdrop-filter: blur(10px);
  z-index: 500;
  box-shadow: 0 10px 30px rgba(6, 2, 18, 0.5);
}

.dock-item {
  width: 45px; height: 45px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.26, 1.55);
}

.dock-item:hover {
  background: var(--cyan);
  color: var(--bg-deep);
  transform: translateY(-10px) scale(1.1);
  box-shadow: var(--glow-cyan);
}

.back-to-top {
  position: fixed;
  bottom: 30px; right: 30px;
  width: 50px; height: 50px;
  border-radius: 50%;
  background: rgba(6, 2, 18, 0.8);
  border: 1px solid rgba(124, 58, 237, 0.3);
  color: var(--cyan);
  font-size: 1.5rem;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: var(--transition);
  z-index: 500;
  backdrop-filter: blur(5px);
}

.back-to-top.visible { opacity: 1; visibility: visible; pointer-events: auto; }
.back-to-top:hover { background: var(--cyan); color: var(--bg-deep); transform: translateY(-5px); box-shadow: var(--glow-cyan); }

/* ==========================================================================
   MODAL
   ========================================================================== */
.modal {
  position: fixed; inset: 0;
  background: rgba(6, 2, 18, 0.9);
  backdrop-filter: blur(10px);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; visibility: hidden;
  transition: var(--transition);
}

.modal.active { opacity: 1; visibility: visible; }

.modal-content {
  background: rgba(18, 5, 36, 0.9);
  border: 1px solid rgba(34, 211, 238, 0.3);
  border-radius: 12px;
  max-width: 900px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  position: relative;
  transform: translateY(30px) scale(0.95);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 30px 60px rgba(0,0,0,0.5), 0 0 20px rgba(34, 211, 238, 0.1);
}

.modal.active .modal-content { transform: translateY(0) scale(1); }

.close-modal {
  position: absolute;
  top: 20px; right: 20px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  z-index: 10;
  transition: var(--transition);
}

.close-modal:hover { background: var(--cyan); color: var(--bg-deep); border-color: var(--cyan); transform: rotate(90deg); }

.modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.modal-img-wrap {
  background: #000;
  display: flex; align-items: center; justify-content: center;
  min-height: 300px;
}

.modal-img-wrap img { width: 100%; height: 100%; object-fit: cover; }

.modal-info {
  padding: 40px;
  display: flex; flex-direction: column; justify-content: center;
}

.modal-info h2 { font-family: var(--font-display); font-size: 2rem; color: var(--cyan-light); margin-bottom: 20px; }
.modal-info p { font-size: 1.05rem; color: var(--text-muted); line-height: 1.7; margin-bottom: 30px; }

@media (max-width: 768px) {
  .modal-body { grid-template-columns: 1fr; }
  .modal-img-wrap { min-height: 200px; }
  .modal-info { padding: 20px; }
}

/* ==========================================================================
   SCROLLBAR
   ========================================================================== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: rgba(124, 58, 237, 0.5); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--cyan); }
::selection { background: rgba(34, 211, 238, 0.3); color: #fff; }

/* REVEAL ANIMATIONS */
.reveal { opacity: 0; transform: translateY(40px); transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal.active { opacity: 1; transform: translateY(0); }

/* ==========================================================================
   WARP OVERLAY
   ========================================================================== */
#warpOverlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(34, 211, 238, 0.08) 60%, rgba(6, 2, 18, 0.95) 100%);
  transition: opacity 0.4s ease;
}

#warpOverlay.active {
  opacity: 1;
}

/* ==========================================================================
   AUDIO TOGGLE
   ========================================================================== */
.audio-toggle {
  position: fixed;
  bottom: 100px;
  right: 30px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(6, 2, 18, 0.7);
  border: 1px solid rgba(34, 211, 238, 0.3);
  color: var(--cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  backdrop-filter: blur(5px);
  transition: var(--transition);
}

.audio-toggle:hover {
  border-color: var(--cyan);
  box-shadow: var(--glow-cyan);
  transform: scale(1.1);
}

.audio-toggle.playing {
  border-color: var(--cyan);
  box-shadow: var(--glow-cyan);
  animation: audioPulse 2s infinite;
}

@keyframes audioPulse {
  0%, 100% { box-shadow: 0 0 5px rgba(34, 211, 238, 0.3); }
  50% { box-shadow: 0 0 15px rgba(34, 211, 238, 0.6); }
}


/* CLICK PING RIPPLE */
.ping-ring {
  position: fixed;
  pointer-events: none;
  border: 1px solid rgba(34, 211, 238, 0.6);
  border-radius: 50%;
  z-index: 50;
  transform: translate(-50%, -50%);
}

/* ==========================================================================
   DISCOVERY SYSTEM
   ========================================================================== */
.hud-discovery {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: rgba(34, 211, 238, 0.5);
  letter-spacing: 2px;
  pointer-events: none;
  text-shadow: 0 0 5px rgba(34, 211, 238, 0.2);
}

.discovery-notif {
  position: fixed;
  top: 80px;
  right: 30px;
  z-index: 2000;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 2px;
  padding: 12px 20px;
  background: rgba(6, 2, 18, 0.9);
  border: 1px solid var(--cyan);
  border-radius: 8px;
  color: var(--cyan-light);
  box-shadow: var(--glow-cyan), inset 0 0 20px rgba(34, 211, 238, 0.05);
  opacity: 0;
  transform: translateX(120%);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(10px);
  pointer-events: none;
  max-width: 260px;
}

.discovery-notif.show {
  opacity: 1;
  transform: translateX(0);
}

/* ==========================================================================
   TOUR BUTTON & OVERLAY
   ========================================================================== */
.tour-btn {
  position: fixed;
  bottom: 30px;
  left: 30px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 2px;
  padding: 10px 16px;
  background: rgba(6, 2, 18, 0.7);
  border: 1px solid rgba(124, 58, 237, 0.4);
  border-radius: 30px;
  color: var(--text-muted);
  z-index: 500;
  backdrop-filter: blur(5px);
  transition: var(--transition);
  cursor: none;
}

.tour-btn:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: var(--glow-cyan);
}

.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 8000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 80px;
}

.tour-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.tour-caption {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
  max-width: 500px;
  padding: 20px 30px;
  background: rgba(6, 2, 18, 0.7);
  border: 1px solid rgba(34, 211, 238, 0.2);
  border-radius: 8px;
  backdrop-filter: blur(10px);
  letter-spacing: 1px;
  line-height: 1.6;
  text-shadow: 0 0 10px rgba(34, 211, 238, 0.3);
  margin-bottom: 20px;
}

.tour-skip {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 2px;
  padding: 8px 16px;
  background: rgba(124, 58, 237, 0.2);
  border: 1px solid rgba(124, 58, 237, 0.4);
  border-radius: 4px;
  color: var(--text-muted);
  transition: var(--transition);
  cursor: none;
  pointer-events: auto;
}

.tour-skip:hover {
  background: rgba(124, 58, 237, 0.4);
  color: var(--text-main);
}

.tour-progress {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.tour-prog-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--violet-light), var(--cyan));
  box-shadow: var(--glow-cyan);
  transition: width 0.3s ease;
}

/* ==========================================================================
   TEXT CONTRAST IMPROVEMENTS
   ========================================================================== */
.hero-title .title-line,
.sec-title {
  text-shadow: 0 2px 20px rgba(6, 2, 18, 0.8);
}

.hero-tagline,
.hero-sub,
.sec-body {
  text-shadow: 0 1px 10px rgba(6, 2, 18, 0.6);
}

/* ==========================================================================
   REDUCED MOTION SUPPORT
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
  .profile-ring { animation: none; }
  .profile-glow { animation: none; }
  .status-dot { animation: none; }
  .pre-logo { animation: none; }
  .reveal { transition: none; opacity: 1; transform: none; }
  .reveal.active { opacity: 1; transform: none; }
}

/* ==========================================================================
   MOBILE TOUCH OPTIMIZATIONS — COMPREHENSIVE & POLISHED
   ========================================================================== */
@media (max-width: 768px) {

  /* Prevent ALL horizontal overflow */
  html, body {
    overflow-x: hidden;
    max-width: 100vw;
  }

  /* Cursor hide on touch */
  #cursorDot, #cursorRing { display: none !important; }

  /* Section - full scroll on mobile, not clipped */
  .section {
    position: relative;
    display: none; /* Hide inactive sections completely from flow */
    min-height: 100svh;
    height: auto;
    justify-content: flex-start;
    padding-top: calc(80px + env(safe-area-inset-top, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    overflow-y: visible; /* Let body handle scrolling */
  }

  .section.active {
    display: flex; /* Only show active section */
  }

  /* Section wrapper must not clip, adjust padding for breathing room */
  .sec-pad { padding: 40px 20px 80px; }
  .sec-inner { padding: 0; width: 100%; max-width: 100%; overflow: hidden; }

  /* Hero */
  .hero-content { padding: 0 10px; margin-top: 20px; }
  .hero-eyebrow { font-size: 0.65rem; margin-bottom: 15px; }
  .hero-title { font-size: clamp(2.5rem, 12vw, 3.5rem); line-height: 1.1; margin-bottom: 20px; }
  .hero-tagline { font-size: 1.1rem; line-height: 1.4; margin-bottom: 15px; }
  .hero-sub { font-size: 0.95rem; line-height: 1.5; margin-bottom: 30px; opacity: 0.8; }
  .hero-actions { flex-direction: column; align-items: stretch; gap: 15px; padding: 0 10px; }
  .btn-primary, .btn-ghost { width: 100%; max-width: none; text-align: center; padding: 14px 20px; font-size: 0.85rem; border-radius: 30px; }
  .hero-metrics { gap: 15px; flex-wrap: wrap; justify-content: center; margin-top: 40px; padding: 20px; background: rgba(18, 5, 36, 0.4); border-radius: 16px; border: 1px solid rgba(124, 58, 237, 0.1); backdrop-filter: blur(10px); }
  .metric-sep { display: none; }
  .metric { flex: 1; min-width: 30%; }
  .m-num { font-size: 1.8rem; }
  .m-label { font-size: 0.6rem; }

  /* Section Titles */
  .sec-tag { font-size: 0.7rem; margin-bottom: 15px; }
  .sec-title { font-size: 2.2rem; line-height: 1.2; margin-bottom: 20px; }

  /* About */
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .about-left { text-align: center; order: 2; }
  .about-right { order: 1; }
  .profile-frame { width: 240px; height: 240px; margin: 0 auto; }
  .about-stats { justify-content: center; flex-wrap: wrap; gap: 15px; }
  .astat { min-width: calc(50% - 15px); padding: 20px 15px; border-radius: 16px; background: rgba(18, 5, 36, 0.5); backdrop-filter: blur(5px); }
  .astat-num { font-size: 1.5rem; }
  .sec-body { max-width: 100%; margin: 0 0 25px 0; font-size: 0.95rem; line-height: 1.6; }

  /* Skills */
  .skills-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 40px;
  }
  .skill-card { padding: 25px 20px; border-radius: 16px; }
  .skill-icon { font-size: 1.5rem; margin-bottom: 15px; }
  .tech-grid {
    grid-template-columns: 1fr; /* Stack on very small screens */
    gap: 15px;
  }
  .tech-cat { padding: 15px; border-radius: 12px; }
  .tcat-head h4 { font-size: 0.8rem; }
  .tech-tags span { font-size: 0.75rem; padding: 6px 12px; }

  /* Portfolio grid - single column */
  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 25px;
  }
  .portfolio-card { max-width: 100%; border-radius: 16px; }
  .card-body { padding: 20px; }
  .filter-tabs { gap: 10px; margin-bottom: 30px; }
  .filter-btn { padding: 10px 16px; font-size: 0.75rem; letter-spacing: 1px; }

  /* Contact */
  .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .contact-form { padding: 30px 20px; border-radius: 16px; }
  .cinfo { padding-left: 15px; font-size: 0.9rem; }
  .cinfo-label { font-size: 0.65rem; }

  /* Nav */
  #header { padding: 15px 20px; background: rgba(6, 2, 18, 0.85); backdrop-filter: blur(15px); border-bottom: 1px solid rgba(124, 58, 237, 0.1); }
  .nav-logo { font-size: 1.1rem; }
  .logo-sub { font-size: 0.5rem; }

  /* HUD hide completely on mobile */
  #hud { display: none; }

  /* Fixed elements reposition */
  .tour-btn { display: none; }
  .floating-dock {
    bottom: calc(15px + env(safe-area-inset-bottom, 0px));
    padding: 10px 20px;
    gap: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    max-width: calc(100vw - 40px);
    border-radius: 30px;
    background: rgba(18, 5, 36, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(124, 58, 237, 0.3);
  }
  .dock-item { width: 35px; height: 35px; }
  
  .back-to-top { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); right: 15px; width: 45px; height: 45px; border-radius: 50%; }
  .audio-toggle { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); right: 75px; width: 45px; height: 45px; border-radius: 50%; }
  .discovery-notif { right: 15px; top: calc(75px + env(safe-area-inset-top, 0px)); font-size: 0.7rem; max-width: calc(100vw - 30px); border-radius: 12px; }

  /* Footer */
  .footer-inner { flex-direction: column; text-align: center; gap: 20px; padding: 40px 20px; }
  .footer-logo { font-size: 1.2rem; }

  /* Modal full-screen on mobile */
  .modal-content { max-height: calc(100vh - 40px); border-radius: 16px; margin: 20px; width: calc(100% - 40px); }
  .modal-body { grid-template-columns: 1fr; }
  .modal-img-wrap { min-height: 200px; border-radius: 16px 16px 0 0; }
  .modal-info { padding: 25px 20px; }
  .modal-info h2 { font-size: 1.6rem; }
  .modal-info p { font-size: 0.95rem; }
  .close-modal { top: 15px; right: 15px; background: rgba(0,0,0,0.5); border-radius: 50%; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; }

  /* Marquee */
  .marquee-inner { gap: 40px; }
  .marquee-inner span { font-size: 0.8rem; }

  /* Scroll progress visible */
  .scroll-progress { height: 4px; top: calc(env(safe-area-inset-top, 0px)); }
}

/* Extra small phones */
@media (max-width: 390px) {
  .hero-title { font-size: 2.2rem; }
  .sec-title { font-size: 1.8rem; }
  .about-stats { flex-direction: column; align-items: center; }
  .astat { width: 100%; max-width: none; }
  .tech-grid { grid-template-columns: 1fr; }
}


/* ─── GALAXY-ANIM 3D FOUNDATIONS ─── */
.section { transform-style: preserve-3d; perspective: 1200px; }
.hero-content,
.sec-inner,
.about-grid,
.contact-grid { transform-style: preserve-3d; }

/* Profile frame depth animation support */
.profile-frame { transform-style: preserve-3d; }

/* Ensure sections have transparent background for canvas to show through */
#hero, #about, #philosophy, #vision-mission, #skills, #portfolio, #contact {
  background: transparent;
}

/* Allow overflow for orbital elements in philosophy */
#philosophy { overflow: visible; }

/* Values cluster perspective container */
.val-cluster { perspective: 800px; transform-style: preserve-3d; }
