/* ============================================================
   ALLLUZ APPLE-GRADE CREATIVE EXPERIENCE (2026 FLAGSHIP UI/UX)
   Scroll-Driven Choreography, Stacking Card Deck, Spotlight Glass,
   Spatial Typography & Fluid Micro-Interactions.
   ============================================================ */

/* 1. VARIÁVEIS DE LUZ, MATERIAIS E FÍSICA */
:root {
  --apple-glass-bg: rgba(16, 23, 34, 0.72);
  --apple-glass-border: rgba(255, 255, 255, 0.1);
  --apple-glass-highlight: rgba(255, 255, 255, 0.18);
  --apple-spotlight-color: rgba(0, 159, 253, 0.15);
  --apple-ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --apple-ease-smooth: cubic-bezier(0.25, 1, 0.5, 1);
}

[data-theme="light"] {
  --apple-glass-bg: rgba(255, 255, 255, 0.85);
  --apple-glass-border: rgba(0, 30, 60, 0.1);
  --apple-glass-highlight: rgba(255, 255, 255, 0.8);
  --apple-spotlight-color: rgba(0, 159, 253, 0.12);
}

/* 2. HERO CINEMÁTICO — PROFUNDIDADE E REVELAÇÃO */
#view-home .home-command-station {
  position: relative;
  background: radial-gradient(120% 120% at 50% 0%, rgba(13, 24, 41, 0.85) 0%, rgba(6, 10, 16, 0.95) 100%) !important;
  border: 1px solid var(--apple-glass-border) !important;
  box-shadow: 0 24px 64px -16px rgba(0, 0, 0, 0.6), inset 0 1px 1px var(--apple-glass-highlight) !important;
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  overflow: hidden;
  transition: transform 0.6s var(--apple-ease-spring), box-shadow 0.6s var(--apple-ease-spring);
}

/* Brilho Especular Superior (Linha de Luz da Apple com flare Coral #FF6B7A) */
#view-home .home-command-station::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 159, 253, 0.8), rgba(255, 107, 122, 0.75), rgba(0, 242, 254, 0.9), rgba(0, 159, 253, 0.8), transparent);
  pointer-events: none;
  z-index: 2;
}

/* Tipografia Display com Gradiente Fluido */
#view-home .command-hero-title {
  letter-spacing: -0.04em !important;
  line-height: 1.08 !important;
  text-wrap: balance;
  font-weight: 800 !important;
}

#view-home .command-gradient-word {
  background: linear-gradient(135deg, #00F2FE 0%, #009FFD 50%, #70A6FF 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  display: inline-block;
  filter: drop-shadow(0 2px 14px rgba(0, 159, 253, 0.35));
}

/* Bento Buttons com Resposta Tátil e Reflexo de Luz */
#view-home .bento-btn {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--apple-glass-border) !important;
  background: rgba(255, 255, 255, 0.03) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.25s var(--apple-ease-spring), border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease !important;
  will-change: transform;
}

#view-home .bento-btn:hover {
  transform: translateY(-3px) scale(1.015) !important;
  border-color: rgba(0, 159, 253, 0.4) !important;
  box-shadow: 0 12px 28px -8px rgba(0, 159, 253, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.2) !important;
  background: rgba(255, 255, 255, 0.06) !important;
}

#view-home .bento-btn:active {
  transform: scale(0.98) !important;
}

/* 3. O DECK DE STACKING CARDS (A MÁGICA NÍVEL APPLE) */
#view-home .home-pillar-stack {
  display: flex !important;
  flex-direction: column !important;
  gap: 20px !important;
  position: relative !important;
  margin-top: 24px;
}

#view-home .home-pillar-stack > .pillar-card {
  position: sticky !important;
  /* Topo empilhado dinâmico com leve cascata */
  top: calc(76px + (var(--stack-index, 0) * 16px)) !important;
  z-index: calc(10 + var(--stack-index, 0)) !important;
  background: #0D141F !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 20px !important;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3), 0 20px 48px -10px rgba(0, 0, 0, 0.7), inset 0 1px 1px rgba(255, 255, 255, 0.15) !important;
  overflow: hidden !important;
  transition: transform 0.4s var(--apple-ease-spring), filter 0.4s ease, box-shadow 0.4s ease !important;
  transform-origin: center top !important;
  will-change: transform, filter;
}

[data-theme="light"] #view-home .home-pillar-stack > .pillar-card {
  background: rgba(255, 255, 255, 0.95) !important;
  border-color: rgba(0, 30, 60, 0.12) !important;
  box-shadow: 0 -2px 14px rgba(0, 0, 0, 0.05), 0 16px 36px -10px rgba(10, 25, 50, 0.12), inset 0 1px 1px rgba(255, 255, 255, 0.9) !important;
}

