body,
html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: "Irish Grover", cursive;
    background: #000;
    overflow: hidden;
    transition: opacity 0.8s ease-out;
}

body {
    background-image: url("../img/index.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 1;
}

/* Cinematic Vignette */
body::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 30%, rgba(0, 0, 0, 0.8) 100%);
    pointer-events: none;
    z-index: 2;
}

/* CRT Scanline Overlay */
body::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
    background-size: 100% 4px;
    /* Scanline spacing */
    z-index: 10;
    pointer-events: none;
    opacity: 0.3;
}

/* ============================ GOD RAYS ============================ */
.godRays {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150vmax;
    height: 150vmax;
    background: repeating-conic-gradient(from 0deg,
            rgba(200, 20, 20, 0.05) 0deg 5deg,
            transparent 5deg 15deg);
    transform: translate(-50%, -50%);
    z-index: -1;
    pointer-events: none;
    opacity: 0;
    filter: blur(8px);
    mix-blend-mode: screen;
    animation: rotateRays 60s linear infinite, raysAppear 3s ease-out forwards;
}

@keyframes rotateRays {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes raysAppear {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) rotate(0deg) scale(0.5);
    }

    100% {
        opacity: 0.6;
        transform: translate(-50%, -50%) rotate(15deg) scale(1);
    }
}

body.fadeOut {
    opacity: 0;
}

main {
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* ============================ MAGICAL PARTICLES ============================ */
.landingHero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(2px 2px at 20% 30%, rgba(255, 255, 255, 0.9), transparent),
        radial-gradient(2px 2px at 60% 70%, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(1px 1px at 50% 50%, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(1px 1px at 80% 10%, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(3px 3px at 15% 90%, rgba(255, 255, 255, 0.8), transparent);
    background-size: 200% 200%;
    animation: particleFloat 15s ease-in-out infinite;
    z-index: 3;
    pointer-events: none;
    filter: drop-shadow(0 0 3px rgba(255, 0, 0, 0.3));
}

/* Fireflies */
.landingHero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(3px 3px at 10% 10%, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(3px 3px at 90% 90%, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(2px 2px at 50% 20%, rgba(255, 255, 255, 0.9), transparent);
    background-size: 150% 150%;
    animation: fireflyMove 10s linear infinite alternate;
    z-index: 3;
    pointer-events: none;
    mix-blend-mode: screen;
}

/* SMOKE LAYER 1 (Bottom Rolling) */
.overlay::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 100%;
    background: radial-gradient(circle at 50% 60%, rgba(150, 20, 20, 0.05), transparent 50%),
        radial-gradient(circle at 20% 80%, rgba(100, 10, 10, 0.08), transparent 40%),
        radial-gradient(circle at 80% 40%, rgba(150, 50, 50, 0.03), transparent 60%);
    filter: blur(20px);
    animation: smokeFloat 25s linear infinite;
    z-index: 2;
    pointer-events: none;
    opacity: 0.4;
}

/* SMOKE LAYER 2 (Rising Wisps) */
.overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 250%;
    height: 150%;
    background: radial-gradient(ellipse at 70% 70%, rgba(150, 50, 50, 0.03), transparent 40%),
        radial-gradient(ellipse at 30% 30%, rgba(200, 50, 50, 0.04), transparent 50%);
    filter: blur(30px);
    animation: smokeFloatReverse 30s linear infinite;
    z-index: 2;
    pointer-events: none;
    opacity: 0.3;
}

@keyframes particleFloat {
    0% {
        background-position: 0% 0%;
        opacity: 0.3;
    }

    50% {
        background-position: 100% 100%;
        opacity: 0.6;
    }

    100% {
        background-position: 0% 0%;
        opacity: 0.3;
    }
}

@keyframes fireflyMove {
    0% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0;
    }

    25% {
        opacity: 1;
    }

    50% {
        transform: translateY(-50px) translateX(30px) scale(1.2);
        opacity: 0.5;
    }

    75% {
        opacity: 1;
    }

    100% {
        transform: translateY(-20px) translateX(-30px) scale(0.8);
        opacity: 0;
    }
}

@keyframes smokeFloat {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(-50%, -20px);
    }
}

