/**
 * Mediaspot Homepage Specific Stylesheet
 * 
 * 3D Hardware-Accelerated Cube, Ambient Drift Stripes,
 * Background Canvases, and Scroll Reveal Animations.
 *
 * @package Mediaspot
 */

/* ==========================================================================
   1. 3D Hardware-Accelerated Cube & Ambient Light Stripes
   ========================================================================== */
:root {
  --cube-size: 260px;
  --cube-half: calc(var(--cube-size) / 2);
  --cube-radius: calc(var(--cube-size) * 0.08);
  --cube-loop: 28s;
}

/* Ambient Light Stripes Drift */
.stripe {
  position: absolute;
  left: 0;
  width: 1400px;
  border-radius: 999px;
  transform-origin: left center;
  will-change: transform;
  animation: stripe-drift var(--cube-loop) linear infinite;
  pointer-events: none;
}

@keyframes stripe-drift {
  from { transform: translateX(-1200px) rotate(-22deg); }
  to   { transform: translateX(2600px) rotate(-22deg); }
}

.s1 { top: 15%; height: 28px; filter: blur(20px); opacity: .28; animation-delay: -2s; background: linear-gradient(90deg, rgba(255,255,255,0) 0%, var(--brand-yellow) 40%, var(--brand-yellow) 60%, rgba(255,255,255,0) 100%); }
.s2 { top: 38%; height: 6px;  filter: blur(4px);  opacity: .42; animation-delay: -11s; background: linear-gradient(90deg, rgba(255,255,255,0) 0%, var(--brand-teal) 40%, var(--brand-teal) 60%, rgba(255,255,255,0) 100%); }
.s3 { top: 62%; height: 32px; filter: blur(22px); opacity: .25; animation-delay: -17s; background: linear-gradient(90deg, rgba(255,255,255,0) 0%, var(--brand-blue) 40%, var(--brand-blue) 60%, rgba(255,255,255,0) 100%); }
.s4 { top: 82%; height: 8px;  filter: blur(5px);  opacity: .35; animation-delay: -6s; background: linear-gradient(90deg, rgba(255,255,255,0) 0%, var(--brand-red) 40%, var(--brand-red) 60%, rgba(255,255,255,0) 100%); }

/* 3D Scene & Perspective */
.cube-scene {
  position: relative;
  width: 100%;
  max-width: 380px;
  height: 380px;
  min-height: 380px;
  aspect-ratio: 1 / 1;
  perspective: 1600px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  contain: layout style;
}

.cube-tilt {
  position: absolute;
  width: 0;
  height: 0;
  transform-style: preserve-3d;
  transform: rotateX(calc(-16deg + (var(--ty, 0) * 1deg))) rotateY(calc(var(--tx, 0) * 1deg));
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cube-3d {
  position: absolute;
  width: 0;
  height: 0;
  transform-style: preserve-3d;
  will-change: transform;
  animation: cube-spin var(--cube-loop) linear infinite;
}

.cube-3d:hover {
  animation-play-state: paused;
}

@keyframes cube-spin {
  from { transform: rotateY(0deg); }
  to   { transform: rotateY(360deg); }
}

.cube-face {
  position: absolute;
  left: 0; top: 0;
  width: var(--cube-size);
  height: var(--cube-size);
  margin-left: calc(var(--cube-half) * -1);
  margin-top: calc(var(--cube-half) * -1);
  background: #ffffff;
  border-radius: var(--cube-radius);
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cube-face img {
  width: 160px;
  height: 184px;
  max-width: 64%;
  max-height: 64%;
  aspect-ratio: 410 / 470;
  object-fit: contain;
  display: block;
  user-select: none;
  pointer-events: none;
}

.cube-face::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--cube-radius);
  background: radial-gradient(120% 120% at 20% 15%, rgba(255,255,255,.95), rgba(248,250,252,0) 65%);
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.f-top::after, .f-bottom::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--cube-radius);
  pointer-events: none;
}
.f-top::after    { background: linear-gradient(180deg, rgba(11,11,12,0) 0%, rgba(11,11,12,.035) 100%); }
.f-bottom::after { background: linear-gradient(180deg, rgba(11,11,12,.085) 0%, rgba(11,11,12,.03) 100%); }

.cube-line {
  position: absolute;
  left: 12%;
  right: 12%;
  border-radius: 999px;
  pointer-events: none;
}
.cube-line.bottom {
  bottom: calc(var(--cube-size) * .07);
  height: 4px;
  filter: blur(2px);
  opacity: .85;
}
.cube-line.top {
  top: calc(var(--cube-size) * .07);
  height: 2px;
  filter: blur(1.5px);
  opacity: .45;
}

.f-front  { transform: rotateY(0deg) translateZ(var(--cube-half)); }
.f-right  { transform: rotateY(90deg) translateZ(var(--cube-half)); }
.f-back   { transform: rotateY(180deg) translateZ(var(--cube-half)); }
.f-left   { transform: rotateY(-90deg) translateZ(var(--cube-half)); }
.f-top    { transform: rotateX(90deg) translateZ(var(--cube-half)); }
.f-bottom { transform: rotateX(-90deg) translateZ(var(--cube-half)); }

.c-yel .cube-line  { background: linear-gradient(90deg, rgba(255,255,255,0) 0%, var(--brand-yellow) 25%, var(--brand-yellow) 75%, rgba(255,255,255,0) 100%); }
.c-teal .cube-line { background: linear-gradient(90deg, rgba(255,255,255,0) 0%, var(--brand-teal) 25%, var(--brand-teal) 75%, rgba(255,255,255,0) 100%); }
.c-red .cube-line  { background: linear-gradient(90deg, rgba(255,255,255,0) 0%, var(--brand-red) 25%, var(--brand-red) 75%, rgba(255,255,255,0) 100%); }
.c-blue .cube-line { background: linear-gradient(90deg, rgba(255,255,255,0) 0%, var(--brand-blue) 25%, var(--brand-blue) 75%, rgba(255,255,255,0) 100%); }

