/* ================================================================
   MARLIN STEM VIRTUAL ACADEMY
   Hero Section Styles
   hero.css

   Covers:
   - Full-screen hero wrapper
   - Animated background layers (grid, glow blobs, particles)
   - Hero content (eyebrow, heading, description, CTAs)
   - Stats bar at the bottom of the hero
   - Scroll indicator animation
================================================================ */


/* ----------------------------------------------------------------
   HERO WRAPPER
   Full viewport height, dark navy background.
   Uses flexbox to push content to the bottom (IST-inspired).
---------------------------------------------------------------- */

.hero {
    position:        relative;
    min-height:      100vh;
    display:         flex;
    flex-direction:  column;
    justify-content: flex-end;  /* Content sits at bottom */
    overflow:        hidden;
    background:      linear-gradient(180deg, rgba(11,61,145,0.98) 0%, rgba(30,136,229,0.96) 100%);
}


/* ================================================================
   BACKGROUND LAYERS
   Stack of decorative layers that sit behind all content.
   Order (back to front):
   1. Gradient base        (.hero__bg)
   2. Grid overlay         (.hero__grid)
   3. Glow blobs           (.hero__glow)
   4. Floating particles   (.hero__particles)
================================================================ */


/* ----------------------------------------------------------------
   LAYER 1 — Gradient base
   Rich dark gradient with depth
---------------------------------------------------------------- */

.hero__bg {
    position: absolute;
    inset:    0;
    z-index:  var(--z-below);

    background:
        /* 45% dark overlay using primary blue */
        linear-gradient(
            135deg,
            rgba(11, 61, 145, 0.45)  0%,
            rgba(11, 61, 145, 0.45)  100%
        ),
        /* Classroom photo - cover the background */
        url("../assets/images/hero-classroom.png") center center / cover no-repeat,
        /* Base gradient fallback */
        linear-gradient(
            135deg,
            #0B3D91  0%,
            #1E88E5  100%
        );
    background-attachment: fixed;
}


/* ----------------------------------------------------------------
   LAYER 2 — Grid overlay
   Subtle tech grid pattern — signals STEM identity
---------------------------------------------------------------- */

