/* ═══════════════════════════════════════════════════════════
   HELLOFANI.IN — Interactive 3D Portfolio
   Design System: Black / Orange / White + Glassmorphism
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

/* ─── CSS Variables ─── */
:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --orange: #FF6B35;
  --orange-glow: #FF8C5A;
  --orange-dark: #CC5529;
  --white: #FFFFFF;
  --white-dim: rgba(255, 255, 255, 0.7);
  --white-muted: rgba(255, 255, 255, 0.4);
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-bg-strong: rgba(255, 255, 255, 0.08);
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --transition-smooth: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-primary);
  color: var(--white);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

/* ─── 3D Canvas ─── */
#canvas-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

#canvas-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ═══════════════════════════════════════════════════════════
   LOADING SCREEN
   ═══════════════════════════════════════════════════════════ */
#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s var(--transition-smooth);
}

#loading-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.loader-logo {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 2rem;
}

.loader-logo span {
  color: var(--orange);
}

.loader-bar-container {
  width: 200px;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.loader-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--orange), var(--orange-glow));
  border-radius: 2px;
  transition: width 0.3s ease;
}

.loader-text {
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--white-muted);
  letter-spacing: 3px;
  text-transform: uppercase;
}

/* ═══════════════════════════════════════════════════════════
   UI OVERLAY (all HTML over canvas)
   ═══════════════════════════════════════════════════════════ */
#ui-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s var(--transition-smooth);
}

#ui-overlay.visible {
  opacity: 1;
}

#ui-overlay>* {
  pointer-events: auto;
}

/* ═══════════════════════════════════════════════════════════
   HERO SECTION
   ═══════════════════════════════════════════════════════════ */
#hero-section {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 5%;
  transition: opacity 0.8s var(--transition-smooth), transform 0.8s var(--transition-smooth);
}

#hero-section.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(30px);
}

.hero-top-bar {
  position: absolute;
  top: 2rem;
  left: 5%;
  right: 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.brand-name span {
  color: var(--orange);
}

.hero-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.hero-left {
  max-width: 420px;
}

.hero-subtitle {
  font-size: 0.75rem;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 1rem;
  font-weight: 500;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -2px;
  margin-bottom: 1.5rem;
}

.hero-title .highlight {
  background: linear-gradient(135deg, var(--orange), var(--orange-glow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-right {
  max-width: 320px;
}

.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.feature-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--white-dim);
  transition: color 0.3s ease;
}

.feature-list li:hover {
  color: var(--white);
}

.feature-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 107, 53, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--orange);
  font-size: 0.7rem;
  flex-shrink: 0;
}

/* Start Experience Button */
.cta-container {
  position: absolute;
  bottom: 4rem;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}

.cta-button {
  background: var(--white);
  color: var(--bg-primary);
  border: none;
  padding: 1rem 2.5rem;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.4s var(--transition-smooth);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.5px;
  will-change: transform, color, box-shadow;
}

.cta-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: var(--orange);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.5s var(--transition-smooth), height 0.5s var(--transition-smooth);
}

.cta-button:hover {
  color: var(--white);
  transform: scale(1.05);
  box-shadow: 0 0 40px rgba(255, 107, 53, 0.3);
}

.cta-button:hover::before {
  width: 300px;
  height: 300px;
}

.cta-button span {
  position: relative;
  z-index: 1;
}

/* ═══════════════════════════════════════════════════════════
   EXPERIENCE SECTION (after clicking Start)
   ═══════════════════════════════════════════════════════════ */
#experience-section {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s var(--transition-smooth);
}

#experience-section.active {
  opacity: 1;
  pointer-events: auto;
}

/* ─── Back Button ─── */
.back-button {
  position: absolute;
  top: 2rem;
  left: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--white);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 20;
  opacity: 0;
  transform: scale(0.8);
}

.back-button.visible {
  opacity: 1;
  transform: scale(1);
}

.back-button:hover {
  background: rgba(255, 107, 53, 0.2);
  border-color: var(--orange);
  transform: scale(1.1);
}

/* ─── Top Center Label ─── */
.section-label {
  position: absolute;
  top: 2rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--orange);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 0.6rem 1.5rem;
  border-radius: 50px;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.section-label.visible {
  opacity: 1;
}

/* ─── Category Sidebar ─── */
.category-sidebar {
  position: absolute;
  right: 3rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  z-index: 15;
  opacity: 0;
  transform: translateY(-50%) translateX(30px);
  transition: all 0.6s var(--transition-smooth);
}

