/* PrimeFi Home: Living Energy + Cyberpunk HUD + INTERACTION */

:root {
    --core-bg: #000205;
    --neon-cyan: #00f0ff;
    --neon-purple: #bc13fe;
    --neon-white: #fff;
    --font-display: 'Space Grotesk', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Dynamic Variables */
    --mouse-x: 0.5;
    --mouse-y: 0.5;
}

body {
    background-color: var(--core-bg);
    margin: 0;
    padding: 0;
    color: #fff;
    font-family: 'Inter', sans-serif;
    overflow: hidden;
    height: 100vh;
}

/* --- INTERACTIVE BACKGROUND --- */
/* The background follows the mouse subtly using calc() */
.living-bg {
    position: fixed;
    inset: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at calc(var(--mouse-x) * 100%) calc(var(--mouse-y) * 100%), rgba(0, 240, 255, 0.2), transparent 30%),
        radial-gradient(circle at 30% 30%, rgba(188, 19, 254, 0.1), transparent 40%),
        radial-gradient(circle at 70% 70%, rgba(0, 50, 255, 0.1), transparent 40%);
    z-index: -2;
    filter: blur(60px);
    transition: background 0.1s;
    /* smooth moving light */
}

/* Add a global vignette */
.vignette {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 15;
    background: radial-gradient(circle at center, transparent 40%, #000 100%);
}


/* --- GRID FLOOR --- */
.cyber-floor {
    position: fixed;
    bottom: -20%;
    left: -50%;
    width: 200%;
    height: 60%;
    background:
        linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px),
        linear-gradient(0deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    transform: perspective(600px) rotateX(60deg);
    mask-image: linear-gradient(to top, rgba(0, 0, 0, 1), transparent);
    z-index: -2;
    /* Animation handled by JS tilt + CSS move */
    transition: transform 0.1s ease-out;
}


/* --- MAIN STAGE (Parallax Container) --- */
.center-stage {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 10;
}


/* --- MASSIVE BRAND (Interactive) --- */
.mega-brand {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 15vw;
    line-height: 0.9;
    letter-spacing: -0.05em;
    color: #fff;
    margin: 0;

    /* MODIFIED: Neon Flicker Effect */
    text-shadow:
        0 0 20px rgba(0, 240, 255, 0.6),
        0 0 60px rgba(0, 240, 255, 0.4),
        0 0 120px rgba(0, 240, 255, 0.2);

    transition: transform 0.1s ease-out;
    /* Removed text-shadow transition so flicker snaps */
    position: relative;
    cursor: default;
    animation: neonFlicker 3s infinite;
}

.mega-brand::after {
    content: 'PRIMEFI';
    position: absolute;
    top: 0;
    left: 3px;
    color: var(--neon-purple);
    opacity: 0;
    mix-blend-mode: screen;
    animation: glitchHit 5s infinite;
}

/* FLICKER ANIMATION */
@keyframes neonFlicker {

    0%,
    19%,
    21%,
    23%,
    25%,
    54%,
    56%,
    100% {
        opacity: 1;
        text-shadow:
            0 0 20px rgba(0, 240, 255, 0.6),
            0 0 60px rgba(0, 240, 255, 0.4),
            0 0 120px rgba(0, 240, 255, 0.2);
    }

    20%,
    24%,
    55% {
        opacity: 0.8;
        text-shadow: none;
        /* Light goes out momentarily */
    }
}


/* --- REST OF TYPOGRAPHY --- */
.sub-orchestra {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    color: var(--neon-cyan);
    letter-spacing: 0.5em;
    text-transform: uppercase;
    margin-top: 2rem;
    padding: 10px 30px;
    border: 1px solid rgba(0, 240, 255, 0.3);
    background: rgba(0, 240, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.1);
    animation: subFloat 6s ease-in-out infinite;
    position: relative;
}

.sub-orchestra::before {
    content: '[';
    position: absolute;
    left: -20px;
    color: #fff;
    opacity: 0.5;
}

.sub-orchestra::after {
    content: ']';
    position: absolute;
    right: -20px;
    color: #fff;
    opacity: 0.5;
}

.sub-slogan {
    margin-top: 2rem;
    color: #fff;
    font-size: 2.5rem;
    font-weight: 600;
    letter-spacing: 4px;
    text-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
    animation: fadeIn 2s ease forwards;
}

@keyframes subFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes glitchHit {

    0%,
    95% {
        opacity: 0;
        transform: translate(0);
    }

    96% {
        opacity: 0.8;
        transform: translate(-5px, 2px);
    }

    97% {
        opacity: 0;
        transform: translate(0);
    }

    98% {
        opacity: 0.8;
        transform: translate(5px, -2px);
    }

    100% {
        opacity: 0;
    }
}


/* --- HOLOGRAPHIC DATA PLATES (3D Tilt) --- */
.holo-deck {
    position: absolute;
    bottom: 8vh;
    display: flex;
    gap: 2rem;
    perspective: 1000px;
    /* Essential for 3D tilt */
}

.holo-plate {
    width: 140px;
    height: 180px;
    background: rgba(10, 15, 20, 0.4);
    border: 1px solid rgba(0, 240, 255, 0.1);
    border-radius: 4px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(12px);
    overflow: hidden;

    /* JS controls transform, but we add transition for smooth return */
    transition: transform 0.1s ease-out, background 0.3s, border-color 0.3s;
    transform-style: preserve-3d;
}

.holo-plate:hover {
    background: rgba(0, 240, 255, 0.08);
    border-color: rgba(0, 240, 255, 0.6);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.15);
}

