/* Reset & Base Setup */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-color: #000000;
  --text-main: #ffffff;
  --text-muted: #8b92a5;
  --accent-red: #ff4a3d;
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Syne', 'Plus Jakarta Sans', sans-serif;
}

html {
  scroll-behavior: smooth;
  overflow: hidden;
  height: 100%;
}

body {
  width: 100%;
  min-height: 100%;
  background-color: #000000;
  color: #ffffff;
  font-family: var(--font-main);
  overflow: hidden;
  user-select: none;
}

/* Enabled only after intro completes */
html.intro-finished {
  overflow-y: auto;
  height: auto;
}

body.intro-finished {
  overflow-x: hidden;
  overflow-y: auto;
}

/* =========================================
   NAVBAR (SLIDES DOWN DURING INTRO)
   ========================================= */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 5vw;
  z-index: 100;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0) 100%);
  backdrop-filter: blur(12px);
  pointer-events: auto;
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.navbar.intro-hidden {
  opacity: 0;
  transform: translateY(-40px);
  pointer-events: none;
}

.navbar.intro-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.navbar .logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 3px;
  color: #ffffff;
  text-decoration: none;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  color: #7b8396;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: color 0.25s ease;
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: #ffffff;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 100%;
  height: 2px;
  background: #ffffff;
  border-radius: 2px;
}

/* =========================================
   HERO SECTION & CANVAS
   ========================================= */
.hero-section {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  background-color: #000000;
}

#particleCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  background-color: #000000;
  cursor: crosshair;
}

.hero-foreground {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 5vw 42px 5vw;
  pointer-events: none;
}

/* =========================================
   GIANT TITLE & SMOOTH INTRO POSITIONING
   ========================================= */
.hero-center {
  position: absolute;
  left: 50%;
  text-align: center;
  pointer-events: none;
  z-index: 8;
  display: flex;
  justify-content: center;
  align-items: center;
  white-space: nowrap;
}

/* Initial Intro State: Exactly in screen center */
.hero-center.intro-center {
  top: 50%;
  bottom: auto;
  transform: translate(-50%, -50%);
  transition: top 1.1s cubic-bezier(0.16, 1, 0.3, 1), transform 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Final Resting State: Slid down to bottom behind chest */
.hero-center.in-position {
  top: calc(100vh - 8vh - 120px);
  transform: translate(-50%, 0);
}

.giant-portfolio-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 12.2vw, 10.5rem);
  font-weight: 900;
  line-height: 0.88;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  
  /* Chrome Metallic Gradient matching Hasibul Hasan's site */
  background: linear-gradient(
    180deg,
    #ffffff 0%,
    #e8ebf2 32%,
    #8e95a8 60%,
    #2c3140 85%,
    rgba(10, 12, 18, 0.25) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.9));
}

/* Scramble letter slots */
.anim-letter-slot {
  display: inline-block;
  min-width: 0;
  letter-spacing: inherit;
  font-family: inherit;
  font-weight: inherit;
}

/* =========================================
   PHYSICS INTRO: FALLING "i" WITH BOUNCE & SHADOWS
   ========================================= */
.i-letter-wrap {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 0.8vw, 12px);
  margin: 0 clamp(4px, 0.6vw, 10px);
  vertical-align: middle;
  transform-origin: center bottom;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.i-letter-wrap.dock-impact {
  transform: scale(1.1);
}

/* Floor Shadow below the landing point */
.i-floor-shadow {
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%) scale(0);
  width: clamp(40px, 4.5vw, 70px);
  height: clamp(10px, 1.2vw, 16px);
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.65) 0%, rgba(59, 130, 246, 0.35) 45%, rgba(0, 0, 0, 0) 75%);
  filter: blur(5px);
  pointer-events: none;
}

