* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-underline-offset: 0.15em;
}

body {
    margin: 0;
    font-weight: 400;
    background-color: rgba(10, 10, 10, 1);
    min-height: 100svh;
    color: white;
    font-family: "Necto Mono", 'Courier New', Courier, monospace;
    overflow: hidden;
    width: 100svw;
    height: 100svh;
}

body::-webkit-scrollbar {
    display: none;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
caption,
a {
    margin: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 400;
}

a {
    color: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: color 300ms;
}

button.expand-target::after,
a.expand-target::after {
    content: '';
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

button {
    border: none;
    background: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    text-align: left;
    color: inherit;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

ul li,
ul dt,
ul dd,
dl li,
dl dt,
dl dd {
    margin: 0;
    display: block;
    height: fit-content;
}

dl dd {
    margin-bottom: 1em;
}

table th,
table tr,
table td {
    text-align: left;
}

small {
    font-size: 60%;
}

strong {
    font-weight: 500;
}

address {
    font-style: normal;
}

figure {
    margin: 0;
}

picture {
    display: block;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

video {
    width: 100%;
    height: auto;
    border: 0;
}

caption {
    text-align: left;
}

::selection {
    background-color: rgb(50, 50, 50);
    color: white;
}


/* 
    Header
*/

.header {
    display: flex;
    justify-content: center;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100svw;
    padding: 12px;
    z-index: 10;
    transition: 300ms ease;
}

.header.open {
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    bottom: 0;
    height: 100svh;
    background: rgba(0, 0, 0, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    overflow-y: auto;
    
}

.header-menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.header-menu-title {
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.header-menu-button {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.45;
    transition: 300ms ease;
}

.header-menu-button:hover {
    opacity: 1;
}

.header-info {
    display: none;
}

.header.open .header-info {
    display: block;
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.35em;
    text-align: left;
    opacity: 0.8;
    width: 100%;
    max-width: 450px;
}

.header.open .header-info p {
    margin-bottom: 1em;
}

.header-info-title {
    margin: 12px 0 24px;
    text-transform: uppercase;
    font-size: 14px;
    text-align: center;
}

.header-info-credits {
    margin: 24px;
    font-size: 14px;
}

/* 
    Page 
*/

.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100svw;
    height: 100svh;
    background-color: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: 300ms;
    opacity: 1;
    text-transform: uppercase;
    gap: 6px;
}

.loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-button {
    opacity: 0.5;
    transition: 300ms;
    text-transform: uppercase;
}

.loading-button:hover {
    opacity: 1;
}

.letters {
    position: absolute;
    top: 50%;
    left: 50%;
    translate: calc(-50% + var(--translateX, 0px)) calc(-50% + var(--translateY, 0px));

    padding: 1200px;
    min-width: 8000px;
    height: fit-content;

    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-evenly;

    user-select: none;
    scale: var(--zoom, 1);
    will-change: scale, translate;
    transition: scale 200ms ease;

    transform-origin: 50% 50%;
}

.letters-x-center {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.letters-y-center {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
}

.letters-actions {
    position: fixed;
    bottom: 0;
    right: 0;
    z-index: 5;
    display: flex;
    gap: 10px;
    padding: 10px;
}

.letters-actions-zoom {
    background-color: rgba(40, 40, 40, 0.5);
    color: white;
    border-radius: 4px;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 24px;
    transition: background-color 300ms;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.letters-actions-zoom:hover {
    background-color: rgba(80, 80, 80, 0.9);
}

/* 
    Letter 
*/
.letter {
    transition: 500ms ease;
    transform: rotate(var(--rotateValue, 0deg)) translate(var(--translateValue, 0));
    cursor: pointer !important;
    width: 6%;
    margin: 4%;
    aspect-ratio: 1/1;
}

.letter.disabled {
    opacity: 0.3;
    pointer-events: none;
}

.letter-images {
    position: relative;
    width: 100%;
    height: 100%;
    aspect-ratio: 1/1;
    pointer-events: none;
}

.letter-images-img {
    position: absolute;
    top: 50%;
    left: 50%;
    translate: calc(-50% + var(--pageOffsetX, 0px)) calc(-50% + var(--pageOffsetY, 0px));
    rotate: var(--pageRotateValue, 0deg);
    width: 100%;
    height: 100%;
    aspect-ratio: 1/1;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.6));
    -webkit-filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.6));
}

/* Open */
.letter.open {
    position: relative;
    width: 12%;
    margin: 1%;
    scale: 1.25;
    transform: rotate(var(--rotateValue, 0deg)) translate(0% 0%);
    z-index: 5;
}

.letter.open .letter-images {
    position: absolute;
    top: 50%;
    left: 50%;
    translate: -50% -50%;
    height: fit-content;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    aspect-ratio: unset;
}

.letter.open .letter-images-img {
    position: static;
    width: 40%;
    height: fit-content;
    margin: 5% 2.5%;
    translate: 0% 0% !important;
}

.letter.open.medium .letter-images-img {
    width: 25%;
    margin: 5% 2.5%;
}

.letter.open.large .letter-images-img {
    width: 20%;
    margin: 5% 2.5%;
}

/* Letter Info */
.letter-info {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 3;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    padding: 10px;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
    opacity: 0;
    pointer-events: none;
    transition: 500ms;
    text-align: center;
}

.letter-info.active {
    opacity: 1;
}

.letter-info-author {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    grid-column: 1;
    grid-row: 1;
    text-align: left;
}

.letter-info-date {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    grid-column: 1;
    grid-row: 2;
    text-align: left;
}

.letter-info-description {
    font-size: 14px;
    grid-column: 2/-2;
    grid-row: 1/3;
    text-align: left;
}

.cursor {
    position: fixed;
    top: 50%;
    left: 50%;
    translate: -50% -50%;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: 150ms ease;
}


/* Image */
.image {
    position: relative;
    width: 6%;
    margin: 4%;
    aspect-ratio: 1/1;
    transition: 500ms;
    pointer-events: none;
}

.image.disabled {
    opacity: 0.3;
    pointer-events: none;
}

.image img {
    position: absolute;
    top: 50%;
    left: 50%;

    translate: calc(-50% + var(--translateValueX, 0)) calc(-50% + var(--translateValueY, 0));
    rotate: var(--rotateValue, 0deg);
    width: 100%;
    height: 100%;
    object-fit: contain;
}