/* =========================
   HAHACAT - STYLE.CSS
   ========================= */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
}

body {
    min-height: 100vh;
    overflow-x: hidden;

    font-family: "Press Start 2P", monospace;

    /* Animated RGB background */
    background: linear-gradient(
        120deg,
        #ff0000,
        #ff00ff,
        #0000ff,
        #00ffff,
        #00ff00,
        #ffff00,
        #ff0000
    );

    background-size: 500% 500%;

    animation: rgbBackground 8s linear infinite;
}


/* =========================
   RGB BACKGROUND
   ========================= */

@keyframes rgbBackground {
    0% {
        background-position: 0% 50%;
    }

    25% {
        background-position: 50% 100%;
    }

    50% {
        background-position: 100% 50%;
    }

    75% {
        background-position: 50% 0%;
    }

    100% {
        background-position: 0% 50%;
    }
}


/* =========================
   MAIN CONTENT
   ========================= */

.container {
    width: min(92%, 700px);

    margin: 0 auto;

    padding: 35px 0 70px;

    text-align: center;

    position: relative;

    z-index: 10;
}


/* =========================
   HAHACAT TITLE
   ========================= */

h1 {
    margin: 10px 0 30px;

    color: white;

    font-size: clamp(
        28px,
        8vw,
        64px
    );

    line-height: 1.2;

    letter-spacing: 3px;

    text-shadow:
        5px 5px 0 #000,
        -2px -2px 0 #000,
        2px -2px 0 #000,
        -2px 2px 0 #000;
}


/* =========================
   MAIN VIDEO BOX
   ========================= */

.main-video {
    width: 100%;

    padding: 8px;

    background: #111;

    border: 5px solid white;

    box-shadow:
        8px 8px 0 #000;

    border-radius: 5px;
}


/* =========================
   MAIN VIDEO
   ========================= */

.main-video video {
    display: block;

    width: 100%;

    height: auto;

    max-height: 65vh;

    object-fit: contain;

    background: #000;
}


/* =========================
   CLICK HERE BUTTON
   ========================= */

#startButton {
    position: relative;

    display: inline-block;

    margin-top: 35px;

    width: min(90%, 600px);

    padding: 20px 15px;

    font-family: "Press Start 2P", monospace;

    font-size: clamp(
        12px,
        3.5vw,
        20px
    );

    color: white;

    cursor: pointer;

    border: 4px solid #000;

    /* Minecraft-style grass block */
    background:
        repeating-linear-gradient(
            0deg,
            #4caf50 0px,
            #4caf50 8px,
            #3d963f 8px,
            #3d963f 16px
        );

    box-shadow:
        7px 7px 0 #000;

    transition:
        transform 0.1s ease,
        box-shadow 0.1s ease,
        filter 0.1s ease;
}


/* Button top grass highlight */

#startButton::before {
    content: "";

    position: absolute;

    left: 0;
    right: 0;

    top: 0;

    height: 6px;

    background: #6bdc70;
}


/* Button hover */

#startButton:hover {
    filter: brightness(1.15);

    transform: translate(
        -2px,
        -2px
    );

    box-shadow:
        9px 9px 0 #000;
}


/* Button pressed */

#startButton:active {
    transform: translate(
        5px,
        5px
    );

    box-shadow:
        2px 2px 0 #000;
}


/* =========================
   VIDEO CHAOS LAYER
   ========================= */

#videoChaos {
    position: fixed;

    left: 0;
    top: 0;

    width: 100vw;
    height: 100vh;

    overflow: hidden;

    pointer-events: none;

    z-index: 1000;
}


/* =========================
   DUPLICATED VIDEOS
   ========================= */

.chaos-video {
    position: absolute;

    display: block;

    height: auto;

    max-width: 300px;

    object-fit: contain;

    background: black;

    border: 3px solid white;

    box-shadow:
        5px 5px 0 #000;

    pointer-events: none;

    animation:
        glitchIn 0.15s ease-out;

    /* Prevent browser UI controls */
    outline: none;
}


/* =========================
   VIDEO APPEAR ANIMATION
   ========================= */

@keyframes glitchIn {

    0% {
        opacity: 0;

        transform:
            scale(0.15)
            rotate(-20deg);
    }

    50% {
        opacity: 1;

        transform:
            scale(1.15)
            rotate(8deg);
    }

    100% {
        opacity: 1;
    }
}


/* =========================
   MOBILE
   ========================= */

@media (max-width: 600px) {

    .container {
        width: 92%;

        padding-top: 28px;
    }

    h1 {
        margin-bottom: 25px;

        font-size: clamp(
            25px,
            9vw,
            48px
        );

        letter-spacing: 2px;
    }

    .main-video {
        padding: 7px;

        border-width: 4px;

        box-shadow:
            6px 6px 0 #000;
    }

    .main-video video {
        max-height: 55vh;
    }

    #startButton {
        width: 92%;

        padding: 18px 8px;

        font-size: clamp(
            11px,
            3.5vw,
            17px
        );

        box-shadow:
            6px 6px 0 #000;
    }

    .chaos-video {
        max-width: none;

        /*
          Makes the duplicated videos
          large enough to see on phones.
        */
        width: 38vw;

        border-width: 2px;

        box-shadow:
            4px 4px 0 #000;
    }
}


/* =========================
   VERY SMALL PHONES
   ========================= */

@media (max-width: 380px) {

    .container {
        width: 94%;
    }

    h1 {
        font-size: 24px;

        letter-spacing: 1px;
    }

    .main-video {
        padding: 5px;
    }

    #startButton {
        padding: 16px 5px;

        font-size: 10px;
    }

    .chaos-video {
        width: 42vw;
    }
}


/* =========================
   LANDSCAPE PHONES
   ========================= */

@media (
    max-height: 500px
) and (
    orientation: landscape
) {

    .container {
        padding-top: 15px;
    }

    h1 {
        margin: 5px 0 15px;

        font-size: 32px;
    }

    .main-video video {
        max-height: 55vh;
    }

    #startButton {
        margin-top: 20px;

        padding: 14px;
    }
}
