/* ============================================================
   GXMBY — style.css
   Clean landing page. Everything visual lives in JS canvases
   or on the two key DOM elements: #mainText and .video-embed.
   ============================================================ */

/* ── Fonts ─────────────────────────────────────────────────── */
@font-face {
    font-family: 'OpenSauceSans';
    src: url('fonts/OpenSauceSans/OpenSauceSansRegular/OpenSauceSansRegular.woff2') format('woff2'),
         url('fonts/OpenSauceSans/OpenSauceSansRegular/OpenSauceSansRegular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'OpenSauceSans';
    src: url('fonts/OpenSauceSans/OpenSauceSansMedium/OpenSauceSansMedium.woff2') format('woff2'),
         url('fonts/OpenSauceSans/OpenSauceSansMedium/OpenSauceSansMedium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'OpenSauceSans';
    src: url('fonts/OpenSauceSans/OpenSauceSansBold/OpenSauceSansBold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'OpenSauceSans';
    src: url('fonts/OpenSauceSans/OpenSauceSansExtraBold/OpenSauceSansExtraBold.woff2') format('woff2'),
         url('fonts/OpenSauceSans/OpenSauceSansExtraBold/OpenSauceSansExtraBold.ttf') format('truetype');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'OpenSauceSans';
    src: url('fonts/OpenSauceSans/OpenSauceSansBlack/OpenSauceSansBlack.otf') format('opentype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* ── Reset & base ───────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #ffffff;
    --fg: #000000;
    --fg-muted: rgba(0, 0, 0, 0.5);
}

html, body {
    width: 100%;
    height: 100%;
}

body {
    background: var(--bg);
    color: var(--fg);
    overflow: hidden;
    position: fixed;
    /* Prevent iOS bounce */
    overscroll-behavior: none;
}

/* ── Canvases ───────────────────────────────────────────────── */
#particleCanvas,
#ghostCanvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#particleCanvas { z-index: 1; }

/* Ghost canvas sits above particles, below everything else */
#ghostCanvas { z-index: 2; }

/* ── Layout ─────────────────────────────────────────────────── */
.content-wrapper {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    padding: 1rem 1rem 5rem;
    /* Particle canvas handles pointer events; let clicks through wrapper */
    pointer-events: none;
}

.content-wrapper > * {
    pointer-events: auto;
}

.text-container {
    position: relative;
    width: 100%;
    max-width: 90vw;
    display: grid;
    place-items: center;
    /* Reserve enough height for the stacked video + text */
    min-height: min(72vw, 34rem);
}

/* ── Video embed ────────────────────────────────────────────── */
.video-embed {
    grid-area: 1 / 1;
    position: relative;
    z-index: 5;
    width: min(84vw, 960px);
    aspect-ratio: 16 / 9;
    transform: translateY(1.5rem);

    border: 1px solid rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.10);
    overflow: hidden;

    transition:
        transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.4s cubic-bezier(0.22, 1, 0.36, 1),
        z-index 0s 0.4s;
}

.video-embed.is-active {
    z-index: 30;
    transform: translateY(0) scale(1.02);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.22);
    transition:
        transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.4s cubic-bezier(0.22, 1, 0.36, 1),
        z-index 0s 0s;
}

.video-frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ── Main text ──────────────────────────────────────────────── */
h1#mainText {
    grid-area: 1 / 1;
    position: relative;
    z-index: 40;

    font-family: 'Arial Black', 'Arial Bold', Gadget, sans-serif;
    font-size: clamp(3rem, 28vw, 25rem);
    font-weight: 900;
    line-height: 0.85;
    letter-spacing: -0.2em;
    text-align: center;
    text-transform: uppercase;
    color: var(--fg);

    user-select: none;
    cursor: default;
    pointer-events: none;

    /* GPU layer — JS will mutate transform/opacity/filter every frame */
    will-change: transform, opacity, filter;
    transform-origin: center center;
}

/* When video is playing, text recedes behind it */
body.video-active h1#mainText {
    z-index: 20;
}

/* ── Social links ───────────────────────────────────────────── */
.social-links {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 2rem;
    z-index: 50;
}

.social-links a {
    font-family: 'OpenSauceSans', sans-serif;
    font-size: clamp(0.65rem, 1.4vw, 0.85rem);
    font-weight: 900;
    color: var(--fg);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.45;
    transition: opacity 0.25s ease;
}

.social-links a:hover {
    opacity: 1;
}

/* ── Mobile ─────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .content-wrapper {
        padding-top: calc(env(safe-area-inset-top) + 1rem);
        padding-bottom: calc(env(safe-area-inset-bottom) + 6rem);
        padding-left: 0;
        padding-right: 0;
    }

    .text-container {
        width: 100vw;
        max-width: 100vw;
        min-height: min(82vw, 22rem);
    }

    .video-embed {
        width: min(calc(100vw - 1.5rem), 560px);
        transform: none;
    }

    .video-embed.is-active {
        transform: scale(1.01);
    }

    .social-links {
        gap: 1.25rem;
    }
}
