/* ============================================================
   Xelta – MOBILE RESPONSIVE STYLES
   Only applies to screens ≤ 768px
   Desktop/tablet styles are completely untouched.
   ============================================================ */

@media screen and (max-width: 768px) {

  /* ── NAVBAR ─────────────────────────────────────────────── */
  .navbar {
    padding: 0.85rem 1.2rem !important;
    justify-content: space-between !important;
  }

  .nav-logo {
    display: flex !important;
    align-items: center !important;
    gap: 0.45rem !important;
    font-size: 1.05rem !important;
    z-index: 1002 !important;
    order: 1 !important;
  }

  .logo-img {
    height: 46px !important;
    /* width: auto !important; */
  }

  .logo-icon {
    display: inline-block !important;
    font-size: 1.35rem !important;
  }

  .logo-text {
    display: inline-block !important;
  }

  .nav-links,
  .nav-cta {
    display: none !important;
  }

  .hamburger {
    display: flex !important;
    order: 2 !important;
    z-index: 1002 !important;
  }

  /* Mobile nav menu (opened by JS) */
  .nav-links.mobile-open {
    display: flex !important;
    flex-direction: column !important;
    position: fixed !important;
    top: 56px !important;
    left: 0 !important;
    right: 0 !important;
    background: rgba(5, 5, 16, 0.98) !important;
    backdrop-filter: blur(20px) !important;
    padding: 1.5rem 2rem !important;
    gap: 1.5rem !important;
    border-bottom: 1px solid rgba(124, 58, 237, 0.3) !important;
    z-index: 999 !important;
  }

  .nav-links.mobile-open .nav-link {
    font-size: 0.9rem !important;
    letter-spacing: 2px !important;
  }

  /* ── HOME SECTION ───────────────────────────────────────── */
  .home-section {
    padding-top: 70px !important;
    min-height: 100svh !important;
  }

  .home-content {
    flex-direction: column !important;
    padding: 1.5rem 1.2rem !important;
    text-align: center !important;
    gap: 2rem !important;
    align-items: center !important;
  }

  /* CUBE FIRST on mobile */
  .cube-wrapper {
    order: -1 !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    margin-top: 0 !important;
  }

  /* HERO TEXT second on mobile */
  .hero-text {
    order: 0 !important;
    max-width: 100% !important;
  }

  .hero-title {
    font-size: clamp(1.8rem, 8vw, 2.6rem) !important;
    line-height: 1.15 !important;
  }

  .hero-sub {
    font-size: 0.95rem !important;
    margin: 0 auto 1.8rem !important;
    max-width: 95% !important;
  }

  .hero-btns {
    justify-content: center !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 0.8rem !important;
  }

  .btn-primary,
  .btn-outline {
    width: 100% !important;
    max-width: 280px !important;
    text-align: center !important;
    justify-content: center !important;
    padding: 0.85rem 1.5rem !important;
    font-size: 0.8rem !important;
  }

  /* ── 3D CUBE ────────────────────────────────────────────── */
  :root {
    --cube-size: 200px !important;
  }

  .cube-wrapper {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }

  .cube-hint {
    font-size: 0.65rem !important;
    margin-top: 1rem !important;
  }

  /* ── DEMO SECTION ───────────────────────────────────────── */
  .demo-section {
    padding: 3.5rem 1rem 2rem !important;
  }

  .demo-header {
    margin-bottom: 1.5rem !important;
  }

  .section-title {
    font-size: clamp(1.6rem, 6vw, 2.2rem) !important;
  }

  .section-sub {
    font-size: 0.9rem !important;
  }

  /* ── CAROUSEL ───────────────────────────────────────────── */
  .carousel-3d-container {
    padding: 1.5rem 0 1rem !important;
    margin: 0 0 1.5rem !important;
    overflow: hidden !important;
  }

  .carousel-arrow {
    width: 38px !important;
    height: 38px !important;
    z-index: 20 !important;
  }

  .carousel-arrow-left  { left: 6px !important; }
  .carousel-arrow-right { right: 6px !important; }

  .carousel-arrow svg {
    width: 18px !important;
    height: 18px !important;
  }

  .carousel-3d-wrapper {
    height: 310px !important;
    overflow: hidden !important;
  }

  /* Card sizes on mobile */
  .carousel-3d-item          { width: 140px !important; height: 200px !important; }
  .carousel-3d-item.active   { width: 180px !important; height: 250px !important; }

  /* Tap feedback instead of hover */
  .carousel-3d-item.active:hover {
    width: 180px !important;
    height: 250px !important;
    transform: translateX(0) perspective(600px) rotateY(0deg) scale(0.95) !important;
  }

  .carousel-3d-item.active:active {
    width: 195px !important;
    height: 265px !important;
    box-shadow: 0 0 30px rgba(124, 58, 237, 0.6) !important;
    transition: all 0.15s ease !important;
  }

  .card-info    { padding: 8px !important; }
  .card-title   { font-size: 0.8rem !important; }
  .card-subtitle{ font-size: 0.68rem !important; }
  .card-badge   { font-size: 0.52rem !important; padding: 2px 7px !important; }

  /* ── VIEW MORE BUTTON ───────────────────────────────────── */
  .view-more-container { margin: 0.8rem 0 1.2rem !important; }

  .btn-view-more {
    font-size: 0.72rem !important;
    padding: 0.8rem 2rem !important;
    letter-spacing: 1.5px !important;
  }

  .btn-view-more svg {
    width: 16px !important;
    height: 16px !important;
  }

  /* ── CREATIVE VIEWS SECTION ─────────────────────────────── */
  .creative-views-section {
    padding: 3rem 1rem 2rem !important;
  }

  .creative-views-header {
    margin-bottom: 2rem !important;
  }

  .creative-views-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.9rem !important;
  }

  .creative-card-info  { padding: 10px !important; }
  .creative-card-title { font-size: 0.85rem !important; }
  .creative-card-subtitle { font-size: 0.72rem !important; }
  .creative-badge      { font-size: 0.52rem !important; padding: 2px 8px !important; }

  /* Play icon always visible on mobile */
  .creative-view-card::after {
    opacity: 0.85 !important;
    font-size: 2.2rem !important;
  }

  /* Tap feedback */
  .creative-view-card:active {
    transform: scale(0.97) !important;
    opacity: 0.9 !important;
  }

  /* Disable hover lift on touch */
  .creative-view-card:hover {
    transform: none !important;
  }

  /* ── CREATIVE VIEWS MODAL ───────────────────────────────── */
  .creative-video-modal {
    padding: 0 !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .creative-modal-backdrop {
    position: fixed !important;
  }

  .creative-modal-content {
    width: 94% !important;
    max-width: 94% !important;
    max-height: fit-content !important;
    height: auto !important;
    border-radius: 10px !important;
    margin: 0 auto !important;
    position: relative !important;
    z-index: 100000 !important;
    overflow: hidden !important;
  }

  .creative-modal-video-wrap {
    max-height: none !important;
    height: auto !important;
    width: 100% !important;
  }

  .creative-modal-video-wrap video {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    object-fit: contain !important;
    display: block !important;
  }

  .creative-modal-info {
    padding: 1.2rem 1.2rem 1.8rem !important;
    min-height: auto !important;
  }

  .creative-modal-info h3 {
    font-size: 1.1rem !important;
    margin-bottom: 0.5rem !important;
  }

  .creative-modal-info p {
    font-size: 0.9rem !important;
    line-height: 1.5 !important;
  }

  .creative-modal-close {
    width: 38px !important;
    height: 38px !important;
    top: 0.6rem !important;
    right: 0.6rem !important;
    background: rgba(0, 0, 0, 0.85) !important;
  }

  .creative-modal-close svg {
    width: 18px !important;
    height: 18px !important;
  }

  /* ── GALLERY SECTION ────────────────────────────────────── */
  .gallery-section {
    padding: 3rem 1rem 2rem !important;
  }

  .gallery-header {
    flex-direction: column !important;
    gap: 1rem !important;
    text-align: center !important;
    margin-bottom: 2rem !important;
  }

  .video-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.9rem !important;
  }

  /* ── VIDEO MODAL (gallery) ──────────────────────────────── */
  .modal-content {
    width: 96% !important;
    max-height: 90vh !important;
  }

  #modalVideo {
    max-height: 55vh !important;
  }

  .modal-info {
    padding: 1rem !important;
  }

  .modal-info h3 { font-size: 1rem !important; }
  .modal-info p  { font-size: 0.82rem !important; }

  /* ── FOOTER ─────────────────────────────────────────────── */
  .footer {
    padding: 2.5rem 1.2rem 0 !important;
  }

  .footer-inner {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
    text-align: center !important;
  }

  .footer-brand p {
    max-width: 100% !important;
    margin: 0 auto !important;
  }

  .newsletter-form {
    max-width: 320px !important;
    margin: 0 auto !important;
  }

  .footer-bottom {
    font-size: 0.75rem !important;
    padding: 1rem 0 !important;
  }
}

