/* ==========================================================================
   PEN2DIGITAL.IO - FUTURISTIC 3D & INTERACTIVE CYBERNETIC SUITE
   Aesthetics: Ultra-Modern Cyber-Editorial & Futuristic 3D Glassmorphism
   Features:
     - 3D Holographic Particle Matrix Canvas
     - 3D Interactive Floating Book Showcase with Cyber Pedestal
     - Gyroscopic 3D Perspective Mouse Tilt & Dynamic Specular Glare
     - Custom Futuristic Cyber Cursor & Trailing Aura
     - Animated Neon / Conic Gradient Cyber Borders
     - Futuristic HUD Badges & Telemetry
     - Floating Futuristic Sound FX HUD Toggle
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Futuristic Color Tokens & Extended Cyber Variables
   -------------------------------------------------------------------------- */
:root {
  --cyber-neon-blue: #00D2FF;
  --cyber-electric: #006ACE;
  --cyber-purple: #7928CA;
  --cyber-indigo: #6366F1;
  --cyber-emerald: #10B981;
  --cyber-glow-blue: rgba(0, 210, 255, 0.4);
  --cyber-glow-electric: rgba(0, 106, 206, 0.35);
  --cyber-grid-line: rgba(0, 106, 206, 0.08);
  --cyber-card-bg: rgba(255, 255, 255, 0.88);
  --cyber-card-border: rgba(0, 106, 206, 0.16);
}

/* --------------------------------------------------------------------------
   2. Custom Futuristic Cyber Cursor
   -------------------------------------------------------------------------- */
@media (hover: hover) and (pointer: fine) {
  body.cyber-cursor-active {
    cursor: none;
  }

  body.cyber-cursor-active a,
  body.cyber-cursor-active button,
  body.cyber-cursor-active input,
  body.cyber-cursor-active select,
  body.cyber-cursor-active [role="button"],
  body.cyber-cursor-active .clickable {
    cursor: none !important;
  }

  .cyber-cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    background: var(--cyber-neon-blue);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99999;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px var(--cyber-neon-blue), 0 0 20px rgba(0, 210, 255, 0.8);
    transition: width 0.15s ease, height 0.15s ease, background 0.2s ease, opacity 0.2s ease;
    mix-blend-mode: normal;
  }

  .cyber-cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    width: 36px;
    height: 36px;
    border: 1.5px solid rgba(0, 106, 206, 0.6);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99998;
    transform: translate(-50%, -50%);
    transition: width 0.22s cubic-bezier(0.16, 1, 0.3, 1),
                height 0.22s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.2s ease,
                background 0.2s ease,
                box-shadow 0.2s ease;
    box-shadow: 0 0 16px rgba(0, 106, 206, 0.25);
  }

  /* Hover States on Clickables */
  .cyber-cursor-ring.cursor-hover {
    width: 54px;
    height: 54px;
    border-color: var(--cyber-neon-blue);
    background: rgba(0, 210, 255, 0.08);
    box-shadow: 0 0 24px rgba(0, 210, 255, 0.45);
  }

  .cyber-cursor-dot.cursor-hover {
    width: 12px;
    height: 12px;
    background: #FFFFFF;
    box-shadow: 0 0 14px #FFFFFF, 0 0 25px var(--cyber-neon-blue);
  }

  /* Click Shockwave */
  .cyber-click-wave {
    position: fixed;
    border-radius: 50%;
    border: 2px solid var(--cyber-neon-blue);
    pointer-events: none;
    z-index: 99997;
    transform: translate(-50%, -50%) scale(0);
    animation: cyberRipple 0.6s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
  }
}

@keyframes cyberRipple {
  0% {
    width: 10px;
    height: 10px;
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.2);
  }
  100% {
    width: 90px;
    height: 90px;
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.6);
  }
}

/* --------------------------------------------------------------------------
   3. Hero Cyber Particle Canvas & 3D Depth Grid
   -------------------------------------------------------------------------- */
.hero-section {
  position: relative;
  overflow: hidden;
}

#cyber-particles-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.85;
}

/* Futuristic Cyber Grid Floor Overlay in Hero */
.hero-cyber-grid {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    linear-gradient(to right, var(--cyber-grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--cyber-grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 40%, rgba(0,0,0,0.7) 10%, rgba(0,0,0,0) 80%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, rgba(0,0,0,0.7) 10%, rgba(0,0,0,0) 80%);
  z-index: 1;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   4. Futuristic HUD Telemetry Badges & Glow Pill
   -------------------------------------------------------------------------- */
.cyber-hud-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 14, 43, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 106, 206, 0.3);
  padding: 8px 18px;
  border-radius: 9999px;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--color-primary);
  box-shadow: 0 4px 20px rgba(0, 106, 206, 0.12);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.cyber-hud-badge::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 210, 255, 0.35), transparent);
  animation: hudScanner 3.5s infinite;
}