.category-sidebar.visible {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.sidebar-title {
  font-family: var(--font-heading);
  font-size: 0.65rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--white-muted);
  margin-bottom: 1rem;
  padding-left: 1rem;
}

.category-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.2rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  background: transparent;
  border: 1px solid transparent;
  will-change: transform, background-color, border-color;
}

.category-item:hover,
.category-item.active {
  background: var(--glass-bg-strong);
  border-color: var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.category-item.active {
  border-color: rgba(255, 107, 53, 0.3);
}

.category-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 107, 53, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--orange);
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.category-item:hover .category-icon,
.category-item.active .category-icon {
  background: rgba(255, 107, 53, 0.25);
  box-shadow: 0 0 15px rgba(255, 107, 53, 0.2);
}

.category-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.category-name {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
}

.category-desc {
  font-size: 0.7rem;
  color: var(--white-muted);
}

.category-arrow {
  margin-left: auto;
  color: var(--white-muted);
  font-size: 0.8rem;
  opacity: 0;
  transform: translateX(-5px);
  transition: all 0.3s ease;
}

.category-item:hover .category-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* ═══════════════════════════════════════════════════════════
   DETAIL PANEL (left slide-in content)
   ═══════════════════════════════════════════════════════════ */
.detail-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 45%;
  height: 100%;
  background: linear-gradient(135deg, rgba(10, 10, 10, 0.35), rgba(20, 20, 20, 0.30));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-right: 1px solid var(--glass-border);
  padding: 5rem 3rem 3rem 3rem;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.7s var(--transition-smooth);
  z-index: 12;
  will-change: transform, opacity;
  contain: layout paint style;
}

.detail-panel.open {
  transform: translateX(0);
}

/* Scrollbar styling */
.detail-panel::-webkit-scrollbar {
  width: 4px;
}

.detail-panel::-webkit-scrollbar-track {
  background: transparent;
}

.detail-panel::-webkit-scrollbar-thumb {
  background: rgba(255, 107, 53, 0.3);
  border-radius: 2px;
}

.panel-header {
  margin-bottom: 2rem;
}

.panel-tag {
  display: inline-block;
  font-size: 0.65rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--orange);
  background: rgba(255, 107, 53, 0.1);
  padding: 0.4rem 1rem;
  border-radius: 50px;
  margin-bottom: 1rem;
  border: 1px solid rgba(255, 107, 53, 0.2);
}

.panel-title {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.panel-description {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--white-dim);
}

/* ─── Content Blocks ─── */
.content-block {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  transition: all 0.3s ease;
}

.content-block:hover {
  border-color: rgba(255, 107, 53, 0.2);
  background: var(--glass-bg-strong);
}

.content-block-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.content-block-title .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
  display: inline-block;
}

.content-block p {
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--white-dim);
}

/* ─── Skill Tags ─── */
.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.skill-tag {
  font-size: 0.75rem;
  padding: 0.4rem 0.9rem;
  border-radius: 50px;
  background: rgba(255, 107, 53, 0.08);
  border: 1px solid rgba(255, 107, 53, 0.15);
  color: var(--orange-glow);
  font-weight: 500;
  transition: all 0.3s ease;
}

.skill-tag:hover {
  background: rgba(255, 107, 53, 0.2);
  border-color: var(--orange);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 107, 53, 0.15);
}

/* ─── Project Cards ─── */
.project-card {
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  transition: all 0.4s var(--transition-smooth);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  will-change: transform, border-color;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 0;
  background: linear-gradient(180deg, var(--orange), var(--orange-glow));
  transition: height 0.4s var(--transition-smooth);
  border-radius: 0 0 3px 0;
}

.project-card:hover {
  border-color: rgba(255, 107, 53, 0.3);
  background: var(--glass-bg-strong);
  transform: translateX(5px);
}

.project-card:hover::before {
  height: 100%;
}

.project-number {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--orange);
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
}

.project-name {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.project-desc {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--white-dim);
}

.project-tech {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.project-tech span {
  font-size: 0.65rem;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--white-muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ─── Contact Section ─── */
.contact-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--white);
  transition: all 0.3s ease;
}

.contact-link:hover {
  border-color: rgba(255, 107, 53, 0.3);
  background: var(--glass-bg-strong);
  transform: translateX(5px);
}

.contact-link-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 107, 53, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--orange);
  flex-shrink: 0;
}

.contact-link-text {
  display: flex;
  flex-direction: column;
}

