@font-face {
    font-family: chalk;
    src: url(./chalk.ttf);
}

:root {
    --degrees: 0deg;
    --w-translatez: -1200px;
    --w-translatex: 0px;
    --sc-translatez: -2000px;

    --height: 0px;
}

.window-wrapper {
    background: #111;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    font-family: 'Anton', sans-serif;
    pointer-events: none;
    justify-content: center;
    align-items: center;

    --w-perspective: 1000px;





    --body-opacity: 0%;
    --eyes-opacity: 100%;
    transform: translateZ(var(--w-translatez));
    perspective: var(--w-perspective);

    background-image: url(./media/wall.webp);

}

.input {
    position: relative !important;
    display: flex;
    align-items: center;
    gap: 20px;
}

.button {
    position: absolute;
    bottom: 10px;
    z-index: 99;
    font-size: 1.5rem;
    cursor: pointer;

    display: flex;
    flex-direction: column;
    align-items: center;
}

.button img {

    max-width: 100px;
    opacity: 0.8;
    filter: grayscale(1) brightness(1);

}

.window-wrapper.add-animation {
    animation: flickerAnimation 5s infinite;
}

.light.add-animation .light_ref {
    animation: flickerAnimationLight 5s infinite;
}

@keyframes flickerAnimation {
    0% {
        background: #111;
    }

    8% {
        background: #000;

    }

    10% {
        background: #111;
    }
}

@keyframes flickerAnimationLight {
    0% {
        background: rgba(255, 255, 255, 0.5);
    }

    8% {
        background: rgba(255, 255, 255, 0.1);

    }

    10% {
        background: rgba(255, 255, 255, 0.5);
    }
}

.slendercat-wrapper {
    transition: 3000ms cubic-bezier(0.17, 0.935, 0.305, 1);
    perspective: 0px;

    transform: rotateY(var(--degrees)) rotateX(0deg) translateZ(var(--sc-translatez));
}

.slendercat-wrapper .body {
    opacity: var(--body-opacity);
}

.slendercat-wrapper .eyes {
    opacity: var(--eyes-opacity);
    transition: 4s;
}

.window-wrapper div {
    position: absolute;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    pointer-events: none;
}

.interface {
    top: 0;
    width: 10%;
    height: 100%;
    pointer-events: auto !important;
}

/*
.interface:nth-child(1) {
    left: 0%;
}

.interface:nth-child(1):hover~.window,
.interface:nth-child(1):hover~.slendercat-wrapper {
    transform: rotateY(-40deg) rotateX(0deg);
}

.interface:nth-child(2) {
    left: 10%;
}

.interface:nth-child(2):hover~.window,
.interface:nth-child(2):hover~.slendercat-wrapper {
    transform: rotateY(-30deg) rotateX(0deg);
}
*/
.interface:nth-child(1) {
    left: 0%;
}

.interface:nth-child(2) {
    left: 10%;
}

.interface:nth-child(3) {
    left: 20%;
}


.interface:nth-child(4) {
    left: 30%;
}

.interface:nth-child(5) {
    left: 40%;
}


.interface:nth-child(6) {
    left: 50%;
}

.interface:nth-child(7) {
    left: 60%;
}


.interface:nth-child(8) {
    left: 70%;
}

.interface:nth-child(9) {
    left: 80%;
}


.interface:nth-child(10) {
    left: 90%;
}

.window {
    width: 100%;
    height: 100%;
    transition: 4000ms cubic-bezier(0.17, 0.935, 0.305, 1);
    transform: rotateX(0deg) translateZ(var(--w-translatez)) translateX(var(--w-translatex));
    z-index: 3;

}


.light {
    top: calc(50% - var(--height) / 2);
    left: calc(50% - 200px / 2);
    width: 200px;
    height: var(--height);
    transform-origin: 50% 100%;
    transform: translateY(200px) translateZ(100px) rotateX(-90deg);
}

.light_ref {
    width: 90px;
    height: 140px;
    background: rgba(255, 255, 255, 0.5);
}

.light_ref_2 {
    right: 0;
}

.light_ref_3 {
    bottom: 0;
}

.light_ref_4 {
    right: 0;
    bottom: 0;
}