@keyframes smokeFloatReverse {
    0% {
        transform: translate(-50%, 0);
    }

    100% {
        transform: translate(0, -30px);
    }
}

/* ============================ HERO CONTENT ============================ */
.landingHero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow: hidden;
}

.overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
    animation: overlayPulse 4s ease-in-out infinite;
}

@keyframes overlayPulse {

    0%,
    100% {
        background: rgba(0, 0, 0, 0.5);
    }

    50% {
        background: rgba(0, 0, 0, 0.4);
    }
}

.landingContent {
    position: relative;
    z-index: 4;
    padding: 1.5rem;
    width: 100%;
    max-width: 1200px;
}

.landingContent figure {
    margin: 0 0 2rem 0;
    animation: logoEntrance 1.5s ease-out forwards, logoFloat 3s ease-in-out 1.5s infinite alternate;
}

@keyframes logoEntrance {
    0% {
        opacity: 0;
        transform: scale(0.3) rotate(-180deg);
        filter: drop-shadow(0 0 30px rgba(255, 20, 20, 0.5)) blur(10px);
    }

    60% {
        opacity: 1;
        transform: scale(1.1) rotate(10deg);
        filter: drop-shadow(0 0 20px rgba(255, 20, 20, 0.3));
    }

    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
        filter: drop-shadow(0 0 10px rgba(255, 20, 20, 0.2));
    }
}

.landingLogo {
    width: 16rem;
    height: auto;
    filter: drop-shadow(0 0 10px rgba(255, 20, 20, 0.1));
    margin-bottom: 1rem;
}

/* ============================ TEXT ANIMATIONS ============================ */

.wordSplit {
    font-family: "Stencil", sans-serif;
    font-size: 2.5rem;
    color: #ffffff;
    margin-bottom: 1rem;
    letter-spacing: 0.15rem;
    text-transform: uppercase;
    display: block;
    line-height: 1.1;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8), 0 0 20px rgba(255, 0, 0, 0.5);
    animation: magicalTextReveal 4s ease-out forwards, chromaticPulse 8s infinite linear;
}

.wordSplitP {
    font-size: 1.1rem;
    color: #ffffff;
    font-family: "Cinzel", serif;
    letter-spacing: 0.1rem;
    font-weight: bold;
    display: block;
    margin-top: 0.5rem;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
    padding: 0 10px;
    line-height: 1.5;
}

.wordSplit span,
.wordSplitP span {
    display: inline-block;
    white-space: nowrap;
    margin: 0 0.2em;
    opacity: 0;
    /* Handled by animation */
    animation: wordMagicalEntrance 1s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes wordMagicalEntrance {
    0% {
        transform: translateY(20px) scale(0.8);
        opacity: 0;
        filter: blur(10px);
    }

    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
        filter: blur(0);
    }
}

/* Magical Text Reveal Animation */
@keyframes magicalTextReveal {
    0% {
        opacity: 0;
        transform: scale(1.5);
        filter: blur(20px);
        text-shadow: 0 0 50px white, 0 0 100px red;
    }

    100% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.8), 0 0 20px rgba(255, 0, 0, 0.4);
    }
}

/* Chromatic Aberration Pulse */
@keyframes chromaticPulse {
    0% {
        text-shadow: 2px 0 red, -2px 0 blue;
    }

    50% {
        text-shadow: -2px 0 red, 2px 0 blue;
    }

    100% {
        text-shadow: 2px 0 red, -2px 0 blue;
    }
}

/* 
   Animation: Word Glow In + Fly Sparks
*/
.wordSplit span {
    animation: wordExplode 0.2s cubic-bezier(0.215, 0.610, 0.355, 1.000) forwards;
}

.wordSplitP span {
    animation: wordExplode 0.2s cubic-bezier(0.215, 0.610, 0.355, 1.000) forwards;
    color: rgba(255, 220, 220, 0.8);
    text-shadow: 0 0 8px rgba(200, 20, 20, 0.3);
}

