/* ==========================================================================
   goAmdi.com - Responsive & Adaptive Stylesheet
   Mobile Carousel, Touch Navigation, Breakpoints & Accessibility
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TABLET & INTERMEDIATE SCREENS (<= 1100px)
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .stage-3d-wrapper {
    max-width: 960px;
    height: 490px;
  }

  .card-3d {
    width: 290px;
    height: 430px;
    padding: 1.1rem;
  }

  .card-3d[data-pos="left"] {
    transform: translateX(-265px) translateY(12px) translateZ(-40px) rotateY(14deg) scale(0.92);
  }

  .card-3d[data-pos="center"] {
    transform: translateX(0px) translateY(-8px) translateZ(50px) rotateY(0deg) scale(1);
  }

  .card-3d[data-pos="right"] {
    transform: translateX(265px) translateY(12px) translateZ(-40px) rotateY(-14deg) scale(0.92);
  }

  .card-3d[data-pos="left"]:hover {
    transform: translateX(-265px) translateY(4px) translateZ(-15px) rotateY(10deg) scale(0.95);
    opacity: 0.98;
    z-index: 4;
  }

  .card-3d[data-pos="center"]:hover {
    transform: translateX(0px) translateY(-14px) translateZ(70px) rotateY(0deg) scale(1.02);
    opacity: 1;
    z-index: 8;
  }

  .card-3d[data-pos="right"]:hover {
    transform: translateX(265px) translateY(4px) translateZ(-15px) rotateY(-10deg) scale(0.95);
    opacity: 0.98;
    z-index: 4;
  }

  .hero-active-ambient {
    width: 95vw;
    height: 520px;
  }
}

/* --------------------------------------------------------------------------
   2. MOBILE & TOUCH CAROUSEL MODE (<= 992px)
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  /* Header adjustments */
  .floating-header {
    top: 0.85rem;
    padding: 0 0.85rem;
  }

  .header-dock {
    height: 58px;
    padding: 0 0.85rem 0 1.1rem;
  }

  .header-nav,
  .btn-header-cta {
    display: none;
  }

  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-pill);
    background: var(--bg-chip);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
  }

  .mobile-menu-toggle svg {
    width: 20px;
    height: 20px;
  }

  /* Mobile Slide-out Drawer (Visible only when open) */
  .mobile-drawer {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-deep);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    z-index: 1050;
    flex-direction: column;
    padding: 1.75rem 1.5rem;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-15px);
    transition: opacity 0.3s ease, transform 0.3s ease;
  }

  .mobile-drawer.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
  }

  .drawer-logo {
    height: 32px;
    width: auto;
  }

  .drawer-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .drawer-close-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--bg-chip);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  .drawer-links {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 2.25rem;
  }

  .drawer-link {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-secondary);
    transition: color 0.2s ease, transform 0.2s ease;
  }

  .drawer-link:hover,
  .drawer-link.active {
    color: var(--text-primary);
    transform: translateX(6px);
  }

  .drawer-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem;
    border-radius: var(--radius-pill);
    background: linear-gradient(135deg, var(--amdi-cyan), var(--amdi-blue));
    color: #000;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
  }

  /* Hero adjustments - Plenty of breathing room under floating header dock */
  .hero-portal {
    padding-top: 125px;
    padding-bottom: 25px;
    min-height: auto;
  }

  .hero-title {
    font-size: 2.2rem;
    line-height: 1.15;
  }

  .hero-subtitle {
    font-size: 0.92rem;
    padding: 0 0.5rem;
    max-width: 90%;
  }

  /* Mobile Ambient Orbs - Evenly distributed across full mobile viewport */
  .affect-glow-container {
    inset: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
  }

  .ambient-orb {
    filter: blur(85px);
    opacity: calc(var(--orb-opacity) * 1.2);
  }

  .orb-1-magenta {
    top: -5%;
    right: -15%;
    width: 340px;
    height: 340px;
  }

  .orb-2-cyan {
    top: 20%;
    left: -20%;
    width: 360px;
    height: 360px;
  }

  .orb-3-blue {
    bottom: 25%;
    right: -10%;
    width: 320px;
    height: 320px;
  }

  .orb-4-green {
    bottom: 2%;
    left: -15%;
    width: 300px;
    height: 300px;
  }

  .orb-5-orange {
    top: 48%;
    left: 15%;
    width: 280px;
    height: 280px;
  }

  /* Mobile Carousel Stage Optimization - FLEX COLUMN TO PUT INDICATOR DEBAJO */
  .stage-3d-wrapper {
    display: flex !important;
    flex-direction: column !important; /* Coloca el carrusel arriba y el indicador cian DEBAJO */
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100%;
    max-width: 100%;
    height: auto;
    perspective: none;
    transform-style: flat;
    margin-top: 1.25rem;
    padding-bottom: 0;
    overflow: visible;
  }

  .stage-nav-arrow {
    display: none;
  }

  .hero-active-ambient {
    width: 100vw;
    height: 480px;
  }
  .hero-ambient-glow {
    filter: blur(55px);
    -webkit-filter: blur(55px);
  }

  .cards-3d-cluster {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch;
    justify-content: flex-start;
    gap: 1.25rem;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0.5rem calc(50vw - 145px) 1rem !important; /* Centra la tarjeta activa en la pantalla */
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    box-sizing: border-box;
  }

  .cards-3d-cluster::-webkit-scrollbar {
    display: none;
  }

  .card-3d {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    animation: none !important;
    flex: 0 0 290px !important;
    width: 290px !important;
    height: 440px;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    opacity: 1 !important;
    filter: none !important;
    margin: 0;
    border-radius: var(--radius-lg);
    box-sizing: border-box;
  }

  .card-3d:hover {
    transform: none !important;
  }

  /* Indicador Cian / Dots Ubicado DEBAJO de las Tarjetas */
  .carousel-dots-wrapper {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.65rem;
    width: 100%;
    margin: 1rem auto 0.25rem !important;
    z-index: 10;
  }

  .carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 0;
  }

  [data-theme="light"] .carousel-dot {
    background: rgba(0, 0, 0, 0.2);
  }

  .carousel-dot.active {
    width: 28px;
    border-radius: var(--radius-pill);
    background: var(--amdi-cyan);
    box-shadow: 0 0 12px var(--amdi-cyan), 0 0 22px rgba(0, 229, 255, 0.55);
  }

  .stage-rotation-hint {
    margin-top: 0.75rem;
    font-size: 0.72rem;
    max-width: 92%;
    text-align: center;
    padding: 0.35rem 0.9rem;
  }

  /* Creator panel in single column */
  .creator-panel-card {
    grid-template-columns: 1fr;
    padding: 2.25rem 1.5rem;
    gap: 2rem;
  }

  .creator-action-btn {
    width: 100%;
    justify-content: center;
  }

  /* Footer layout */
  .footer-pill-dock {
    flex-direction: column;
    text-align: center;
    border-radius: var(--radius-lg);
    padding: 1.75rem 1.25rem;
    gap: 1rem;
  }

  .footer-right {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }
}

/* --------------------------------------------------------------------------
   3. SMALL SMARTPHONES (<= 480px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  .hero-title {
    font-size: 2.1rem;
  }

  .hero-brand-pill {
    font-size: 0.7rem;
    padding: 0.35rem 0.75rem;
  }

  .cards-3d-cluster {
    padding-left: 1rem;
    padding-right: 1rem;
    gap: 0.85rem;
  }

  .card-3d {
    flex: 0 0 270px;
    width: 270px;
    height: 425px;
    padding: 1rem;
  }

  .card-project-name {
    font-size: 1.15rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .creator-panel-card {
    padding: 1.75rem 1.25rem;
  }

  .creator-heading {
    font-size: 1.55rem;
  }
}

/* --------------------------------------------------------------------------
   4. ACCESSIBILITY: PREFERS-REDUCED-MOTION
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .ambient-orb,
  .halo-core,
  .halo-particles,
  .card-3d,
  .scan-line-laser,
  .holo-pass-sheen,
  .wave-bar {
    animation: none !important;
  }
}
