* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: rgb(0, 0, 0);
    --ui: #ededed;
    --uifade: #888888;
    --link: rgb(255, 255, 255);
    --hover: #ff0d54;
    --fade: rgba(18, 18, 18, 0.75);
    --bg-color: #1a1a1a;
    --text-color: #c6c6c6;
    --accent-color: #ffffff;
    --credits: #ededed;
    --credits-sub: rgba(126, 126, 126, 0.5);
}

html {
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

body {
    background: var(--bg);
    width: 100%;
    overflow-x: hidden;
    color: var(--text-color);
    font-family: 'Helvetica Neue', sans-serif;
    margin: 0;
    padding: 0;
    overflow: hidden;

    height: 100vh;
}

img {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

@font-face {
    font-family: 'Montserrat';
    src: url('./fonts/Montserrat.ttf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Athemi';
    src: url('./fonts/athemi_otf-webfont.woff2') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Aesthetic';
    src: url('./fonts/Aesthetic.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Remington';
    src: url('./fonts/Remington Noiseless.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAYAAABWc9/wAAAADklEQVQIW2NgYGAgAAAABQABf5JpQAAAAABJRU5ErkJggg==');
    opacity: 0.1;
    pointer-events: none;
    z-index: 100;
}

.film:after {
    content: "";
    background-image: url("https://upload.wikimedia.org/wikipedia/commons/7/76/1k_Dissolve_Noise_Texture.png");
    height: 200%;
    width: 200%;
    position: fixed;
    top: 0;
    left: 0;
    opacity: 0.1;
    animation: animateGrain 8s steps(10) infinite;
    z-index: 1000;
    mix-blend-mode: normal;
    pointer-events: none;
}

body.overlay-active .film:after {
    z-index: 9001;
}

@keyframes animateGrain {
    0%,
    100% {
        transform: translate(0, 0);
    }
    10% {
        transform: translate(-5%, -10%);
    }
    20% {
        transform: translate(-15%, -20%);
    }
    30% {
        transform: translate(-5%, -10%);
    }
    40% {
        transform: translate(-15%, -20%);
    }
    50% {
        transform: translate(-5%, -10%);
    }
    60% {
        transform: translate(-15%, -20%);
    }
    70% {
        transform: translate(-5%, -10%);
    }
    80% {
        transform: translate(-15%, -20%);
    }
    90% {
        transform: translate(-5%, -10%);
    }
    100% {
        transform: translate(-15%, -20%);
    }
}

.gallery-header {
    position: fixed;
    top: 30px;
    width: 90%;
    max-width: 1200px;
    display: flex;
    justify-content: space-between;
    z-index: 50;
    font-weight: bold;
    letter-spacing: 2px;
}

.gallery-footer {
    position: fixed;
    bottom: 30px;
    right: 5%;
    font-size: 0.8rem;
    opacity: 0.5;
}

.video-player {
    position: fixed;
    top: 0;
    left: 0;
    transform: none;

    width: 100vw;
    max-width: none;

    height: 100vh;
    padding-bottom: 0;

    overflow: hidden;
    background: black;
    border-radius: 0;

    box-shadow: inset 0 0 100px rgb(0, 0, 0),
    inset 0 0 0 2px black;

    z-index: 10;
    transition: filter 0.1s ease-in-out, transform 0.1s ease-in-out;
}

.video-player video {
    position: absolute;
    top: 0;
    left: 0;

    width: 100%;
    height: 100%;
    margin: 0;

    object-fit: cover;
    display: block;
    filter: brightness(1.2) contrast(1.1);

    z-index: 1;
    transform: none;
}


@keyframes static-flicker {
    0%   { clip-path: inset(0 0 0% 0); }
    10%  { clip-path: inset(5% 0 5% 0); }
    20%  { clip-path: inset(1% 0 1% 0); }
    30%  { clip-path: inset(8% 0 8% 0); }
    40%  { clip-path: inset(2% 0 2% 0); }
    50%  { clip-path: inset(10% 0 10% 0); }
    60%  { clip-path: inset(4% 0 4% 0); }
    70%  { clip-path: inset(1% 0 1% 0); }
    80%  { clip-path: inset(7% 0 7% 0); }
    90%  { clip-path: inset(3% 0 3% 0); }
    100% { clip-path: inset(0 0 0% 0); }
}

.video-player.is-jittering {
    filter:
            saturate(0.5)
            contrast(2)
            brightness(1.5)
            hue-rotate(10deg);

    animation: static-flicker 0.1s steps(1) infinite;
    transform: rotate(0.1deg);
}



.film-border-blur {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;

    z-index: 25;

    border-radius: 0;

    transform: none;
    margin: 0;

    box-shadow: inset 0 0 100px 80px rgba(46, 46, 46, 0.25),
    inset 0 0 0 0 rgb(0, 0, 0);
    outline: none;
}

.video-transition-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 29;
    pointer-events: none;

    background-color: rgb(0, 0, 0);
    background-image: linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 100% 12px;

    opacity: 0;
    transform: none;
    filter: brightness(1) contrast(1);

    transition: opacity 0.4s ease-out, transform 0.4s ease-out, filter 0.4s ease-out;
}

.video-transition-overlay.is-active {
    opacity: 1;
    filter: brightness(1.2) contrast(1.1);
}

@keyframes overlayJitter {
    0%   { transform: translate(0.5px, 0.8px); }
    25%  { transform: translate(-0.7px, 1.2px) rotate(0.1deg); }
    50%  { transform: translate(1px, -0.5px); }
    75%  { transform: translate(-1.2px, 0.9px) rotate(-0.2deg); }
    100% { transform: translate(0.5px, 0.8px); }
}

.video-transition-overlay.is-jittering {
    animation: overlayJitter 0.15s infinite steps(4);
    background-size: 100% 10px;
    filter: brightness(1.5) contrast(1.3) hue-rotate(5deg);
}

.video-transition-overlay.is-fading-out {
    opacity: 0;
    transform: scale(1.05);
    filter: brightness(0.8) contrast(1.0);
}

.gallery-controls {
    position: fixed;
    right: 5%;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;

    gap: 100px;

    z-index: 98;
}

.counter-display {
    font-family: 'Athemi', cursive;
    color: var(--accent-color);
    font-size: 2rem;
    font-weight: lighter;
    letter-spacing: 5px;
    z-index: 97;
}

.counter-display .current-number {
    font-size: 3.6rem;
    font-weight: 800;
    line-height: 1;
    display: inline-block;
    vertical-align: top;
    z-index: 97;
}

.counter-display .total-number {
    font-size: 2rem;
    opacity: 0.7;
    font-weight: 400;
    z-index: 97;
}


.counter-display .current-number .digit-wrapper {
    display: inline-block;
    vertical-align: top;
    overflow: hidden;
    height: 1em;
    position: relative;
    margin: 0 -0.05em;
    z-index: 97;
}

.counter-display .current-number .digit-wrapper .animated-num {
    display: block;
    will-change: transform;

    height: 10em;

    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);

    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
    line-height: 1;
    z-index: 97;
}

.arrow-btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-color);
    cursor: pointer;

    transition: all 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94);

    border-radius: 50%;

    padding: 60px;

    background-repeat: no-repeat;
    background-position: center center;

    background-size: 60%;
    font-size: 0;
    z-index: 97;
}

