/* Base Elements */
body {
    user-select: none;
    -webkit-user-select: none;
}

body,
html {
    height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fffaf0;
    font-family: 'Instrument Serif', serif;
    text-align: center;
    touch-action: none;
}

h1 {
    font-size: 3rem;
    margin: 10px 0;
    font-weight: 300;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 1), 0 4px 20px rgba(0, 0, 0, 0.8), 0 0 40px rgba(0, 0, 0, 0.6);
    z-index: 10;
    pointer-events: none;
}

p {
    font-size: 1.5rem;
    max-width: 400px;
    margin: 0.5rem 0 0 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 1), 0 4px 20px rgba(0, 0, 0, 0.8), 0 0 40px rgba(0, 0, 0, 0.6);
    z-index: 10;
    pointer-events: none;
}

/* IDs */
#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 10% 90%, #27231f 0%, #222131 40%, #08080b 100%);
}

#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #222131 0%, #08080b 100%);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease-out, visibility 0.8s ease-out;
}

#preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

#rotating-title {
    display: inline-block;
    position: absolute;
    text-decoration: underline;
    left: 0;
    bottom: 0px;
    white-space: nowrap;
    transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out;
}

/* Classes (Sorted Alphabetically) */
.back {
    transform: rotateY(180deg) translateZ(250px);
}

.bottom {
    transform: rotateX(-90deg) translateZ(250px);
}

.cube {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transform: translateZ(-250px);
    transition: transform 0.5s ease-out;
    cursor: grab;
}

.cube.dragging {
    transition: none;
    cursor: grabbing;
}

.face {
    position: absolute;
    width: 500px;
    height: 500px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

.face > img {
    width: 230px;
    height: 230px;
    border-radius: 50%;
    border: 3px solid #fff;
    object-fit: cover;
    margin-bottom: 0.75rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.face li:last-child {
    margin-bottom: 0;
}

.face ol {
    text-align: left;
    padding-left: 1rem;
    z-index: 10;
    pointer-events: none;
    font-size: 1.5rem;
}

.face ol li {
    margin-bottom: 1.25rem;
}

.face p {
    margin: 0.25rem 0;
    text-align: left;
}

.front {
    transform: rotateY(0deg) translateZ(250px);
}

.highlight {
    margin: 0 -0.4em;
    padding: 0.1em 0.4em;
    border-radius: 0.6em 0.3em;
    letter-spacing: 1%;
    background-image: linear-gradient(to right,
            rgba(255, 225, 0, 0.1),
            rgba(255, 225, 0, 0.7) 4%,
            rgba(255, 225, 0, 0.3));
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

.left {
    transform: rotateY(-90deg) translateZ(250px);
}

.logo-placeholder {
    display: inline-block;
    vertical-align: middle;
    height: 48px;
    margin: 0 10px;
    object-fit: contain;
    filter: brightness(0) invert(1) opacity(0.6);
    transition: filter 0.3s ease;
}

.logo-placeholder:hover {
    filter: brightness(1) invert(0) opacity(1);
}

.logos-carousel {
    width: 100%;
    overflow: hidden;
    mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
    padding: 5px 0;
    margin-top: 1rem;
    white-space: nowrap;
    pointer-events: auto;
}

.logos-track {
    display: inline-block;
    animation: scroll 12s linear infinite;
}

.logos-track:hover {
    animation-play-state: paused;
}

.right {
    transform: rotateY(90deg) translateZ(250px);
}

.scene {
    width: 500px;
    height: 500px;
    perspective: 1500px;
    z-index: 100;
}

.social-link {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 1.25rem;
    transition: color 0.3s ease, transform 0.3s ease;
}

.social-link .fill-icon {
    fill: currentColor;
}

.social-link .stroke-icon {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.social-link svg {
    width: 24px;
    height: 24px;
}

.social-link:hover {
    color: #d1860e;
    transform: translateY(-3px);
    text-shadow: 0 0 15px rgba(209, 134, 14, 0.5);
}

.social-links {
    position: absolute;
    bottom: 40px;
    display: flex;
    gap: 1.5rem;
    align-items: center;
    z-index: 10000;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: #d1860e;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.title-container {
    display: inline-block;
    vertical-align: bottom;
    overflow: hidden;
    height: 1.25em;
    transition: width 0.2s ease-in-out;
    position: relative;
    text-shadow: none;
}

.title-swap-in {
    transform: translateY(100%);
    opacity: 0;
}

.title-swap-out {
    transform: translateY(-100%);
    opacity: 0;
}

.top {
    transform: rotateX(90deg) translateZ(250px);
}

/* Keyframes */
@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Media Queries */
@media screen and (max-width: 600px) {
    h1 {
        font-size: 2rem;
    }

    p {
        font-size: 1.25rem;
        max-width: 300px;
    }

    .back {
        transform: rotateY(180deg) translateZ(180px);
    }

    .bottom {
        transform: rotateX(-90deg) translateZ(180px);
    }

    .cube {
        transform: translateZ(-180px);
    }

    .face {
        width: 360px;
        height: 360px;
        padding: 0 10px;
        box-sizing: border-box;
    }

    .face > img {
        width: 160px;
        height: 160px;
    }

    .face li {
        margin-bottom: 0.5rem;
    }

    .face ol {
        font-size: 1.25rem;
    }

    .front {
        transform: rotateY(0deg) translateZ(180px);
    }

    .left {
        transform: rotateY(-90deg) translateZ(180px);
    }

    .logos-carousel {
        margin-top: 0;
    }

    .right {
        transform: rotateY(90deg) translateZ(180px);
    }

    .scene {
        width: 360px;
        height: 360px;
    }

    .social-link {
        font-size: 1.1rem;
    }

    .social-link svg {
        width: 20px;
        height: 20px;
    }

    .social-links {
        bottom: 25px;
        gap: 1rem;
    }

    .top {
        transform: rotateX(90deg) translateZ(180px);
    }
}