.wall {
    width: 100%;
    height: 100%;
    z-index: 4;

}

.office {
    width: 100%;
    height: 100%;
    z-index: 5;
}

.door {
    width: 100%;
}

.ceiling {
    bottom: calc(50% - 3169px / 2);
    width: 2150px;
    height: 3500px;
    background: rgba(0, 0, 0, 1);
    left: calc(50% - 2120px / 2);
    transform: translateZ(+400px) rotateX(270deg);
    background-image: url(./media/ceiling.webp);
    background-size: 330px;
    background-position: -70px;
}

.right_wall,
.right_wall .wall_texture,
.right_wall img {
    backface-visibility: visible !important;
}

.wall_texture {
    position: relative !important;
    width: 100%;
    height: 100%;
    background-image: url(./media/wall.webp);
    background-size: 480px;
}

.right_wall {
    display: flex;

    bottom: calc(50% - 600px / 2);
    width: 2500px;
    height: 500px;
    left: calc(50% - 2000px / 2);
    transform: translateZ(+1250px) rotateX(360deg) rotateY(-90deg);
}

.left_wall {
    bottom: calc(50% - 600px / 2);
    width: 2500px;
    height: 500px;
    right: calc(50% - 2000px / 2);
    transform: translateZ(+1250px) rotateX(360deg) rotateY(90deg);
}

.office_wall_right {
    display: flex;
    justify-content: flex-start;
    align-items: center;

    bottom: calc(50% + calc(-500px + -100px) / 2);
    width: 2500px;
    height: 500px;
    left: calc(50% + calc(-1000px + 500px) / 2);
    transform: translateZ(48px) rotateX(360deg) rotateY(-90deg);

    background-image: url(./media/wall.webp);
    background-size: 480px;
}

.office_wall_left {
    display: flex;
    justify-content: flex-end;
    align-items: center;

    bottom: calc(50% + calc(-500px + -100px) / 2);
    width: 2500px;
    height: 500px;
    right: calc(50% + calc(-1000px + 500px) / 2);
    transform: translateZ(48px) rotateX(360deg) rotateY(90deg);

    background-image: url(./media/wall.webp);
    background-size: 480px;
}

.office_wall_back {
    left: calc(50% + -2000px / 2);
    transform: translateZ(-1200px);
    width: 2000px;
    height: 480px;
    top: calc(50% + -360px / 2);
    background: rgba(0, 0, 0, 1);
    background-position: left top;
    display: flex;
    justify-content: center;
    background-image: url(./media/wall.webp);
    background-size: 480px;
    background-position: -20px -15px;
    align-items: center;
}

.desk {
    position: absolute;
    left: calc(50% + -510px / 2);
    transform: translateZ(-1000px);
    bottom: calc(50% + calc(-940px + 340px) / 2);
    width: 520px;
    max-width: unset;
    pointer-events: none;
}

.baldi_wrapper {
    pointer-events: all !important;
    position: absolute;
    left: calc(50% + -90px / 2);
    transform: translateZ(-1100px);
    bottom: calc(50% + calc(-940px + 340px) / 2);
}

.baldistanding {
    opacity: 0;
    height: 380px;

    cursor: url(./baldi_pointer.cur), pointer !important;
}

.baldistanding:hover {}

.lamp {
    position: absolute;
    left: calc(50% + -46px / 2);
    transform: translateZ(-700px);
    bottom: calc(50% + calc(-109px + 340px) / 2);
    width: 60px;
    max-width: unset;
}

.principal {
    position: absolute;
    left: calc(50% + 654px / 2);
    transform: translateZ(1000px);
    bottom: calc(50% + calc(-910px + 340px) / 2);
    width: 200px;
    max-width: unset;
}

.plant {
    position: absolute;
    left: calc(50% + -755px / 2);
    transform: translateZ(-1000px);
    bottom: calc(50% + calc(-910px + 340px) / 2);
    width: 60px;
    max-width: unset;
}

.papers {
    position: absolute;
    left: calc(50% + 754px / 2);
    transform: translateZ(-900px) rotateY(-25deg) rotateX(61deg);
    bottom: calc(50% + calc(-975px + 340px) / 2);
    width: 60px;
    max-width: unset;
}