@keyframes hudScanner {
  0% { left: -100%; }
  50%, 100% { left: 150%; }
}

.cyber-tag {
  font-family: monospace;
  color: var(--cyber-neon-blue);
  background: rgba(0, 14, 43, 0.9);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.72rem;
  letter-spacing: 1px;
}

/* --------------------------------------------------------------------------
   5. Clean Modern Card Hover Styles (Zero Tilt)
   -------------------------------------------------------------------------- */
.package-card,
.process-card,
.metric-card,
.book-card,
.llc-card,
.calculator-card,
.testimonial-card,
.hero-mockup-wrapper {
  transform: none;
  transform-style: flat;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
              box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.2s ease;
}

.package-card:hover,
.process-card:hover,
.book-card:hover,
.llc-card:hover,
.testimonial-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 36px rgba(0, 14, 43, 0.08), 0 0 20px rgba(0, 106, 206, 0.1);
}

.metric-card:hover {
  transform: translateY(-3px);
}

/* --------------------------------------------------------------------------
   6. 3D Interactive Holographic Book Showcase in Hero
   -------------------------------------------------------------------------- */
.hero-3d-interactive-showcase {
  position: relative;
  margin-top: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  perspective: 1400px;
  z-index: 4;
}

.hero-3d-book-stage {
  position: relative;
  width: 100%;
  max-width: 980px;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 36px;
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 106, 206, 0.2);
  border-radius: 24px;
  padding: 36px 40px;
  box-shadow: 0 30px 70px rgba(0, 14, 43, 0.12),
              0 0 50px rgba(0, 106, 206, 0.1),
              inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

@media (max-width: 900px) {
  .hero-3d-book-stage {
    grid-template-columns: 1fr;
    padding: 24px;
  }
}

/* Left side of stage: Live Telemetry & Quick Action */
.stage-telemetry {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.telemetry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--color-border-light);
  padding-bottom: 12px;
}

.telemetry-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: monospace;
  font-size: 0.78rem;
  color: var(--cyber-emerald);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.telemetry-status .pulse-circle {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyber-emerald);
  box-shadow: 0 0 10px var(--cyber-emerald);
  animation: pulseDot 1.6s infinite;
}

.stage-title {
  font-family: var(--font-heading);
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1.25;
}

.stage-desc {
  font-size: 0.94rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 8px;
}

.telemetry-box {
  background: #F8FAFC;
  border: 1px solid var(--color-border-light);
  border-radius: 12px;
  padding: 12px 14px;
  transition: all 0.25s ease;
}

.telemetry-box:hover {
  border-color: var(--color-accent-blue);
  background: #FFFFFF;
  box-shadow: 0 4px 15px rgba(0, 106, 206, 0.08);
}

.telemetry-lbl {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.telemetry-val {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--color-primary);
  margin-top: 2px;
}

.stage-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

/* Right side of stage: The 3D Rotating Holographic Book */
.stage-book-viewport {
  position: relative;
  height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1200px;
}

/* Hologram Pedestal Base */
.hologram-pedestal {
  position: absolute;
  bottom: 10px;
  width: 220px;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 210, 255, 0.45) 0%, rgba(0, 106, 206, 0.15) 50%, transparent 75%);
  box-shadow: 0 0 35px rgba(0, 210, 255, 0.5);
  animation: pedestalGlow 3s ease-in-out infinite alternate;
  pointer-events: none;
}

.hologram-pedestal::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 170px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px dashed rgba(0, 210, 255, 0.8);
  animation: spinRings 12s linear infinite;
}

@keyframes pedestalGlow {
  0% { transform: scale(0.95); opacity: 0.7; }
  100% { transform: scale(1.08); opacity: 1; }
}

