@font-face {
    font-family: OldStandard TT;
    font-style: normal;
    font-weight: 600;
    src: url("assets/fonts/OldRound-30-1-1.ttf") format("truetype");
}


* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 600;
    letter-spacing: -0.01em;
    background-color: rgba(255, 255, 255);
}

/* Touch Pan */
html,
body,
#canvasContainer {
    touch-action: none;
    overscroll-behavior: contain;
}

h1, h2, p {
    margin: 0;
}

::selection {
    background-color: rgba(0, 0, 0, 0.1);
    color: black;
}

input,
textarea,
button,
select,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    border: 0;
    background: transparent;
    font-size: 0.8rem;
    line-height: 0.8rem;
    cursor: pointer;
    padding: 0 0.5rem;
    font-weight: 600;
    font-family: Arial, Helvetica, sans-serif;
    text-transform: uppercase;
    color: inherit !important;
}


a {
    color: inherit;
    text-underline-offset: 0.2em;
}

.text-small {
    font-size: 1rem;
}

.text-medium {
    font-size: 1.25rem;
}

.text-serif {
    font-family: "OldStandard TT", serif;
}

/* Elements */
.canvas-container {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    overflow: hidden;
    cursor: grab;
    scale: var(--scale, 1);
    transform-origin: var(--originX, 0) var(--originY, 0);
    transition: scale 500ms ease;
}

.canvas-container.dragging {
    cursor: grabbing !important;
}

.canvas-container .p5Canvas {
    background-color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    cursor: grab;
    scale: var(--scale, 1);
    transform-origin: var(--originX, 0) var(--originY, 0);
    /* transition: 50ms; */
    transition: scale 500ms ease;
}

.canvas-container .map {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 3600px;
    height: 3600px;
    z-index: 10;
    transform-origin: var(--originX, 0) var(--originY, 0);
    transition: scale 500ms ease;
}


.nav {
    position: fixed;
    bottom: 0;
    right: 0;
    z-index: 5;
    padding: 1rem;
}

.nav button {
    border: 0;
    background: white;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
    width: 2rem;
    height: 2rem;
    border-radius: 4px;
    font-size: 1.25rem;
    cursor: pointer;
}

/* 
    Map 
*/
.map {
    scale: var(--scale, 1);
}

.map-word {
    position: absolute;
    top: 0;
    left: 0;
    translate: var(--posX, 0) var(--posY, 0);
    rotate: var(--rotateValue, 0);
    color: rgb(80, 80, 80);
    user-select: none;
}

.map-word.preview-active {
    color: black;
}


.map-word-fullscreen-button {
    opacity: 0;
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 50%;
    translate: -50% 0;
    padding: 0.15rem;
    background-color: rgba(240, 240, 240, 0.15);
    text-transform: uppercase;
    font-family: OldStandard TT, serif;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.2em;
    text-align: center;
    transition: 300ms ease-in-out;
    pointer-events: none;
    touch-action: none;
    user-select: none;
    white-space: nowrap;
}

.map-word-fullscreen-button::after {
    content: " ";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;

}

.map-word.preview-active .map-word-fullscreen-button {
    pointer-events: all;
    touch-action: auto;
    opacity: 0.5;
    transition: 1;
}

.map-word.preview-active .map-word-fullscreen-button:hover {
    opacity: 1;
}

/* .map-word.has-media {
    cursor: pointer;
} */

.map-word.no-audio {
    font-family: OldStandard TT, serif;
    font-weight: 600;
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: unset;
    color: rgba(180, 180, 180, 1);
}

.map-word-text {
    font-size: 1rem;
    text-transform: uppercase;
    display: inline-block;
    transition: text-shadow 10ms linear, translate 300ms 200ms linear, scale 0.1s linear;
    scale: var(--textScale, 0.75);
    user-select: none;
}

.map-word-media {
    /* display: none; */
    opacity: 0;
    width: 220px;
    height: auto;
    max-width: 50vw;
    max-height: 25vh;
    position: absolute;
    bottom: calc(100% + 1rem);
    left: 50%;
    translate: -50% 0;
    pointer-events: none;
    transition: 300ms ease-in-out;
    border-radius: 2px;
    z-index: -1;
    pointer-events: none;
    user-select: none;
    transition: 300ms;
    cursor: url("img/fullscreen.png") 16 16, pointer;
}

.map-word.preview-active .map-word-media {
    pointer-events: all;
    opacity: 1;
}

.map-word-3d-placeholder {
    width: fit-content;
    margin: auto;
    
    border-radius: 0.15rem;
    background-color: rgba(245, 245, 245, 0.9);
    color: rgb(140, 140, 140);
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: OldStandard TT, serif;
/* 
    width: 200px;
    height: 200px;
    max-width: 50vw;
    max-height: 25vh; */

    opacity: 0;
    pointer-events: none;
    touch-action: none;

}

.map-word.preview-active .map-word-3d-placeholder {
    opacity: 1;
    pointer-events: all;
    touch-action: auto;
}

.map-word-media img,
.map-word-media video {
    width: 100%;
    height: 100%;
    max-height: 25vh;
    object-fit: contain;
    pointer-events: none;
}