.contact-link-label {
  font-size: 0.7rem;
  color: var(--white-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.contact-link-value {
  font-size: 0.95rem;
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════
   SOUND TOGGLE
   ═══════════════════════════════════════════════════════════ */
.sound-toggle {
  position: absolute;
  bottom: 2rem;
  left: 2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  z-index: 25;
  background: none;
  border: none;
  color: var(--white-muted);
  font-size: 0.65rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-family: var(--font-body);
  transition: color 0.3s ease;
}

.sound-toggle:hover {
  color: var(--white);
}

.sound-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}

.sound-bar {
  width: 2px;
  background: var(--orange);
  border-radius: 1px;
  transition: height 0.2s ease;
}

.sound-toggle.active .sound-bar {
  animation: soundWave 0.6s ease-in-out infinite alternate;
}

.sound-bar:nth-child(1) {
  height: 4px;
  animation-delay: 0s;
}

.sound-bar:nth-child(2) {
  height: 8px;
  animation-delay: 0.1s;
}

.sound-bar:nth-child(3) {
  height: 6px;
  animation-delay: 0.2s;
}

.sound-bar:nth-child(4) {
  height: 10px;
  animation-delay: 0.15s;
}

.sound-bar:nth-child(5) {
  height: 5px;
  animation-delay: 0.05s;
}

@keyframes soundWave {
  0% {
    transform: scaleY(0.4);
  }

  100% {
    transform: scaleY(1);
  }
}

/* ─── Credits ─── */
.credits {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  font-size: 0.65rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--white-muted);
  z-index: 25;
}

.credits span {
  color: var(--orange);
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════
   HOTSPOT INDICATORS (3D projected)
   ═══════════════════════════════════════════════════════════ */
.hotspot {
  position: absolute;
  width: 20px;
  height: 20px;
  pointer-events: auto;
  cursor: pointer;
  z-index: 11;
}

.hotspot-dot {
  width: 10px;
  height: 10px;
  background: var(--orange);
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px var(--orange), 0 0 20px rgba(255, 107, 53, 0.4);
}

.hotspot-pulse {
  width: 20px;
  height: 20px;
  border: 2px solid var(--orange);
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: hotspotPulse 2s ease-out infinite;
}

@keyframes hotspotPulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }

  100% {
    transform: translate(-50%, -50%) scale(2.5);
    opacity: 0;
  }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .detail-panel {
    width: 100%;
    padding: 6rem 2rem 5rem;
  }

  .category-sidebar {
    right: 1rem;
  }

  .hero-content {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
  }

  .hero-right {
    max-width: 100%;
  }

  .feature-list {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .category-sidebar {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
    top: auto;
    transform: none;
    flex-direction: row;
    justify-content: center;
    overflow-x: auto;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--glass-bg-strong);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }

  .category-sidebar.visible {
    transform: none;
  }

  .sidebar-title {
    display: none;
  }

  .category-desc,
  .category-arrow {
    display: none;
  }

  .category-item {
    flex-direction: column;
    gap: 0.3rem;
    min-width: 70px;
    text-align: center;
    padding: 0.6rem;
  }

  .category-name {
    font-size: 0.7rem;
  }

  .hero-title {
    font-size: 2rem;
  }

  /* Push sound toggle and credits above the bottom nav bar only when nav is visible */
  #experience-section.active~.sound-toggle {
    bottom: 8rem;
  }

  #experience-section.active~.credits {
    bottom: 8rem;
  }
}

/* ═══════════════════════════════════════════════════════════
   UTILITY ANIMATIONS
   ═══════════════════════════════════════════════════════════ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.animate-in {
  animation: fadeInUp 0.6s var(--transition-smooth) forwards;
  opacity: 0;
}

.animate-in:nth-child(1) {
  animation-delay: 0.1s;
}

.animate-in:nth-child(2) {
  animation-delay: 0.2s;
}

.animate-in:nth-child(3) {
  animation-delay: 0.3s;
}

.animate-in:nth-child(4) {
  animation-delay: 0.4s;
}

.animate-in:nth-child(5) {
  animation-delay: 0.5s;
}

.animate-in:nth-child(6) {
  animation-delay: 0.6s;
}

/* Divider */
.divider {
  width: 50px;
  height: 2px;
  background: linear-gradient(90deg, var(--orange), transparent);
  margin: 1.5rem 0;
  border-radius: 1px;
}

/* Stats Row */
.stats-row {
  display: flex;
  gap: 2rem;
  margin-top: 1.5rem;
}

.stat {
  text-align: center;
}

.stat-number {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  color: var(--orange);
  line-height: 1;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--white-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 0.25rem;
}