/* Custom Style for Learning Fun Redesign */

:root {
    /* === Learning Fun Brand System ===
       From Cinematic Playroom design kit */
    --brand-primary: #0C71C3;
    /* Azul principal */
    --brand-accent: #F9CC00;
    /* Amarelo */
    --brand-danger: #DD3333;
    /* Vermelho */
    --brand-neutral: #607D8B;
    /* Neutro cinza-azulado */
    --brand-dark: #0D1B2A;
    /* Fundo escuro */
    --brand-light: #F4F7FA;
    /* Fundo claro */
}

html {
    scroll-behavior: smooth;
}

/* Noise Texture Overlay */
.noise-overlay {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Smooth Transitions */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Navbar Scrolled State */
nav#navbar.scrolled {
    background: rgba(244, 247, 250, 0.75);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(12, 113, 195, 0.12);
    top: 1.5rem;
    padding: 0.5rem 1.5rem;
    width: 85%;
}

nav#navbar.scrolled #nav-links a {
    color: rgba(13, 27, 42, 0.7);
}

nav#navbar.scrolled #nav-links a:hover {
    color: var(--brand-primary);
}

/* Shrink logo when scrolled */
nav#navbar.scrolled #nav-logo-img {
    height: 2rem;
}

/* Premium Utilities */
.rounded-premium {
    border-radius: 3rem;
}

.text-drama {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
}

/* ==============================================
   HERO: Standard static section (no parallax)
   ============================================== */
#home {
    position: relative;
    z-index: 10;
}

/* 5. Hero Content positioning */
.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 80rem;
    margin: 0 auto;
    padding: 0 2rem 2rem;
}

@media (min-width: 768px) {
    .hero-content {
        padding: 0 2rem 5rem;
    }
}

/* 6. Hero text reveal — GPU-composited CSS transitions (no JS jank)
      Default: invisible + shifted down
      .revealed class: visible at origin position */
.hero-reveal {
    opacity: 0;
    transform: translateY(2.5rem);
    transition:
        opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered cascade when all reveal at end of video scrub */
#hero-eyebrow.revealed {
    transition-delay: 0s;
}

#hero-title-1.revealed {
    transition-delay: 0.12s;
}

#hero-title-2.revealed {
    transition-delay: 0.27s;
}

#hero-desc.revealed {
    transition-delay: 0.42s;
}

#hero-cta-container.revealed {
    transition-delay: 0.58s;
}

/* When hiding (scroll back up), all disappear instantly — no delay */
#hero-eyebrow,
#hero-title-1,
#hero-title-2,
#hero-desc,
#hero-cta-container {
    transition-delay: 0s;
}

/* Animation Utilities Section */
@keyframes fade-in-up {
    0% {
        opacity: 0;
        transform: translateY(2.5rem);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-text-container {
    display: inline-block;
    vertical-align: top;
}

/* Sticky Stacking Logic */
.sticky-step {
    isolation: isolate;
    /* own stacking context → z-index respected */
    transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.9s ease;
}

/* Scale-down WITHOUT blur — blur breaks stacking context ordering */
.sticky-step.scaled-down {
    transform: scale(0.93) translateY(-24px);
    opacity: 0.45;
}

/* Custom Micro-interactions */
.feature-card {
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.feature-card:hover {
    transform: translateY(-10px);
    border-color: rgba(0, 89, 178, 0.2);
}

/* Hide Scrollbar but keep functionality */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ==============================================
   ANIMATED GEOMETRIC SHAPES
   ============================================== */

@keyframes float-a {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-15px);
    }
}

@keyframes float-b {

    0%,
    100% {
        transform: translateY(0px) scale(1);
    }

    50% {
        transform: translateY(-10px) scale(1.05);
    }
}

@keyframes spin-slow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes spin-slow-rev {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(-360deg);
    }
}

@keyframes pulse-ring {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.6;
    }

    50% {
        transform: scale(1.08);
        opacity: 1;
    }
}

/* ============================================================
   MOBILE FIXES — program cards overlap + bottom-stack layout
   (inline absolute/sticky from desktop must be overridden here)
   ============================================================ */
@media (max-width: 1023px) {

    /* Hero: fullscreen cover again; ~10% “zoom out” sin banda blanca abajo
       (#id + !important: Tailwind CDN carga después de style.css) */
    .hero-image-wrap {
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    #home .hero-bg-img {
        /* ~11% más ancha/alta que el área → se ve un poco más de escena (≈10%) */
        position: absolute !important;
        inset: auto !important;
        width: 111% !important;
        height: 111% !important;
        max-width: none !important;
        max-height: none !important;
        left: -5.5% !important;
        top: -5.5% !important;
        object-fit: cover;
        object-position: 56% 38%;
    }

    /* Soluções: remove stacking war between steps (was z-10 / z-12 / z-14) */
    #solucoes {
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
    }

    #solucoes .program-card {
        position: relative !important;
        inset: auto !important;
        z-index: auto !important;
        min-height: 0 !important;
    }

    /* Bottom stack: desktop-only scrub uses absolute children; on mobile use normal flow */
    #bottom-stack-wrap.bottom-stack-wrap-el,
    .bottom-stack-wrap-el {
        height: auto !important;
    }

    .sticky-stack-container.sticky-stack-el,
    .sticky-stack-el {
        position: relative !important;
        top: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
        perspective: none !important;
    }

    .bottom-stack-section {
        position: relative !important;
        inset: auto !important;
        height: auto !important;
        min-height: 0 !important;
        overflow-x: hidden !important;
        overflow-y: visible !important;
        transform: none !important;
        z-index: auto !important;
    }
}

/* Hero: desktop/tablet lg — encuadre estándar (sin zoom-out móvil) */
@media (min-width: 1024px) {
    #home .hero-bg-img {
        inset: 0 !important;
        width: 100% !important;
        height: 100% !important;
        left: auto !important;
        top: auto !important;
        max-width: none;
        object-position: right center;
    }
}