/* ============================================================
   Experior FM — Header & Navigation
   Sticky header, desktop nav, mobile toggle, logo styles.
   Futuristic logo animations, transparent hero integration.
   ============================================================ */

/* ── Site Header ── */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: transparent;
    z-index: var(--z-sticky);
    transition: background 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}

/* After scrolling: solid white background (all pages transition on scroll) */
.site-header.scrolled {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

/* ── Logo ── */
.site-header__logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
    position: relative;
}

.logo-img {
    height: 50px;
    width: auto;
    display: block;
    object-fit: contain;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                filter 0.4s ease;
}

/* Futuristic glow aura behind header logo */
.site-header__logo::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 160%;
    transform: translate(-50%, -50%);
    background: radial-gradient(
        ellipse at center,
        rgba(236, 25, 112, 0.12) 0%,
        rgba(160, 172, 8, 0.06) 40%,
        transparent 70%
    );
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: -1;
}

.site-header__logo:hover::before {
    opacity: 1;
}

.site-header__logo:hover .logo-img {
    transform: scale(1.04);
    filter: drop-shadow(0 0 8px rgba(236, 25, 112, 0.25));
}

/* ── Footer Logo ── */
.logo-img--footer {
    height: 45px;
    background: #fff;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    position: relative;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.5s ease;
}

/* Futuristic scanning line animation on footer logo */
.footer__logo {
    position: relative;
    display: inline-block;
    overflow: hidden;
    border-radius: var(--radius-md);
}

.footer__logo::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(236, 25, 112, 0.08) 30%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(160, 172, 8, 0.08) 70%,
        transparent 100%
    );
    animation: logoScanline 4s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes logoScanline {
    0%   { left: -60%; }
    50%  { left: 100%; }
    100% { left: 100%; }
}

.footer__logo:hover .logo-img--footer {
    transform: scale(1.03);
    box-shadow:
        0 0 15px rgba(236, 25, 112, 0.2),
        0 0 30px rgba(160, 172, 8, 0.1);
}

/* ── Transparent header: light nav text over dark hero (all pages) ── */
.site-header:not(.scrolled) .main-nav__link {
    color: rgba(255, 255, 255, 0.85);
}

.site-header:not(.scrolled) .main-nav__link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

.site-header:not(.scrolled) .main-nav__link.active {
    color: #fff;
    animation-name: activeGlowPulseLight;
}

.site-header:not(.scrolled) .main-nav__link.active::after {
    background: var(--color-primary-light);
    box-shadow: 0 0 6px rgba(240, 24, 154, 0.5);
}

/* Logo hover glow on transparent header (all pages use logo-home.png) */
.site-header:not(.scrolled) .site-header__logo:hover .logo-img {
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.4));
}

/* Mobile toggle bars: white on transparent header (all pages) */
.site-header:not(.scrolled) .mobile-toggle__bar {
    background: #fff;
}

/* When mobile menu is open: reset to dark colors for white overlay */
.site-header:not(.scrolled) .mobile-toggle.open .mobile-toggle__bar {
    background: var(--color-dark);
}

/* ── Mobile Nav Logo (hidden on desktop) ── */
.mobile-nav-logo {
    display: none;
}

/* ── Main Navigation ── */
.main-nav__list {
    display: flex;
    align-items: center;
    gap: 2px;
}

.main-nav__link {
    display: block;
    padding: 0.55rem 1rem;
    font-family: var(--font-family-heading);
    font-size: 0.85rem;
    font-weight: var(--font-weight-semibold);
    color: var(--color-dark);
    text-decoration: none;
    text-transform: uppercase;
    border-radius: var(--radius-md);
    transition: color 0.25s ease,
                background 0.25s ease,
                text-shadow 0.3s ease;
    position: relative;
    letter-spacing: 0.04em;
}

/* Animated underline — grows from center on hover */
.main-nav__link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 24px;
    height: 2.5px;
    background: var(--color-primary);
    border-radius: 2px;
    transition: transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
    transform-origin: center;
}

.main-nav__link:hover {
    color: var(--color-primary);
    background: var(--color-primary-bg);
    text-shadow: 0 0 8px rgba(236, 25, 112, 0.3);
}

.main-nav__link:hover::after {
    transform: translateX(-50%) scaleX(1);
}