/* ── EXTRA SMALL (≤ 420px) ──────────────────────────────── */
@media screen and (max-width: 420px) {

  :root { --cube-size: 170px !important; }

  .hero-title {
    font-size: clamp(1.5rem, 9vw, 2rem) !important;
  }

  .carousel-3d-wrapper { height: 270px !important; }

  .carousel-3d-item          { width: 120px !important; height: 175px !important; }
  .carousel-3d-item.active   { width: 155px !important; height: 220px !important; }

  .carousel-3d-item.active:hover {
    width: 155px !important;
    height: 220px !important;
  }

  .creative-views-grid {
    grid-template-columns: 1fr !important;
  }

  .video-grid {
    grid-template-columns: 1fr !important;
  }

  .creative-modal-content {
    width: 98% !important;
    max-height: fit-content !important;
    height: auto !important;
  }

  .creative-modal-video-wrap,
  .creative-modal-video-wrap video {
    max-height: none !important;
    height: auto !important;
  }
}

/* ============================================================
   MOBILE STICKY PARALLAX VIDEO STACK
   Each card sticks at the top while the next one slides over it.
   Desktop: stack hidden, carousel visible (unchanged).
   Mobile: carousel hidden, stack visible.
   ============================================================ */

/* ── DESKTOP: hide stack completely ── */
.mpv-stack {
  display: none;
}

