* {
    font-size: 1rem;
    letter-spacing: .02rem;
    line-height: 1.25;
    font-family: 'Times New Roman', Times, serif;
    list-style-type: none;
}

body {
    background: rgb(239, 239, 239);
    touch-action: manipulation;
}


a {
    text-decoration: none;
    color: black;
}

#about-description a,
.project-description a,
.writing-text a {
    text-decoration: underline;
}

nav {
    margin-bottom: 2rem;
    position: fixed;
    left: .5rem;
    top: .5rem;
    z-index: 10;
}

nav a {
    font-size: 2rem;
    color: black;
}

#nav-about {
    position: relative;
    z-index: 10;
}



#about-description {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgb(239, 239, 239);
    z-index: 5;
    mix-blend-mode: multiply;
    padding: 3rem .5rem .5rem .5rem;
    box-sizing: border-box;
    overflow-y: auto;
}

#about-description,
#about-description p,
#about-description a,
#about-description ul li {
    font-size: 2rem;
}

#about-description ul {
    margin-top: 1.5rem;
}

.hidden {
    display: none !important;
}

/* Layout Structural Styles */
.project-section {
    width: 100%;
    max-width: 100vw;
    padding: 0 .5rem .5rem .5rem;
}

.project-section:first-child {
    margin-top: 3rem;
}



.carousel-container {
    position: relative;
    width: 100%;
    height: 75vh;
    overflow: hidden;
}

.carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.carousel-item {
    display: none;
    width: 100%;
    height: 100%;
    overflow: hidden;
    cursor: pointer;
    box-sizing: border-box;
}

.carousel-item.active {
    display: block;
}

.carousel-item img,
.carousel-item video {
    width: 100%;
    height: 100%;
    object-fit: fill;
    display: block;
}

.project-info {}

.project-title {
    font-weight: 900;
}

.project-description {
    width: 100%;
}

.info-left {
    width: 100%;
}

.carousel-nav-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: .25rem;
    margin-bottom: .25rem;
}

.carousel-nav-numbers {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    align-items: center;
}

.fullscreen-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    background: white;
    border: none;
    cursor: pointer;
    color: black;
    mix-blend-mode: screen;
    line-height: 1;
    padding: 0.25rem .5rem .35rem .5rem;
}

.fullscreen-btn.hidden {
    display: none !important;
}

.nav-thumb-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    height: 20px;
    width: auto;
    overflow: hidden;
    box-sizing: border-box;
    display: inline-block;
}

.nav-thumb-btn.active {
    background-color: transparent !important;
}

.nav-thumb-btn img,
.nav-thumb-btn video {
    height: 100%;
    width: auto;
    display: block;
    opacity: 0;
}

.nav-thumb-btn.active img,
.nav-thumb-btn.active video {
    opacity: 1;
}


@media (max-width: 768px) {

    * {
        font-size: 1rem;
    }

    nav a {
        font-size: 1.5rem;
    }

    .project-section {
        width: 100% !important;
        max-width: 100% !important;
        padding: .5rem !important;
    }

    #about-description {
        padding: 4rem .5rem .5rem .5rem;
    }

    #about-description,
    #about-description p,
    #about-description a,
    #about-description ul li {
        font-size: 1.5rem;
    }


    .carousel-item img,
    .carousel-item video {
        object-fit: contain !important;
    }

    #wormhole-panel {
        width: 100vw !important;
        padding: 0 !important;
    }

}

/* ==========================================================================
   Wormhole Portal Styles
   ========================================================================== */

/* 1. Swirling Wormhole Button */
.wormhole-button {
    position: fixed;
    top: 0.5rem;
    right: 0.5rem;
    width: 3.5rem;
    height: 3.5rem;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 100;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.wormhole-button img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform-origin: center;
    will-change: transform;
}

.wormhole-button:active {
    transform: scale(0.9);
}

/* 2. Full-Page Glassmorphic Overlay Panel */
#wormhole-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(239, 239, 239, 0.95);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    z-index: 90;
    box-sizing: border-box;
    padding: 0;
    display: none;
    flex-direction: column;
}

#wormhole-panel.active {
    display: flex;
}

.panel-content {
    flex-grow: 1;
    overflow-y: auto;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* Custom Scrollbar for Panel */
.panel-content::-webkit-scrollbar {
    width: 4px;
}

.panel-content::-webkit-scrollbar-track {
    background: transparent;
}

.panel-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.08);
    border-radius: 4px;
}

.panel-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* 3. Responsive Flex-Grid Layout for Writings (Height and Width fit content) */
#wormhole-writings-list {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.25rem;
    padding: 0.25rem;
    box-sizing: border-box;
    width: 100%;
}

.writing-card {
    box-sizing: border-box;
    padding: .25rem;
    text-align: left;
    flex: 0 1 auto;
    /* Cell size depends on content, responsive wrapping */
    max-width: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.writing-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.25rem;
}

.writing-index,
.writing-date {
    color: black;
}

.writing-text {
    white-space: pre-wrap;
    color: black;
}

.writing-card img,
.wormhole-image-file {
    max-width: 100%;
    height: auto;
    display: block;
    margin-top: 0.5rem;
}