/* Active link: underline always visible + glow pulse */
.main-nav__link.active {
    color: var(--color-primary);
    font-weight: var(--font-weight-semibold);
    animation: activeGlowPulse 3s ease-in-out infinite;
}

.main-nav__link.active::after {
    transform: translateX(-50%) scaleX(1);
    animation: underlineGlowPulse 3s ease-in-out infinite;
}

/* Active link glow pulse keyframes */
@keyframes activeGlowPulse {
    0%, 100% { text-shadow: 0 0 4px rgba(236, 25, 112, 0.2); }
    50%      { text-shadow: 0 0 12px rgba(236, 25, 112, 0.45); }
}

@keyframes underlineGlowPulse {
    0%, 100% { box-shadow: 0 0 4px rgba(236, 25, 112, 0.3); }
    50%      { box-shadow: 0 0 10px rgba(236, 25, 112, 0.6); }
}

/* Transparent header: lighter active glow */
@keyframes activeGlowPulseLight {
    0%, 100% { text-shadow: 0 0 4px rgba(255, 255, 255, 0.15); }
    50%      { text-shadow: 0 0 14px rgba(240, 24, 154, 0.5); }
}

/* ── Nav Link Staggered Entrance ── */
@keyframes navFadeDown {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-nav__item {
    opacity: 0;
    animation: navFadeDown 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.main-nav__item:nth-child(1) { animation-delay: 0.1s; }
.main-nav__item:nth-child(2) { animation-delay: 0.18s; }
.main-nav__item:nth-child(3) { animation-delay: 0.26s; }
.main-nav__item:nth-child(4) { animation-delay: 0.34s; }
.main-nav__item:nth-child(5) { animation-delay: 0.42s; }
.main-nav__item:nth-child(6) { animation-delay: 0.50s; }

/* ── Mobile Toggle ── */
.mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    padding: 6px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: calc(var(--z-overlay) + 1);
}

.mobile-toggle__bar {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--color-dark);
    border-radius: 2px;
    transform-origin: center;
    transition: transform 0.4s cubic-bezier(0.68, -0.6, 0.32, 1.6),
                opacity 0.25s ease,
                scale 0.25s ease;
}

/* Mobile toggle open state — springy overshoot */
.mobile-toggle.open .mobile-toggle__bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-toggle.open .mobile-toggle__bar:nth-child(2) {
    opacity: 0;
    scale: 0;
}

.mobile-toggle.open .mobile-toggle__bar:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ── Scrolled Header — Animated Starfield ── */

/* Layer 1: Drifting stars — magenta, olive, gold, white */
.site-header::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.6s ease;
    background-image:
        /* Magenta stars */
        radial-gradient(1.5px 1.5px at 5% 25%,  rgba(236, 25, 112, 0.6) 50%, transparent 100%),
        radial-gradient(1px 1px   at 18% 70%, rgba(236, 25, 112, 0.45) 50%, transparent 100%),
        radial-gradient(1.2px 1.2px at 48% 20%, rgba(236, 25, 112, 0.5) 50%, transparent 100%),
        radial-gradient(1px 1px   at 75% 55%, rgba(236, 25, 112, 0.4) 50%, transparent 100%),
        /* Olive stars */
        radial-gradient(1.3px 1.3px at 12% 45%, rgba(160, 172, 8, 0.55) 50%, transparent 100%),
        radial-gradient(1px 1px   at 38% 80%, rgba(160, 172, 8, 0.4) 50%, transparent 100%),
        radial-gradient(1.5px 1.5px at 62% 30%, rgba(160, 172, 8, 0.5) 50%, transparent 100%),
        radial-gradient(1px 1px   at 88% 65%, rgba(160, 172, 8, 0.35) 50%, transparent 100%),
        /* Gold stars */
        radial-gradient(1.2px 1.2px at 28% 35%, rgba(200, 152, 24, 0.5) 50%, transparent 100%),
        radial-gradient(1px 1px   at 55% 75%, rgba(200, 152, 24, 0.4) 50%, transparent 100%),
        radial-gradient(1.3px 1.3px at 82% 15%, rgba(200, 152, 24, 0.45) 50%, transparent 100%),
        /* White stars */
        radial-gradient(1px 1px   at 8% 60%,  rgba(255, 255, 255, 0.4) 50%, transparent 100%),
        radial-gradient(1.2px 1.2px at 33% 50%, rgba(255, 255, 255, 0.35) 50%, transparent 100%),
        radial-gradient(1px 1px   at 58% 15%, rgba(255, 255, 255, 0.3) 50%, transparent 100%),
        radial-gradient(1.3px 1.3px at 92% 40%, rgba(255, 255, 255, 0.4) 50%, transparent 100%),
        radial-gradient(1px 1px   at 70% 85%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    background-size: 250% 250%;
    animation: headerStarDrift 20s linear infinite,
               headerStarBlink1 3s ease-in-out infinite alternate;
}

