/* ==========================================================================
   SCROLL REVEAL ANIMATIONS (IntersectionObserver)
   ========================================================================== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

/* Staggered items */
.stagger-container .stagger-item {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.stagger-container.active .stagger-item {
    opacity: 1;
    transform: translateY(0);
}

.stagger-container.active .stagger-item:nth-child(1) { transition-delay: 0.1s; }
.stagger-container.active .stagger-item:nth-child(2) { transition-delay: 0.2s; }
.stagger-container.active .stagger-item:nth-child(3) { transition-delay: 0.3s; }
.stagger-container.active .stagger-item:nth-child(4) { transition-delay: 0.4s; }
.stagger-container.active .stagger-item:nth-child(5) { transition-delay: 0.5s; }
.stagger-container.active .stagger-item:nth-child(6) { transition-delay: 0.6s; }

/* ==========================================================================
   INSTITUTIONAL INTRO PRELOADER & STARTING ANIMATIONS
   ========================================================================== */
.gaya-intro-preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #080e18;
    overflow: hidden;
    transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1),
                opacity 0.7s cubic-bezier(0.77, 0, 0.175, 1);
    will-change: transform, opacity;
}

/* Background Ambient Lighting & Grid */
.intro-bg-ambient {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 45%, rgba(14, 116, 144, 0.35) 0%, rgba(30, 58, 138, 0.2) 40%, #080e18 85%);
    pointer-events: none;
}

.intro-grid-pattern {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 44px 44px;
    background-position: center center;
    pointer-events: none;
    mask-image: radial-gradient(circle at center, black 35%, transparent 80%);
    -webkit-mask-image: radial-gradient(circle at center, black 35%, transparent 80%);
}

/* Content Container */
.intro-content-wrapper {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1.5rem;
    max-width: 520px;
    width: 90%;
}

/* Emblem Assembly */
.intro-emblem-box {
    position: relative;
    width: 144px;
    height: 144px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.75rem;
}

.intro-svg-gear {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.intro-gear-outer {
    animation: spinClockwise 18s linear infinite;
}

.intro-gear-inner {
    animation: spinCounterClockwise 12s linear infinite;
}

.intro-emblem-orb {
    position: absolute;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.45) 0%, rgba(37, 99, 235, 0.2) 60%, transparent 80%);
    filter: blur(14px);
    animation: emblemPulse 2.4s ease-in-out infinite alternate;
}

.intro-logo-card {
    position: relative;
    z-index: 2;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 30px rgba(56, 189, 248, 0.55), 0 10px 25px rgba(0, 0, 0, 0.6);
    border: 3px solid rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    animation: logoEntrance 0.85s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.intro-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

/* Text Box */
.intro-text-box {
    margin-bottom: 1.85rem;
    text-align: center;
}

.intro-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.9rem;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #f8fafc;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.85rem;
    animation: introFadeIn 0.8s ease 0.15s both;
}

.intro-brand-title {
    font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
    font-size: clamp(1.6rem, 3.8vw, 2.3rem);
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.06em;
    margin: 0 0 0.35rem 0;
    line-height: 1.15;
    background: linear-gradient(135deg, #ffffff 30%, #93c5fd 70%, #38bdf8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 20px rgba(56, 189, 248, 0.3);
    animation: introFadeIn 0.8s ease 0.3s both;
}

.intro-brand-sub {
    font-size: 0.825rem;
    color: #94a3b8;
    font-weight: 600;
    letter-spacing: 0.12em;
    margin: 0;
    text-transform: uppercase;
    animation: introFadeIn 0.8s ease 0.45s both;
}

/* Progress Container */
.intro-progress-container {
    width: 100%;
    max-width: 380px;
}

.intro-progress-track {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}

.intro-progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #38bdf8, #60a5fa, #f59e0b);
    border-radius: 4px;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.85);
    transition: width 0.1s linear;
}

.intro-status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.65rem;
    font-size: 0.725rem;
    font-weight: 600;
}

.intro-status-text {
    color: #64748b;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.intro-percent-number {
    color: #38bdf8;
    font-family: monospace;
    font-weight: 700;
}

/* Skip Button */
.intro-skip-btn {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #cbd5e1;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    padding: 0.4rem 0.95rem;
    border-radius: 50px;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: all 0.25s ease;
    z-index: 10;
}

.intro-skip-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    border-color: #38bdf8;
    transform: translateX(2px);
}

/* Leaving Curtain Transition */
.gaya-intro-preloader.is-leaving {
    transform: translateY(-100%);
    opacity: 0.95;
    pointer-events: none;
}