@keyframes spinRings {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 3D Realistic Book Structure */
.book-3d-scene {
  width: 190px;
  height: 275px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: grab;
  user-select: none;
}

.book-3d-scene:active {
  cursor: grabbing;
}

.book-3d-container {
  width: 100%;
  height: 100%;
  position: absolute;
  transform-style: preserve-3d;
  animation: bookFloat 4.5s ease-in-out infinite;
}

@keyframes bookFloat {
  0% { transform: translateY(0px) rotateY(-18deg) rotateX(10deg); }
  50% { transform: translateY(-16px) rotateY(-10deg) rotateX(6deg); }
  100% { transform: translateY(0px) rotateY(-18deg) rotateX(10deg); }
}

/* Front Cover */
.book-face-front {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 3px 8px 8px 3px;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(0, 14, 43, 0.25);
  backface-visibility: hidden;
  transform: translateZ(14px);
  background: #000E2B;
}

.book-face-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Hologram Laser Scanner Line on Book */
.book-face-front::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #00D2FF, #FFFFFF, #00D2FF, transparent);
  box-shadow: 0 0 12px #00D2FF, 0 0 24px #00D2FF;
  animation: laserScan 3.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  opacity: 0.9;
}

@keyframes laserScan {
  0% { top: 0%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* Book Spine (Left side) */
.book-face-spine {
  position: absolute;
  width: 28px;
  height: 100%;
  left: -14px;
  top: 0;
  background: linear-gradient(90deg, #000717, #061A40, #000E2B);
  transform: rotateY(-90deg);
  border-radius: 3px 0 0 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.6);
}

.book-spine-text {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  color: #D97706;
  font-family: var(--font-heading);
  font-size: 0.65rem;
  letter-spacing: 2px;
  font-weight: 700;
  text-transform: uppercase;
}

/* Book Page Edge (Right side) */
.book-face-pages {
  position: absolute;
  width: 26px;
  height: 98%;
  right: -13px;
  top: 1%;
  background: repeating-linear-gradient(
    to bottom,
    #F8FAFC,
    #F8FAFC 2px,
    #E2E8F0 3px,
    #CBD5E1 4px
  );
  transform: rotateY(90deg);
  box-shadow: inset 0 0 6px rgba(0,0,0,0.15);
}

/* Book Top Pages Edge */
.book-face-top {
  position: absolute;
  width: 100%;
  height: 26px;
  top: -13px;
  background: #F1F5F9;
  transform: rotateX(90deg);
  box-shadow: inset 0 0 6px rgba(0,0,0,0.1);
}

/* Book Bottom Edge */
.book-face-bottom {
  position: absolute;
  width: 100%;
  height: 26px;
  bottom: -13px;
  background: #E2E8F0;
  transform: rotateX(-90deg);
}

/* Book Back Cover */
.book-face-back {
  position: absolute;
  width: 100%;
  height: 100%;
  background: #000717;
  transform: translateZ(-14px) rotateY(180deg);
  border-radius: 8px 3px 3px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: #94A3B8;
  font-size: 0.72rem;
  text-align: center;
}

/* --------------------------------------------------------------------------
   7. Rotating Conic-Gradient Cyber Neon & Glowing Tier 02 Card (White Typography)
   -------------------------------------------------------------------------- */
.package-card.popular {
  position: relative;
  z-index: 2;
  border: 1px solid transparent !important;
  background: linear-gradient(145deg, #005bb7 0%, #0088ff 50%, #4f46e5 100%);
  background-clip: padding-box;
  color: #FFFFFF !important;
}

.package-card.popular::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: calc(var(--radius-lg) + 2px);
  background: conic-gradient(
    from var(--conic-angle, 0deg),
    #006ACE 0%,
    #00D2FF 25%,
    #6366F1 50%,
    #00D2FF 75%,
    #006ACE 100%
  );
  z-index: -1;
  animation: rotateConic 6s linear infinite;
}

@property --conic-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

@keyframes rotateConic {
  from { --conic-angle: 0deg; }
  to { --conic-angle: 360deg; }
}

/* Tier 02 Growth Accelerator - Crisp White Prominent Typography */
.package-card.popular,
.package-card.popular * {
  color: #FFFFFF !important;
}

.package-card.popular .pkg-tier-name {
  color: #FFFFFF !important;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-shadow: 0 1px 4px rgba(0, 14, 43, 0.4);
  opacity: 0.95;
}

.package-card.popular .pkg-name {
  color: #FFFFFF !important;
  font-weight: 800;
  text-shadow: 0 2px 10px rgba(0, 14, 43, 0.45);
}

.package-card.popular .pkg-tagline {
  color: #F8FAFC !important;
  font-weight: 500;
  text-shadow: 0 1px 4px rgba(0, 14, 43, 0.3);
  opacity: 0.95;
}

.package-card.popular .pkg-pricing-box {
  border-top: 1px solid rgba(255, 255, 255, 0.3) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.package-card.popular .pkg-delivery-time {
  color: #FFFFFF !important;
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0, 14, 43, 0.35);
}

.package-card.popular .pkg-delivery-time svg {
  color: #FFFFFF !important;
  stroke: #FFFFFF !important;
  filter: drop-shadow(0 1px 3px rgba(0, 14, 43, 0.4));
}

.package-card.popular .pkg-features-list li {
  color: #FFFFFF !important;
  text-shadow: 0 1px 3px rgba(0, 14, 43, 0.35);
  font-weight: 500;
}

.package-card.popular .pkg-features-list li span {
  color: #FFFFFF !important;
}

.package-card.popular .pkg-features-list li b,
.package-card.popular .pkg-features-list li strong {
  color: #FFFFFF !important;
  font-weight: 800;
  text-shadow: 0 1px 4px rgba(0, 14, 43, 0.4);
}

.package-card.popular .pkg-features-list li svg {
  color: #FFFFFF !important;
  stroke: #FFFFFF !important;
  stroke-width: 2.8 !important;
  filter: drop-shadow(0 1px 4px rgba(0, 14, 43, 0.45));
}

.package-card.popular .popular-badge {
  background: #FFFFFF !important;
  color: #006ACE !important;
  box-shadow: 0 6px 20px rgba(0, 14, 43, 0.3) !important;
  border: 1px solid rgba(255, 255, 255, 0.95);
  font-weight: 800;
  z-index: 10;
}

.package-card.popular .btn-primary {
  box-shadow: 0 6px 24px rgba(0, 14, 43, 0.4) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.6) !important;
}

.package-card.popular .btn-primary:hover {
  border-color: #FFFFFF !important;
  box-shadow: 0 10px 30px rgba(0, 14, 43, 0.5) !important;
}

/* --------------------------------------------------------------------------
   8. Futuristic Magnetic Buttons & Shimmer Shine
   -------------------------------------------------------------------------- */
.btn-primary,
.btn-secondary {
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.25s ease,
              background-color 0.2s ease;
}

.btn-primary::after,
.btn-secondary::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 40%;
  height: 200%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  transform: rotate(25deg);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-primary:hover::after,
.btn-secondary:hover::after {
  opacity: 1;
  animation: buttonLightPass 1s ease forwards;
}

@keyframes buttonLightPass {
  0% { left: -60%; }
  100% { left: 160%; }
}

/* --------------------------------------------------------------------------
   9. Floating Futuristic Audio Toggle HUD (Bottom-Right)
   -------------------------------------------------------------------------- */
.cyber-audio-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 14, 43, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #FFFFFF;
  border: 1px solid rgba(0, 210, 255, 0.35);
  padding: 8px 14px;
  border-radius: 9999px;
  font-family: monospace;
  font-size: 0.76rem;
  letter-spacing: 0.5px;
  box-shadow: 0 8px 24px rgba(0, 14, 43, 0.3), 0 0 15px rgba(0, 210, 255, 0.2);
  cursor: pointer;
  transition: all 0.25s ease;
}