.controlshadow {
    position: absolute;
    top: 50%;
    left: 50%;
    height: 900px;
    transform: translate(-50%, -50%);
    z-index: 96;
}

.arrow-btn.up {
    background-image: url('./assets/arrowup.svg');
}

.arrow-btn.up:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);

    transform: translateY(-20px) scale(1.1);
}

.arrow-btn.down {
    background-image: url('./assets/arrowdown.svg');
}

.arrow-btn.down:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);

    transform: translateY(20px) scale(1.1);
}

@media (max-width: 600px) {

    body {
        touch-action: pan-y;
        overscroll-behavior: none;
    }

    .video-player {
        position: fixed;
        left: 0;
        top: 0;
        transform: none;
        width: 100vw;
        height: 100vh;
        padding-bottom: 0;
        border-radius: 0;
    }

    .gallery-header, .gallery-footer {
        width: 100%;
        box-sizing: border-box;
    }

    .film-border-blur {
        border-radius: 0;
    }

    .gallery-controls {
        top: auto;
        bottom: 5%;
        right: 50%;
        transform: translateX(50%);
        flex-direction: row;
        gap: 30px;
    }

    .arrow-btn {
        padding: 40px;
    }

    .gallery-header, .gallery-footer {
        font-size: 0.9rem;
    }
}

.video-details {
    position: fixed;
    bottom: 80px;
    left: 80px;
    width: clamp(280px, 45vw, 600px);

    padding: 0;
    z-index: 103;
}

.project-title-container {
    font-family: "Athemi", sans-serif;
    font-size: clamp(4rem, 6vw, 7rem);
    font-weight: lighter;
    margin-bottom: 25px;
    color: rgb(255, 255, 255);
    mix-blend-mode: screen;
}

.project-description {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: clamp(1rem, 1.5vw, 1.1rem);
    line-height: 1.6;
    margin-bottom: 60px;
    color: rgb(128, 128, 128);
    mix-blend-mode: screen;
}

.creation-details-list {
    display: flex;
    flex-wrap: wrap;
    gap: 70px;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    color: rgb(158, 158, 158);
    font-size: 1.05rem;
    mix-blend-mode: screen;
}

.detail-item {
    margin: 0;
    padding: 0;
    white-space: nowrap;
}
