:root {
    /* color variables */
    --primary-color: #e3d4c9;
    --secondary-color: #967d53;
    --terciary-color: #c09f70;

    --text-dark-color: #695739;

    --scanner-color: #18c890;
}

body {
    background: var(--primary-color);
    font-family: 'Didot', serif;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

#css,
#webgl {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

/* mobile text */
.mobile-text {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--secondary-color);
    font-family: 'Nanum Pen Script', cursive;
    z-index: 200;
}

/* pre-loader */
.preloader {
    background-color: rgba(51, 51, 51, 0.5);
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    color: white;
    font-size: larger;
}

.preloader-animated {
    animation-name: disappear;
    animation-duration: 0s;
    animation-delay: 2.5s;
    animation-timing-function: ease-in-out;
    animation-fill-mode: forwards;
    pointer-events: none;
}

.ticket {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 70vw;
    max-width: 950px;
    margin: 10px auto;
    color: var(--terciary-color);

    .stub .check {
        box-sizing: border-box;
    }
}

.check {
    background: var(--primary-color);
    height: 22vh;
    min-height: 275px;
    width: 50vw;
    max-width: 750px;
    min-width: 550px;
    padding: 20px;
    position: relative;
}

.title {
    margin: 0;
    padding: 0;
    font-size: x-large;
    /* font-size: min(calc(10px + 1vw), x-large); */
    position: absolute;
    top: 5%;
    right: 5%;
    text-shadow: var(--secondary-color) 1px 1px 2px;
}

.separator {
    width: 70%;
    border: 0;
    height: 3px;
    background: var(--terciary-color);
    position: absolute;
    top: 33%;
    right: 5%;
}

.subtitle {
    margin: 5% 0 0 0;
    padding: 0;
    font-size: 1.2em;
    font-style: bold;
    position: absolute;
    top: 30%;
    right: 5%;
    text-align: right;

    h3 {
        margin: 0;
    }
}

.info {
    font-size: medium;
    position: absolute;
    bottom: 5%;
    font-size: 1em;

    p {
        margin: 0;
    }
}

.extra-info {
    font-size: 1em;
    background-color: var(--secondary-color);
    color: var(--primary-color);
    border-bottom-left-radius: 12px;
    border-top-left-radius: 12px;
    position: absolute;
    bottom: 5%;
    right: 5%;
    padding-left: 10px;
    padding-right: 10px;

    p {
        margin-left: 0.4em;
        margin-right: 0.4em;
    }
}

.stub {
    background: var(--secondary-color);
    height: 22vh;
    min-height: 275px;
    width: 22vw;
    max-width: 275px;
    min-width: 275px;
    color: var(--primary-color);
    padding: 20px;
    position: relative;
    justify-content: center;
    align-items: center;
    display: flex;
    border-left: .18em dashed var(--primary-color);
}

.stub-animated {
    animation-name: rip;
    animation-duration: 2s;
    animation-delay: 0.5s;
    animation-timing-function: ease-in-out;
}

.stub-text {
    position: absolute;
    top: 10%;
}

.barcode {
    position: absolute;
    bottom: 25%;
    width: 60%;
    height: 20%;
    background: repeating-linear-gradient(to right,
            var(--primary-color),
            var(--primary-color) 2%,
            var(--secondary-color) 2%,
            var(--secondary-color) 6%);
}

.stub-number {
    position: absolute;
    bottom: 5%;
    font-size: 0.8em;
}

/* animations */
@keyframes disappear {
    100% {
        opacity: 0;
        display: none;
    }
}

@keyframes rip {
    0% {
        transform: translateX(0);
        transform-origin: bottom left;
    }

    35% {
        transform: rotate(30deg);
        transform-origin: bottom left;
    }

    100% {
        transform: translateY(80%) translateX(5%) rotate(10deg);
        transform-origin: bottom left;
    }
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

/* scanner ticket */
/* https://codepen.io/kani339/pen/abBQZop */
.ocrloader {
    width: 180px;
    height: 75px;
    margin: 20px;
    outline-offset: 10px;
    position: absolute;
    bottom: 14%;
    left: 9%;
}

.ocrloader span::before {
    content: "";
    position: absolute;
    top: 5%;
    bottom: 0;
    left: 4%;
    width: 5px;
    height: 90%;
    background: var(--scanner-color);
    box-shadow: 0 0 50px 10px var(--scanner-color);
    clip-path: inset(0);
    animation:
        x 1s ease-in-out infinite alternate,
        y 1s ease-in-out infinite;
}

.ocrloader p::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--scanner-color);
    position: relative;
    right: 4px;
}

