:root {
    --font-family: "Font", Helvetica Neue, Helvetica, Arial, sans-serif;
    --font-size: 12px;
    --color-primary: #000;
    --color-secondary: #cccccc;
    --color-bg: #fff;
    --color-cursor: #fff;
}

@font-face {
    font-family: "Font";
    src: url("_fonts/font.woff2") format("woff2");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

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

html,
body {
    height: 100%;
    font-family: var(--font-family);
    background: var(--color-bg);
    font-size: var(--font-size);
    font-weight: normal;
    -webkit-font-smoothing: antialiased;
    letter-spacing: 0.5px;
    text-rendering: optimizelegibility;
}

p {
    hyphens: auto;
    -webkit-hyphens: auto;
}

.hyphens-supported p {
    text-align: justify;
}

body:has(.container) {
    overflow: hidden;
    touch-action: pan-x pan-y;
}

@media (max-width: 768px) {
    body:has(.container) {
        overflow-y: auto;
    }
}

/* Nav */

.nav {
    display: flex;
    align-items: center;
    padding: 20px 20px;
    text-transform: uppercase;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--color-bg, #fff);
    border-top: 1px solid var(--color-secondary);
}

.nav-brand {
    color: var(--color-primary);
    text-decoration: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-links {
    display: flex;
    gap: 30px;
    margin-left: auto;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    color: var(--color-secondary);
}

h1 {
    font-size: var(--font-size);
    font-weight: normal;
    text-transform: uppercase;
}

p {
    font-size: var(--font-size);
    line-height: 1.3;
    color: var(--color-primary);
    text-transform: uppercase;
}

time {
    text-transform: uppercase;
    text-align: center;
}

/* Index - Grid */

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.grid {
    display: flex;
    flex-wrap: wrap;
    line-height: 0;
    touch-action: pan-x pan-y;
    overflow-y: auto;
    align-content: flex-start;
    flex: 1;
    min-height: 0;
}

.grid-item {
    width: calc(100% / 12);
    cursor: pointer;
    position: relative;
}

.grid-item img {
    width: 100%;
    display: block;
}

.grid-item:hover img {
    animation: blink 0.5s step-end infinite;
}

.viewer {
    flex: 1;
    overflow: hidden;
    background: var(--color-bg);
}

/* Index - Modal */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    align-items: center;
    justify-content: center;
    cursor: none;
}

.modal-overlay.active {
    display: flex;
}

body:has(.container) .modal-overlay.active.user-triggered {
    background: var(--color-bg);
}

.modal-cursor {
    position: fixed;
    pointer-events: none;
    z-index: 101;
    font-size: var(--font-size);
    color: var(--color-cursor);
    display: none;
    transform: translate(-50%, -50%);
    user-select: none;
    mix-blend-mode: difference;
    text-transform: uppercase;
    white-space: nowrap;
}

.modal-overlay.active ~ .modal-cursor {
    display: block;
}

.modal-img,
.modal-video {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    display: block;
    cursor: none;
}

.modal-video::-webkit-media-controls {
    display: none !important;
}

/* Info - Content */

.content {
    max-width: 35%;
    padding: 16px 16px;
    margin: 0 0 0 65%;
}

.content img {
    display: block;
    max-width: 100%;
    margin-top: 8px;
}

/* Log */

.log-entry {
    margin-bottom: 128px;
}

.log-date {
    display: block;
}

.log-entry p {
    margin-bottom: 12px;
}

/* Player */

.player {
    width: 100%;
}

.player video {
    display: block;
    width: 100%;
    background: var(--color-primary);
}

.player video::-webkit-media-controls {
    display: none !important;
}

.player-seekbar {
    width: 100%;
    height: 120px;
    background: var(--color-secondary);
    cursor: pointer;
    position: relative;
}

.player-seekbar-progress {
    height: 100%;
    width: 0;
    background: var(--color-primary);
}

.player-controls {
    display: flex;
    gap: 12px;
    margin-top: 6px;
}

.player-btn {
    background: none;
    border: none;
    font-family: inherit;
    font-size: var(--font-size);
    text-transform: uppercase;
    cursor: pointer;
    padding: 0;
    color: var(--color-primary);
}

.player-btn:hover {
    color: var(--color-secondary);
}

.player-time {
    font-size: var(--font-size);
    color: var(--color-primary);
    margin-left: auto;
}

/* Blink */

@keyframes blink {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

.blink {
    animation: blink 0.5s step-end infinite;
}

.blink:hover {
    animation: none;
}

/* Mobile */

@media (max-width: 768px) {
    .nav {
        padding-top: 20px;
        padding-bottom: 20px;
    }
    .grid {
        padding-bottom: 120px;
    }
    .container {
        height: auto;
        overflow: visible;
    }
    .viewer {
        display: none;
    }
    .grid {
        overflow-y: visible;
        flex: none;
    }
    .grid-item {
        width: calc(100% / 6);
    }
    .grid-item:hover img {
        animation: none;
    }
    .modal-overlay,
    .modal-img,
    .modal-video {
        cursor: default;
    }
    .modal-cursor,
    .modal-overlay.active ~ .modal-cursor {
        display: none !important;
    }
    .content {
        max-width: 100%;
        margin-left: 0;
    }
}