.cube-core {
  position: absolute;
  left: 0; top: 0;
  width: var(--cube-size);
  height: var(--cube-size);
  margin-left: calc(var(--cube-half) * -1);
  margin-top: calc(var(--cube-half) * -1);
  background: #ffffff;
  border-radius: calc(var(--cube-radius) * .35);
}
.cube-core.k-front  { transform: rotateY(0deg) translateZ(calc(var(--cube-half) - var(--cube-radius) * .32)); }
.cube-core.k-back   { transform: rotateY(180deg) translateZ(calc(var(--cube-half) - var(--cube-radius) * .32)); }
.cube-core.k-right  { transform: rotateY(90deg) translateZ(calc(var(--cube-half) - var(--cube-radius) * .32)); }
.cube-core.k-left   { transform: rotateY(-90deg) translateZ(calc(var(--cube-half) - var(--cube-radius) * .32)); }
.cube-core.k-top    { transform: rotateX(90deg) translateZ(calc(var(--cube-half) - var(--cube-radius) * .32)); }
.cube-core.k-bottom { transform: rotateX(-90deg) translateZ(calc(var(--cube-half) - var(--cube-radius) * .32)); }

/* Ground Shadow & Atmospheric Glow under Cube */
.cube-glow {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, 90px);
  width: 380px; height: 80px;
  background: radial-gradient(closest-side, rgba(27, 191, 166, 0.35), rgba(63, 169, 228, 0.15) 60%, rgba(255,255,255,0) 100%);
  filter: blur(24px);
  pointer-events: none;
}
.cube-shadow {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, 115px);
  width: 240px; height: 35px;
  background: radial-gradient(closest-side, rgba(15, 23, 42, 0.22), rgba(0,0,0,0) 100%);
  filter: blur(14px);
  pointer-events: none;
}

/* ==========================================================================
   2. Scroll Reveal Transitions (Progressive Enhancement - 100% visible by default)
   ========================================================================== */
.reveal-elem {
  opacity: 1;
  transform: none;
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1), transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}
.js .reveal-elem {
  opacity: 0;
  transform: translateY(24px);
}
.js .reveal-elem.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   3. Section Specific Layout Enhancements
   ========================================================================== */

/* Hero Section Padding (Ensures generous spacing below sticky header) */
#hero {
  padding-top: 3rem !important;
  padding-bottom: 3.2rem;
}
@media (min-width: 640px) {
  #hero {
    padding-top: 3.75rem !important;
    padding-bottom: 4rem;
  }
}
@media (min-width: 1024px) {
  #hero {
    padding-top: 4.75rem !important;
    padding-bottom: 4.8rem;
  }
}

/* Services Flagship Top 2 Bento Grid: Always 2 Columns on Desktop */
.services-flagship-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
@media (min-width: 640px) {
  .services-flagship-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* Services Flagship Cards: glass surface + floating detached shadow */
.svc-flagship-card {
  position: relative;
  isolation: isolate;
  border-radius: 1.75rem;
  padding: 2rem;
  background:
    radial-gradient(140% 120% at 0% 0%, var(--svc-tint, rgba(27, 191, 166, 0.14)) 0%, transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.99));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(15, 23, 42, 0.07);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.4s ease, box-shadow 0.4s ease;
}
@media (min-width: 1024px) {
  .svc-flagship-card {
    padding: 2.5rem;
  }
}

/* Soft blurred ellipse pooling under the card: reads as detached/floating from the page background */
.svc-flagship-card::after {
  content: '';
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -18px;
  height: 36px;
  z-index: -1;
  border-radius: 50%;
  background: var(--svc-shadow-color, rgba(27, 191, 166, 0.4));
  filter: blur(22px);
  opacity: 0.5;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.svc-flagship-card:hover,
.js .svc-flagship-card.is-visible:hover {
  transform: translateY(-6px);
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.svc-flagship-card:hover::after {
  opacity: 0.85;
  transform: translateY(6px) scale(1.04);
}

.svc-flagship-card--teal {
  --svc-tint: rgba(27, 191, 166, 0.16);
  --svc-shadow-color: rgba(27, 191, 166, 0.42);
}
.svc-flagship-card--amber {
  --svc-tint: rgba(245, 178, 26, 0.18);
  --svc-shadow-color: rgba(245, 178, 26, 0.42);
}

.svc-flagship-icon {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.svc-flagship-icon--teal {
  background: linear-gradient(135deg, #1bbfa6, #0f8f7c);
  box-shadow: 0 10px 20px -8px rgba(15, 143, 124, 0.65);
}
.svc-flagship-icon--amber {
  background: linear-gradient(135deg, #f5b21a, #d18c05);
  box-shadow: 0 10px 20px -8px rgba(209, 140, 5, 0.6);
}

/* Accessible Native FAQ Details/Summary Accordion */
details.faq-item {
  transition: all 0.25s ease;
}
details.faq-item summary::-webkit-details-marker {
  display: none !important;
}
details.faq-item summary {
  list-style: none !important;
}
details.faq-item[open] {
  border-color: #99f6e4;
  background-color: rgba(240, 253, 250, 0.4);
}
details.faq-item[open] .faq-icon {
  transform: rotate(180deg);
  background-color: #f0fdfa;
  color: #115e59;
}

/* Prefers Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .cube-3d, .stripe, .reveal-elem {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}
