@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Space+Mono:ital,wght@0,400;0,700;1,400&family=Syne:wght@400;500;600;700;800&display=swap');

:root {
  --bg-cosmos: #08080a;
  --bg-surface: rgba(255, 255, 255, 0.04);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(255, 255, 255, 0.25);
  --text-primary: #ffffff;
  --text-secondary: #909296;
  --text-muted: #5c5f66;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  cursor: default; /* Keep responsive cursor */
}

html, body {
  background-color: var(--bg-cosmos);
  color: var(--text-primary);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  overflow-x: hidden;
  width: 100%;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.font-display {
  font-family: 'Syne', sans-serif;
  letter-spacing: -0.03em;
}

.font-mono {
  font-family: 'Space Mono', monospace;
}

/* Glassmorphic Pills */
.glass-pill {
  background: rgba(20, 20, 24, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 20px -1px rgba(0, 0, 0, 0.5);
  transition: all 0.25s ease-out;
}

.glass-pill:hover, .glass-pill:focus-within {
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7), 0 0 15px rgba(255, 255, 255, 0.05);
}

/* Hero Floating Constellation Cards (Exact Match to User Reference) */
.hero-card {
  position: absolute;
  overflow: hidden;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.92), 0 0 0 1px rgba(255, 255, 255, 0.12);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
  will-change: transform;
  opacity: 1 !important;
  visibility: visible !important;
  cursor: pointer;
}

.hero-card.rect-card {
  border-radius: 26px;
}

.hero-card.arch-card {
  border-radius: 9999px 9999px 26px 26px;
}

.hero-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
  filter: contrast(1.05) brightness(1.02);
}

.hero-card:hover {
  z-index: 45 !important;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.98), 0 0 30px rgba(212, 175, 55, 0.2), 0 0 0 1.5px rgba(255, 255, 255, 0.35);
  transform: translateY(-8px) scale(1.03);
}

.hero-card:hover img {
  transform: scale(1.06);
}

/* Mobile Signature Cards */
.hero-mobile-card {
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.12);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
  cursor: pointer;
  flex-shrink: 0;
}

.hero-mobile-card.rect-card {
  border-radius: 18px;
}

.hero-mobile-card.arch-card {
  border-radius: 9999px 9999px 16px 16px;
}

.hero-mobile-card:hover, .hero-mobile-card:active {
  transform: translateY(-4px) scale(1.04);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.9), 0 0 15px rgba(212, 175, 55, 0.35), 0 0 0 1.5px rgba(255, 255, 255, 0.3);
}

.view-render-btn {
  cursor: pointer;
}

/* Custom Follower Cursor */
#custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}

.cursor-dot {
  width: 8px;
  height: 8px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
  transition: transform 0.2s ease;
}

.cursor-pill {
  opacity: 0;
  transform: scale(0.6);
  background: rgba(18, 18, 22, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 9999px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
}

#custom-cursor.active-pill .cursor-pill {
  opacity: 1;
  transform: scale(1);
}

/* Polaroid Card in Section 2 */
.polaroid-frame {
  background: #ffffff;
  padding: 12px 12px 36px 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.1);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.polaroid-frame:hover {
  transform: rotate(0deg) scale(1.02) !important;
}

/* =======================================================
   3D COVERFLOW AUTO-SWIPING CAROUSEL (User Reference Match)
   ======================================================= */
.coverflow-viewport {
  position: relative;
  width: 100%;
  min-height: 600px;
  perspective: 1200px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 0;
  user-select: none;
}

.coverflow-track {
  position: relative;
  width: 100%;
  max-width: 1200px;
  height: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.coverflow-card {
  position: absolute;
  width: 310px;
  height: 520px;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.12);
  transition: transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1),
              filter 0.55s cubic-bezier(0.2, 0.8, 0.2, 1),
              opacity 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform, filter, opacity;
  cursor: pointer;
}

.coverflow-card img,
.coverflow-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  pointer-events: none;
  background: #000;
}