.chalkboard_wrapper {
    pointer-events: all !important;
    position: relative !important;
    cursor: url(./baldi_pointer.cur), pointer !important;
}

.chalkboard_wrapper:hover {}

.chalkboard {
    width: 580px;
    z-index: 11;
    pointer-events: none;
}

.chalkboard_text {
    position: absolute;
    top: 0;
    left: 50%;
    z-index: 12;
    padding: 22px;
    text-align: center;
    font-size: 2rem;
    font-family: chalk, "Comic Sans", cursive;
    transform: translate(-50%,0);
}

.chalkboard_credit {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 12;
    font-size: 10px;
    font-family: chalk, "Comic Sans", cursive;
}

.rules_wrapper {
    pointer-events: all !important;
    position: relative !important;
    cursor: url(./baldi_pointer.cur), pointer !important;
}


.rules {
    width: 320px;
    z-index: 11;
    pointer-events: none;
}

.rules_text {
    top: 0;
    left: 0;
    z-index: 12;
    padding: 40px 60px;
    padding-bottom: 0px;
    text-align: center;
    font-family: "Comic Sans MS", "Comic Sans", cursive;
}


.front_wall_glass {
    top: calc(50% - 282px / 2);
    left: calc(50% - 200px / 2);
    width: 200px;
    height: 440px;
    transform: translateZ(-10px);
}

.baldi {
    position: absolute;
    /* width: 74%; */
    bottom: 0;
    right: 0;
    width: 85%;
}

.front_wall_top {
    top: calc(50% - 100px - 285px / 2);
    width: 2999px;
    height: 100px;
    background: rgba(0, 0, 0, 1);
    left: -1405px;
    background-image: url(./media/wall.webp);
    background-size: 480px;
    background-position: 80px -18px;
}

.front_wall_top::before {
    content: '';
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 20px;
    background: rgba(50, 50, 50, 1);
    transform-origin: 0 100%;
    transform: rotateX(90deg);
}

.front_wall_right {
    left: calc(50% + 200px / 2);
    width: 900px;
    height: 1180px;
    transform: translateY(200px);
    background: rgba(0, 0, 0, 1);

    background: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8)), url(./media/bg.webp), rgba(0, 0, 0, 1);
    background-position: left top;


    display: flex;
    justify-content: flex-start;

    background-image: url(./media/wall.webp);
    background-size: 480px;
    background-position: -20px -15px;
}

.front_wall_right::before {
    content: "";
    position: absolute;
    width: 20px;
    height: 100%;
    background: rgba(50, 50, 50, 1);
    transform-origin: 0 0;
    transform: rotateY(90deg);
}

.floor {
    top: calc(50% + 600px / 2);
    left: calc(50% - 2500px / 2);
    width: 3000px;
    height: 4000px;
    transform: translateZ(800px) translateY(-2000px) rotateX(90deg);
}

.horizontal {
    position: relative !important;
    display: flex;
    width: 100%;
    height: 2500px;
}

.carpet_texture {
    position: relative !important;
    width: 100%;
    height: 1195px;
    background-size: 400px;
    background-image: url(./media/carpet.webp);
}

.horizontal .carpet_texture {
    height: 100%;
}

.floor_texture {
    position: relative !important;
    width: 100%;
    height: 100%;
    background-size: 400px;
    background-image: url(./media/floor.webp);
}

.floor::before {
    content: "";
    position: absolute;
    width: 100%;
    height: 20px;
    background: rgba(50, 50, 50, 1);
    transform-origin: 0 0;
    transform: rotateX(-90deg);
}

.bold {
    font-weight: bold;
}

.front_wall_left {
    left: calc(50% - 400px - 200px / 2);
    width: 400px;
    height: 1180px;
    transform: translateY(200px);
    background: rgba(0, 0, 0, 1);


    background: linear-gradient(rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.85)), url(./media/bg2.webp), rgba(0, 0, 0, 1);
    background-position: right top;


    display: flex;
    justify-content: flex-end;

    background-image: url(./media/wall.webp);
    background-size: 480px;
    background-position: 20px -15px;
}