.i-floor-shadow.active-shadow {
  animation: shadowBounce 1.4s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.i-floor-shadow.bar-shadow {
  animation: barShadowBounce 1.1s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes shadowBounce {
  0% { transform: translateX(-50%) scale(0); opacity: 0; }
  35% { transform: translateX(-50%) scale(1.4); opacity: 0.9; }
  50% { transform: translateX(-50%) scale(0.6); opacity: 0.3; }
  65% { transform: translateX(-50%) scale(1.2); opacity: 0.8; }
  80% { transform: translateX(-50%) scale(0.85); opacity: 0.5; }
  100% { transform: translateX(-50%) scale(1); opacity: 0.7; }
}

@keyframes barShadowBounce {
  0% { transform: translateX(-50%) scale(0.6); opacity: 0.3; }
  45% { transform: translateX(-50%) scale(1.6); opacity: 1; }
  65% { transform: translateX(-50%) scale(0.85); opacity: 0.6; }
  85% { transform: translateX(-50%) scale(1.2); opacity: 0.85; }
  100% { transform: translateX(-50%) scale(1); opacity: 0.7; }
}

/* Dot: Falls FIRST from the top, hits floor and bounces */
.i-dot {
  order: 1;
  width: clamp(16px, 1.9vw, 26px);
  height: clamp(16px, 1.9vw, 26px);
  background: linear-gradient(180deg, #ffffff 0%, #cbd5e1 100%);
  border-radius: 50%;
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.8), 0 10px 20px rgba(0, 0, 0, 0.7);
  opacity: 0;
  display: block;
  transform: translateY(-90vh);
}

.i-dot.drop-bounce {
  opacity: 1;
  animation: dotDrop 0.85s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes dotDrop {
  0% {
    transform: translateY(-85vh) scaleY(1.5) scaleX(0.7);
    opacity: 0;
  }
  45% {
    transform: translateY(0) scaleY(0.6) scaleX(1.4);
    opacity: 1;
  }
  65% {
    transform: translateY(-40px) scaleY(1.1) scaleX(0.9);
  }
  80% {
    transform: translateY(0) scaleY(0.85) scaleX(1.15);
  }
  92% {
    transform: translateY(-12px) scale(1);
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* Bar: Falls AFTER the dot has settled, then lands and bounces */
.i-bar {
  order: 2;
  width: clamp(16px, 1.9vw, 26px);
  height: clamp(52px, 6.8vw, 86px);
  background: linear-gradient(180deg, #ffffff 0%, #9ca3af 100%);
  border-radius: 6px;
  box-shadow: 0 0 35px rgba(255, 255, 255, 0.6), 0 15px 30px rgba(0, 0, 0, 0.8);
  opacity: 0;
  display: block;
  transform: translateY(-90vh);
}

.i-bar.drop-bounce {
  opacity: 1;
  animation: barDrop 0.95s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes barDrop {
  0% {
    transform: translateY(-90vh) scaleY(1.4) scaleX(0.7) rotate(25deg);
    opacity: 0;
  }
  50% {
    transform: translateY(0) scaleY(0.65) scaleX(1.35) rotate(16deg);
    opacity: 1;
  }
  70% {
    transform: translateY(-35px) scaleY(1.1) scaleX(0.9) rotate(8deg);
  }
  85% {
    transform: translateY(0) scaleY(0.88) scaleX(1.12) rotate(2deg);
  }
  94% {
    transform: translateY(-10px) scale(1) rotate(0deg);
  }
  100% {
    transform: translateY(0) scale(1) rotate(0deg);
    opacity: 1;
  }
}

/* When fused into uppercase I */
.i-letter-wrap.fused {
  gap: 0;
  margin: 0;
  transition: gap 0.25s ease, margin 0.25s ease;
}

.i-letter-wrap.fused .i-dot {
  opacity: 0;
  transform: scale(0);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.i-letter-wrap.fused .i-bar {
  height: clamp(65px, 8.5vw, 110px);
  border-radius: 4px;
  transition: height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* =========================================
   FOOTER BAR (HERO ROLE)
   ========================================= */
.hero-footer-bar {
  display: flex;
  justify-content: flex-start;
  align-items: flex-end;
  width: 100%;
  z-index: 20;
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-footer-bar.intro-hidden {
  opacity: 0;
  transform: translateY(35px);
  pointer-events: none;
}

.hero-footer-bar.intro-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Scroll Progress Bar at Bottom of Fixed Navbar */
.scroll-progress-line {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, #38bdf8 0%, #818cf8 50%, #c084fc 100%);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.85), 0 0 24px rgba(129, 140, 248, 0.5);
  z-index: 101;
  pointer-events: none;
  transition: width 0.08s ease-out;
}

.hero-role-wrapper {
  display: flex;
  align-items: baseline;
  gap: 8px;
  pointer-events: auto;
}

.role-bold {
  font-size: clamp(1.4rem, 2.5vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #ffffff;
}

.role-italic {
  font-size: clamp(1.3rem, 2.4vw, 2.2rem);
  font-weight: 400;
  font-style: italic;
  color: #9da3b5;
  font-family: 'Syne', serif;
}

/* =========================================
   ABOUT SECTION ("INTRO")
   Matching Hasibul Hasan Reference Design
   ========================================= */
.about-section {
  position: relative;
  width: 100vw;
  min-height: 100vh;
  background-color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 7vw 100px 7vw;
  z-index: 20;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  box-sizing: border-box;
}

.about-container {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: clamp(40px, 6vw, 95px);
  align-items: center;
  width: 100%;
  max-width: 1360px;
}

/* Left Column: Heading */
.about-left {
  display: flex;
  flex-direction: column;
  padding-top: 6px;
}

.section-badge {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 3.5px;
  color: #555e70;
  text-transform: uppercase;
  margin-bottom: 16px;
  display: inline-block;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(4.2rem, 9.5vw, 8rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
  
  /* Chrome Metallic Silver Gradient matching Hasibul Hasan */
  background: linear-gradient(
    180deg,
    #ffffff 0%,
    #dbe0eb 35%,
    #767f92 70%,
    #1e232e 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.95));
}

/* Right Column: Bio Card */
.about-right {
  display: flex;
  justify-content: center;
  width: 100%;
}

.bio-card {
  background: rgba(14, 17, 24, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  padding: clamp(32px, 4.2vw, 56px);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(16px);
  transition: border-color 0.35s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  width: 100%;
  contain: layout;
}

.bio-card:hover {
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-3px);
  box-shadow: 0 35px 80px rgba(0, 0, 0, 0.85), 0 0 50px rgba(255, 255, 255, 0.04);
}

.bio-text {
  font-size: clamp(1.05rem, 1.35vw, 1.25rem);
  color: #848c9e;
  font-weight: 400;
  user-select: none;
  font-variant-numeric: tabular-nums;
  position: relative;
  overflow: hidden;
}

.bio-line {
  display: block;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  margin: 0 0 6px 0;
  line-height: 1.85;
  transition: color 0.3s ease;
  position: relative;
  cursor: pointer;
  border-radius: 4px;
  padding: 1px 4px;
  margin-left: -4px;
  margin-right: -4px;
}

.bio-line:last-child {
  margin-bottom: 0;
}

.bio-line:hover {
  color: #a4adbf;
}

.bio-line.as {
  /* Subtle glitch glow when ripple wave is active */
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.4);
  color: #9ca6ba;
}

.bio-line .highlight {
  color: #ffffff;
  font-weight: 700;
  transition: color 0.2s ease;
}

/* =========================================
   STACK DIVIDER (HASIBUL HASAN REFERENCE)
   ========================================= */
.stack-divider {
  width: 100vw;
  background-color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 50px 7vw 15px 7vw;
  position: relative;
  z-index: 20;
}

.stack-divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.01) 0%, rgba(255, 255, 255, 0.12) 50%, rgba(255, 255, 255, 0.01) 100%);
}

.stack-divider-badge {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 4.5px;
  color: #555e70;
  text-transform: uppercase;
}

/* =========================================
   SKILLS / SOLAR SYSTEM (VENGEANCE UI 3D ORBIT)
   Interactive 3D Technology Ecosystem Animation
   ========================================= */

.skills-section.solar-section {
  position: relative;
  width: 100vw;
  min-height: 100vh;
  background: radial-gradient(circle at 50% 45%, rgba(14, 25, 45, 0.5) 0%, rgba(0, 0, 0, 1) 78%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 130px 4vw 30px 4vw;
  z-index: 20;
  overflow: hidden;
  box-sizing: border-box;
}

.skills-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  z-index: 30;
  pointer-events: none;
  margin-bottom: -15px;
}

.staggered-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4.2vw, 3.8rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #ffffff;
  text-shadow: 0 4px 25px rgba(0, 0, 0, 0.9), 0 0 35px rgba(56, 189, 248, 0.28);
  margin: 0;
}

.skills-subtitle {
  font-size: clamp(0.82rem, 1vw, 0.95rem);
  color: #8fa0b5;
  max-width: 580px;
  margin-top: 8px;
  margin-bottom: 0;
  line-height: 1.45;
  font-weight: 400;
}

/* 3D Viewport */
.solar-viewport {
  position: relative;
  width: 100%;
  max-width: 1400px;
  flex: 1;
  min-height: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1200px;
  perspective-origin: 50% 50%;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.solar-viewport:active {
  cursor: grabbing;
}

/* 3D Orbital Stage (Enlarged for grand presence) */
.solar-stage {
  position: relative;
  width: 1000px;
  height: 1000px;
  transform-style: preserve-3d;
  transform: scale(var(--solar-scale, 1.2)) rotateX(var(--tilt-x, 66deg)) rotateZ(var(--tilt-z, -14deg));
  transition: transform 0.12s cubic-bezier(0.2, 0.8, 0.4, 1);
  pointer-events: none;
}

/* Sun Core */
.solar-sun {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 76px;
  height: 76px;
  transform-style: preserve-3d;
  transform: translate(-50%, -50%) rotateZ(calc(-1 * var(--tilt-z, -14deg))) rotateX(calc(-1 * var(--tilt-x, 66deg)));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  pointer-events: auto;
}

.sun-core-circle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #38bdf8 0%, #0284c7 45%, #0369a1 85%, #082f49 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  box-shadow:
    0 0 30px rgba(56, 189, 248, 0.8),
    0 0 60px rgba(14, 165, 233, 0.45),
    inset 0 0 15px rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: sunGlow 4s ease-in-out infinite alternate;
}

.sun-icon {
  width: 28px;
  height: 28px;
  color: #ffffff;
  filter: drop-shadow(0 0 6px #ffffff);
  animation: spinSunIcon 16s linear infinite;
}

@keyframes spinSunIcon {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.sun-pulse-ring {
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  border: 1.5px solid rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.35);
  animation: sunPulse 3s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
  pointer-events: none;
}

.sun-plasma-aura {
  position: absolute;
  inset: -36px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.22) 0%, rgba(56, 189, 248, 0) 70%);
  filter: blur(12px);
  pointer-events: none;
}

@keyframes sunPulse {
  0% { transform: scale(0.85); opacity: 0.9; }
  100% { transform: scale(1.6); opacity: 0; }
}

@keyframes sunGlow {
  0% { box-shadow: 0 0 25px rgba(56, 189, 248, 0.7), 0 0 50px rgba(14, 165, 233, 0.3); }
  100% { box-shadow: 0 0 45px rgba(56, 189, 248, 0.95), 0 0 85px rgba(14, 165, 233, 0.55); }
}

.sun-tag {
  margin-top: 10px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: #7dd3fc;
  text-transform: uppercase;
  background: rgba(3, 105, 161, 0.35);
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
  white-space: nowrap;
}

/* Orbit Tracks */
.orbit-track {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  transform-style: preserve-3d;
}

.orbit-1 { width: 260px; height: 260px; }
.orbit-2 { width: 430px; height: 430px; }
.orbit-3 { width: 610px; height: 610px; }
.orbit-4 { width: 790px; height: 790px; }
.orbit-5 { width: 980px; height: 980px; }

/* Subtle elliptical dashed orbit guide */
.orbit-line {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.11);
  box-shadow: inset 0 0 20px rgba(56, 189, 248, 0.03), 0 0 15px rgba(56, 189, 248, 0.03);
}

/* Rotator Containers */
.orbit-rotator {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  transform-style: preserve-3d;
}

.orbit-spin-cw {
  animation: orbitSpinCW var(--duration, 40s) linear infinite;
}

.orbit-spin-ccw {
  animation: orbitSpinCCW var(--duration, 40s) linear infinite;
}

/* When ANY planet is hovered, gracefully pause or slow the orbits so the user can easily click/inspect */
.solar-viewport.is-paused .orbit-rotator,
.solar-stage:hover .orbit-rotator.is-paused {
  animation-play-state: paused;
}

/* Planet Placement Anchor */
.planet-anchor {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  transform-style: preserve-3d;
  transform: rotate(var(--angle)) translateX(var(--radius));
}

/* Planet Badges (Billboarding to stay upright & face camera) */
.planet-pill {
  position: absolute;
  top: 0;
  left: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 11px;
  background: rgba(14, 18, 27, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8), 0 0 14px rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
  cursor: pointer;
  pointer-events: auto;
  user-select: none;
  transform-style: preserve-3d;
  white-space: nowrap;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.orbit-spin-cw .planet-pill {
  animation: counterSpinCW var(--duration, 40s) linear infinite;
}

.orbit-spin-ccw .planet-pill {
  animation: counterSpinCCW var(--duration, 40s) linear infinite;
}

.solar-viewport.is-paused .planet-pill {
  animation-play-state: paused;
}

.planet-pill img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.6));
  transition: transform 0.3s ease;
}

.planet-pill span {
  font-size: 0.82rem;
  font-weight: 700;
  color: #e2e8f0;
  letter-spacing: -0.2px;
  transition: color 0.3s ease;
}

/* Hover State on Planet Pill */
.planet-pill:hover {
  background: rgba(17, 24, 39, 0.98);
  border-color: #38bdf8;
  box-shadow:
    0 14px 35px rgba(0, 0, 0, 0.95),
    0 0 28px rgba(56, 189, 248, 0.6),
    inset 0 0 10px rgba(56, 189, 248, 0.2);
  z-index: 999;
}

.planet-pill:hover img {
  transform: scale(1.2);
}

.planet-pill:hover span {
  color: #ffffff;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.8);
}

/* Keyframes for Orbit Rotation */
@keyframes orbitSpinCW {
  from { transform: rotateZ(0deg); }
  to { transform: rotateZ(360deg); }
}

@keyframes orbitSpinCCW {
  from { transform: rotateZ(360deg); }
  to { transform: rotateZ(0deg); }
}

/* Billboarding: Pills counter-rotate so they stay completely level & upright */
@keyframes counterSpinCW {
  from {
    transform: translate(-50%, -50%) rotate(calc(-1 * var(--angle))) rotateZ(0deg) rotateZ(calc(-1 * var(--tilt-z, -14deg))) rotateX(calc(-1 * var(--tilt-x, 66deg)));
  }
  to {
    transform: translate(-50%, -50%) rotate(calc(-1 * var(--angle))) rotateZ(-360deg) rotateZ(calc(-1 * var(--tilt-z, -14deg))) rotateX(calc(-1 * var(--tilt-x, 66deg)));
  }
}

@keyframes counterSpinCCW {
  from {
    transform: translate(-50%, -50%) rotate(calc(-1 * var(--angle))) rotateZ(0deg) rotateZ(calc(-1 * var(--tilt-z, -14deg))) rotateX(calc(-1 * var(--tilt-x, 66deg)));
  }
  to {
    transform: translate(-50%, -50%) rotate(calc(-1 * var(--angle))) rotateZ(360deg) rotateZ(calc(-1 * var(--tilt-z, -14deg))) rotateX(calc(-1 * var(--tilt-x, 66deg)));
  }
}

/* Responsive Scaling for Tablets & Mobile */
@media (max-width: 1200px) {
  .solar-stage {
    --solar-scale: 1.05;
  }
}

@media (max-width: 1080px) {
  .solar-viewport {
    min-height: 500px;
  }
  .solar-stage {
    --solar-scale: 0.92;
  }
}

@media (max-width: 768px) {
  .skills-section.solar-section {
    height: auto;
    min-height: 100vh;
    padding: 85px 4vw 35px 4vw;
  }
  .solar-viewport {
    min-height: 440px;
  }
  .solar-stage {
    --solar-scale: 0.72;
  }
  .planet-pill {
    padding: 5px 10px 5px 8px;
    gap: 6px;
  }
  .planet-pill img {
    width: 16px;
    height: 16px;
  }
  .planet-pill span {
    font-size: 0.72rem;
  }
}

@media (max-width: 480px) {
  .solar-stage {
    --solar-scale: 0.54;
  }
}

/* =========================================
   RESPONSIVE DESIGN (GENERAL)
   ========================================= */
@media (max-width: 960px) {
  .nav-links {
    display: none;
  }
  .about-container {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .hero-center.in-position {
    top: calc(100vh - 16vh - 100px);
  }
  .about-section {
    padding: 90px 6vw;
  }
}

/* =========================================
   PROJECTS SECTION: 3D BOOKS SHOWCASE
   Vengeance UI Inspired Three.js Publication Experience
   ========================================= */

.projects-section {
  position: relative;
  width: 100vw;
  min-height: 100vh;
  background: #000000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 85px 4vw 80px 4vw;
  z-index: 20;
  overflow: hidden;
  box-sizing: border-box;
}

.projects-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 25px;
  position: relative;
  z-index: 25;
}

.projects-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4.2vw, 3.8rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #ffffff;
  text-shadow: 0 4px 25px rgba(0, 0, 0, 0.9), 0 0 35px rgba(56, 189, 248, 0.28);
  margin: 0;
}

.projects-subtitle {
  font-size: clamp(0.82rem, 1vw, 0.95rem);
  color: #8fa0b5;
  max-width: 620px;
  margin-top: 8px;
  margin-bottom: 0;
  line-height: 1.5;
  font-weight: 400;
}

/* Books Showcase Container */
.books-showcase-wrapper {
  position: relative;
  width: 100%;
  max-width: 1360px;
  height: 680px;
  min-height: 580px;
  border-radius: 28px;
  background: radial-gradient(circle at 50% 50%, rgba(18, 25, 42, 0.75) 0%, rgba(8, 11, 20, 0.95) 75%, rgba(4, 6, 12, 1) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  overflow: hidden;
  user-select: none;
  outline: none;
  touch-action: none;
}

/* Background Watermark Word */
.book-hero-word {
  position: absolute;
  left: 50%;
  top: 18%;
  transform: translate(-50%, 0);
  pointer-events: none;
  z-index: 1;
  user-select: none;
  font-family: var(--font-display);
  font-size: clamp(5rem, 15vw, 12rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  color: rgba(255, 255, 255, 0.035);
  line-height: 0.85;
  white-space: nowrap;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease;
}

.books-showcase-wrapper.detail-open .book-hero-word {
  opacity: 0;
  transform: translate(-50%, -40px);
}

/* Three.js Canvas */
#booksCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  display: block;
}

/* Top Nav Bar */
.books-nav-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 22px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.books-showcase-wrapper.detail-open .books-nav-bar {
  opacity: 0;
}

.books-nav-title {
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: #94a3b8;
  text-transform: uppercase;
}

/* Carousel Buttons */
.book-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 15;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
}

.book-prev-btn { left: 22px; }
.book-next-btn { right: 22px; }

.book-carousel-btn:hover {
  background: #38bdf8;
  border-color: #38bdf8;
  color: #000000;
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.6);
}

.books-showcase-wrapper.detail-open .book-carousel-btn {
  opacity: 0;
  pointer-events: none;
}

/* Cursor Follower "OPEN" Slip */
.book-open-slip {
  position: absolute;
  z-index: 30;
  pointer-events: none;
  padding: 10px 24px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #0d121f;
  background: #f8fafc;
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.3);
  transform: translate(-50%, -50%) rotate(-3deg);
  opacity: 0;
  transition: opacity 0.25s ease;
  will-change: left, top, opacity;
}

.book-open-slip.is-visible {
  opacity: 1;
}

/* Detail Close Button (✕) */
.book-detail-close {
  position: absolute;
  top: 26px;
  right: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 35;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
}

.books-showcase-wrapper.detail-open .book-detail-close {
  opacity: 1;
  pointer-events: auto;
}

.book-detail-close:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #ef4444;
  transform: rotate(90deg);
}