.map-word-3d {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    max-height: calc(100svh - 6rem);
}

.page-multimedia .map-word-3d canvas {
    background-color: rgba(0, 0, 0, 0.15);
}



/* 
    Page Title 
*/
.page-title {
    position: fixed;
    top: 0;
    left: 0;
    max-width: 100vw;
    width: fit-content;
    padding: 0.5rem 1rem 0.25rem;
    z-index: 1000;
    display: flex;
    /* background: linear-gradient(to bottom, rgba(255, 255, 255, 1) 75%, rgba(255, 255, 255, 0) 100%); */
    background: white;
    border-radius: 0  0 25%;
    box-shadow: 0px 0px 12px 12px #fff;
}

.page-title button {
    font-size: 1.25rem;
    font-weight: 400;
    transition: 300ms ease-in-out;
}

.page-title button.active {
    rotate: 45deg;
}

/* 
    Page Intro
*/

.page-intro {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    opacity: 0;
    pointer-events: none;
    width: calc(450px);
    max-width: 100vw;
    max-height: 100svh;
    overflow-y: auto;
    padding: 3rem 1rem 1rem;
    background: white;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-family: OldStandard TT, serif;
}

.page-intro.active {
    pointer-events: all;
    opacity: 1;   
}

.page-intro-content {
    display: none;
    line-height: 1.3em;
}

.page-intro-content.active {
    display: block;
}

.page-intro-content p {
    margin-bottom: 1em;
}

.page-intro-content .indented {
    margin-left: 1rem;
}

.page-intro-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-intro-footer span,
.page-intro-footer button {
    opacity: 0.5;
}

.page-intro-footer button.active,
.page-intro-footer button:hover {
    opacity: 1;
}

@media screen and (min-width: 768px) {
    .page-intro {
        width: 600px;
        padding: 3rem 6rem 1rem 1rem;
        background: linear-gradient(to right, rgba(255, 255, 255, 0.9) 90%, rgba(255, 255, 255, 0.1) 100%);
    }
}

/* 
    Page Multimedia 
*/

.page-multimedia {
    opacity: 0;
    pointer-events: none;
    transition: 300ms 150ms ease-in-out;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.page-multimedia.active {
    pointer-events: all;
    opacity: 1;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 20;
    padding: 4rem 1.5rem 1.5rem;
}

.page-multimedia-close {
    position: absolute;
    top: 0;
    right: 0;
    border: 0;
    border-radius: 0;
    font-size: 2rem;
    padding: 1.25rem 1rem;
    cursor: pointer;
    background: transparent;
    z-index: 1;
    font-weight: 400;
    font-family: Arial, Helvetica, sans-serif;
    text-transform: uppercase;
}

.page-multimedia .media-item {
    display: none;
    height: calc(100% - 2rem);
}

.page-multimedia .media-item img,
.page-multimedia .media-item video {
    flex-grow: 1;
    width: 100%;
    height: auto;
    max-height: calc(100svh - 8rem);
    object-fit: contain;
}

.page-multimedia .media-item video {
    background-color: black;
    border-radius: 4px;
}

.page-multimedia .media-item.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.page-multimedia .media-item-caption {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    font-family: OldStandard TT, serif;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.75);
    text-align: center;
    text-wrap: balance;
}

/* 
    Cursor 
*/
.cursor {
    position: fixed;
    top: 50%;
    left: 50%;
    translate: -50% -50%;
    width: 1.5rem;
    height: 1.5rem;
    z-index: 5;
    pointer-events: none;
    user-select: none;
    opacity: 0;
    transition: 300ms ease-in-out;
}

.cursor img {
    width: 100%;
    height: 100%;
}

.zoom {
    font-weight: 400;
    user-select: none;
}


/* 
    Wave Animation 
*/
.wave-animation {
    display: flex;
    gap: 0.5em;
}

.wave-animation .word {
    rotate: var(--rotateValue, 0);
    display: block;
    transition: 500ms linear;
    text-transform: uppercase;

    translate: var(--offsetX, 0) var(--offsetY, 0);
}

.no-audio .wave-animation,
.no-audio .wave-animation .word {
    text-transform: unset;
}

/* 
    Mobile Disclaimer 
*/

.hover-disclaimer {
    display: none;
}



@media screen and (hover:none) {
    .hover-disclaimer {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        
        bottom: 0;
        right: 0;
        padding: 1rem;
        z-index: 100;
        background-color: rgba(255, 255, 255, 0.95);

        display: flex;
        justify-content: center;
        align-items: center;
    }

    .hover-disclaimer-modal p  {
        margin-bottom: 1.5rem;
        text-align: center;
    }

    .hover-disclaimer-modal button  {
        display: block;
        padding: 0.25rem 0.5rem;
        background-color: rgba(0, 0, 0, 0.15);

        margin: 0.5rem auto;
        margin-bottom: 2rem;
    }
}

/* 
    Loading 
*/

.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    cursor: wait;
}

.loading-message {
    display: none;
    opacity: 0.75;
    font-family: OldStandard TT, serif;
}

.loading-message.active {
    display: block;
}