@media screen and (max-width: 768px) {

  /* Hide carousel on mobile */
  .carousel-3d-container {
    display: none !important;
  }

  /* Show demo header on mobile */
  .demo-header {
    display: block !important;
    text-align: center !important;
    padding: 1.5rem 1rem 0.75rem !important;
    background: var(--bg2) !important;
    position: sticky !important;
    top: 70px !important;
    z-index: 50 !important;
  }

  /* Demo section: no extra padding */
  .demo-section {
    padding: 0 !important;
    min-height: unset !important;
    background: var(--bg2) !important;
  }

  /* ── OUTER SCROLL CONTAINER: 6 cards ── */
  .mpv-stack {
    display: block !important;
    position: relative !important;
    /* Dynamic height: each card gets 100vh of scroll, total = 6 * 100vh = 600vh */
    height: 600vh !important;
    margin: 0 !important;
  }

  /* ── POST-RESTRUCTURE: STICKY PARENT ── */
  .sticky-parent-container {
    position: sticky !important;
    top: calc(70px + 90px) !important; /* Navbar (70px) + Header (approx 90px) */
    height: calc(100vh - 160px) !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
  }

  .sticky-window-container {
    flex: 1 !important;
    position: relative !important;
    width: 100% !important;
  }

  /* ── WINDOW: previously sticky, now absolutely positioned inside flex item ── */
  .mpv-sticky-window {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    height: 100% !important;
    width: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 10px 1rem 1rem !important;
  }
  
  .view-more-mobile-container {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    z-index: 10 !important;
  }
  
  /* Hide desktop view more on mobile */
  #demo > .view-more-container {
    display: none !important;
  }

  /* ── EACH CARD: absolutely centered in the window ── */
  .mpv-sticky-card {
    position: absolute !important;
    top: 50% !important;
    left: 1rem !important;
    right: 1rem !important;
    width: calc(100% - 2rem) !important;
    /* Fixed height to ensure video area is visible */
    height: auto !important;
    min-height: 300px !important;
    /* Start below viewport */
    transform: translateY(calc(-50% + 100vh)) !important;
    overflow: hidden !important;
    border-radius: 14px !important;
    border: 1px solid rgba(124, 58, 237, 0.3) !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.7) !important;
    background: #000 !important;
    display: flex !important;
    flex-direction: column !important;
    transition: transform 0.22s ease-out, opacity 0.16s linear !important;
    will-change: transform, opacity !important;
    opacity: 0 !important;
  }

  /* First card starts centered and visible */
  .mpv-sticky-card[data-index="0"] {
    transform: translateY(-50%) !important;
    opacity: 1 !important;
    z-index: 1 !important;
  }

  /* z-index stacking */
  .mpv-sticky-card[data-index="1"] { z-index: 2 !important; }
  .mpv-sticky-card[data-index="2"] { z-index: 3 !important; }
  .mpv-sticky-card[data-index="3"] { z-index: 4 !important; }
  .mpv-sticky-card[data-index="4"] { z-index: 5 !important; }
  .mpv-sticky-card[data-index="5"] { z-index: 6 !important; }

  /* Active card: centered and visible */
  .mpv-sticky-card.mpv-visible {
    transform: translateY(-50%) !important;
    opacity: 1 !important;
  }

  /* ── VIDEO AREA: Fixed 16:9 aspect ratio ── */
  .mpv-video-area {
    position: relative !important;
    width: 100% !important;
    aspect-ratio: 16 / 9 !important;
    background: linear-gradient(135deg, #0d0d2b 0%, #1a0a3a 50%, #0a1a2e 100%) !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* ── VIDEO: fills the video area ── */
  .mpv-video-area .progressive-video-container,
  .mpv-video-area video {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    position: relative !important;
    z-index: 1 !important;
  }

  /* ── Gradient overlay on video ── */
  .mpv-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: linear-gradient(
      to bottom,
      rgba(0,0,0,0.0) 0%,
      rgba(0,0,0,0.1) 60%,
      rgba(0,0,0,0.5) 100%
    ) !important;
    z-index: 2 !important;
    pointer-events: none !important;
  }

  /* ── Badge ── */
  .mpv-badge {
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
    z-index: 5 !important;
    padding: 3px 10px !important;
    background: linear-gradient(135deg, #7c3aed, #06b6d4) !important;
    color: #fff !important;
    font-family: 'Orbitron', sans-serif !important;
    font-size: 0.55rem !important;
    font-weight: 700 !important;
    letter-spacing: 1.5px !important;
    text-transform: uppercase !important;
    border-radius: 4px !important;
  }

  /* ── Info below video ── */
  .mpv-info {
    position: relative !important;
    z-index: 4 !important;
    padding: 0.9rem 1rem 1rem !important;
    background: rgba(5, 5, 16, 0.97) !important;
    border-top: 1px solid rgba(124, 58, 237, 0.2) !important;
  }

  .mpv-title {
    font-family: 'Orbitron', sans-serif !important;
    font-size: 1.2rem !important;
    font-weight: 900 !important;
    color: #fff !important;
    margin-bottom: 0.3rem !important;
    line-height: 1.2 !important;
  }

  .mpv-sub {
    font-size: 0.82rem !important;
    color: rgba(255,255,255,0.75) !important;
    font-family: 'Rajdhani', sans-serif !important;
  }
}

/* ============================================================
   MOBILE VIEW MORE BUTTON
   Hidden on desktop, shown on mobile only.
   ============================================================ */

/* Desktop: hidden */
.mpv-view-more-wrap {
  display: none;
}

@media screen and (max-width: 768px) {

  .mpv-view-more-wrap {
    display: flex !important;
    justify-content: center !important;
    padding: 2rem 1rem 1rem !important;
  }

  .mpv-view-more-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.7rem !important;
    font-family: 'Orbitron', sans-serif !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    letter-spacing: 2px !important;
    text-transform: uppercase !important;
    color: #fff !important;
    padding: 1rem 2.5rem !important;
    border-radius: 50px !important;
    border: 2px solid #06b6d4 !important;
    background: linear-gradient(135deg, #7c3aed, #06b6d4) !important;
    box-shadow: 0 0 24px rgba(6, 182, 212, 0.45), 0 0 48px rgba(124, 58, 237, 0.3) !important;
    cursor: pointer !important;
    width: 90% !important;
    max-width: 360px !important;
    justify-content: center !important;
    position: relative !important;
    overflow: hidden !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .mpv-view-more-btn:active {
    transform: scale(0.97) !important;
    box-shadow: 0 0 40px rgba(6, 182, 212, 0.7) !important;
  }

  .mpv-view-more-btn svg {
    flex-shrink: 0 !important;
    transition: transform 0.4s ease !important;
  }

  .mpv-view-more-btn.open svg {
    transform: rotate(180deg) !important;
  }

  .mpv-view-more-btn.open {
    background: linear-gradient(135deg, #06b6d4, #7c3aed) !important;
  }
}