/* Side Detail Panel */
.book-detail-panel {
  position: absolute;
  right: 6%;
  top: 50%;
  width: min(520px, 44%);
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-44%);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.books-showcase-wrapper.detail-open .book-detail-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%);
}

.detail-badge-pill {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: #38bdf8;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.detail-project-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.2vw, 3.2rem);
  font-weight: 800;
  color: #ffffff;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.detail-project-desc {
  font-size: 0.95rem;
  color: #94a3b8;
  line-height: 1.6;
  margin-bottom: 18px;
}

.detail-tech-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.tech-chip {
  font-size: 0.75rem;
  font-weight: 600;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px 12px;
  border-radius: 999px;
  letter-spacing: 0.5px;
}

.detail-meta-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.88rem;
  color: #64748b;
  margin-bottom: 20px;
}

.detail-stars-wrap {
  color: #38bdf8;
  font-size: 1.05rem;
  letter-spacing: 2px;
}

.detail-meta-sep {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.16);
}

.detail-meta-status {
  color: #94a3b8;
  font-weight: 600;
}

.detail-meta-year {
  margin-left: auto;
  font-weight: 700;
  color: #7dd3fc;
}

.detail-divider-line {
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin-bottom: 22px;
}

.detail-actions-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.btn-detail-action {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-detail-primary {
  background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
  color: #000000;
  box-shadow: 0 10px 25px rgba(56, 189, 248, 0.35);
}

.btn-detail-primary:hover {
  transform: scale(1.05);
  box-shadow: 0 14px 35px rgba(56, 189, 248, 0.55);
}

.btn-detail-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.btn-detail-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

/* Responsive Scaling for Projects */
@media (max-width: 1024px) {
  .books-showcase-wrapper {
    height: 720px;
  }
  .book-detail-panel {
    right: auto;
    left: 50%;
    top: auto;
    bottom: 30px;
    width: 90%;
    transform: translate(-50%, 20px);
  }
  .books-showcase-wrapper.detail-open .book-detail-panel {
    transform: translate(-50%, 0);
  }
}

@media (max-width: 768px) {
  .projects-section {
    padding: 70px 4vw 60px 4vw;
  }
  .books-showcase-wrapper {
    height: 640px;
    border-radius: 20px;
  }
  .detail-project-title {
    font-size: 1.8rem;
  }
  .detail-project-desc {
    font-size: 0.85rem;
    line-height: 1.5;
  }
  .book-prev-btn { left: 10px; }
  .book-next-btn { right: 10px; }
}

/* =========================================
   CONTACT SECTION: 3D WAVE GRID BACKGROUND
   Interactive 3D Grid of Instanced Cubes (Vengeance UI)
   ========================================= */
.contact-section {
  position: relative;
  width: 100vw;
  min-height: 100vh;
  background-color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-sizing: border-box;
  z-index: 20;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.wave-grid-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.wave-grid-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.wave-grid-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, 0.72) 100%);
  z-index: 2;
}

