/**
 * SCHOLAR IT – Cinematic Intro
 * Full-screen dark theme, startup-style launch animation.
 * Standalone: intro.html + intro.css (no dependency on main dashboard).
 */

/* ========== Reset & Base ========== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    min-height: 100%;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0a0a0f;
    color: #fff;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* ========== Backdrop ========== */
.intro-backdrop {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.intro-gradient {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 80%, rgba(124, 58, 237, 0.12) 0%, transparent 45%),
        radial-gradient(ellipse 50% 30% at 20% 70%, rgba(59, 130, 246, 0.08) 0%, transparent 40%),
        linear-gradient(180deg, #0a0a0f 0%, #0f0f18 50%, #0a0a0f 100%);
    animation: intro-gradient-pulse 12s ease-in-out infinite alternate;
}

@keyframes intro-gradient-pulse {
    0% { opacity: 1; }
    100% { opacity: 0.92; }
}

/* Subtle grid */
.intro-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 20%, transparent 70%);
    animation: intro-grid-fade 4s ease-out 1s both;
}

@keyframes intro-grid-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Ambient glows */
.intro-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0;
    animation: intro-glow-in 3s ease-out 2s forwards;
}

.intro-glow-1 {
    width: 400px;
    height: 400px;
    background: rgba(99, 102, 241, 0.25);
    top: -10%;
    left: 20%;
}

.intro-glow-2 {
    width: 300px;
    height: 300px;
    background: rgba(124, 58, 237, 0.2);
    bottom: 10%;
    right: 15%;
    animation-delay: 2.5s;
}

.intro-glow-3 {
    width: 200px;
    height: 200px;
    background: rgba(59, 130, 246, 0.15);
    top: 50%;
    left: -5%;
    animation-delay: 3s;
}

@keyframes intro-glow-in {
    to { opacity: 1; }
}

/* ========== Content ========== */
.intro-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem;
    max-width: 90vw;
}

/* Badge */
.intro-badge {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 2.5rem;
    opacity: 0;
    transform: translateY(20px);
    animation: intro-fade-up 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.2s forwards;
}

/* Title */
.intro-title {
    font-family: 'Orbitron', sans-serif;
    font-weight: 800;
    font-size: clamp(2.5rem, 10vw, 5.5rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.intro-title-line {
    display: block;
    overflow: hidden;
}

.intro-title-line-1 {
    animation: intro-title-reveal 1.2s cubic-bezier(0.22, 1, 0.36, 1) 0.5s both;
}

.intro-word {
    display: inline-block;
    background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.85) 50%, rgba(255, 255, 255, 0.7) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-fill-color: transparent;
    opacity: 0;
    transform: translateY(100%);
    animation: intro-word-up 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.intro-word-1 {
    animation-delay: 0.7s;
    letter-spacing: 0.02em;
}

.intro-word-2 {
    margin-left: 0.15em;
    animation-delay: 0.95s;
    letter-spacing: 0.2em;
    background: linear-gradient(135deg, #a78bfa 0%, #6366f1 50%, #818cf8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-fill-color: transparent;
}

@keyframes intro-title-reveal {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes intro-word-up {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Subtitle */
.intro-subtitle {
    font-size: clamp(0.9rem, 2.5vw, 1.15rem);
    font-weight: 400;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 1.25rem;
    opacity: 0;
    transform: translateY(24px);
    animation: intro-fade-up 0.9s cubic-bezier(0.22, 1, 0.36, 1) 1.4s forwards;
}

/* Divider line */
.intro-line {
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.9), transparent);
    margin: 0 auto 1.25rem;
    opacity: 0;
    animation: intro-line-grow 1s cubic-bezier(0.22, 1, 0.36, 1) 1.9s forwards;
}

@keyframes intro-line-grow {
    0% {
        width: 0;
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        width: min(200px, 40vw);
        opacity: 1;
    }
}

/* Tagline */
.intro-tagline {
    font-size: clamp(0.85rem, 2vw, 1rem);
    font-weight: 300;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.12em;
    margin-bottom: 2.5rem;
    opacity: 0;
    transform: translateY(16px);
    animation: intro-fade-up 0.8s cubic-bezier(0.22, 1, 0.36, 1) 2.2s forwards;
}

@keyframes intro-fade-up {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* CTA Button */
.intro-cta {
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-decoration: none;
    color: #fff;
    padding: 1rem 2.25rem;
    border: 2px solid rgba(99, 102, 241, 0.6);
    background: rgba(99, 102, 241, 0.12);
    border-radius: 4px;
    opacity: 0;
    transform: translateY(20px) scale(0.98);
    animation: intro-cta-in 1s cubic-bezier(0.22, 1, 0.36, 1) 2.6s forwards;
    transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.intro-cta:hover {
    border-color: rgba(99, 102, 241, 1);
    background: rgba(99, 102, 241, 0.22);
    box-shadow: 0 0 32px rgba(99, 102, 241, 0.35);
    transform: translateY(-2px) scale(1.02);
}

.intro-cta:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.4);
}

@keyframes intro-cta-in {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ========== Scanline (optional cinematic overlay) ========== */
.intro-scanline {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.04) 2px,
        rgba(0, 0, 0, 0.04) 4px
    );
    opacity: 0.2;
    animation: intro-scanline 12s linear infinite;
}

@keyframes intro-scanline {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}
