:root {
    --color-white: #FFFFFF;
    --color-black: #000000;
    --color-gray: #bebfc3;
    --font-regular: 'Ronzino', sans-serif;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.6s ease;
    --footer-height: 2rem;
    --footer-height-mobile: 1.5rem;
    --thumbnail-height: 60px;
    --thumbnail-height-mobile: 44px;
    --mobile-info-height: 0px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    margin: 0;
    padding: 0;
    height: 100%;
    overscroll-behavior: none;
}

body {
    min-height: 100dvh;
    min-height: -webkit-fill-available;
    min-width: 100dvw;
    background-color: var(--color-white);
    color: var(--color-black);
    overflow: hidden;
    font-family: var(--font-regular);
    font-feature-settings: "onum" 1;
    font-variant-numeric: oldstyle-nums;
    overscroll-behavior: none;
    isolation: isolate;
}


@font-face {
    font-family: 'Ronzino';
    src: local('Ronzino Regular'),
        local('Ronzino-Regular'),
        url('fonts/Ronzino-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Ronzino';
    src: local('Ronzino Bold'),
        local('Ronzino-Bold'),
        url('fonts/Ronzino-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Ronzino';
    src: local('Ronzino Oblique'),
        local('Ronzino-Oblique'),
        url('fonts/Ronzino-Oblique.woff2') format('woff2');
    font-weight: 400;
    font-style: oblique;
    font-display: swap;
}

a {
    text-decoration: none;
}

/* ========================================================================
   GALLERY LAYOUT
   ======================================================================== */

.home-body {
    display: block;
    height: 100dvh;
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
    background-color: var(--color-white);
    padding-bottom: 0;
}

#gallery-container {
    position: fixed;
    top: calc(var(--footer-height) + env(safe-area-inset-top, 0px) + 1vh);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--footer-height) - var(--thumbnail-height) - env(safe-area-inset-top, 0px) - 1vh);
    overflow: hidden;
    z-index: 1;
}

#gallery-track {
    display: flex;
    flex-wrap: nowrap;
    height: 100%;
    transition: transform 0.6s ease;
    will-change: transform;
}

.gallery-slide {
    flex: 0 0 100vw;
    min-width: 100vw;
    height: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    cursor: crosshair;
    user-select: none;
    background-color: var(--color-white);
    padding-bottom: 0;
}

.gallery-slide img,
.gallery-slide video {
    max-width: 94vw;
    max-height: calc(100% - 4rem - 1vh);
    height: calc(100% - 4rem - 1vh);
    width: auto;
    object-fit: contain;
    display: block;
    filter: saturate(0.95) contrast(1.05);
    user-select: none;
    pointer-events: none;
}

/* ========================================================================
   PROJECT INFO (BOTTOM-LEFT)
   ======================================================================== */

#project-info-bottom {
    position: fixed;
    top: auto;
    bottom: var(--thumbnail-height);
    height: calc(4rem + 1vh);
    left: 0;
    right: 0;
    width: 100%;

    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;

    z-index: 100;
    color: var(--color-black);
    mix-blend-mode: normal;
    pointer-events: none;
    max-width: 100%;
    text-align: left;
    transform: none;
    padding: 0 1vh;
}

#project-info-bottom a {
    color: var(--color-black);
    pointer-events: auto;
    text-decoration: none;
    transition: text-decoration var(--transition-normal);
    text-underline-offset: 2px;
}

#project-info-bottom a:hover {
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
}

#project-title-bottom {
    font-size: 0.8rem;
    line-height: 1.1rem;
    letter-spacing: 0.02em;
    font-weight: 400;
    font-style: oblique;
    margin: 0;
    white-space: nowrap;
    width: calc(50vw - 2px - 1vh);
    flex-shrink: 0;
}

#project-detail-bottom {
    font-size: 0.8rem;
    line-height: 1.1rem;
    padding: 0;
    white-space: nowrap;
}

/* ========================================================================
   THUMBNAIL STRIP
   ======================================================================== */

#thumbnail-strip {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: var(--thumbnail-height);
    z-index: 100;
    background-color: var(--color-white);
    overflow: hidden;
    display: flex;
    align-items: center;
}