.front_wall_left p,
.front_wall_right p {
    max-width: 90ch;
    opacity: 0.35;
    margin-top: 330px;
    margin-right: 42px;
    text-align: center;
    font-size: .875rem;
    pointer-events: all;

    transition: opacity 1s;
}

.front_wall_left p:hover,
.front_wall_right p:hover {

    opacity: 1;

}

.front_wall_right p {
    max-width: 50ch;
    margin-left: 42px;
    margin-top: 300px;
}

.front_wall_left p img,
.front_wall_right p img {
    width: 200px;
    margin: auto;
}

.front_wall_left::before {
    content: "";
    position: absolute;
    right: 0;
    width: 20px;
    height: 100%;
    background: rgba(50, 50, 50, 1);
    transform-origin: 100% 0;
    transform: rotateY(-90deg);
}

.front_wall_vertical {
    top: calc(50% - 300px / 2);
    left: calc(50% - 20px / 2);
    width: 20px;
    height: 300px;
    background: rgba(0, 0, 0, 1);
}

.front_wall_vertical::before {
    content: "";
    position: absolute;
    width: 20px;
    height: 100%;
    background: rgba(50, 50, 50, 1);
    transform-origin: 0 0;
    transform: rotateY(90deg);
}

.front_wall_vertical::after {
    content: "";
    position: absolute;
    right: 0;
    width: 20px;
    height: 100%;
    background: rgba(50, 50, 50, 1);
    transform-origin: 100% 0;
    transform: rotateY(-90deg);
}

.front_wall_horizontal {
    top: calc(50% - 20px / 2);
    left: calc(50% - 200px / 2);
    width: 200px;
    height: 20px;
    background: rgba(0, 0, 0, 1);
}

.front_wall_horizontal::before {
    content: "";
    position: absolute;
    width: 100%;
    height: 20px;
    background: rgba(50, 50, 50, 1);
    transform-origin: 0 0;
    transform: rotateX(-90deg);
}

.front_wall_horizontal::after {
    content: "";
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 20px;
    background: rgba(50, 50, 50, 1);
    transform-origin: 0 100%;
    transform: rotateX(90deg);
}

.mask {
    width: 100%;
    height: 100%;
    transform: translateZ(1px);
}

.mask_right {
    left: calc(50% + 200px);
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 1);
}

.mask_left {
    left: calc(42% - 100% - 200px);
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 1);
}

@media (max-width: 940px) {

    .wasd {
        height: 20vh;
        width: 62vw;
    }

    .grid {
        height: 90%;
        width: 60%;
    }

    .links-img {
        height: 12vh;
    }

    .hero-icon {
        width: 6vh;
    }

    /* Mobile perspective fixes to prevent glitches */
    .window-wrapper {
        --w-perspective: 800px;
        perspective: 800px;
        -webkit-perspective: 800px;
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
        will-change: transform;
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }

    .window {
        -webkit-transform: rotateX(0deg) translateZ(var(--w-translatez)) translateX(var(--w-translatex));
        will-change: transform;
    }

    .window-wrapper div {
        -webkit-transform-style: preserve-3d;
        -webkit-backface-visibility: hidden;
    }

    /* Simplify complex transforms on mobile */
    .ceiling,
    .floor,
    .right_wall,
    .left_wall {
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }

    /* Add hardware acceleration for better performance */
    .office_wall_back {
        will-change: transform;
    }

    .office_wall_left,
    .office_wall_right {
        will-change: transform;
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }

    /* Adjust principal position for mobile perspective */
    .principal {
        transform: translateZ(600px);
        width: 150px;
    }

    /* Fix office wall element glitching on mobile */
    .office_wall_back {
        transform: translateZ(-1200px) !important;
    }

    .office_wall_back,
    .office_wall_back > div {
        -webkit-transform-style: flat !important;
        transform-style: flat !important;
    }

    .office_wall_back .chalkboard_wrapper,
    .office_wall_back .rules_wrapper,
    .office_wall_back .gif {
        -webkit-backface-visibility: hidden !important;
        backface-visibility: hidden !important;
        -webkit-transform-style: flat !important;
        transform-style: flat !important;
    }

}

@keyframes rotate {
    0% {
        transform: rotateY(50deg);
    }

    100% {
        transform: rotateY(-50deg);
    }
}