.gaya-intro-preloader.is-hidden {
    display: none !important;
}

/* Keyframes for Preloader */
@keyframes spinClockwise {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes spinCounterClockwise {
    from { transform: rotate(360deg); }
    to { transform: rotate(0deg); }
}

@keyframes emblemPulse {
    0% { transform: scale(0.9); opacity: 0.4; }
    100% { transform: scale(1.2); opacity: 0.8; }
}

@keyframes logoEntrance {
    0% { transform: scale(0.6); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes introFadeIn {
    0% { opacity: 0; transform: translateY(12px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   HERO ENTRANCE CHOREOGRAPHY (AFTER INTRO COMPLETES)
   ========================================================================== */
body.intro-active {
    overflow: hidden !important;
}

/* Animated Entrance for Slide 1 Content */
body.hero-animated .hero-carousel .carousel-item.active .hero-badge {
    animation: heroDropBadge 0.75s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

body.hero-animated .hero-carousel .carousel-item.active .hero-title {
    animation: heroRiseTitle 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.25s both;
}

body.hero-animated .hero-carousel .carousel-item.active .hero-gradient-text {
    background-size: 200% auto;
    animation: heroShimmerGradient 4s ease infinite;
}

body.hero-animated .hero-carousel .carousel-item.active .hero-subtitle {
    animation: heroSlideSubtitle 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.4s both;
}

body.hero-animated .hero-carousel .carousel-item.active .hero-btn-group {
    animation: heroPopBtns 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.55s both;
}

body.hero-animated .hero-carousel .carousel-item.active .hero-pills-row .hero-pill {
    animation: heroPillCascade 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

body.hero-animated .hero-carousel .carousel-item.active .hero-pills-row .hero-pill:nth-child(1) { animation-delay: 0.70s; }
body.hero-animated .hero-carousel .carousel-item.active .hero-pills-row .hero-pill:nth-child(2) { animation-delay: 0.78s; }
body.hero-animated .hero-carousel .carousel-item.active .hero-pills-row .hero-pill:nth-child(3) { animation-delay: 0.86s; }
body.hero-animated .hero-carousel .carousel-item.active .hero-pills-row .hero-pill:nth-child(4) { animation-delay: 0.94s; }

body.hero-animated .hero-top-info-pill {
    animation: heroCornerPill 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.6s both;
}

/* Subtle cinematic zoom on active hero background */
body.hero-animated .hero-carousel .carousel-item.active .hero-slide-bg {
    animation: heroKenBurns 10s ease-out forwards;
}

/* Hero Keyframes */
@keyframes heroDropBadge {
    0% { opacity: 0; transform: translateY(-24px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes heroRiseTitle {
    0% { opacity: 0; transform: translateY(35px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes heroShimmerGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes heroSlideSubtitle {
    0% { opacity: 0; transform: translateY(22px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes heroPopBtns {
    0% { opacity: 0; transform: translateY(20px) scale(0.92); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes heroPillCascade {
    0% { opacity: 0; transform: translateY(16px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes heroCornerPill {
    0% { opacity: 0; transform: translateY(-20px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes heroKenBurns {
    0% { transform: scale(1.06); }
    100% { transform: scale(1.0); }
}

/* Shimmer pulse on Primary Apply button */
.btn-hero-primary {
    position: relative;
    overflow: hidden;
}

.btn-hero-primary::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 40%;
    height: 200%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.35), transparent);
    transform: rotate(30deg);
    animation: heroBtnShimmer 4.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes heroBtnShimmer {
    0%, 75% { left: -60%; opacity: 0; }
    80% { opacity: 1; }
    100% { left: 160%; opacity: 0; }
}

/* Carousel Slide Transitions */
.hero-carousel .carousel-item {
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.8s ease;
}

/* ==========================================================================
   ACCESSIBILITY: PREFERS REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .reveal, .reveal-left, .reveal-right, .reveal-scale, .stagger-item,
    .btn, .card-technical, .card-img-wrapper img, .nav-link::after, .arrow-icon,
    .intro-gear-outer, .intro-gear-inner, .intro-emblem-orb, .intro-logo-card,
    .intro-eyebrow, .intro-brand-title, .intro-brand-sub, .intro-progress-bar,
    .hero-badge, .hero-title, .hero-subtitle, .hero-btn-group, .hero-pill, .hero-slide-bg {
        transition: none !important;
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }

    .gaya-intro-preloader {
        display: none !important;
    }
}