.cyber-audio-toggle:hover {
  border-color: var(--cyber-neon-blue);
  box-shadow: 0 10px 30px rgba(0, 14, 43, 0.4), 0 0 25px rgba(0, 210, 255, 0.45);
  transform: translateY(-2px);
}

.cyber-audio-toggle.active {
  border-color: var(--cyber-emerald);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.cyber-audio-toggle .audio-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
}

/* --------------------------------------------------------------------------
   10. Interactive 3D Mockup Scanner Beam in Hero
   -------------------------------------------------------------------------- */
.hero-mockup-wrapper {
  position: relative;
  overflow: hidden;
}

.hero-mockup-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #00D2FF 50%, transparent);
  box-shadow: 0 0 15px #00D2FF, 0 0 30px #00D2FF;
  z-index: 5;
  animation: mockupScan 4.5s ease-in-out infinite;
  opacity: 0.75;
  pointer-events: none;
}

@keyframes mockupScan {
  0% { top: 0%; opacity: 0; }
  15% { opacity: 0.85; }
  85% { opacity: 0.85; }
  100% { top: 100%; opacity: 0; }
}

/* Futuristic HUD Telemetry overlay on hero mockup */
.mockup-hud-overlay {
  position: absolute;
  bottom: 14px;
  left: 16px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 14, 43, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 210, 255, 0.3);
  padding: 6px 14px;
  border-radius: 8px;
  font-family: monospace;
  font-size: 0.72rem;
  color: #E2E8F0;
  pointer-events: none;
}

.mockup-hud-overlay .hud-pill {
  color: var(--cyber-neon-blue);
  font-weight: 700;
}