.contact-content-container {
  position: relative;
  z-index: 10;
  pointer-events: none;
  text-align: center;
  padding: 0 24px;
  max-width: 860px;
  user-select: none;
}

.contact-badge {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 3.5px;
  color: #64748b;
  text-transform: uppercase;
  margin-bottom: 16px;
  display: inline-block;
}

.contact-headline {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 5.2rem);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: #0f172a;
  text-shadow: 0 0 35px rgba(255, 255, 255, 0.95), 0 2px 20px rgba(255, 255, 255, 0.85);
  margin: 0 0 16px 0;
}

.contact-subline {
  font-size: clamp(1rem, 1.3vw, 1.25rem);
  color: #334155;
  font-weight: 600;
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.6;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
}

/* =========================================
   SOCIAL FLIP BUTTON (VENGEANCE UI PORT)
   3D Staggered Icon Flip & Tooltip Interaction
   ========================================= */

.social-flip-wrapper {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 36px;
  position: relative;
  z-index: 30;
}

.social-flip-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.2vw, 14px);
  padding: clamp(14px, 1.8vw, 20px) clamp(18px, 2.4vw, 28px);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(56, 189, 248, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: border-color 0.4s ease, box-shadow 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.social-flip-button:hover {
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 
    0 30px 80px rgba(0, 0, 0, 0.65),
    0 0 60px rgba(56, 189, 248, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transform: translateY(-2px);
}

/* Border Lines Container - Clipped Animation */
.social-border-track {
  position: absolute;
  inset: -1px;
  border-radius: 24px;
  overflow: hidden;
  pointer-events: none;
}

.social-border-line-top {
  position: absolute;
  top: 0;
  left: 0;
  height: 1px;
  width: 100%;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.95), transparent);
  animation: slideBorderLeftRight 2.6s linear infinite;
}

