@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&family=Mrs+Saint+Delafield&display=swap');

/* Ambient Neon Haze Background */
.neon-haze-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -20;
    overflow: hidden;
    pointer-events: none;
    background: var(--deep-night);
}

.haze-blob {
    position: absolute;
    width: 60vw;
    height: 60vw;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.12;
    animation: drift 30s infinite alternate ease-in-out;
}

.haze-blob-1 {
    top: -10%;
    left: -10%;
    background: var(--ice-cyan);
    animation-duration: 25s;
}

.haze-blob-2 {
    bottom: -10%;
    right: -10%;
    background: var(--electric-purple);
    animation-duration: 35s;
    animation-delay: -5s;
}

.haze-blob-3 {
    top: 40%;
    left: 30%;
    width: 40vw;
    height: 40vw;
    background: var(--hot-magenta);
    opacity: 0.08;
    animation-duration: 40s;
    animation-delay: -10s;
}

@keyframes drift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(10%, 15%) scale(1.1); }
}

/* Scroll Reveal Base Classes */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    filter: blur(5px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

/* No-reveal override for heroes and above-the-fold content */
.no-reveal {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    visibility: visible !important;
    transition: none !important;
}



/* Portal Transition Overlay */
.portal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: var(--deep-night);
    pointer-events: none;
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.portal-ring {
    width: 0;
    height: 0;
    border: 2px solid var(--ice-cyan);
    border-radius: 50%;
    opacity: 0;
    box-shadow: 0 0 30px var(--ice-cyan);
}

.portal-active .portal-overlay {
    opacity: 1;
    pointer-events: all;
}

.portal-active .portal-ring {
    animation: portal-sweep 0.6s ease-out forwards;
}

@keyframes portal-sweep {
    0% { width: 0; height: 0; opacity: 1; border-width: 10px; }
    100% { width: 300vmax; height: 300vmax; opacity: 0; border-width: 2px; }
}

/* Accessibility: prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .haze-blob { animation: none !important; }
    .reveal { transition: none !important; opacity: 1 !important; transform: none !important; filter: none !important; }
    .glass-card:hover { transform: none !important; }
    .glass-card::after { display: none !important; }
    .sticky-cta-pill { transition: opacity 0.3s ease !important; transform: translateY(0) !important; }
    .sticky-cta-pill.is-visible { opacity: 1 !important; }
    .portal-ring { animation: none !important; }
    .portal-overlay { transition: opacity 0.2s ease !important; }
}

:root {
    --neon-lavender: #CBB3EB;
    --electric-purple: #8E5FD0;
    --hot-magenta: #B45AE6;
    --ice-cyan: #46C7D5;
    --soft-glow-white: #F2EEFA;
    --deep-night: #0B0717;
    --mid-night-purple: #160E2B;
    --haze-violet: #3A2558;
    --font-primary: 'Poppins', sans-serif;
    --font-script: 'Montserrat', sans-serif;
}

body {
    background-color: var(--deep-night);
    color: var(--soft-glow-white);
    font-family: var(--font-primary);
}

.font-script {
    font-family: var(--font-script);
    font-style: italic;
    font-weight: 900;
    letter-spacing: -0.05em;
}

.neon-text-lavender {
    color: var(--neon-lavender);
    text-shadow: 0 0 8px rgba(203, 179, 235, 0.4);
    letter-spacing: -0.02em;
}

.neon-text-purple {
    color: var(--electric-purple);
    text-shadow: 0 0 8px rgba(142, 95, 208, 0.4);
}

.neon-text-cyan {
    color: var(--ice-cyan);
    text-shadow: 0 0 8px rgba(70, 199, 213, 0.4);
}

/* Backward compatibility for existing classes */
.neon-text-teal {
    color: var(--ice-cyan);
    text-shadow: 0 0 10px rgba(70, 199, 213, 0.5);
}

.glass-card {
    position: relative;
    overflow: hidden;
    background: rgba(22, 14, 43, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(203, 179, 235, 0.1);
    border-radius: 1.5rem;
    padding: 2rem;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-card:hover {
    border-color: rgba(203, 179, 235, 0.3);
    box-shadow: 0 10px 30px rgba(142, 95, 208, 0.15);
    transform: translateY(-4px);
}

.glass-card::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 45%,
        rgba(255, 255, 255, 0.03) 48%,
        rgba(255, 255, 255, 0.07) 50%,
        rgba(255, 255, 255, 0.03) 52%,
        transparent 55%
    );
    transform: rotate(25deg) translateY(100%);
    transition: transform 0.6s ease;
    pointer-events: none;
}

.glass-card:hover::after {
    transform: rotate(25deg) translateY(-100%);
}

.btn-primary {
    background: linear-gradient(135deg, var(--electric-purple), var(--hot-magenta));
    color: white;
    font-weight: 800;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(180, 90, 230, 0.4);
    opacity: 0.9;
}

.nav-link {
    color: rgba(242, 238, 250, 0.6);
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--neon-lavender);
}

.neon-border-teal {
    border-color: var(--ice-cyan);
    box-shadow: 0 0 15px rgba(70, 199, 213, 0.3);
}

.neon-border-purple {
    border-color: var(--electric-purple);
    box-shadow: 0 0 15px rgba(142, 95, 208, 0.3);
}

/* --- Full-page Loader Animation --- */
#loader-overlay {
    position: fixed;
    inset: 0;
    background-color: var(--deep-night);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.45s ease, visibility 0.45s;
    overflow: hidden;
    pointer-events: all;
}

#loader-overlay.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Neon bloom backgrounds */
#loader-overlay::before,
#loader-overlay::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    z-index: -1;
}