/* 3D Coverflow States */
.coverflow-card[data-state="active"] {
  transform: translateX(0%) scale(1) translateZ(0);
  filter: blur(0px) brightness(1);
  opacity: 1;
  z-index: 30;
  box-shadow: 0 30px 60px -10px rgba(0, 0, 0, 0.95), 0 0 35px rgba(255, 255, 255, 0.12), 0 0 0 1.5px rgba(255, 255, 255, 0.25);
}

.coverflow-card[data-state="prev-1"] {
  transform: translateX(-82%) scale(0.86) translateZ(-80px);
  filter: blur(7px) brightness(0.75);
  opacity: 0.5;
  z-index: 20;
}

.coverflow-card[data-state="next-1"] {
  transform: translateX(82%) scale(0.86) translateZ(-80px);
  filter: blur(7px) brightness(0.75);
  opacity: 0.5;
  z-index: 20;
}

.coverflow-card[data-state="prev-2"] {
  transform: translateX(-150%) scale(0.72) translateZ(-160px);
  filter: blur(10px) brightness(0.5);
  opacity: 0.22;
  z-index: 10;
}

.coverflow-card[data-state="next-2"] {
  transform: translateX(150%) scale(0.72) translateZ(-160px);
  filter: blur(10px) brightness(0.5);
  opacity: 0.22;
  z-index: 10;
}

.coverflow-card[data-state="hidden"] {
  transform: scale(0.5) translateZ(-300px);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}

/* Pagination Dots Indicator with Active Pill */
.coverflow-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
}

.coverflow-dot {
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.25);
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  cursor: pointer;
}

.coverflow-dot.active {
  width: 24px;
  background: #ffffff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

/* Arrow Nav Buttons */
.coverflow-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(20, 20, 24, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(12px);
  z-index: 35;
  transition: all 0.2s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.coverflow-nav-btn:hover {
  background: white;
  color: black;
  transform: translateY(-50%) scale(1.1);
}

/* Video Player Frame Styling */
.reel-device-frame {
  position: relative;
  width: 100%;
  max-width: 360px;
  aspect-ratio: 9/16;
  margin: 0 auto;
  border-radius: 32px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.15);
  background: #000;
}

.reel-device-frame video {
  width: 100%;
  height: 100%;
  object-fit: contain; /* Never crop! */
  background: #000;
}

/* Split Line Reveal Masking */
.split-line-wrap {
  overflow: hidden;
  display: block;
}
.split-line {
  display: block;
  transform: translateY(115%);
  opacity: 0;
  transition: transform 0.65s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.65s ease;
}
.split-line.revealed {
  transform: translateY(0%);
  opacity: 1;
}

/* Fullscreen Preloader */
#preloader {
  position: fixed;
  inset: 0;
  background: #08080a;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Smooth Canvas Background */
#cosmos-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

body.loading {
  overflow: hidden;
}

/* Archive Gallery Items */
.archive-item {
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.archive-item:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8), 0 0 20px rgba(255, 255, 255, 0.1);
}

/* Mobile & Touchscreen Optimization (Zero Lag, Native Feel) */
@media (hover: none) and (pointer: coarse) {
  #custom-cursor {
    display: none !important;
  }
}

@media (max-width: 640px) {
  /* 3D Coverflow Mobile Dimensions */
  .coverflow-viewport {
    min-height: 480px;
    padding: 10px 0;
  }

  .coverflow-track {
    height: 460px;
  }

  .coverflow-card {
    width: 260px;
    height: 435px;
    border-radius: 24px;
  }

  .coverflow-card[data-state="prev-1"] {
    transform: translateX(-70%) scale(0.85) translateZ(-60px);
  }

  .coverflow-card[data-state="next-1"] {
    transform: translateX(70%) scale(0.85) translateZ(-60px);
  }

  .coverflow-card[data-state="prev-2"] {
    transform: translateX(-120%) scale(0.7) translateZ(-120px);
    opacity: 0.15;
  }

  .coverflow-card[data-state="next-2"] {
    transform: translateX(120%) scale(0.7) translateZ(-120px);
    opacity: 0.15;
  }

  /* Coverflow Nav Buttons on Mobile */
  .coverflow-nav-btn {
    width: 38px;
    height: 38px;
  }
}