.social-border-line-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 1px;
  width: 100%;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.95), transparent);
  animation: slideBorderRightLeft 2.6s linear infinite;
}

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

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

/* Node (Individual Letter Item) */
.social-flip-node {
  position: relative;
  width: clamp(40px, 4.2vw, 50px);
  height: clamp(40px, 4.2vw, 50px);
  display: block;
  perspective: 1000px;
  text-decoration: none;
  cursor: pointer;
}

/* Inner 3D Flip Card */
.social-flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.75s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Staggered Delay for the Flip Animation when button is hovered or tapped */
/* Note: nth-child starts at 2 because index 1 is .social-border-track */
.social-flip-button:hover .social-flip-node:nth-child(2) .social-flip-inner,
.social-flip-button.touch-active .social-flip-node:nth-child(2) .social-flip-inner {
  transform: rotateY(180deg);
  transition-delay: 0.00s;
}
.social-flip-button:hover .social-flip-node:nth-child(3) .social-flip-inner,
.social-flip-button.touch-active .social-flip-node:nth-child(3) .social-flip-inner {
  transform: rotateY(180deg);
  transition-delay: 0.07s;
}
.social-flip-button:hover .social-flip-node:nth-child(4) .social-flip-inner,
.social-flip-button.touch-active .social-flip-node:nth-child(4) .social-flip-inner {
  transform: rotateY(180deg);
  transition-delay: 0.14s;
}
.social-flip-button:hover .social-flip-node:nth-child(5) .social-flip-inner,
.social-flip-button.touch-active .social-flip-node:nth-child(5) .social-flip-inner {
  transform: rotateY(180deg);
  transition-delay: 0.21s;
}
.social-flip-button:hover .social-flip-node:nth-child(6) .social-flip-inner,
.social-flip-button.touch-active .social-flip-node:nth-child(6) .social-flip-inner {
  transform: rotateY(180deg);
  transition-delay: 0.28s;
}
.social-flip-button:hover .social-flip-node:nth-child(7) .social-flip-inner,
.social-flip-button.touch-active .social-flip-node:nth-child(7) .social-flip-inner {
  transform: rotateY(180deg);
  transition-delay: 0.35s;
}
.social-flip-button:hover .social-flip-node:nth-child(8) .social-flip-inner,
.social-flip-button.touch-active .social-flip-node:nth-child(8) .social-flip-inner {
  transform: rotateY(180deg);
  transition-delay: 0.42s;
}