.site-header.scrolled::before {
    opacity: 1;
}

@keyframes headerStarDrift {
    0%   { background-position: 0% 0%; }
    25%  { background-position: 50% 100%; }
    50%  { background-position: 100% 0%; }
    75%  { background-position: 50% 100%; }
    100% { background-position: 0% 0%; }
}

@keyframes headerStarBlink1 {
    0%   { opacity: 0; }
    100% { opacity: 1; }
}

/* Ensure header content stays above the starfield */
.site-header__inner {
    position: relative;
    z-index: 1;
}

/* Layer 2: Blinking accent stars on inner — different rhythm & colors */
.site-header__inner::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.6s ease;
    background-image:
        /* Bright magenta blinkers */
        radial-gradient(2px 2px at 10% 40%, rgba(236, 25, 112, 0.7) 50%, transparent 100%),
        radial-gradient(2px 2px at 45% 65%, rgba(236, 25, 112, 0.6) 50%, transparent 100%),
        radial-gradient(1.8px 1.8px at 80% 30%, rgba(236, 25, 112, 0.65) 50%, transparent 100%),
        /* Bright olive blinkers */
        radial-gradient(2px 2px at 25% 55%, rgba(160, 172, 8, 0.65) 50%, transparent 100%),
        radial-gradient(1.8px 1.8px at 60% 25%, rgba(160, 172, 8, 0.6) 50%, transparent 100%),
        radial-gradient(2px 2px at 90% 70%, rgba(160, 172, 8, 0.55) 50%, transparent 100%),
        /* Bright gold blinkers */
        radial-gradient(1.8px 1.8px at 35% 20%, rgba(200, 152, 24, 0.65) 50%, transparent 100%),
        radial-gradient(2px 2px at 70% 50%, rgba(200, 152, 24, 0.6) 50%, transparent 100%),
        /* White blinkers */
        radial-gradient(2.2px 2.2px at 15% 75%, rgba(255, 255, 255, 0.5) 50%, transparent 100%),
        radial-gradient(2px 2px at 52% 40%, rgba(255, 255, 255, 0.45) 50%, transparent 100%),
        radial-gradient(2.2px 2.2px at 85% 55%, rgba(255, 255, 255, 0.5) 50%, transparent 100%);
    background-size: 300% 300%;
    animation: headerStarDrift2 30s linear infinite,
               headerStarBlink2 2s ease-in-out infinite alternate;
}

.site-header.scrolled .site-header__inner::before {
    opacity: 1;
}

@keyframes headerStarDrift2 {
    0%   { background-position: 100% 50%; }
    50%  { background-position: 0% 0%; }
    100% { background-position: 100% 50%; }
}

@keyframes headerStarBlink2 {
    0%   { opacity: 0; }
    100% { opacity: 1; }
}

/* ── Scroll Border — Gradient Slide-In ── */
.site-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(
        90deg,
        var(--color-primary) 0%,
        var(--color-secondary) 50%,
        var(--color-accent) 100%
    );
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
    pointer-events: none;
}

.site-header.scrolled::after {
    transform: scaleX(1);
}

/* ── Accessibility: Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
    .main-nav__item {
        animation: none;
        opacity: 1;
    }

    .main-nav__link.active {
        animation: none;
    }

    .main-nav__link.active::after {
        animation: none;
    }

    .main-nav__link::after {
        transition: none;
    }

    .main-nav__link {
        transition: color 0.25s ease, background 0.25s ease;
    }

    .site-header::after {
        transition: none;
    }

    .site-header::before {
        animation: none;
        opacity: 0 !important;
    }

    .site-header__inner::before {
        animation: none;
        opacity: 0 !important;
    }

    .mobile-toggle__bar {
        transition: all 0.2s ease;
    }
}
