/* --- DESIGN SYSTEM & VARIABLES --- */
:root {
    --primary-clr: greenyellow;
    --bg-clr: #433;
    --text-clr: #f4f3f0;
    --orb-size: 30px;
    --imageSize: 160vw;

    /* Grid */
    --grid-columns: 12;
    --grid-gutter: 1rem;

    /* Font Sizes */
    --font-size-2b: 0.625rem;
    --font-size-1b: 0.8125rem;
    --font-size: 1rem;
    --font-size-1: 1.25rem;
    --font-size-2: 1.5625rem;
    --font-size-3: 2rem;
    --font-size-4: 2.5rem;
    --font-size-5: 3.1875rem;
    --font-size-6: 4rem;

    /* Line Heights */
    --line-height-2b: 2;
    --line-height-1b: 1.5385;
    --line-height: 1.5;
    --line-height-1: 1.4;
    --line-height-2: 1.28;
    --line-height-3: 1.25;
    --line-height-4: 1.2;
    --line-height-5: 1.1765;
    --line-height-6: 1.125;

    /* Letter Spacings */
    --letter-space-2b: 0.074em;
    --letter-space-1b: 0.05em;
    --letter-space: 0.035em;
    --letter-space-1: 0.022em;
    --letter-space-2: 0.0116em;
    --letter-space-3: 0.0025em;
    --letter-space-4: -0.004em;
    --letter-space-5: -0.0096em;
    --letter-space-6: -0.0137em;
}

/* --- RESET & FONTS --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

@font-face {
    font-family: "Alte Haas Grotesk";
    src: url("/fonts/AlteHaasGroteskRegular.ttf") format("truetype");
    font-weight: 400;
}

@font-face {
    font-family: "Alte Haas Grotesk";
    src: url("/fonts/AlteHaasGroteskBold.ttf") format("truetype");
    font-weight: 700;
}

@font-face {
    font-family: "Junicode";
    src: url("/fonts/JunicodeVF-Italic.woff2") format("woff2");
    font-style: normal;
}

/* --- BASE STYLES --- */
html,
body {
    background-color: var(--bg-clr);
    min-height: 100vh;
    overflow: hidden;
}

body {
    font-size: 16px;
    line-height: var(--line-height);
    letter-spacing: var(--letter-space);
    color: var(--text-clr);
    font-family: "Alte Haas Grotesk", Arial, sans-serif;
}

/* --- TYPOGRAPHY --- */
h1,
h2,
h3,
h4,
h5,
h6 {
    text-wrap: balance;
    font-weight: 900;
}

h1 {
    font-size: var(--font-size-3);
}
h2,
h3 {
    font-size: var(--font-size-2);
}

p {
    margin-block: 1.5rem;
    font-size: var(--font-size);
}

a {
    color: var(--text-clr);
    text-decoration: none;
    transition: color 0.2s ease-in;
}

a:hover {
    color: var(--primary-clr);
}

.ascii {
    opacity: 0.05;
    height: auto;
    width: 100dvw;
    position: absolute;
    top: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.ascii video {
    width: var(--imageSize);
    max-width: none;
    position: relative;
}

/* --- INTERACTIVE CANVAS & CONTAINER --- */
canvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.4;
}
#container {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 2;
}

#orb-counter {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: end;
    align-items: center;
    padding-bottom: 4vh;
    text-wrap: wrap;
    font-family: "Courier New", monospace;
    font-size: var(--font-size-3);
    font-weight: 700;
    color: var(--primary-clr);

    pointer-events: none;
    z-index: 200;

    opacity: 0;
}

#orb-counter p {
    font-size: var(--font-size-1);
    margin-bottom: 0.5rem;
}

#flavour-text {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    font-family: "Courier New", monospace;
    color: var(--primary-clr);
    pointer-events: none;
    font-size: 15px;
    letter-spacing: var(--letter-space);
    line-height: var(--line-height);
}

@media (max-width: 550px) {
    #flavour-text {
        left: 1.5rem;
    }
}

.orb {
    position: absolute;
    width: var(--orb-size);
    height: var(--orb-size);
    border-radius: 50%;
    cursor: pointer;
    will-change: transform;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition:
        box-shadow 0.2s ease,
        background-color 0.2s ease,
        border-color 0.2s ease;

    border: 2px solid var(--primary-clr);
    background-color: var(--bg-clr);
}

.orb.active-orb {
    background-color: var(--primary-clr);
}

.orb:hover {
    box-shadow: 0 0 30px var(--primary-clr) !important;
    z-index: 10;
}

/* --- MODAL ARCHITECTURE --- */

#modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: hsla(from hex var(--text-clr) 0.4);
    z-index: 100;
    backdrop-filter: blur(2px);

    display: none;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#modal-overlay.active {
    opacity: 1;

    pointer-events: auto;
}

.modal {
    position: absolute;
    background: var(--bg-clr);
    padding: 2.5rem;
    border-radius: 1.5rem;
    width: 320px;
    border: 1px solid greenyellow;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    pointer-events: auto;

    /* Animation Start State */
    opacity: 0;
    transform: scale(0.9);
    transition:
        transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        opacity 0.2s ease-out;
}

#modal-overlay.active .modal {
    opacity: 1;
    transform: scale(1);
}

/* Modal Content Details */
.modal h2 {
    font-family: "Junicode", serif;
    font-size: var(--font-size-2);
    color: var(--primary-clr);
    margin-bottom: 0.5rem;
}

.modal p {
    font-size: var(--font-size-1b);
    color: var(--text-clr);
    margin-block: 1rem;
    line-height: 1.4;
}

.open-btn {
    display: inline-block;
    background-color: var(--primary-clr);
    color: var(--bg-clr);
    padding: 0.8rem 2rem;
    border-radius: 5rem;
    font-weight: 700;
    font-size: var(--font-size-1b);
    text-transform: uppercase;
    letter-spacing: var(--letter-space-1b);
    transition:
        transform 0.2s ease,
        background-color 0.2s ease;
}

.open-btn:hover {
    color: var(--bg-clr);
    transform: translateY(-3px);
    filter: brightness(1.1);
}

/* --- UTILITY CLASSES --- */
.grid {
    display: grid;
    grid-template-columns: repeat(var(--grid-columns), 1fr);
    gap: var(--grid-gutter);
}

.fw-bold {
    font-weight: 800;
}