/* Front & Back Faces */
.social-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  user-select: none;
}

/* Front Face: Bold Letter */
.social-front {
  background: #ffffff;
  color: #0f172a;
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 1.4vw, 1.35rem);
  font-weight: 900;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.6);
  transition: background 0.25s ease, transform 0.25s ease;
}

/* Back Face: Social Icon */
.social-back {
  background: #090d16;
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.45);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.35);
  transform: rotateY(180deg);
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.social-flip-node:hover .social-back {
  background: #38bdf8;
  color: #040812;
  border-color: #38bdf8;
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.7);
  transform: rotateY(180deg) scale(1.08);
}

/* Floating Tooltip */
.social-tooltip {
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translate(-50%, -8px) scale(0.85);
  background: #090d16;
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), 0 0 15px rgba(56, 189, 248, 0.25);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 50;
}

.social-tooltip-arrow {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 6px;
  height: 6px;
  margin-top: -3px;
  background: #090d16;
  border-right: 1px solid rgba(56, 189, 248, 0.4);
  border-bottom: 1px solid rgba(56, 189, 248, 0.4);
}

/* Tooltip shows ONLY when the parent button is hovered AND that specific letter is hovered */
.social-flip-button:hover .social-flip-node:hover .social-tooltip {
  opacity: 1;
  transform: translate(-50%, -16px) scale(1);
}