/* Staggered Delays for H1 */
.wordSplit span:nth-child(1) {
    animation-delay: 0.25s;
}

.wordSplit span:nth-child(2) {
    animation-delay: 0.5s;
}

.wordSplit span:nth-child(3) {
    animation-delay: 0.75s;
}

/* Staggered Delays for P (starts after H1) */
.wordSplitP span:nth-child(1) {
    animation-delay: 1s;
}

.wordSplitP span:nth-child(2) {
    animation-delay: 1.25s;
}

.wordSplitP span:nth-child(3) {
    animation-delay: 1.5s;
}

.wordSplitP span:nth-child(4) {
    animation-delay: 1.75s;
}

.wordSplitP span:nth-child(5) {
    animation-delay: 2s;
}

.wordSplitP span:nth-child(6) {
    animation-delay: 2.25s;
}


/* Shimmer effect for text */
@keyframes shimmer {
    0% {
        background-position: -200% center;
    }

    100% {
        background-position: 200% center;
    }
}

/* Keyframes for text appearance (Dim Red Light) */
@keyframes wordExplode {
    0% {
        opacity: 0;
        transform: scale(3);
        filter: blur(30px);
        text-shadow: 0 0 40px rgba(255, 20, 20, 0.5);
        color: #fff;
    }

    20% {
        color: #fff;
    }

    50% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
        text-shadow: 0 0 20px rgba(255, 20, 20, 0.3);
    }

    100% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
        /* Subtle glow remains */
        text-shadow: 0 0 10px rgba(255, 20, 20, 0.2), 0 0 15px rgba(200, 100, 100, 0.1);
    }
}

.wordSplit span,
.wordSplitP span {
    background: none;
    /* Removed gradient text for pure white */
    -webkit-text-fill-color: #ffffff;
}

/* Spark/Particle Effect (White & Red) */
.wordSplit span::before,
.wordSplit span::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 10px white, 0 0 20px red;
    opacity: 0;
    pointer-events: none;
    z-index: -1;
}

/* Sparks flying animation */
.wordSplit span::before {
    animation: sparkFly1 0.1s ease-out forwards;
}

.wordSplit span::after {
    animation: sparkFly2 0.1s ease-out forwards;
}

/* Stagger sparks same as text */
.wordSplit span:nth-child(1)::before,
.wordSplit span:nth-child(1)::after {
    animation-delay: 0.20s;
}

.wordSplit span:nth-child(2)::before,
.wordSplit span:nth-child(2)::after {
    animation-delay: 0.4s;
}

.wordSplit span:nth-child(3)::before,
.wordSplit span:nth-child(3)::after {
    animation-delay: 0.8s;
}

/* (We can add more for P tags if needed, but H1 is the main focus) */


