.academy-hero {
    --hero-shift-x: 0px;
    --hero-shift-y: 0px;
    isolation: isolate;
}

.academy-hero::before {
    content: '';
    position: absolute;
    z-index: 1;
    inset: -45% -20%;
    pointer-events: none;
    opacity: 0.34;
    background-image:
        linear-gradient(115deg, transparent 43%, rgba(59, 130, 246, 0.12) 50%, transparent 57%),
        linear-gradient(rgba(96, 165, 250, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(96, 165, 250, 0.055) 1px, transparent 1px);
    background-size: 180% 100%, 58px 58px, 58px 58px;
    transform: perspective(700px) rotateX(63deg) rotateZ(-7deg);
    transform-origin: center;
    animation: heroGridDrift 18s linear infinite;
}

.hero-motion-lines {
    position: absolute;
    z-index: 2;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.hero-motion-lines span {
    position: absolute;
    left: -20%;
    width: 140%;
    height: 1px;
    opacity: 0;
    background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.65), transparent);
    box-shadow: 0 0 18px rgba(59, 130, 246, 0.35);
    transform: rotate(-8deg);
    animation: heroScan 8s ease-in-out infinite;
}

.hero-motion-lines span:nth-child(2) {
    animation-delay: 2.6s;
}

.hero-motion-lines span:nth-child(3) {
    animation-delay: 5.2s;
}

.hero-motion-content {
    will-change: transform;
    transform: translate3d(var(--hero-shift-x), var(--hero-shift-y), 0);
    transition: transform 450ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hero-motion-ready .hero-motion-content > * {
    opacity: 0;
    animation: heroContentIn 760ms cubic-bezier(0.2, 0.75, 0.25, 1) forwards;
}

.hero-motion-ready .hero-motion-content > *:nth-child(1) { animation-delay: 80ms; }
.hero-motion-ready .hero-motion-content > *:nth-child(2) { animation-delay: 170ms; }
.hero-motion-ready .hero-motion-content > *:nth-child(3) { animation-delay: 270ms; }
.hero-motion-ready .hero-motion-content > *:nth-child(4) { animation-delay: 380ms; }
.hero-motion-ready .hero-motion-content > *:nth-child(5) { animation-delay: 490ms; }

.academy-hero h1 .text-blue-400 {
    display: inline-block;
    animation: heroAccentGlow 3.8s ease-in-out 1s infinite;
}

.academy-hero .hero-motion-content a,
.academy-hero .hero-motion-content button {
    position: relative;
    isolation: isolate;
}

.academy-hero .hero-motion-content a::after,
.academy-hero .hero-motion-content button::after {
    content: '';
    position: absolute;
    z-index: -1;
    inset: -1px;
    border-radius: inherit;
    opacity: 0;
    box-shadow: 0 0 28px rgba(59, 130, 246, 0.45);
    transition: opacity 250ms ease;
}

.academy-hero .hero-motion-content a:hover::after,
.academy-hero .hero-motion-content button:hover::after {
    opacity: 1;
}

.hero-motion-scroll {
    position: absolute;
    z-index: 12;
    bottom: 22px;
    left: 50%;
    width: 1px;
    height: 44px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.16);
}

.hero-motion-scroll::after {
    content: '';
    position: absolute;
    inset: -100% 0 auto;
    height: 100%;
    background: #60a5fa;
    animation: heroScrollCue 2.2s ease-in-out infinite;
}

@keyframes heroContentIn {
    from { opacity: 0; transform: translateY(24px) scale(0.985); filter: blur(5px); }
    to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

@keyframes heroGridDrift {
    to { background-position: -180% 0, 58px 58px, 58px 58px; }
}

@keyframes heroScan {
    0%, 15% { top: -8%; opacity: 0; }
    28% { opacity: 0.7; }
    58% { opacity: 0.16; }
    72%, 100% { top: 108%; opacity: 0; }
}

@keyframes heroAccentGlow {
    0%, 100% { text-shadow: 0 0 0 rgba(96, 165, 250, 0); }
    50% { text-shadow: 0 0 28px rgba(96, 165, 250, 0.38); }
}

@keyframes heroScrollCue {
    0% { transform: translateY(0); }
    60%, 100% { transform: translateY(200%); }
}

@media (max-width: 767px) {
    .academy-hero::before { opacity: 0.2; }
    .hero-motion-lines { opacity: 0.55; }
    .hero-motion-scroll { bottom: 14px; height: 30px; }
}

@media (prefers-reduced-motion: reduce) {
    .academy-hero::before,
    .hero-motion-lines span,
    .hero-motion-ready .hero-motion-content > *,
    .academy-hero h1 .text-blue-400,
    .hero-motion-scroll::after {
        animation: none !important;
    }

    .hero-motion-ready .hero-motion-content > * { opacity: 1; filter: none; transform: none; }
    .hero-motion-content { transform: none !important; transition: none; }
    .hero-motion-lines, .hero-motion-scroll { display: none; }
}
