/* 
 * Global CSS: Where dreams go to die and specificity wars are waged
 * 
 * Legend has it that three frontend developers walked into this file...
 * Only their !important declarations made it out alive.
 * 
 * "From their molten chains, I forged them to crowns."
 * - The Scrolls of the Remembered Flame, describing CSS resets
 * 
 * May your z-index always be properly aligned,
 * And your selector specificity never be questioned.
 */

/** ===== FONTS ===== */
/* Urbanist font for modern UI elements */
@import url("https://fonts.googleapis.com/css2?family=Urbanist:ital,wght@0,100..900;1,100..900&display=swap");

/* EB Garamond for elegant serif text and Prompt for headers */
@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400..800;1,400..800&family=Noto+Color+Emoji&family=Prompt:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

/* Fira Code for monospace and code blocks */
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@300..700&display=swap');
@layer reset, global;

@layer global {

    /** ===== GLOBAL CSS ===== */
    html,
    body {
        font-family: "EB Garamond", serif;
        color: var(--foreground);
        background: var(--deep-space);
        margin: 0;
        display: flex;
        flex-direction: column;
        padding: 0;
        height: 100%;
        min-height: 100%;
        max-width: 100%;
        width: 100%;
        overflow-y: auto;
        line-height: 1.6em;
        letter-spacing: 0.05em;
    }

    strong {
        font-weight: 600;
    }

    em {
        font-style: italic;
    }

    a {
        color: var(--brand);
        text-decoration: none;
        transition: all 0.3s ease;
        position: relative;
    }

    a:hover {
        color: rgba(var(--star-glow-rgb), 0.9);
    }

    a:after {
        content: '';
        position: absolute;
        width: 0;
        height: 1px;
        bottom: -2px;
        left: 0;
        background: linear-gradient(90deg, transparent, var(--brand), transparent);
        transition: width 0.3s ease;
    }

    a:hover:after {
        width: 100%;
    }

    hr {
        background: linear-gradient(90deg, transparent, rgba(var(--foreground-rgb), 0.1), transparent);
        height: 1px;
        margin: 1.5em 0;
        width: 100%;
        border: none;
    }

    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        font-weight: 400;
        line-height: 1.2;
    }

    h1 {
        font-size: 2.5rem;
        letter-spacing: 0.02em;
    }

    h2 {
        font-size: 2rem;
    }

    h3 {
        font-size: 1.75rem;
    }

    * {
        scrollbar-width: thin;
        scrollbar-color: rgba(var(--foreground-rgb), 0.2) rgba(var(--foreground-rgb), 0.05);
    }

    /**
 * Global Animations & Classes
**/

    .construction-animation-background {
        --s-color-1: var(--color-1, rgba(var(--foreground-rgb), 0));
        --s-color-2: var(--color-2, rgba(var(--copilot-rgb), 0.2));
        --a-time: var(--anim-time, 1s);

        /* Define the repeat length along the diagonal */
        --repeat-length: 40px;

        background-size: calc(var(--repeat-length) * 1.4) calc(var(--repeat-length) * 1.4);
        background-image: repeating-linear-gradient(45deg,
                var(--s-color-1) 0,
                var(--s-color-1) calc(var(--repeat-length) * 0.5),
                var(--s-color-2) calc(var(--repeat-length) * 0.5),
                var(--s-color-2) var(--repeat-length));
        animation: construction-animation var(--a-time) linear infinite;
    }

    @keyframes construction-animation {
        0% {
            background-position: 0 0;
        }

        100% {
            /* Move the background by one repeat length */
            background-position: calc(var(--repeat-length) * -1.8) calc(var(--repeat-length) * 1);
        }
    }
}

.glowing-text {
    color: color-mix(in srgb, var(--galaxy-blue), var(--foreground) 80%);
    text-shadow: 0 0 20px var(--galaxy-blue);
    /* animation: glow-pulse 3s ease-in-out infinite; */
}

.cosmic-title,
strong {
    color: var(--foreground);
    letter-spacing: 0.1em;
    text-shadow:
        0 0 0.2em rgba(var(--star-glow-rgb), 0.3),
        0 0 1em rgba(var(--galaxy-blue-rgb), 0.2);
    background: linear-gradient(to bottom,
            rgba(var(--foreground-rgb), 1) 0%,
            rgba(var(--flame-0-rgb), 1) 50%);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    /* animation: cosmic-pulse 4s ease-in-out infinite; */
}

@keyframes cosmic-pulse {

    0%,
    100% {
        opacity: 0.9;
        text-shadow:
            0 0 5px rgba(var(--star-glow-rgb), 0.5),
            0 0 10px rgba(var(--galaxy-blue-rgb), 0.3);
    }

    50% {
        opacity: 1;
        text-shadow:
            0 0 7px rgba(var(--star-glow-rgb), 0.7),
            0 0 15px rgba(var(--galaxy-blue-rgb), 0.5);
    }
}