@keyframes sparkFly1 {
    0% {
        width: 10px;
        height: 10px;
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    100% {
        width: 2px;
        height: 2px;
        opacity: 0;
        transform: translate(-200%, -200%) scale(0);
        /* Fly top-left */
    }
}

@keyframes sparkFly2 {
    0% {
        width: 10px;
        height: 10px;
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    100% {
        width: 2px;
        height: 2px;
        opacity: 0;
        transform: translate(200%, -50%) scale(0);
        /* Fly right */
    }
}


/* Logo Animation */
@keyframes logoFloat {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
        filter: drop-shadow(0 0 10px rgba(200, 20, 20, 0.15));
    }

    50% {
        transform: translateY(-15px) rotate(2deg) scale(1.02);
        filter: drop-shadow(0 0 20px rgba(255, 20, 20, 0.3));
    }

    100% {
        transform: translateY(0) rotate(0deg) scale(1);
        filter: drop-shadow(0 0 10px rgba(200, 20, 20, 0.15));
    }
}


/* ============================ RESPONSIVE DESIGN (Granular Mobile First) ============================ */

/* Base Styles (Smallest Mobile < 380px) */
/* (Currently handled by root styles) */

/* Tiny Mobile */
@media (min-width: 380px) {
    .landingLogo {
        width: 17rem;
    }

    .wordSplit {
        font-size: 2.6rem;
        margin-bottom: 1.1rem;
    }

    .wordSplitP {
        font-size: 1.15rem;
    }
}

/* Mobile Medium */
@media (min-width: 430px) {
    .landingLogo {
        width: 17.5rem;
    }

    .word-split {
        font-size: 2.7rem;
    }

    .word-split-p {
        font-size: 1.18rem;
    }
}

/* Small Mobile */
@media (min-width: 480px) {
    .landingLogo {
        width: 18rem;
    }

    .wordSplit {
        font-size: 2.8rem;
        letter-spacing: 0.18rem;
    }

    .wordSplitP {
        font-size: 1.2rem;
    }
}


/* Specific Breakpoint 486px */
@media (min-width: 486px) {
    .landingContent {
        padding: 1.8rem;
    }

    .landingLogo {
        margin-bottom: 1.2rem;
    }
}

/* Mid Mobile */
@media (min-width: 600px) {
    .landingLogo {
        width: 19rem;
    }

    .wordSplit {
        font-size: 3rem;
    }

    .wordSplitP {
        font-size: 1.3rem;
    }
}

/* Large Mobile / Phablet */
@media (min-width: 700px) {
    .landingLogo {
        width: 20rem;
    }

    .wordSplit {
        font-size: 3.2rem;
    }

    .wordSplitP {
        font-size: 1.4rem;
    }
}

/* Tablet (Standard) */
@media (min-width: 768px) {
    .landingContent {
        padding: 2rem;
    }

    .landingLogo {
        width: 21rem;
        margin-bottom: 1.5rem;
    }

    .wordSplit {
        font-size: 3.5rem;
        margin-bottom: 1.5rem;
        letter-spacing: 0.2rem;
    }

    .wordSplitP {
        font-size: 1.5rem;
        margin-top: 1rem;
    }
}

/* Large Tablet */
@media (min-width: 850px) {
    .landingLogo {
        width: 22rem;
    }

    .wordSplit {
        font-size: 3.8rem;
    }

    .wordSplitP {
        font-size: 1.6rem;
    }
}

/* Laptop */
@media (min-width: 1000px) {
    .landingLogo {
        width: 23rem;
        margin-bottom: 2rem;
    }

    .wordSplit {
        font-size: 4.2rem;
        letter-spacing: 0.25rem;
    }

    .wordSplitP {
        font-size: 1.8rem;
    }
}

/* Large Screen */
@media (min-width: 1200px) {
    .landingLogo {
        width: 25rem;
    }

    .wordSplit {
        font-size: 5rem;
        letter-spacing: 0.3rem;
        line-height: 1.2;
    }

    .wordSplitP {
        font-size: 2rem;
    }
}

/* Performance Optimizations */
.landingHero::before,
.landingHero::after,
.overlay::before,
.overlay::after,
.godRays {
    will-change: transform, opacity;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* ============================ MAGIC CURSOR ============================ */
.magicParticle {
    position: fixed;
    pointer-events: none;
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, rgba(255, 150, 150, 0.8), rgba(200, 20, 20, 0.3), transparent);
    border-radius: 50%;
    z-index: 9999;
    animation: particleFade 1s ease-out forwards;
}

@keyframes particleFade {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(0);
        opacity: 0;
    }
}

/* ============================ PORTAL TRANSITION ============================ */
.portalOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 100%, #000 100%);
    z-index: 10000;
    pointer-events: none;
    transition: background 1s ease-in-out;
}

/* When active, the black circle closes in */
body.fadeOut .portalOverlay {
    background: radial-gradient(circle at center, transparent 0%, #000 0%);
    animation: portalClose 1.5s cubic-bezier(0.55, 0.055, 0.675, 0.19) forwards;
}

@keyframes portalClose {
    0% {
        background: radial-gradient(circle at center, transparent 150%, #000 150%);
    }

    100% {
        background: radial-gradient(circle at center, transparent 0%, #000 0%);
    }
}

.god-rays {
    filter: blur(3px);
}

.overlay::before {
    filter: blur(20px);
}

.overlay::after {
    filter: blur(30px);
}