/* ==========================================================================
   Root Theme & Variables
   ========================================================================== */
@import url("https://fonts.googleapis.com/css2?family=Audiowide&family=Inter:wght@300;400;600&family=JetBrains+Mono:wght@400;700&display=swap");

:root {
  --primary-color: #00d4ff;
  --primary-dark: #003366;
  --primary-glow: rgba(0, 212, 255, 0.5);
  --white: #ffffff;
  --bg-dark: #02050a;

  --font-main: "Audiowide", cursive, sans-serif;
  --font-sec: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

/* ==========================================================================
   Concave Panoramic Screen (Wraps around the user)
   ========================================================================== */

/* The Pinned Scroll Track */
.cx-master-scroll {
  position: relative;
  width: 100%;
  background-color: var(--bg-dark);
  color: var(--white);
  overflow: hidden;
}

.cx-sticky-frame {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh; /* Mobile browser height fix */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  box-sizing: border-box;
}

/* Ambient Back Glow */
.cx-ambient-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60vw;
  height: 60vw;
  background: radial-gradient(
    circle,
    rgba(0, 51, 102, 0.4) 0%,
    transparent 70%
  );
  filter: blur(60px);
  z-index: 1;
  pointer-events: none;
}

/* --- Premium Text Formatting --- */
.cx-text-content {
  text-align: center;
  max-width: 900px;
  /* padding: 0 24px;
  margin-bottom: 4vh; */
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cx-scene-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 4px;
  color: var(--primary-color);
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 15px;
  text-shadow: 0 0 10px var(--primary-glow);
}
.cx-scene-label .cx-line {
  width: 30px;
  height: 2px;
  background: var(--primary-color);
  box-shadow: 0 0 5px var(--primary-color);
}
.cx-scene-label .cx-highlight {
  color: var(--white);
  font-weight: 700;
  font-size: 14px;
}

.cx-master-title {
  font-family: var(--font-main);
  font-size: clamp(32px, 5vw, 56px);
  letter-spacing: 4px;
  color: var(--white);
  margin: 0 0 25px 0;
  text-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
}
.cx-master-title span {
  color: var(--primary-color);
}

.cx-header-main {
  font-family: var(--font-sec);
  font-size: clamp(14px, 1.2vw, 17px);
  color: #e0e0e0;
  line-height: 1.7;
  font-weight: 300;
  margin-bottom: 16px;
  max-width: 750px;
}

.cx-header-sub {
  font-family: var(--font-sec);
  font-size: clamp(12px, 1vw, 14px);
  color: #888888;
  line-height: 1.6;
  font-weight: 300;
  margin-bottom: 20px;
}

.cx-header-tagline {
  font-family: var(--font-sec);
  font-size: clamp(12px, 1vw, 14px);
  color: #888888;
  letter-spacing: 1px;
}

.cx-header-tagline span {
  font-family: var(--font-main);
  color: var(--primary-color);
  letter-spacing: 2px;
  text-shadow: 0 0 12px var(--primary-glow);
}

/* --- Drag Hint --- */
.cx-interaction-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2vh;
  z-index: 10;
  opacity: 0.7;
}

.cx-pulse-ring {
  width: 6px;
  height: 6px;
  background: var(--primary-color);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.7);
  animation: cx-pulse 1.5s infinite;
}
@keyframes cx-pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(0, 212, 255, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(0, 212, 255, 0);
  }
}

/* --- 3D Viewport --- */
.cx-3d-viewport {
  position: relative;
  width: 100%;
  height: 550px; /* Increased height for larger videos */
  perspective: 1200px; /* Deep perspective */
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  z-index: 5;
}

.cx-3d-viewport:active {
  cursor: grabbing;
}

/* Edge Blending */
.cx-vignette {
  position: absolute;
  top: 0;
  width: 15vw;
  height: 100%;
  z-index: 20;
  pointer-events: none;
}
.cx-vignette.cx-left {
  left: 0;
  background: linear-gradient(to right, var(--bg-dark) 0%, transparent 100%);
}
.cx-vignette.cx-right {
  right: 0;
  background: linear-gradient(to left, var(--bg-dark) 0%, transparent 100%);
}

/* --- The VR Engine --- */
.cx-3d-prism {
  position: relative;

  /* Desktop Layout - Increased Sizes (Math: radius ≈ width * 1.207) */
  --card-width: 800px;
  --radius: 966px;

  width: var(--card-width);
  height: 450px;
  transform-style: preserve-3d;

  /* Push forward to place front face on the screen plane */
  transform: translateZ(var(--radius)) rotateY(var(--rotation, 0deg));
}

.cx-prism-face {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  /* Crucial for 3D Video Rendering */
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;

  /* Angled inward (-45deg) and pushed back into the screen */
  transform: rotateY(calc(var(--i) * -45deg))
    translateZ(calc(-1 * var(--radius)));

  /* Cyber/Cinematic Styling */
  border: 1px solid rgba(0, 212, 255, 0.15);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.8),
    inset 0 0 20px rgba(0, 212, 255, 0.05);
  border-radius: 12px; /* Slightly rounder for bigger cards */
  background: #000;
}

/* Video specific styling */
.cx-prism-face video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  border-radius: 8px; /* Apply rounded corners directly to video */

  /* HARDWARE ACCELERATION FIX: Forces browser to render video properly in 3D space */
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.cx-face-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    0deg,
    rgba(0, 10, 20, 0.6) 0%,
    transparent 40%,
    transparent 60%,
    rgba(0, 10, 20, 0.4) 100%
  );
  pointer-events: none;
  border-radius: 8px;
}

/* --- Responsive Scaling (Perfect Alignment, No Cut-offs) --- */

/* Small Laptops & Tablets (Max 1024px) */
@media (max-width: 1024px) {
  .cx-3d-viewport {
    height: 450px;
    perspective: 1200px;
  }
  .cx-3d-prism {
    --card-width: 650px;
    --radius: 785px; /* 650 * 1.207 */
    height: 365px;
  }
  .cx-text-content {
    padding: 0 40px;
  }
}

/* Mobile Landscape & Standard Mobile (Max 768px) */
@media (max-width: 768px) {
  .cx-text-content {
    margin-bottom: 3vh;
  }
  .cx-master-title {
    margin-bottom: 15px;
  }

  .cx-3d-viewport {
    perspective: 1000px;
    height: 350px;
  }
  .cx-3d-prism {
    --card-width: 480px;
    --radius: 579px; /* 480 * 1.207 */
    height: 270px;
  }
  .cx-ambient-glow {
    width: 90vw;
    height: 90vw;
  }
}

/* Small Mobile (Max 480px) */
@media (max-width: 480px) {
  .cx-text-content {
    padding: 0 20px;
    margin-bottom: 2vh;
  }
  .cx-header-main {
    font-size: 12px;
    line-height: 1.5;
    margin-bottom: 10px;
  }
  .cx-header-sub {
    display: none;
  }
  .cx-header-tagline {
    font-size: 10px;
  }

  .cx-3d-viewport {
    perspective: 800px;
    height: 280px;
  }
  .cx-3d-prism {
    --card-width: 340px;
    --radius: 410px; /* 340 * 1.207 */
    height: 190px;
  }
  .cx-interaction-hint {
    font-size: 8px;
    letter-spacing: 2px;
  }
}
