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

body {
    position: relative;
    background-color: rgb(224, 224, 224);
}

h2 {
    font-family: "Comic Neue", cursive;
    font-weight: 700;
    font-style: normal;
    font-size: 1.5rem;
    color: blue;
    line-height: 1em;
    margin-bottom: 0.5rem;
}

a {
    all: unset;
}

p {
    line-height: 1.75em;
}

button {
    all: unset;
    cursor: pointer;
}

#loading-container {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background-color: rgb(224, 224, 224);
    z-index: 1000;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

#loading-container img {
    max-width: clamp(15rem, 60%, 20rem);
}

#loading-container.hide {
  opacity: 0;
}

.loading-dot {
  opacity: 0;
  animation: blink 0.5s infinite;
}

.loading-dot:nth-child(2) {
  animation-delay: 0.1s;
}
.loading-dot:nth-child(3) {
  animation-delay: 0.2s;
}
.loading-dot:nth-child(4) {
  animation-delay: 0.3s;
}

@keyframes blink {
  0%, 20% { opacity: 0; }
  30%, 80% { opacity: 1; }
  100% { opacity: 0; }
}

.p-highlight {
    color: blue;
    cursor: pointer;
}

.p-highlight:hover {
    background-color: blue;
    color: rgb(224, 224, 224);
}

.bg-container {
    position: fixed;
    inset: 0;
}

.bg-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    -webkit-filter:  opacity(0.3);
    filter:  opacity(0.3);
    transform: translate3d(0, 0, 0);
}

.overlay {
    position: fixed;
    pointer-events: none;
    inset: 0;
    z-index: 100;
    background-color: rgba(224, 224, 224, 0.5);
    opacity: 0;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    transition: 0.5s ease-in-out;
    transform: translate3d(0, 0, 0);
}

.lightbox-container {
    position: fixed;
    inset: 100%;
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 400;
    transition: 0.5s ease-in-out;
    padding: 4rem 0 0 0;
}

.lightbox {
    position: relative;
    margin: 2rem;
    background-color: rgb(255, 255, 255, 0.5);
    border-radius: 16px;
    border: 1px solid white;
    max-height: calc(100vh - 10rem);
    max-height: calc(100dvh - 10rem);
    overflow-x: hidden;
    overflow-y: auto;
}

.lightbox-bar {
    position: sticky;
    top: 0;
    display: flex;
    font-size: 1.125rem;
    background-color: rgb(0, 0, 255);
    color: white;
    z-index: 100;
    overflow: hidden;
    border-radius: 16px 16px 0 0;
    /* -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px); */
}

.lightbox-bar div {
    font-family: "Comic Neue", cursive;
    font-weight: 700;
    font-style: normal;
    padding: 0.5rem 1rem;
}

.lightbox-bar>div:first-child {
    width: 100%;
}

.lightbox-bar>div:last-child {
    background-color: rgb(0, 0, 0, 0.75);
    cursor: pointer;
}

.info {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    gap: 2rem;
    max-width: 30rem;
}

#lightbox-grid {
    padding: 0;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(max(8rem, 15%), 1fr));
    width: calc(100vw - 4rem);
}

.grid-cell {
    outline: 1px solid white;
    outline-offset: -0.5px;
    padding: 2rem 0 2.5rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
}

.grid-cell-artwork {
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    max-width: clamp(4rem, 60%, 8rem);
}

.grid-cell-artwork img,
.grid-cell-artwork video,
.grid-cell-artwork div {
    position: absolute;
    width: 100%;
    pointer-events: none;
}

.grid-cell-artwork video {
    opacity: 0;
}

.grid-cell.hovering-artwork {
    background-color: rgb(255, 255, 255, 0.5);
}

.grid-cell.hovering-artwork .grid-cell-artwork {
    outline: 2px solid blue;
    outline-offset: 2px;
}

.grid-cell.hovering-artwork video {
    opacity: 1;
    pointer-events: none;
}

.grid-cell.hovering-artwork img {
    opacity: 0;
}

.grid-cell.playing {
    background-color: rgb(0, 0, 255, 0.4);
    color: white;
}

.grid-cell.playing.hovering-artwork > .grid-cell-artwork {
    outline: 2px solid white;
    outline-offset: 2px;
}

.grid-cell-serial {
    font-size: 0.75rem;
    line-height: 1em;
    margin-bottom: 1rem;
}

.copyright {
    font-size: 0.75rem;
    margin-top: 2rem;
}

.overlay.show {
    opacity: 1;
}

.lightbox-container.show {
    inset: 0;
    opacity: 1;
}

nav {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem 0 0.5rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

.logo {
    display: block;
    height: 4rem;
    cursor: pointer;
}

.nav-buttons {
    display: flex;
    margin-left: auto;
    gap: 0.25rem;
    align-items: center;
}

.nav-button {
    padding: 0.5rem 0.75rem;
    border-radius: 16px;
    border: 1px solid transparent;
    text-decoration: underline;
    cursor: pointer;
}

.nav-button:hover {
    text-decoration: none;
}

.nav-button.active {
    background-color: rgb(255, 255, 255, 0.5);
    border: 1px solid white;
    box-sizing: border-box;
    text-decoration: none;
}

.fg-container {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 4rem 0 0 0;
    display: flex;
    position: relative;
    justify-content: center;
    align-items: center;
}

.content {
    display: flex;
    justify-content: center;
    position: relative;
    top: -2.5rem;
}

.fg-video {
    width: auto;
    height: calc(100vh - 15rem);
    height: calc(100dvh - 15rem);
    max-height: calc(200vh / 3);
    max-height: calc(200dvh / 3);
    min-height: 15.5rem;
    border-radius: 16px;
    -webkit-filter: drop-shadow(0 4px 20px rgb(0, 0, 0, 0.2));
    filter: drop-shadow(0 4px 20px rgb(0, 0, 0, 0.2));
}

.content-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    font-family: "Comic Neue", cursive;
    font-weight: 700;
    font-style: normal;
    font-size: 1.5rem;
    position: absolute;
    bottom: -5rem;
}

.button-prev,
.button-next {
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    border-radius: 16px;
    text-align: center;
    border: 2px solid blue;
    background-color: rgb(224, 224, 224);
    color: blue;
    font-size: 1.5rem;
}

.button-prev div,
.button-next div {
    position: relative;
    font-family: "Comic Neue", cursive;
    font-weight: 700;
    font-style: normal;
    bottom: 0.05em;
}

.button-grid,
.button-random {
    width: clamp(7rem, 13vh, 9rem);
    width: clamp(7rem, 13dvh, 9rem);
    height: 2.5rem;
    border-radius: 16px;
    text-align: center;
    border: 2px solid blue;
}

.button-grid {
    background-color: rgb(224, 224, 224);
    color: blue;
}

.button-random {
    background-color: blue;
    color: rgb(224, 224, 224);
}

@media (height < 28rem) {
    .content {
        top: -1.5rem;
    }

    .fg-container {
        padding: 0;
    }

    .fg-video {
        height: calc(100vh - 10rem);
        height: calc(100dvh - 10rem);
        max-height: none;
    }

    .content-buttons {
        bottom: -4rem;
        gap: 0.75rem;
    }

    .button-grid,
    .button-random {
        font-size: 1.25rem;
        width: 6.25rem;
        height: 2rem;
    }
}