@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:ital,wght@0,400;0,700;1,400&display=swap');

:root {
    --bg-color: #ffffff;
    --text-color: #000000;
}

body {
    font-family: 'Courier Prime', 'Courier New', Courier, monospace;
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-color);
    background-color: var(--bg-color);
    margin: 0;
    padding: 30px 30px 30px 220px;
    min-height: 100vh;
    box-sizing: border-box;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.layout-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-column-gap: 20px;
    grid-row-gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    min-height: 100%;
    align-content: start;
    position: relative;
    padding-bottom: 60px;
}

nav {
    position: fixed;
    top: 30px;
    left: 30px;
    bottom: 30px;
    width: 150px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 1000;
    font-size: 13px;
}



footer {
    grid-column: 1 / -1;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    font-size: 11px;
    color: #ccc;
    padding-top: 10px;
    display: flex;
    justify-content: flex-start;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

nav ul li {
    display: block;
    margin-bottom: 15px;
}

nav a {
    text-decoration: none;
    color: #999;
    transition: color 0.3s ease;
}

nav a:hover,
nav a.active {
    color: #000;
}

main {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
}

h1.identity-title {
    font-size: 13px;
    font-weight: normal;
    text-transform: capitalize;
    letter-spacing: 1px;
    margin-top: 5vh;
    margin-bottom: 30px;
    grid-column: 1 / 6;
    grid-row: 2;
    align-self: end;
    white-space: nowrap;
    color: #000;
}

.intro-text-block {
    grid-column: 4 / 9;
    margin-top: 10vh;
}

.image-block {
    grid-column: 9 / 12;
    grid-row: 3;
    margin-top: -8vh;
    position: relative;
    z-index: 0;
    align-self: start;
}

.overlap-text {
    grid-column: 1 / 9;
    grid-row: 3;
    background: transparent;
    padding: 0;
    z-index: 1;
    margin-top: 10vh;
    padding-right: 40px;
}

.home-center {
    grid-column: 1 / -1;
    height: 70vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.identity-trigger {
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    display: inline-block;
    white-space: nowrap;
}

.identity-trigger span {
    display: inline-block;
    vertical-align: bottom;
}

.expand-text {
    opacity: 0;
    max-width: 0;
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    transition: all 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.identity-trigger:hover .expand-text {
    opacity: 1;
    max-width: 45px;
}

p {
    margin-bottom: 20px;
    color: #333;
}

.email-link {
    display: inline-block;
    margin-top: 20px;
    border-bottom: 1px solid #000;
    padding-bottom: 2px;
    color: #000;
    text-decoration: none;
}

.email-link:hover {
    background-color: transparent;
    color: #000;
}

img {
    width: 100%;
    height: auto;
    filter: grayscale(100%);
    display: block;
}

footer {
    grid-column: 1 / -1;
    margin-top: 100px;
    font-size: 11px;
    color: #ccc;
    border-top: none;
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
}

@media (max-width: 768px) {

    /* ── Body & Layout ── */
    body {
        padding: 70px 20px 80px 20px;
    }

    body.horizontal-mode {
        overflow: hidden;
        padding: 70px 0 60px 0;
    }

    /* Project page: let whole page scroll, not just the gallery */
    body.project-page {
        overflow: auto !important;
        overflow-y: scroll !important;
        height: auto !important;
        padding: 70px 20px 40px 20px;
    }

    .layout-grid {
        grid-template-columns: 1fr;
    }

    /* ── Navigation: fixed left → fixed top bar ── */
    nav {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: auto;
        width: 100%;
        height: 50px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 0 20px;
        background: var(--bg-color);
        border-bottom: 1px solid #eee;
        z-index: 1000;
        box-sizing: border-box;
    }

    nav ul {
        display: flex;
        flex-direction: row;
        gap: 20px;
        margin: 0;
    }

    nav ul li {
        margin-bottom: 0;
    }

    /* ── Home / About page blocks: stack in separate rows, no overlap ── */
    .identity-title {
        grid-column: 1 / -1;
        grid-row: auto;
        margin-top: 20px;
        white-space: normal;
    }

    .image-block {
        grid-column: 1 / -1;
        grid-row: auto;
        margin-top: 20px;
        max-width: 60%;
    }

    .overlap-text {
        grid-column: 1 / -1;
        grid-row: auto;
        margin-top: 24px;
        padding: 0;
        z-index: auto;
    }

    .intro-text-block {
        grid-column: 1 / -1;
        grid-row: auto;
        margin-top: 20px;
    }

    .overlap-text {
        margin-top: 20px;
        padding: 0;
    }

    .identity-trigger {
        font-size: 16px;
    }

    .home-center {
        height: 50vh;
    }

    /* ── Project pages: single scrolling column, no split ── */
    .project-split-layout {
        display: block !important;
        height: auto !important;
        overflow: visible !important;
    }

    .left-info {
        width: 100% !important;
        flex: none !important;
        padding: 20px 0 0 0;
        box-sizing: border-box;
    }

    .right-gallery {
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        padding: 0;
        margin-top: 48px;
        cursor: default;
        box-sizing: border-box;
    }

    .right-gallery img {
        max-width: 100%;
        margin: 0 0 24px 0;
    }

    /* ── Bento / project content: full width, keep internal size ratios ── */
    .bento-layout,
    .section-text-container,
    .trailer-container,
    .project-content {
        width: 100% !important;
        margin-left: 0 !important;
        box-sizing: border-box;
    }

    /* ── Horizontal scroll pages: sidebar top, content swipes below ── */
    body.horizontal-mode {
        overflow: hidden !important;
        padding: 0 !important;
    }

    /* Sidebar: fixed strip below nav */
    .scroll-sidebar {
        position: fixed !important;
        top: 50px;
        left: 0;
        right: 0;
        width: 100% !important;
        height: auto !important;
        max-height: 90px;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 12px 20px !important;
        background: var(--bg-color);
        border-bottom: 1px solid #eee;
        z-index: 500;
        box-sizing: border-box !important;
        margin-right: 0 !important;
        overflow: hidden;
    }

    /* Sidebar title: smaller on mobile */
    .scroll-sidebar h1.identity-title {
        font-size: 11px !important;
        margin: 0 !important;
        white-space: normal;
        line-height: 1.3;
    }

    /* Content area: horizontal scroll below nav + sidebar */
    .horizontal-scroll-display {
        position: fixed !important;
        top: 140px; /* nav 50px + sidebar 90px */
        left: 0 !important;
        right: 0 !important;
        bottom: 60px;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: flex-start;
        padding: 20px;
        cursor: default;
        -webkit-overflow-scrolling: touch;
        box-sizing: border-box;
    }

    .h-column {
        flex: 0 0 auto;
        width: 80vw;
        max-width: 80vw;
        height: 100%;
        margin-right: 40px;
    }

    .h-text {
        width: 80vw;
        min-width: unset;
        max-width: 80vw;
    }

    .h-image img,
    .h-image video {
        height: 100%;
        width: auto;
        max-width: none;
    }

    .fixed-sidebar,
    .assignment-fixed-info {
        position: static;
        width: 100%;
        height: auto;
        padding: 0;
        margin-bottom: 20px;
    }

    .scroll-sidebar {
        width: 100%;
    }

    /* ── Global footer ── */
    .global-footer {
        font-size: 10px;
        padding: 0 10px;
    }
}


article h1 {
    white-space: nowrap;
    width: 100%;
    margin-bottom: 20px;
}

.assignment-link {
    text-decoration: none;
    color: #999;
    font-size: 14px;
    display: block;
    white-space: nowrap;
    transition: color 0.3s ease;
}

.assignment-link:hover {
    color: #000;
}

/* Horizontal Layout Styles */
body.horizontal-mode {
    display: block;
    overflow: hidden;
    margin: 0;
    /* Removed padding: 0 to inherit the global 220px left padding */
}

/* Removed the specific horizontal-mode nav override so it uses the global fixed left sidebar */

.horizontal-scroll-display {
    position: absolute;
    top: 30px;
    left: 520px; /* Start after the fixed sidebar */
    right: 30px;
    bottom: 60px;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    align-items: center;
    box-sizing: border-box;

    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
}

.horizontal-scroll-display::-webkit-scrollbar {
    display: none;
}

.horizontal-scroll-display.active {
    cursor: grabbing;
}

.h-column {
    flex: 0 0 auto;
    height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin-right: 100px;
    position: relative;
    max-width: 80vw;
}

.scroll-sidebar {
    width: 300px;
    justify-content: space-between;
    padding-bottom: 0;
    flex-shrink: 0;
}

.h-text {
    width: 600px;
    min-width: 400px;
    max-width: 60vw;
    justify-content: flex-end;
    padding-bottom: 0;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.h-text> :last-child {
    margin-bottom: 0;
}

.h-image {
    justify-content: flex-start;
    padding-top: 0;
    margin-right: 50px;
}

.h-image img,
.h-image video {
    height: 100%;
    width: auto;
    object-fit: contain;
    display: block;
    object-position: top left;

    -webkit-user-drag: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: none;
}

.h-image video {
    pointer-events: auto;
}

.h-text h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-weight: normal;
    font-size: 13px;
}

.global-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: var(--bg-color);
    border-top: 1px solid #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    font-size: 11px;
    color: #ccc;
}

.global-footer a {
    color: #ccc;
    text-decoration: none;
    margin: 0 5px;
}

.global-footer img {
    filter: none;
    width: auto;
    height: 14px;
    vertical-align: middle;
    margin-left: 2px;
    display: inline-block;
}
/* --- Project Page Split-Screen Layout --- */
body.project-page {
    overflow: hidden;
}

.project-split-layout {
    display: flex;
    width: 100%;
    height: calc(100vh - 60px);
}

.left-info {
    flex: 0 0 300px;
    padding: 10vh 40px 0 0;
    box-sizing: border-box;
}

.right-gallery {
    flex: 1;
    height: calc(100vh - 60px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10vh 5vw 20vh 2vw; /* Top right bottom left padding for breathing room */
    box-sizing: border-box;
    cursor: grab;
}

.right-gallery::-webkit-scrollbar {
    display: none;
}
.right-gallery {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.right-gallery img {
    max-width: 75%;
    height: auto;
    display: block;
    cursor: zoom-in;
    filter: none !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin: 0 0 60px auto;
    -webkit-user-drag: none; /* 禁止鼠标拖拽保存 */
    user-select: none; /* 禁止选中 */
    -webkit-touch-callout: none; /* 禁止手机长按呼出保存菜单 */
}

/* Lightbox */
#lightbox {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.95);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    cursor: zoom-out;
}
#lightbox.active {
    opacity: 1;
    pointer-events: auto;
}
#lightbox img {
    max-width: 90vw;
    max-height: 95vh;
    object-fit: contain;
    filter: none !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.assignment-fixed-info {
    position: fixed;
    top: 10vh;
    left: 220px;
    bottom: 10vh;
    width: 250px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    z-index: 10;
}

.fixed-sidebar {
    position: fixed;
    top: calc(50vh - 15px);
    transform: translateY(-50%);
    left: 220px;
    height: 60vh;
    width: 300px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.fixed-sidebar h1.identity-title {
    margin-top: 0;
}

.return-link {
    font-size: 13px;
    text-decoration: none;
    color: #999;
    display: inline-block;
    transition: color 0.3s ease;
}
.return-link:hover {
    color: #000;
}

/* Lightbox Navigation */
.lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 40px; /* Made much bigger */
    color: #555; /* Darker for visibility */
    cursor: pointer;
    padding: 20px;
    transition: color 0.3s ease, transform 0.2s ease;
    user-select: none;
    z-index: 10001;
    mix-blend-mode: difference; /* Ensures visibility on both white background and dark images */
    color: white; /* With difference blend mode, white becomes inverse of background */
}
.lb-nav:hover { 
    transform: translateY(-50%) scale(1.1);
}
.lb-prev { left: 2vw; }
.lb-next { right: 2vw; }

.lb-close {
    position: absolute;
    top: 30px;
    right: 5vw;
    font-size: 40px;
    color: #555;
    cursor: pointer;
    padding: 10px;
    transition: transform 0.2s ease;
    user-select: none;
    z-index: 10001;
    line-height: 1;
    mix-blend-mode: difference;
    color: white;
}
.lb-close:hover { 
    transform: scale(1.1);
}

.left-info h1 {
    color: #000 !important;
    font-weight: normal !important;
    text-transform: capitalize;
}

.nav-home-trigger {
    text-decoration: none;
    color: #999;
    display: inline-block;
    white-space: nowrap;
    transition: color 0.3s ease;
    cursor: pointer;
}

.nav-home-trigger:hover {
    color: #000;
}

.nav-home-trigger span.static {
    display: inline-block;
    vertical-align: bottom;
}

.shrink-text {
    opacity: 1;
    max-width: 45px;
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    vertical-align: bottom;
    transition: all 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-home-trigger:hover .shrink-text {
    opacity: 0;
    max-width: 0;
}