@media (max-width: 640px) {
  .social-flip-button {
    gap: 6px;
    padding: 10px 14px;
    border-radius: 18px;
  }
  .social-flip-node {
    width: 38px;
    height: 38px;
  }
}

/* =========================================
   BREAKOUT GAME SECTION ("HELLO WORLD")
   Hasibul Hasan Reference Style
   ========================================= */
.play-section {
  position: relative;
  width: 100vw;
  background-color: #050505;
  color: #ffffff;
  padding: 95px 4vw 85px 4vw;
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  z-index: 20;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.play-container {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.play-header {
  margin-bottom: 22px;
}

.play-caption {
  display: inline-block;
  padding-bottom: 4px;
  border-bottom: 2px solid #38bdf8;
  font-size: clamp(0.78rem, 1vw, 0.9rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
  text-transform: uppercase;
}

.breakout-panel {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 480px;
  background-color: #000000;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
  user-select: none;
  outline: none;
  cursor: default;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.breakout-panel.is-playing {
  cursor: none;
}

.breakout-panel:focus-visible {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px #38bdf8, 0 25px 60px rgba(0, 0, 0, 0.8);
}

.breakout-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Lives dots (Top Right) */
.breakout-lives {
  position: absolute;
  top: 18px;
  right: 22px;
  display: flex;
  gap: 8px;
  pointer-events: none;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.breakout-lives.active {
  opacity: 1;
}

.life-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

.life-dot.alive {
  background: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.8);
}

/* Action Overlay (Bottom Right) */
.breakout-action-bar {
  position: absolute;
  bottom: 16px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 10;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

.breakout-action-bar.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transform: translateY(6px);
}

.breakout-status-text {
  font-family: var(--font-display);
  font-size: clamp(0.72rem, 0.9vw, 0.85rem);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  display: none;
  user-select: none;
}

.breakout-status-text.show {
  display: inline-block;
}

.breakout-status-text.won {
  color: #38bdf8;
}

.breakout-btn {
  pointer-events: auto;
  cursor: pointer;
  padding: 8px 24px;
  background-color: #000000;
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: #38bdf8;
  font-family: var(--font-display);
  font-size: clamp(0.72rem, 0.9vw, 0.82rem);
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  border-radius: 4px;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.breakout-btn:hover {
  background-color: #38bdf8;
  color: #000000;
  border-color: #38bdf8;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.6);
}

/* =========================================
   PORTFOLIO FOOTER (MATCHING 3RD PICTURE)
   ========================================= */
.portfolio-footer {
  position: relative;
  width: 100vw;
  background-color: #000000;
  color: #94a3b8;
  z-index: 20;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
  padding: 30px 4vw 38px 4vw;
}

.footer-container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

.footer-inner {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.footer-copyright {
  margin: 0;
  color: #64748b;
  font-weight: 400;
}

.footer-nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 1.8vw, 24px);
  flex-wrap: wrap;
}

.footer-nav a {
  color: #64748b;
  text-decoration: none;
  transition: color 0.25s ease;
}

.footer-nav a:hover {
  color: #ffffff;
}

.footer-sep {
  display: inline-block;
  width: 1px;
  height: 12px;
  background: rgba(255, 255, 255, 0.15);
}

@media (max-width: 768px) {
  .play-section {
    padding: 60px 4vw 50px 4vw;
  }
  .breakout-panel {
    aspect-ratio: 4 / 3;
    min-height: 400px;
  }
  .footer-inner {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 16px;
  }
}

/* =========================================
   MILLION DOLLAR SCROLL REVEAL SYSTEM
   Cinematic, 120fps GPU accelerated reveals
   ========================================= */

/* Base hidden state for any element observed for scroll entrance */
[data-reveal] {
  opacity: 0;
  transition-property: opacity, transform, filter;
  transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity, filter;
}

/* 1. Category / Eyebrow Badges */
[data-reveal="badge"] {
  transform: translateY(22px) scale(0.92);
  filter: blur(6px);
  transition-duration: 0.75s;
}

[data-reveal="badge"].is-revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

/* 2. Bold Section Headings */
[data-reveal="title"] {
  transform: translateY(46px);
  filter: blur(12px);
  transition-duration: 0.95s;
  transition-delay: 0.08s;
  position: relative;
}

[data-reveal="title"].is-revealed {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

/* Metallic Light Shimmer across title upon reveal */
[data-reveal="title"].is-revealed::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.22) 50%, transparent 70%);
  background-size: 200% 100%;
  pointer-events: none;
  animation: titleShimmer 1.4s ease 0.4s forwards;
  opacity: 0;
}

@keyframes titleShimmer {
  0% { background-position: 200% 0; opacity: 0; }
  30% { opacity: 1; }
  100% { background-position: -200% 0; opacity: 0; }
}

/* 3. Subtitles & Supporting Text */
[data-reveal="subtitle"] {
  transform: translateY(28px);
  filter: blur(8px);
  transition-duration: 0.85s;
  transition-delay: 0.16s;
}

[data-reveal="subtitle"].is-revealed {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

/* 4. Luxury Card Surfaces (About Bio Card, Social Flip Container) */
[data-reveal="card"] {
  transform: translateY(55px) scale(0.96);
  filter: blur(10px);
  transition-duration: 1.05s;
  transition-delay: 0.12s;
  position: relative;
}

[data-reveal="card"].is-revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

/* Bio Card Luminous Sheen sweep on reveal */
.bio-card.is-revealed::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.85), transparent);
  animation: bioCardSheen 1.6s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
  pointer-events: none;
}

