:root {
    touch-action: none;

    line-height: 1.5;
    font-size: 16px;
    font-family: "PT Sans";
    /* font-family: "Inconsolata"; */
}

html, body {
    overflow: hidden;

    margin: 0; padding: 0;
    width: 100%; height: 100%;
}

#full-container video, #full-container img {
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: center;

    background-color: black;
}

#safe-container {
    padding: 80px;

    display: grid;
    gap: 16px;
    grid-template-columns: repeat(7, 128px);
    grid-template-rows: repeat(3, 128px);

    --light: hsl(0 0% 75%);
    
    color: var(--light);
}

.cell {
    overflow: visible;

    pointer-events: none;
}

.full {
    position: relative;
    left: -64px;
    top: -64px;

    width: calc(100% + 128px);
    height: calc(100% + 128px);

    transform: scale(50%);

    display: flex;
    flex-direction: column;
    justify-content: center;
}

.full:focus-within {
    transform: scale(100%);
    z-index: 1;
}

.cell h1 {
    margin: 16px;
    margin-top: 24px;
    font-size: unset;
    text-align: center;
}

.cell p {
    margin: 8px;
    margin-top: 16px;
    text-align: justify;
}

.story {
    position: relative;
    outline: solid 1px var(--light);
    box-shadow: 0 0 4px 4px black;
}

.story-text {
    color: var(--light);

    font-size: 20px;
    font-family: "Inconsolata";
    text-shadow: 
        -1px    0 1px black, 
           0 -1px 1px black,
         1px    0 1px black, 
           0  1px 1px black;
    text-transform: uppercase;

    position: absolute;
    inset: 0;

    padding: 1em;

    display: flex;
    flex-direction: column;
    gap: .5em;
}

.story-text p {
    margin: 0;
}

.text-window {
    pointer-events: all;

    position: relative;

    width: 100%;
    max-height: 100%;

    background: black;
    outline: solid 1px var(--light);
    color: var(--light);

    box-shadow: 0 0 4px 4px black;

    overflow-y: auto;
    scrollbar-color: var(--light) transparent;
    scrollbar-width: thin;
}

.text-window::-webkit-scrollbar {
    background-color: transparent;
    width: 8px;
}

.text-window::-webkit-scrollbar-thumb {
    background-color: var(--light);
}

.text-window::-webkit-scrollbar-track {
    background-color: transparent;
}

.window {
    pointer-events: all;
    
    position: relative;

    width: 100%;
    height: 100%;

    background: black;
    outline: solid 2px var(--light);
    color: var(--light);

    overflow: hidden;

    box-shadow: 0 0 4px 4px black;

    cursor: pointer;
}

.window:focus-within {
    outline-width: 1px;
}

.window > * {
    width: 100%;
    height: 100%;
}

.cell img, .cell video {
    object-fit: cover;
}

.tinter {
    position: relative;
    transition: background .5s;
    background: var(--light);
}

.window:focus-within .tinter {
    background: white;
}

.window[data-closed] {
    --light: gray !important;
}

.tinter > * {
    mix-blend-mode: multiply;
    
    width: 100%;
    height: 100%;

    transition: filter .5s;
    filter: grayscale(100%);
}

.window:focus-within .tinter > * {
    filter: grayscale(0%);
}

/* .window:hover .tinter > * {
    filter: grayscale(0%);
} */

iframe {
    border: none;
    padding: 0;
}

.caption {
    position: absolute;
    left: 0; right: 0;
    top: 0; bottom: 0;

    color: white;
    font-family: "PT Serif Caption";
    text-align: center;
    text-shadow: 
         1px  1px 1px black, 
        -1px  1px 1px black, 
        -1px -1px 1px black, 
         1px -1px 1px black;

    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    padding: 16px;

    pointer-events: none;
    visibility: hidden;
}

.window:hover .caption {
    visibility: visible;
    animation: .5s .5s forwards fade-out;
}

.window:focus-within .caption {
    visibility: visible;
    animation: .5s .5s forwards fade-out;
}


@keyframes fade-out {
    to {
        opacity: 0;
    }
}

#background-video {
    /* z-index: -100; */
    left: 0;
    top: 0;
    position: absolute;
    width: 100%;
    height: 100%;
}

#background-video img, #background-video video {
    object-fit: cover;
    width: 100%;
    height: 100%;

    left: 0;
    top: 0;
    position: absolute;
    width: 100%;
    height: 100%;
}

img, video {
    display: flex;
}

.scrolling {
    position: relative;
    left: 0; right: 0; top: 0; bottom: 0;
    animation: scrolling 10s linear infinite;
}

@keyframes scrolling {
    0% { transform: translateY(0%); }
    100% { transform: translateY(-50%); }
}

.flip img {
    transform: scale(100%, -100%);
}

.mirror img {
    transform: scale(-100%, 100%);
}

.flash {
    animation: flash .1s step-end;
}

@keyframes flash {
    0%   { filter: invert(); box-shadow: none; }
    100% { filter: unset; }
}