#thumbnail-track {
    display: flex;
    flex-wrap: nowrap;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    align-items: center;
    gap: 2px;
    padding: 0 calc(50vw - 2px) 0 calc(50vw - 2px);
    -ms-overflow-style: none;
    scrollbar-width: none;
    scroll-behavior: smooth;
}

#thumbnail-track::-webkit-scrollbar {
    display: none;
}

.thumbnail-item {
    flex: 0 0 auto;
    height: 100%;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.25s ease;
    user-select: none;
    display: flex;
    align-items: center;
}

.thumbnail-item:hover {
    opacity: 0.7;
}

.thumbnail-item.active {
    opacity: 1;
}

.thumbnail-item img,
.thumbnail-item video {
    height: 100%;
    width: auto;
    object-fit: cover;
    display: block;
    pointer-events: none;
    user-select: none;
}

/* ========================================================================
   TOP BAR
   ======================================================================== */

.top-bar {
    position: fixed;
    top: 0px;
    left: 0px;
    right: 0px;
    width: 100%;
    background-color: var(--color-gray);
    backdrop-filter: blur(16px) saturate(135%);
    -webkit-backdrop-filter: blur(16px) saturate(135%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    z-index: 10000;
    padding: env(safe-area-inset-top, 0px) 1vh 0 1vh;
    height: calc(var(--footer-height) + env(safe-area-inset-top, 0px));
    min-height: calc(var(--footer-height) + env(safe-area-inset-top, 0px));
    display: flex;
    align-items: center;
    box-sizing: border-box;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .top-bar {
        background-color: var(--color-gray);
        border-bottom: none;
    }
}

/* Shared Navigation Typography */
.nav-text,
.home-body .site-title,
.home-body .info-link,
.lang-switcher,
.info-body .site-title,
.info-body .info-link,
.footer-marquee-text {
    font-size: 0.75rem;
    line-height: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.075em;
    font-variant-numeric: lining-nums tabular-nums;
    color: var(--color-black);
}

.home-body .site-title {
    text-decoration: none;
    text-underline-offset: 2px;
}

.home-body .site-title:hover {
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
}

.home-body .info-link {
    position: absolute;
    left: calc(50vw - 2px);
    text-decoration: none;
    text-underline-offset: 2px;
}

.home-body .info-link:hover {
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
}

/* Language Switcher */

.lang-switcher {
    display: inline;
    font-feature-settings: "lnum" 1, "tnum" 1, "case" 1;
    margin-left: 0.5em;
}

.lang-link {
    color: var(--color-black);
    text-decoration: none;
    transition: text-decoration var(--transition-normal);
}

.lang-link:hover {
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
}

.desktop-only {
    display: inline;
}

.mobile-only {
    display: none;
}

/* ========================================================================
   INFO PAGE
   ======================================================================== */

.info-body {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
    background-color: var(--color-white);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.info-body .site-title,
.info-body .info-link {
    text-decoration: none;
    text-underline-offset: 2px;
}

.info-body .site-title:hover,
.info-body .info-link:hover {
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
}

.info-body .info-link {
    position: absolute;
    left: calc(50vw - 2px);
}

.info-page {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: calc(var(--footer-height) + 1vh) 1vh calc(var(--footer-height) + 1vh) calc(50vw - 2px);
}

.info-page-content {
    max-width: calc(50vw - 2px - 1vh);
    width: 100%;
    text-align: left;
}

.info-page-content .intro-text {
    margin-bottom: 1vh;
}

.info-page-content .small-text>* {
    margin: 0;
    margin-bottom: 1vh;
}

.info-page-content .small-text>*:last-child {
    margin-bottom: 0;
}

.intro-text {
    font-size: 1.15rem;
    line-height: 1.5rem;
    text-align: left;
    text-wrap: pretty;
}

.small-text {
    font-size: 1.15rem;
    line-height: 1.5rem;
    text-align: left;
}

.location-mail {
    display: block;
}

.platform-links {
    display: block;
    margin-top: 0.75rem;
}

.platform-label,
.contact-label {
    font-size: 0.75rem;
    line-height: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.075em;
}

.degree-sup {
    font-size: 0.75rem;
    vertical-align: super;
    display: inline-block;
    width: 1.5em;
    text-transform: uppercase;
    line-height: 1;
}

.platform-links:has(.degree-sup) {
    line-height: 1.5rem;
}

.typeset-note {
    display: block;
    margin-top: 0;
    font-size: 0.75rem;
    line-height: 1.1rem;
}

.intro-text a,
.small-text a {
    position: relative;
    display: inline-block;
    text-decoration: none;
    color: var(--color-black);
    transition: text-decoration var(--transition-normal);
    text-underline-offset: 2px;
}

.intro-text a:hover,
.small-text a:hover {
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
}

.intro-text a:hover::selection,
.small-text a:hover::selection {
    color: #bebfc3;
}

.lining-zero {
    font-variant-numeric: lining-nums;
    font-feature-settings: "lnum" 1, "onum" 0;
}

::selection {
    color: var(--color-gray);
}

.hover-effect {
    transition: color var(--transition-normal), filter var(--transition-normal);
}

.hover-effect:hover {
    color: var(--color-gray);
    filter: blur(2.5px);
}

div {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

div::-webkit-scrollbar {
    display: none;
}

/* Exception: info page needs visible scrollbar */
.info-page-content {
    scrollbar-width: thin;
}

.info-page-content::-webkit-scrollbar {
    display: block;
    width: 4px;
}

/* ========================================================================
   FOOTER MARQUEE
   ======================================================================== */

.footer-marquee {
    position: fixed;
    bottom: 0px;
    left: 0px;
    right: 0px;
    width: 100%;
    background-color: rgba(255, 82, 0, 0.6);
    backdrop-filter: blur(16px) saturate(135%);
    -webkit-backdrop-filter: blur(16px) saturate(135%);
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    overflow: clip;
    z-index: 10000;
    padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
    height: calc(var(--footer-height) + env(safe-area-inset-bottom, 0px));
    min-height: calc(var(--footer-height) + env(safe-area-inset-bottom, 0px));
    max-height: calc(var(--footer-height) + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    display: flex;
    align-items: center;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: transform;
    contain: paint;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .footer-marquee {
        background-color: #ff5200;
        border-top: none;
    }
}

.footer-marquee-content {
    display: inline-flex;
    white-space: nowrap;
    animation: marquee 60s linear infinite;
    will-change: transform;
}

.footer-marquee-text {
    /* Shared styles via selector grouping above */
    user-select: none;
    pointer-events: none;
    font-feature-settings: "lnum" 1, "tnum" 1;
}

.footer-marquee-text .num {
    letter-spacing: 0;
}

.footer-marquee-text .emdash {
    position: relative;
    top: -1px;
    display: inline-block;
}

.footer-marquee-text a {
    color: var(--color-black);
    text-decoration: none;
    transition: text-decoration var(--transition-normal);
    text-underline-offset: 2px;
    pointer-events: auto;
    user-select: none;
}

.footer-marquee-text a:hover {
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-100%);
    }
}

/* ========================================================================
   MOBILE RESPONSIVE (≤768px)
   ======================================================================== */

@media (max-width: 768px) {
    #gallery-container {
        top: calc(var(--footer-height-mobile) + env(safe-area-inset-top, 0px) + 2.5vw);
        /* Dynamic bottom: thumbnail + info text height + padding */
        height: auto;
        bottom: calc(var(--thumbnail-height-mobile) + var(--mobile-info-height) + 2.5vw - 0.15rem);
    }

    .gallery-slide {
        align-items: center;
        padding-top: 0;
    }

    .gallery-slide img,
    .gallery-slide video {
        height: auto;
        max-height: 100%;
        width: auto;
        max-width: 100vw;
        object-fit: contain;
    }

    #project-info-bottom {
        top: auto;
        bottom: var(--thumbnail-height-mobile);
        height: auto;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        padding: 0 2.5vw;
        padding-bottom: calc(2.5vw - 0.1rem);
    }

    #project-title-bottom {
        font-size: 0.65rem;
        line-height: 0.85rem;
        font-weight: 400;
        font-style: oblique;
        white-space: nowrap;
        width: calc(50vw - 2px - 2.5vw);
        flex-shrink: 0;
    }

    #project-detail-bottom {
        display: none;
    }

    #thumbnail-strip {
        bottom: 0;
        height: var(--thumbnail-height-mobile);
    }

    .thumbnail-item {
        height: 100%;
    }

    .top-bar {
        height: calc(var(--footer-height-mobile) + env(safe-area-inset-top, 0px));
        min-height: calc(var(--footer-height-mobile) + env(safe-area-inset-top, 0px));
        padding: env(safe-area-inset-top, 0px) 2.5vw 0 2.5vw;
    }

    .home-body .site-title {
        font-size: 0.65rem;
        line-height: 0.9rem;
    }

    .home-body .info-link {
        position: absolute;
        left: auto;
        right: 2.5vw;
        font-size: 0.65rem;
        line-height: 0.9rem;
    }

    .lang-switcher {
        font-size: 0.65rem;
        line-height: 0.9rem;
        margin-left: 0.25em;
    }

    .lang-link:hover {
        text-decoration-thickness: 1px;
    }

    .desktop-only {
        display: none;
    }

    .mobile-only {
        display: inline;
    }

    .footer-marquee {
        height: var(--footer-height-mobile);
        min-height: var(--footer-height-mobile);
        padding-top: 0;
        padding-bottom: 0;
        max-width: 100vw;
        contain: strict;
    }

    .footer-marquee-text {
        font-size: 0.65rem;
        line-height: 0.9rem;
    }

    .footer-marquee-content {
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }

    /* Info page mobile */
    .info-body .info-link {
        left: auto;
        right: 2.5vw;
        font-size: 0.65rem;
        line-height: 0.9rem;
    }

    .info-body .site-title {
        font-size: 0.65rem;
        line-height: 0.9rem;
    }

    .info-page {
        padding: calc(var(--footer-height-mobile) + 2.5vw) 2.5vw calc(var(--footer-height-mobile) + 2.5vw) 2.5vw;
    }

    .info-page-content {
        max-width: 100%;
    }

    .info-page-content .small-text>*:last-child {
        margin-bottom: 0;
        padding-bottom: 0;
    }

    .info-page-content .typeset-note {
        margin-top: 0;
        margin-bottom: 0;
        padding-top: 0;
        padding-bottom: 0;
    }

    .intro-text {
        font-size: 0.95rem;
        line-height: 1.25rem;
        margin-bottom: 2vh;
    }

    .small-text {
        font-size: 0.95rem;
        line-height: 1.25rem;
    }

    .typeset-note {
        font-size: 0.65rem;
        line-height: 0.9rem;
        margin-top: 0;
    }

    .platform-label,
    .contact-label {
        font-size: 0.65rem;
        line-height: 0.85rem;
    }

    .degree-sup {
        font-size: 0.6rem;
    }

    .platform-links {
        margin-top: 0.65rem;
    }

    .platform-links:has(.degree-sup) {
        line-height: 1.25rem;
    }

    /* Mobile hover thinner underlines */
    a:hover,
    #project-info-bottom a:hover,
    .home-body .site-title:hover,
    .home-body .info-link:hover,
    .intro-text a:hover,
    .small-text a:hover,
    .footer-marquee-text a:hover {
        text-decoration-thickness: 1px;
    }
}

/* ========================================================================
   PRINT STYLES
   ======================================================================== */

@media print {

    .top-bar,
    .footer-marquee,
    #gallery-container,
    #project-info-bottom,
    #thumbnail-strip {
        display: none !important;
    }

    .info-page {
        padding: 0 !important;
        margin: 0 !important;
        height: auto !important;
        overflow: visible !important;
    }

    .info-page-content {
        max-width: 100% !important;
        width: 100% !important;
    }

    body {
        overflow: visible !important;
        background-color: #fff !important;
        color: #000 !important;
    }

    a {
        text-decoration: none !important;
        color: #000 !important;
    }
}