/**
 * PRIMA GROUPS — DESIGN SYSTEM & 3D MOTION ENGINE
 * Inspired by Bending Spoons (bendingspoons.com)
 * Architecture: Clean Vanilla CSS + 3D Transform Utilities
 */

/* ==========================================================================
   1. LENIS SMOOTH SCROLL ENGINE (Official Recommended CSS)
   Prevents browser native smooth-scroll conflicts and eliminates jank/stutter
   ========================================================================== */
html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.lenis.lenis-smooth iframe {
  pointer-events: none;
}

/* ==========================================================================
   2. ROOT VARIABLES & GLOBAL BASE TYPOGRAPHY
   ========================================================================== */
:root {
  --color-accent: #F2C94C;           /* Imperial Gold from primagroups-logo.png */
  --color-gold: #D4AF37;
  --color-skypro: #1E88E5;
  --color-termite: #16398F;
  --color-outsourcing: #7B2382;
  --color-navy-dark: #071126;        /* Enterprise Holding Dark Blue */
  --color-navy-deep: #040915;
  --perspective-midrange: 1100px;
}

html, body {
  background-color: #071126;
  color: #ffffff;
  font-family: 'Instrument Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Minimalist Dark Navy Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: #040915;
}
::-webkit-scrollbar-thumb {
  background: #162B4D;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #F2C94C;
}

/* Instrument Serif typography helper */
.font-serif {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
}

.text-accent {
  color: #F2C94C;
}

/* ==========================================================================
   3. 3D SPATIAL CYLINDER ENGINE
   Reverse-engineered from Bending Spoons 0l-3jmj~vm9b_.js
   ========================================================================== */
.perspective-midrange {
  perspective: 1100px;
  -webkit-perspective: 1100px;
}

.transform-3d {
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
}

.backface-hidden {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Enforced Extra-Large Responsive Sizing for 3D Carousel Cards */
.carousel {
  position: relative;
  width: 290px;
  height: 365px;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  will-change: transform;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}

@media (min-width: 640px) {
  .carousel {
    width: 350px;
    height: 440px;
  }
}

@media (min-width: 1024px) {
  .carousel {
    width: 410px;
    height: 520px;
  }
}

@media (min-width: 1280px) {
  .carousel {
    width: 450px;
    height: 565px;
  }
}

@media (min-width: 1536px) {
  .carousel {
    width: 480px;
    height: 600px;
  }
}

.carousel:active {
  cursor: grabbing;
}

.card {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 5;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform, opacity;
  border-radius: 2rem;
  overflow: hidden;
  box-shadow: 0 30px 75px -15px rgba(0, 0, 0, 0.95);
  transition: box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.35s ease, opacity 0.35s ease;
  border: 1px solid rgba(255, 255, 255, 0.16);
  text-decoration: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  display: block;
  cursor: pointer;
  touch-action: pan-y;
}

.card * {
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

/* High-Performance Hardware-Accelerated Video Layer */
.card video {
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  contain: strict;
}

@media (min-width: 768px) {
  .card {
    border-radius: 2.75rem;
  }
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 45px 95px -15px rgba(0, 0, 0, 0.7);
}

/* Brand-Specific 3D Card Hover Glows */
.card.card-theme-gold:hover {
  border-color: rgba(242, 201, 76, 0.95);
  box-shadow: 0 45px 95px -15px rgba(242, 201, 76, 0.55);
}

.card.card-theme-sky:hover {
  border-color: rgba(66, 165, 245, 0.95);
  box-shadow: 0 45px 95px -15px rgba(30, 136, 229, 0.6);
}

.card.card-theme-termite:hover {
  border-color: rgba(30, 74, 184, 0.95);
  box-shadow: 0 45px 95px -15px rgba(22, 57, 143, 0.55);
}

.card.card-theme-purple:hover {
  border-color: rgba(168, 50, 166, 0.95);
  box-shadow: 0 45px 95px -15px rgba(123, 35, 130, 0.6);
}

.card.card-theme-fms:hover,
.card.card-theme-cyan:hover {
  border-color: rgba(30, 75, 163, 0.95);
  box-shadow: 0 45px 95px -15px rgba(30, 75, 163, 0.7);
}

/* Edge Horizon Vignette (seamless 5% edge fade, zero cut-off lines) */
.horizon-vignette {
  position: absolute;
  pointer-events: none;
  top: -250px !important;
  bottom: -250px !important;
  left: 0;
  right: 0;
  height: auto !important;
  background: linear-gradient(
    90deg,
    #071126 0%,
    rgba(7, 17, 38, 0.45) 2.5%,
    transparent 5%,
    transparent 95%,
    rgba(7, 17, 38, 0.45) 97.5%,
    #071126 100%
  );
}

/* ==========================================================================
   4. BENDING SPOONS GIANT COLORED CARD DROP-SHADOW GLOWS
   Tuned specifically to the exact logo colors in assets/logo/
   ========================================================================== */
.card-glow-gold {
  box-shadow: 0 90px 110px -60px #D4AF37;
}

.card-glow-cyan {
  box-shadow: 0 90px 110px -60px #0F2B5C;
}

.card-glow-sky {
  box-shadow: 0 90px 110px -60px #1E88E5;
}

.card-glow-navy {
  box-shadow: 0 90px 110px -60px #16398F;
}

.card-glow-purple {
  box-shadow: 0 90px 110px -60px #7B2382;
}

/* ==========================================================================
   5. SEAMLESS FLOATING LOGO CONTAINER (ZERO WHITE BACKGROUND BOX)
   Direct brand integration floating naturally over card gradients and videos
   ========================================================================== */
.card-logo-box {
  width: 100%;
  max-width: 300px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  margin-right: auto;
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
  border: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 640px) {
  .card-logo-box {
    height: 155px;
  }
}

.card:hover .card-logo-box {
  transform: scale(1.06);
}

.card-logo-box img,
.card-logo-box svg {
  width: auto;
  height: auto;
  max-width: 88%;
  max-height: 82%;
  object-fit: contain;
  display: block;
  margin: auto;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.4));
  transition: filter 0.35s ease, transform 0.35s ease;
}

.card:hover .card-logo-box img,
.card:hover .card-logo-box svg {
  filter: drop-shadow(0 14px 32px rgba(0, 0, 0, 0.6));
}