@keyframes bioCardSheen {
  0% { left: -100%; opacity: 0; }
  50% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

/* 5. 3D Stages (3D Books Showcase, Breakout Game Panel) */
[data-reveal="stage"] {
  transform: translateY(65px) scale(0.95);
  filter: blur(12px);
  transition-duration: 1.15s;
  transition-delay: 0.18s;
}

[data-reveal="stage"].is-revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

/* 6. Social Flip Button: Staggered 3D Cascading Flip Entrance on Scroll */
.social-flip-wrapper:not(.is-revealed) .social-flip-node {
  opacity: 0;
  transform: perspective(600px) rotateY(-80deg) scale(0.7);
}

.social-flip-wrapper.is-revealed .social-flip-node {
  opacity: 1;
  transform: perspective(600px) rotateY(0deg) scale(1);
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.social-flip-wrapper.is-revealed .social-flip-node[data-index="0"] { transition-delay: 0.10s; }
.social-flip-wrapper.is-revealed .social-flip-node[data-index="1"] { transition-delay: 0.18s; }
.social-flip-wrapper.is-revealed .social-flip-node[data-index="2"] { transition-delay: 0.26s; }
.social-flip-wrapper.is-revealed .social-flip-node[data-index="3"] { transition-delay: 0.34s; }
.social-flip-wrapper.is-revealed .social-flip-node[data-index="4"] { transition-delay: 0.42s; }
.social-flip-wrapper.is-revealed .social-flip-node[data-index="5"] { transition-delay: 0.50s; }
.social-flip-wrapper.is-revealed .social-flip-node[data-index="6"] { transition-delay: 0.58s; }

/* 7. Breakout Game Panel neon glow sweep on reveal */
.breakout-panel.is-revealed {
  animation: panelGlowFlash 1.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes panelGlowFlash {
  0% {
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 0 rgba(56, 189, 248, 0);
  }
  40% {
    box-shadow: 0 30px 75px rgba(0, 0, 0, 0.95), 0 0 40px rgba(56, 189, 248, 0.35);
  }
  100% {
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 16px rgba(56, 189, 248, 0.08);
  }
}

/* Performance cleanup after transition finishes */
[data-reveal].reveal-done {
  will-change: auto;
  filter: none !important;
}

/* Accessibility: Respect Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  [data-reveal],
  [data-reveal="badge"],
  [data-reveal="title"],
  [data-reveal="subtitle"],
  [data-reveal="card"],
  [data-reveal="stage"],
  .social-flip-wrapper:not(.is-revealed) .social-flip-node {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }
}