.ocrloader:before,
.ocrloader:after,
.ocrloader em:after,
.ocrloader em:before {
    border-color: var(--scanner-color);
    content: "";
    position: absolute;
    width: 45px;
    height: 46px;
    border-style: solid;
    border-width: 0px;
}

.ocrloader:before {
    left: 0;
    top: 0;
    border-left-width: 3px;
    border-top-width: 3px;
    border-radius: 5px 0 0 0;
}

.ocrloader:after {
    right: 0;
    top: 0;
    border-right-width: 3px;
    border-top-width: 3px;
    border-radius: 0 5px 0 0;
}

.ocrloader em:before {
    left: 0;
    bottom: 0;
    border-left-width: 3px;
    border-bottom-width: 3px;
    border-radius: 0 0 0 5px;
}

.ocrloader em:after {
    right: 0;
    bottom: 0;
    border-right-width: 3px;
    border-bottom-width: 3px;
    border-radius: 0 0 5px 0;
}

.ocrloader-close {
    animation: close-ocr 0.75s forwards;
}

@keyframes move {

    0%,
    100% {
        transform: translateY(190px);
    }

    50% {
        transform: translateY(0%);
    }

    75% {
        transform: translateY(160px);
    }
}

@keyframes x {
    to {
        transform: translateX(-100%);
        left: 100%;
    }
}

@keyframes y {
    33% {
        clip-path: inset(0 0 0 -100px);
    }

    50% {
        clip-path: inset(0 0 0 0);
    }

    83% {
        clip-path: inset(0 -100px 0 0);
    }

}

@keyframes close-ocr {
    to {
        opacity: 0;
        display: none;
    }

}

/* UI */
.main-ui {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
    display: flex;
    flex-direction: row;
    gap: 10px;
}

.button {
    font-family: 'Didot', serif;
    font-size: 1.2em;
    color: var(--secondary-color);
    background-color: var(--primary-color);
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s, color 0.3s;
}

.close-button {
    display: none;
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 102;
}

.scene-ui {
    position: absolute;
    bottom: 10px;
    margin: 5%;
    width: 90%;
    z-index: 5;

    display: none;
    flex-direction: row;
    gap: 10px;
    justify-content: space-between;
}

/* project card info */
.project-card {
    background-color: var(--primary-color);
    width: 30%;
    max-width: 350px;
    padding: 20px;
    color: var(--secondary-color);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    pointer-events: auto;
}

.project-card:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.project-title {
    margin: 0;
    font-size: 2em;
    font-weight: bold;
}

.project-subinfo {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

.project-organization {
    margin: 5px 0;
    font-size: 1.2em;
    font-style: italic;
}

.project-dates {
    margin: 5px 0;
    font-size: 0.9em;
    font-style: italic;
}

.project-description {
    margin: 10px 0;
    font-size: 1em;
}

.project-link {
    display: inline-block;
    margin: 10px 0;
    font-size: 1em;
    color: var(--terciary-color);
}

.project-tags {
    margin: 10px 0;
}

hr {
    border: 0;
    height: 1px;
    background: var(--terciary-color);
    margin: 10px 0 10px 0;
}

/* card modal */
.modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--primary-color);
    color: var(--secondary-color);
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 200;
    width: 30%;
    max-width: 400px;
    max-height: 80%;
    overflow-y: auto;
}

.close {
    position: absolute;
    top: 5px;
    right: 15px;
    cursor: pointer;
    font-size: 2em;
}

.close:hover {
    color: var(--terciary-color);
}

/* scene UI buttons */
.visit-link-button {
    text-decoration: none;
    font-weight: bold;
    margin: auto;
}

.prev-button {
    /* position: absolute; */
    left: 5%;
}

.next-button {
    /* position: absolute; */
    right: 5%;
}

/* about me section */
#about-me-section {
    display: none;
    background-color: rgba(51, 51, 51, 0.5);
    position: absolute;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
    z-index: 100;
    font-size: larger;

    color: var(--secondary-color);
    padding: 20px;
    overflow-y: auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);

}

.handwritten {
    font-family: 'Nanum Pen Script';
}