#loader-overlay::before {
    top: -100px;
    left: -100px;
    background-color: var(--ice-cyan);
}

#loader-overlay::after {
    bottom: -100px;
    right: -100px;
    background-color: var(--electric-purple);
}

/* Scanlines overlay */
.scanlines {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(18, 16, 16, 0) 50%,
        rgba(0, 0, 0, 0.15) 50%
    );
    background-size: 100% 4px;
    z-index: 10;
    pointer-events: none;
}

/* Neon Glitch Image Loader */
.flux-loader-logo {
    position: relative;
    width: 280px; /* Scaled up a bit */
    margin-bottom: 2rem;
    user-select: none;
    filter: drop-shadow(0 0 15px rgba(203, 179, 235, 0.4));
}

.flux-loader-logo img {
    width: 100%;
    height: auto;
    display: block;
}

.flux-loader-logo::before,
.flux-loader-logo::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../img/just%20flux.png') no-repeat center;
    background-size: contain;
    opacity: 0.8;
    z-index: -1;
}

.flux-loader-logo::before {
    left: 3px;
    filter: drop-shadow(-2px 0 var(--ice-cyan)) hue-rotate(90deg);
    animation: glitch-anim-1 2.5s infinite linear alternate-reverse;
}

.flux-loader-logo::after {
    left: -3px;
    filter: drop-shadow(2px 0 var(--electric-purple)) hue-rotate(-90deg);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

.flux-wordmark::before {
    left: 2px;
    text-shadow: -2px 0 var(--ice-cyan);
    animation: glitch-anim-1 2.5s infinite linear alternate-reverse;
}

.flux-wordmark::after {
    left: -2px;
    text-shadow: -2px 0 var(--electric-purple);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

.loader-subtext {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--soft-glow-white);
    opacity: 0.6;
    letter-spacing: 0.1em;
    margin-bottom: 2rem;
}

/* Loading Bar */
.loader-bar-container {
    width: 240px;
    height: 2px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 99px;
    overflow: hidden;
}

.loader-bar {
    height: 100%;
    width: 40%;
    background: var(--ice-cyan);
    box-shadow: 0 0 10px var(--ice-cyan);
    animation: loader-bar-anim 1.5s infinite ease-in-out;
}

/* Animations */
@keyframes glitch-anim-1 {
    0% { clip-path: inset(20% 0 30% 0); transform: translate(-2px, -1px); }
    10% { clip-path: inset(60% 0 10% 0); transform: translate(1px, 2px); }
    20% { clip-path: inset(10% 0 70% 0); transform: translate(-1px, -2px); }
    30% { clip-path: inset(40% 0 40% 0); transform: translate(2px, 1px); }
    40% { clip-path: inset(80% 0 5% 0); transform: translate(-2px, -1px); }
    50% { clip-path: inset(15% 0 65% 0); transform: translate(1px, 2px); }
    100% { clip-path: inset(45% 0 45% 0); transform: translate(0); }
}

@keyframes glitch-anim-2 {
    0% { clip-path: inset(15% 0 75% 0); transform: translate(2px, 1px); }
    15% { clip-path: inset(55% 0 25% 0); transform: translate(-1px, -2px); }
    30% { clip-path: inset(35% 0 45% 0); transform: translate(1px, 2px); }
    45% { clip-path: inset(75% 0 15% 0); transform: translate(-2px, -1px); }
    60% { clip-path: inset(5% 0 85% 0); transform: translate(2px, 1px); }
    100% { clip-path: inset(45% 0 45% 0); transform: translate(0); }
}

@keyframes loader-bar-anim {
    0% { transform: translateX(-100%); }
    50% { transform: translateX(150%); }
    100% { transform: translateX(-100%); }
}

/* Accessibility: prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .flux-wordmark::before,
    .flux-wordmark::after,
    .loader-bar {
        animation: none !important;
        display: none !important;
    }
    .flux-wordmark {
        text-shadow: 0 0 10px var(--neon-lavender);
    }
}

/* Global Micro-Interactions */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* Creator Hub Enhancements */
.resource-card {
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.resource-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(70, 199, 213, 0.12);
    border-color: rgba(70, 199, 213, 0.2);
}

.resource-card:focus-visible {
    outline: none;
    border-color: rgba(70, 199, 213, 0.3);
    box-shadow: 0 8px 24px rgba(70, 199, 213, 0.12), 0 0 0 2px var(--deep-night), 0 0 0 4px var(--ice-cyan);
}

.category-tab.active {
    box-shadow: 0 0 12px rgba(70, 199, 213, 0.15);
}

#resource-search:focus {
    box-shadow: 0 0 20px rgba(70, 199, 213, 0.2), 0 0 40px rgba(70, 199, 213, 0.1);
    border-color: var(--ice-cyan);
}

/* Back-to-Top Button Enhancements */
#backToTop {
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

#backToTop:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 0 25px rgba(70, 199, 213, 0.35) !important;
}

#backToTop:active {
    transform: translateY(0) !important;
}

#backToTop:focus-visible {
    outline: none;
    box-shadow: 0 0 25px rgba(70, 199, 213, 0.35), 0 0 0 2px var(--deep-night), 0 0 0 4px var(--ice-cyan) !important;
}

/* Anchor Section Highlight */
@keyframes anchor-highlight {
    0% {
        background-color: rgba(70, 199, 213, 0.05);
    }
    100% {
        background-color: transparent;
    }
}

section[id]::before {
    content: '';
    display: block;
    height: 1px;
    margin-top: -1px;
}

/* Responsive Animations */
@media (prefers-reduced-motion: reduce) {
    .resource-card:hover {
        transform: none;
    }
    
    #backToTop:hover {
        transform: none !important;
    }
}