/* Efeito Spotlight Interativo em Cada Cartão */
#view-home .pillar-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 0%), var(--apple-spotlight-color), transparent 60%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1;
}

#view-home .pillar-card:hover::before {
  opacity: 1;
}

/* Imagem do Pilar com Reveal e Profundidade */
#view-home .pillar-media-half {
  position: relative;
  overflow: hidden;
}

#view-home .pillar-half-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--apple-ease-spring), filter 0.6s ease;
}

#view-home .pillar-card:hover .pillar-half-img {
  transform: scale(1.04) !important;
}

/* Gradiente de Fusão entre Imagem e Conteúdo */
#view-home .pillar-media-gradient {
  background: linear-gradient(180deg, transparent 40%, #0D141F 100%) !important;
}

@media (min-width: 760px) {
  #view-home .pillar-media-gradient {
    background: linear-gradient(90deg, transparent 40%, #0D141F 100%) !important;
  }
  [data-theme="light"] #view-home .pillar-media-gradient {
    background: linear-gradient(90deg, transparent 40%, #FFFFFF 100%) !important;
  }
}

/* 4. SCROLL-DRIVEN ANIMATION NATIVO (PARA NAVEGADORES MODERNOS: CHROME, EDGE, SAFARI 26+) */
@supports ((animation-timeline: scroll()) and (animation-range: 0% 100%)) {
  #view-home .home-pillar-stack {
    timeline-scope: --card-0, --card-1, --card-2, --card-3;
  }

  #view-home .pillar-card:nth-child(1) { view-timeline: --card-0 block; }
  #view-home .pillar-card:nth-child(2) { view-timeline: --card-1 block; }
  #view-home .pillar-card:nth-child(3) { view-timeline: --card-2 block; }
  #view-home .pillar-card:nth-child(4) { view-timeline: --card-3 block; }

  /* Quando o cartão seguinte sobe e encobre, o anterior escala para baixo e ganha profundidade cinematográfica */
  #view-home .pillar-card:nth-child(1) {
    animation: appleCardStackScale auto linear both;
    animation-timeline: --card-1;
    animation-range: entry 0% entry 100%;
  }

  #view-home .pillar-card:nth-child(2) {
    animation: appleCardStackScale auto linear both;
    animation-timeline: --card-2;
    animation-range: entry 0% entry 100%;
  }

  #view-home .pillar-card:nth-child(3) {
    animation: appleCardStackScale auto linear both;
    animation-timeline: --card-3;
    animation-range: entry 0% entry 100%;
  }

  @keyframes appleCardStackScale {
    from {
      transform: scale(1);
      filter: brightness(1) blur(0px);
    }
    to {
      transform: scale(0.95);
      filter: brightness(0.8) blur(2px);
    }
  }
}

/* 5. SEÇÃO PROCESSO — SCROLLYTELLING & REVELAÇÃO */
#view-home .home-process {
  position: relative;
  background: linear-gradient(135deg, rgba(16, 23, 34, 0.75) 0%, rgba(10, 15, 23, 0.85) 100%) !important;
  border: 1px solid var(--apple-glass-border) !important;
  border-radius: 20px !important;
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.5), inset 0 1px 1px var(--apple-glass-highlight) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: transform 0.4s var(--apple-ease-spring), box-shadow 0.4s ease;
}

#view-home .home-process figure img {
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  transition: transform 0.5s var(--apple-ease-spring);
}

#view-home .home-process:hover figure img {
  transform: scale(1.02);
}

/* 6. VITRINE NETFLIX & ALLLUZ WORKS COM CARDS VIVOS */
#view-home .home-studio-teaser {
  background: linear-gradient(105deg, rgba(0, 159, 253, 0.12) 0%, rgba(16, 23, 34, 0.8) 100%) !important;
  border: 1px solid rgba(0, 159, 253, 0.25) !important;
  box-shadow: 0 12px 32px -8px rgba(0, 159, 253, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.15) !important;
  border-radius: 16px !important;
  transition: transform 0.3s var(--apple-ease-spring), border-color 0.3s ease !important;
}

#view-home .home-studio-teaser:hover {
  transform: translateY(-2px) !important;
  border-color: rgba(0, 159, 253, 0.5) !important;
}

/* 7. ACESSIBILIDADE E PREFERS-REDUCED-MOTION (MANDATÓRIO) */
@media (prefers-reduced-motion: reduce) {
  #view-home .home-pillar-stack > .pillar-card {
    position: relative !important;
    top: auto !important;
    transform: none !important;
    animation: none !important;
    filter: none !important;
  }
  #view-home .pillar-half-img {
    transform: none !important;
  }
  #view-home .bento-btn {
    transition: none !important;
    transform: none !important;
  }
}