/* book */
/* https://codepen.io/captain_anonym0us/pen/ybVbpv */
.book {
    transition: opacity 0.4s 0.2s;
    perspective: 250vw;
    margin-top: 10vh;
    /* center pages */
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: left;

    p,
    ul {
        margin: 5% 10% 5% 10%;
    }

    h2 {
        margin: 10% 10% 5% 10%;
    }

    h1 {
        text-align: center;
        justify-content: center;
    }

}

.cover {
    background-color: var(--secondary-color) !important;
    float: left;
    margin-bottom: 0.5em;
    padding-top: 3em;
    background: left top no-repeat;
    background-size: cover;
    color: var(--primary-color);
}

.page {
    width: 30vw;
    max-width: 400px;
    height: 44vw;
    max-height: 575px;
    min-height: 540px;
    float: left;
    margin-bottom: 0.5em;
    background: left top no-repeat;
    background-size: cover;
}

.page:nth-child(even) {
    clear: both;
}

.book .pages {
    width: 60vw;
    max-width: 800px;
    height: 44vw;
    max-height: 575px;
    position: relative;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    border-radius: 8px;
}

.book .page {
    float: none;
    clear: none;
    margin: 0;
    position: absolute;
    top: 0;
    width: 30vw;
    max-width: 400px;
    height: 44vw;
    max-height: 575px;
    transform-origin: 0 0;
    transition: transform 1.4s;
    backface-visibility: hidden;
    transform-style: preserve-3d;
    cursor: pointer;
    user-select: none;
    background-color: var(--primary-color);
    box-shadow: 0 0 0 1px var(--secondary-color);
}

.book .page:before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.7s;
    z-index: 2;
}

.book .page:nth-child(odd) {
    pointer-events: all;
    transform: rotateY(0deg);
    right: 0;
    border-radius: 0 8px 8px 0;
    background-image: linear-gradient(to right, rgba(0, 0, 0, .15) 0%, rgba(0, 0, 0, 0) 10%);
}

.book .page:nth-child(odd):hover {
    transform: rotateY(-15deg);
}

.book .page:nth-child(odd):hover:before {
    background: rgba(0, 0, 0, 0.03);
}

.book .page:nth-child(odd):before {
    background: rgba(0, 0, 0, 0);
}

.book .page:nth-child(even) {
    pointer-events: none;
    transform: rotateY(180deg);
    transform-origin: 100% 0;
    left: 0;
    border-radius: 8px 0 0 8px;
    border-color: black;
    background-image: linear-gradient(to left, rgba(0, 0, 0, .12) 0%, rgba(0, 0, 0, 0) 10%);
}

.book .page:nth-child(even):before {
    background: rgba(0, 0, 0, 0.2);
}

.book .page.grabbing {
    transition: none;
}

.book .page.flipped:nth-child(odd) {
    pointer-events: none;
    transform: rotateY(-180deg);
}

.book .page.flipped:nth-child(odd):before {
    background: rgba(0, 0, 0, 0.2);
}

.book .page.flipped:nth-child(even) {
    pointer-events: all;
    transform: rotateY(0deg);
}

.book .page.flipped:nth-child(even):hover {
    transform: rotateY(15deg);
}

.book .page.flipped:nth-child(even):hover:before {
    background: rgba(0, 0, 0, 0.03);
}

.book .page.flipped:nth-child(even):before {
    background: rgba(0, 0, 0, 0);
}

*,
* :before,
*:after {
    box-sizing: border-box;
}

.page:nth-child(odd) {
    background-position: right top;
}

/* personalize pages */
.coffee-page {
    /* override page */
    background-image: url('./data/book/coffee.png'), linear-gradient(to right, rgba(0, 0, 0, .15) 0%, rgba(0, 0, 0, 0) 10%) !important;
    background-repeat: no-repeat;
    background-size: 40% auto, cover !important;
    background-position: 120% 110%, right top !important;
    /* filter coffee image only */
    background-blend-mode: multiply, normal !important;
}

.contact-info {
    font-family: 'Nanum Pen Script';
    color: var(--text-dark-color);

    p {
        margin: 5px 0 0 0;
    }

    span {
        margin: 0;
    }

    h3 {
        margin-bottom: 0.5em;
    }
}

/* speech bubble */
#speech-bubble {
    background: var(--primary-color);
    border-radius: 10px;
    padding: 10px;
    max-width: 200px;
    text-align: center;
    font-family: Arial, sans-serif;
    font-size: 14px;
    color: var(--text-dark-color);
    position: absolute;
    pointer-events: none;

}
#speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 15%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid var(--primary-color);
}