/* Hero Glitch Reveal Effect
 * Kinetic text scramble animation for Playmaker's Edge brand
 * Inspired by terminal/hacker aesthetics with AI undertones
 */

/* ==========================================================================
   Hero Layout - Prominence First
   ========================================================================== */

.hero-section--glitch {
    min-height: 85vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 4rem 2rem;
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

/* Subtle animated grid background */
.hero-section--glitch::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(16, 185, 129, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(16, 185, 129, 0.06) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    opacity: 0;
    animation: gridFadeIn 2s ease-out 1.5s forwards;
}

@keyframes gridFadeIn {
    to { opacity: 1; }
}

/* ==========================================================================
   Brand Title - The Star of the Show
   ========================================================================== */

.hero-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.hero-brand__primary {
    display: block;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 500;
    letter-spacing: 0.5em;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    opacity: 0;
}

.hero-brand__primary.revealed {
    opacity: 1;
}

.hero-brand__edge {
    display: block;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: clamp(4rem, 12vw, 8rem);
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--cta-primary);
    text-transform: uppercase;
    position: relative;
    opacity: 0;
    text-shadow:
        0 0 20px rgba(16, 185, 129, 0.3),
        0 0 40px rgba(16, 185, 129, 0.2),
        0 0 60px rgba(16, 185, 129, 0.1);
}

.hero-brand__edge.revealed {
    opacity: 1;
    animation: edgeGlow 3s ease-in-out infinite alternate;
}

@keyframes edgeGlow {
    0% {
        text-shadow:
            0 0 20px rgba(16, 185, 129, 0.3),
            0 0 40px rgba(16, 185, 129, 0.2),
            0 0 60px rgba(16, 185, 129, 0.1);
    }
    100% {
        text-shadow:
            0 0 30px rgba(16, 185, 129, 0.5),
            0 0 60px rgba(16, 185, 129, 0.3),
            0 0 90px rgba(16, 185, 129, 0.15);
    }
}

/* Terminal cursor after EDGE */
.hero-brand__cursor {
    display: inline-block;
    width: 4px;
    height: 1em;
    background-color: var(--cta-primary);
    margin-left: 0.1em;
    vertical-align: middle;
    opacity: 0;
    animation: cursorBlink 1s step-end infinite;
}

.hero-brand__edge.revealed .hero-brand__cursor {
    opacity: 1;
}

@keyframes cursorBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* ==========================================================================
   Glitch Character Animation
   ========================================================================== */

.glitch-char {
    display: inline-block;
    position: relative;
    transition: none;
}

/* During scramble - rapid character switching */
.glitch-char.scrambling {
    animation: glitchJitter 0.05s steps(1) infinite;
}

@keyframes glitchJitter {
    0% { transform: translate(0, 0); }
    25% { transform: translate(1px, -1px); }
    50% { transform: translate(-1px, 1px); }
    75% { transform: translate(1px, 1px); }
    100% { transform: translate(0, 0); }
}

/* RGB split effect during reveal */
.glitch-char.splitting {
    animation: rgbSplit 0.15s ease-out forwards;
}

@keyframes rgbSplit {
    0% {
        text-shadow:
            -2px 0 #ff0000,
            2px 0 #00ffff;
        opacity: 0.8;
    }
    50% {
        text-shadow:
            -1px 0 #ff0000,
            1px 0 #00ffff;
        opacity: 0.9;
    }
    100% {
        text-shadow: none;
        opacity: 1;
    }
}

/* ==========================================================================
   Subtitle & CTA
   ========================================================================== */

.hero-tagline {
    font-size: clamp(1rem, 2.5vw, 1.35rem);
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.6s ease-out;
    font-weight: 400;
    letter-spacing: 0.02em;
}

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

/* ==========================================================================
   CFB Identity Badge
   ========================================================================== */

.hero-cfb-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding: 0.6rem 1.25rem;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 50px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.75rem;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.6s ease-out 0.1s;
}

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

.cfb-badge__icon {
    color: var(--cta-primary);
    font-size: 0.85rem;
}

.cfb-badge__text {
    color: var(--cta-primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.cfb-badge__separator {
    color: rgba(16, 185, 129, 0.3);
}

.cfb-badge__stat {
    color: var(--text-secondary);
    font-weight: 500;
}

@media (max-width: 600px) {
    .hero-cfb-badge {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.5rem 1rem;
        font-size: 0.7rem;
    }

    .cfb-badge__separator:last-of-type,
    .cfb-badge__stat:last-of-type {
        display: none;
    }
}

.hero-cta-section--glitch {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.6s ease-out 0.2s;
}

.hero-cta-section--glitch.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   Glassmorphic Stats Cards
   ========================================================================== */

.hero-stats-glass {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 3rem;
    flex-wrap: wrap;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s ease-out 0.4s;
}

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

.stat-card-glass {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-xl);
    padding: 1.5rem 2.5rem;
    text-align: center;
    text-decoration: none;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    min-width: 160px;
}

.stat-card-glass:hover {
    transform: translateY(-4px);
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow:
        0 12px 40px rgba(16, 185, 129, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.stat-card-glass__value {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--cta-primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-card-glass__label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
}

.stat-card-glass--featured {
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.05);
}

.stat-card-glass--featured .stat-card-glass__value {
    color: var(--cta-primary);
}

.stat-card-glass--featured .stat-card-glass__label {
    color: var(--cta-primary);
}


/* Secondary CTA - Teal text in light mode */
.hero-cta-section--glitch .hero-secondary-cta,
.hero-cta-section--glitch .btn-outline-light {
    color: var(--cta-primary) !important;
    border-color: var(--cta-primary) !important;
    background: transparent !important;
}

.hero-cta-section--glitch .hero-secondary-cta:hover,
.hero-cta-section--glitch .btn-outline-light:hover {
    color: #ffffff !important;
    background-color: var(--cta-primary) !important;
    border-color: var(--cta-primary) !important;
}

/* Dark mode - white outline */
[data-theme="dark"] .hero-cta-section--glitch .hero-secondary-cta,
[data-theme="dark"] .hero-cta-section--glitch .btn-outline-light {
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .hero-cta-section--glitch .hero-secondary-cta:hover,
[data-theme="dark"] .hero-cta-section--glitch .btn-outline-light:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.8);
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 768px) {
    .hero-section--glitch {
        min-height: 75vh;
        padding: 3rem 1.5rem;
    }

    .hero-brand__primary {
        letter-spacing: 0.3em;
    }

    .hero-brand__edge {
        letter-spacing: 0.1em;
    }

    .hero-stats-glass {
        gap: 1rem;
    }

    .stat-card-glass {
        padding: 1rem 1.5rem;
        min-width: 130px;
    }

    .stat-card-glass__value {
        font-size: 2rem;
    }

    .hero-cta-section--glitch {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }

    .hero-cta-section--glitch .btn {
        width: 100%;
        max-width: 280px;
    }
}

@media (max-width: 480px) {
    .hero-section--glitch {
        min-height: 70vh;
    }

    .stat-card-glass {
        width: 100%;
        max-width: 200px;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .hero-brand__primary,
    .hero-brand__edge,
    .hero-tagline,
    .hero-cta-section--glitch,
    .hero-stats-glass {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .glitch-char.scrambling {
        animation: none;
    }

    .glitch-char.splitting {
        animation: none;
    }

    .hero-brand__edge.revealed {
        animation: none;
        text-shadow:
            0 0 20px rgba(16, 185, 129, 0.3),
            0 0 40px rgba(16, 185, 129, 0.2);
    }

    @keyframes cursorBlink {
        0%, 100% { opacity: 1; }
    }
}