.hero__grid {
    position: absolute;
    inset:    0;
    z-index:  var(--z-below);

    background-image:
        linear-gradient(rgba(95, 174, 227, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(95, 174, 227, 0.025) 1px, transparent 1px);

    background-size: 72px 72px;

    /* Slow drift animation — gives it life */
    animation: gridDrift 30s linear infinite;
}

@keyframes gridDrift {
    0%   { transform: translateY(0); }
    100% { transform: translateY(72px); }
}


/* ----------------------------------------------------------------
   LAYER 3 — Glow blobs
   Large soft radial glows — adds depth and atmosphere
---------------------------------------------------------------- */

.hero__glow {
    position:       absolute;
    border-radius:  50%;
    pointer-events: none;
    z-index:        var(--z-below);
}

/* Top-right cyan glow */
.hero__glow--top-right {
    width:      700px;
    height:     700px;
    top:        -180px;
    right:      -180px;
    background: radial-gradient(
        circle,
        rgba(30, 136, 229, 0.08) 0%,
        transparent             65%
    );
    animation: glowPulse 7s ease-in-out infinite;
}

/* Bottom-left blue glow */
.hero__glow--bottom-left {
    width:      550px;
    height:     550px;
    bottom:     80px;
    left:       -120px;
    background: radial-gradient(
        circle,
        rgba(11, 61, 145, 0.10) 0%,
        transparent            65%
    );
    animation: glowPulse 9s ease-in-out infinite reverse;
}

@keyframes glowPulse {
    0%,  100% { transform: scale(1);     opacity: 0.7; }
    50%        { transform: scale(1.12);  opacity: 1.0; }
}


/* ----------------------------------------------------------------
   LAYER 4 — Floating particles
   Tiny rising bubbles — generated by JavaScript
---------------------------------------------------------------- */

.hero__particles {
    position: absolute;
    inset:    0;
    z-index:  var(--z-below);
    overflow: hidden;
}

/* Individual particle — JS sets size, position, timing */
.particle {
    position:      absolute;
    border-radius: 50%;
    background:    rgba(30, 136, 229, 0.12);
    animation:     particleRise linear infinite;
}

@keyframes particleRise {
    0%   {
        transform: translateY(100vh) scale(0);
        opacity:   0;
    }
    8%   { opacity: 1; }
    92%  { opacity: 1; }
    100% {
        transform: translateY(-120px) scale(1);
        opacity:   0;
    }
}


/* ================================================================
   HERO CONTENT
   The main text and CTAs — sits on top of all background layers
================================================================ */

.hero__content {
    position:   relative;
    z-index:    var(--z-raised);
    padding:    0 var(--section-x) var(--space-20);
    max-width:  920px;
}


/* ----------------------------------------------------------------
   EYEBROW — small label above the main heading
---------------------------------------------------------------- */

.hero__eyebrow {
    display:         inline-flex;
    align-items:     center;
    gap:             var(--space-3);
    margin-bottom:   var(--space-5);

    font-size:       var(--text-xs);
    font-weight:     var(--weight-bold);
    text-transform:  uppercase;
    letter-spacing:  0.12em;
    color:           var(--accent-green);
}

.hero__eyebrow-line {
    width:         32px;
    height:        2px;
    background:    var(--accent-green);
    border-radius: var(--radius-full);
    flex-shrink:   0;
}

/* Pulsing live dot */
.hero__eyebrow-dot {
    width:         8px;
    height:        8px;
    border-radius: 50%;
    background:    var(--accent-green);
    animation:     liveDot 2.5s ease-in-out infinite;
    flex-shrink:   0;
}

@keyframes liveDot {
    0%,  100% { opacity: 1;   transform: scale(1);   }
    50%        { opacity: 0.4; transform: scale(0.75); }
}


/* ----------------------------------------------------------------
   MAIN HEADING
---------------------------------------------------------------- */

.hero__heading {
    font-family:    var(--font-display);
    font-size:      clamp(44px, 7.5vw, 92px);
    font-weight:    var(--weight-bold);
    line-height:    var(--leading-tight);
    letter-spacing: -0.025em;
    color:          var(--white);
    margin-bottom:  var(--space-6);
}

/* Italic cyan line — the "future" word */
.hero__heading em {
    display:      block;
    font-style:   italic;
    color:        var(--secondary-blue);

    /* Gradient text effect */
    background:   linear-gradient(
        135deg,
        var(--secondary-blue)  0%,
        #8DC8F5          100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip:         text;
}


/* ----------------------------------------------------------------
   DESCRIPTION TEXT
---------------------------------------------------------------- */

.hero__description {
    font-size:     clamp(16px, 2.2vw, 20px);
    font-weight:   var(--weight-light);
    line-height:   var(--leading-relaxed);
    color:         rgba(245, 251, 255, 0.86);
    max-width:     580px;
    margin-bottom: var(--space-10);
}


/* ----------------------------------------------------------------
   CTA BUTTONS — side by side
---------------------------------------------------------------- */

.hero__actions {
    display:     flex;
    align-items: center;
    gap:         var(--space-4);
    flex-wrap:   wrap;
}

/* Primary CTA — solid blue */
.hero__btn-primary {
    display:         inline-flex;
    align-items:     center;
    gap:             var(--space-2);
    padding:         16px 40px;
    border-radius:   var(--radius);
    background:      var(--primary-blue);
    color:           var(--white);
    font-size:       var(--text-base);
    font-weight:     var(--weight-bold);
    border:          2px solid var(--primary-blue);
    text-decoration: none;
    transition:      var(--transition);
    box-shadow:      0 4px 16px rgba(11, 61, 145, 0.3);
    letter-spacing:  0.01em;
}

.hero__btn-primary:hover {
    background:   var(--secondary-blue);
    color:        var(--white);
    border-color: var(--secondary-blue);
    transform:    translateY(-2px);
    box-shadow:   0 12px 40px rgba(30, 136, 229, 0.35);
}

/* Secondary CTA — ghost outline */
.hero__btn-secondary {
    display:         inline-flex;
    align-items:     center;
    gap:             var(--space-2);
    padding:         16px 40px;
    border-radius:   var(--radius);
    background:      transparent;
    color:           var(--white);
    font-size:       var(--text-base);
    font-weight:     var(--weight-semi);
    border:          2px solid rgba(255, 255, 255, 0.55);
    text-decoration: none;
    transition:      var(--transition);
    letter-spacing:  0.01em;
}

.hero__btn-secondary:hover {
    border-color: var(--white);
    background:   rgba(255, 255, 255, 0.10);
}

/* Icon inside buttons */
.hero__btn-primary i,
.hero__btn-secondary i {
    font-size: 18px;
    transition: transform var(--duration-base) var(--ease-spring);
}

.hero__btn-primary:hover i,
.hero__btn-secondary:hover i {
    transform: translateX(3px);
}


/* ================================================================
   STATS BAR
   Full-width bar anchored to the bottom of the hero.
   Shows key numbers — builds instant credibility.
================================================================ */

.hero__stats {
    position:          relative;
    z-index:           var(--z-raised);
    display:           flex;
    background:        rgba(255, 255, 255, 0.05);
    backdrop-filter:   blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top:        1px solid rgba(200, 165, 92, 0.14);
}

/* Individual stat */
.hero__stat {
    flex:           1;
    display:        flex;
    flex-direction: column;
    align-items:    center;
    justify-content:center;
    padding:        var(--space-8) var(--space-5);
    border-right:   1px solid rgba(200, 165, 92, 0.12);
    text-align:     center;
    transition:     background var(--duration-base) var(--ease);
}

.hero__stat:last-child {
    border-right: none;
}

.hero__stat:hover {
    background: rgba(200, 165, 92, 0.08);
}

/* The big number */
.hero__stat-number {
    font-family:  var(--font-display);
    font-size:    clamp(28px, 4vw, 44px);
    font-weight:  var(--weight-bold);
    color:        var(--white);
    line-height:  1;
    margin-bottom:var(--space-2);

    display:      flex;
    align-items:  baseline;
    gap:          2px;
}

/* The suffix (+ or %) */
.hero__stat-number sup {
    font-family: var(--font-body);
    font-size:   clamp(14px, 2vw, 20px);
    font-weight: var(--weight-semi);
    color:       var(--cyan-500);
    margin-left: 1px;
}

/* The label below the number */
.hero__stat-label {
    font-size:      var(--text-xs);
    font-weight:    var(--weight-medium);
    color:          rgba(255, 248, 235, 0.48);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}


/* ================================================================
   SCROLL INDICATOR
   Subtle bounce arrow at the bottom — hints to scroll down
================================================================ */

.hero__scroll-hint {
    position:        absolute;
    bottom:          108px;     /* Sits above the stats bar */
    right:           var(--section-x);
    z-index:         var(--z-raised);

    display:         flex;
    flex-direction:  column;
    align-items:     center;
    gap:             var(--space-2);

    color:           rgba(255, 248, 235, 0.40);
    font-size:       var(--text-xs);
    font-weight:     var(--weight-medium);
    text-transform:  uppercase;
    letter-spacing:  0.1em;
    writing-mode:    vertical-rl;

    animation: scrollHint 2.5s ease-in-out infinite;
}

.hero__scroll-hint i {
    font-size:    18px;
    writing-mode: horizontal-tb;
}

@keyframes scrollHint {
    0%,  100% { transform: translateY(0);   opacity: 0.35; }
    50%        { transform: translateY(8px); opacity: 0.65; }
}


/* ================================================================
   RESPONSIVE ADJUSTMENTS
================================================================ */

/* Tablet */
@media (max-width: 900px) {

    .hero__content {
        padding-bottom: var(--space-16);
    }

    .hero__stats {
        flex-wrap: wrap;
    }

    .hero__stat {
        /* 2 stats per row on tablet */
        min-width:    50%;
        border-bottom:1px solid rgba(200, 165, 92, 0.12);
    }

    .hero__stat:nth-child(2n) {
        border-right: none;
    }

    .hero__scroll-hint {
        display: none;
    }
}

/* Mobile */
@media (max-width: 600px) {

    .hero {
        /* Allow content to breathe on small phones */
        min-height: 100dvh;   /* dvh = dynamic viewport height (mobile browser fix) */
    }

    .hero__content {
        padding-bottom: var(--space-12);
    }

    .hero__heading {
        font-size: clamp(38px, 10vw, 52px);
    }

    .hero__description {
        font-size: var(--text-base);
    }

    .hero__actions {
        flex-direction: column;
        align-items:    stretch;
    }

    .hero__btn-primary,
    .hero__btn-secondary {
        justify-content: center;
        padding:         15px 32px;
    }

    /* 2 stats per row on mobile */
    .hero__stat {
        min-width:    50%;
        padding:      var(--space-5) var(--space-3);
    }
}

/* Very small phones */
@media (max-width: 380px) {

    .hero__heading {
        font-size: 36px;
    }

    .hero__stat-number {
        font-size: 26px;
    }
}