/* Internal elements need translateZ to pop out in 3D */
.hp-shape,
.hp-label {
    transform: translateZ(20px);
}


/* Corners */
.hp-corner {
    position: absolute;
    width: 6px;
    height: 6px;
    border: 1px solid transparent;
    transition: 0.3s;
}

.top-l {
    top: 2px;
    left: 2px;
    border-top-color: #fff;
    border-left-color: #fff;
}

.top-r {
    top: 2px;
    right: 2px;
    border-top-color: #fff;
    border-right-color: #fff;
}

.bot-l {
    bottom: 2px;
    left: 2px;
    border-bottom-color: #fff;
    border-left-color: #fff;
}

.bot-r {
    bottom: 2px;
    right: 2px;
    border-bottom-color: #fff;
    border-right-color: #fff;
}

.holo-plate:hover .hp-corner {
    width: 100%;
    height: 100%;
    opacity: 0.5;
    border-color: var(--neon-cyan);
}


/* --- CSS SHAPES (Abstract) --- */
.hp-shape {
    width: 60px;
    height: 60px;
    margin-bottom: 2rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.shape-layers div {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 1px solid #fff;
    transform: rotateX(60deg) rotateZ(45deg);
    opacity: 0.5;
    transition: 0.3s;
}

.shape-layers .l1 {
    transform: translateY(-15px) rotateX(60deg) rotateZ(45deg);
    border-color: var(--neon-cyan);
}

.shape-layers .l2 {
    transform: translateY(0px) rotateX(60deg) rotateZ(45deg);
}

.shape-layers .l3 {
    transform: translateY(15px) rotateX(60deg) rotateZ(45deg);
}

.holo-plate:hover .l1 {
    transform: translateY(-25px) rotateX(60deg) rotateZ(45deg);
    opacity: 1;
}

.holo-plate:hover .l3 {
    transform: translateY(25px) rotateX(60deg) rotateZ(45deg);
    opacity: 1;
}

.shape-bars {
    display: flex;
    gap: 4px;
    align-items: flex-end;
    height: 40px;
}

.bar {
    width: 6px;
    background: #fff;
    opacity: 0.5;
    transition: 0.3s;
}

.bar:nth-child(1) {
    height: 40%;
}

.bar:nth-child(2) {
    height: 80%;
    background: var(--neon-cyan);
}

.bar:nth-child(3) {
    height: 60%;
}

.holo-plate:hover .bar {
    opacity: 1;
    height: 100%;
}

.shape-core {
    width: 40px;
    height: 40px;
    border: 2px dashed var(--neon-purple);
    border-radius: 50%;
    animation: spinSlow 10s linear infinite;
    opacity: 0.7;
}

.holo-plate:hover .shape-core {
    animation: spinFast 1s linear infinite;
    border-color: #fff;
    opacity: 1;
}

@keyframes spinSlow {
    to {
        transform: rotate(360deg);
    }
}

@keyframes spinFast {
    to {
        transform: rotate(360deg);
    }
}

.shape-target {
    width: 40px;
    height: 40px;
    border: 1px solid #fff;
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shape-target::after {
    content: '+';
    font-family: monospace;
}

.holo-plate:hover .shape-target {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 10px var(--neon-cyan);
    transform: scale(1.1);
}

.shape-wave {
    width: 40px;
    height: 2px;
    background: transparent;
    box-shadow: 10px 10px 0 0 #fff;
    animation: wave 2s infinite alternate;
}

@keyframes wave {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(10deg);
    }
}

.hp-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 2px;
    color: #888;
    text-transform: uppercase;
    transition: 0.3s;
}

.holo-plate:hover .hp-label {
    color: var(--neon-cyan);
    letter-spacing: 3px;
}


/* --- HUD --- */
.cyber-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 20;
    padding: 2rem;
}

.hud-tl {
    position: absolute;
    top: 2rem;
    left: 2rem;
    width: 200px;
    height: 100px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.hud-tr {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 200px;
    height: 100px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    text-align: right;
}

.hud-bl {
    position: absolute;
    bottom: 2rem;
    left: 2rem;
    width: 200px;
    height: 100px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: flex-end;
}

.hud-br {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    width: 200px;
    height: 100px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
}

.hud-text {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--neon-cyan);
    padding: 10px;
    opacity: 0.7;
}

/* Streams */
.side-stream {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.2);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 5px;
    cursor: default;
}

.stream-l {
    left: 1.5rem;
}

.stream-r {
    right: 1.5rem;
}

@media (max-width: 768px) {

    .cyber-overlay,
    .side-stream {
        display: none;
    }

    .mega-brand {
        font-size: 20vw;
    }

    .holo-deck {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
        bottom: 2rem;
        gap: 1rem;
    }

    .holo-plate {
        width: 100px;
        height: 120px;
    }
}