/* === BASE === */
body {
    background: #fbfaf7;
    -webkit-font-smoothing: antialiased;
    font-family: "Slabo 27px", "Trebuchet MS", Helvetica, Arial, sans-serif;
    font-weight: normal;
    text-rendering: optimizeLegibility;
    padding: 0;
    margin: 0;
    min-height: 100%;
}

html.hidescrollbar, html.hidescrollbar body {
    overflow: hidden;
    height: 100vh;
}

h1, h2, h3 {
    font-family: "Slabo 27px", "Trebuchet MS", Helvetica, Arial, sans-serif;
}

h2, h3 { margin-bottom: 10px; }

h4.project-sub {
    margin: 0;
    font-size: 18pt;
    color: #aaa;
}

hr {
    border: 0;
    border-bottom: 1px solid rgba(60, 54, 47, 0.14);
}

a {
    color: #6df;
    text-decoration: none;
}

a:hover { text-decoration: underline; }

strong {
    font-weight: 700;
    color: #1e1d1a;
}

.icon {
    display: inline-block;
    font-size: 1em;
    margin: 0 5px;
    opacity: 0.6;
    color: #000;
}

.icon:hover { opacity: 1.0; }

/* === HEADER === */
#headerwrap {
    margin: 0 auto;
    max-width: 2100px;
}

#header {
    margin: 0 50px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(50, 45, 38, 0.1);
}

#header #logo {
    font-size: 22pt;
    font-weight: bold;
    letter-spacing: 2px;
    color: #333;
}

#header #logo a {
    color: #333;
    text-decoration: none;
}

#header #logo-img {
    height: 36px;
    width: auto;
    display: block;
    filter: brightness(0) saturate(100%) invert(85%) sepia(10%) saturate(400%) hue-rotate(350deg) brightness(95%);
}

#header #links {
    display: inline-block;
}

#header #links a {
    margin-left: 12px;
}

/* === LOADER === */
#loader {
    display: none;
    position: fixed;
    top: 100px;
    right: 0;
    left: 0;
    bottom: 50px;
    z-index: 100;
    background: none;
}

#loader #spinner, #project-page #loading {
    position: absolute;
    top: 0; bottom: 0; left: 0; right: 0;
    margin: auto;
    border: 10px solid #fff;
    border-top: 10px solid #ccc;
    border-right: 10px solid #ccc;
    border-left: 10px solid #ccc;
    border-bottom: 10px solid rgba(255,255,255,0);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* === CONTAINER === */
#container {
    margin: 0 auto;
    padding: 0 50px;
    max-width: 2000px;
}

#content, #page-content {
    font-size: 13pt;
    line-height: 30px;
}

/* === GRID === */
:root {
    --entry-margin: 0px;
    --entry-width: calc(20% - var(--entry-margin) * 2);
    --entry-width-double: calc(40% - var(--entry-margin) * 2);
    --entry-height: calc(17% - var(--entry-margin) * 2);
    --entry-height-double: calc(34% - var(--entry-margin) * 2);
}

.grid {
    margin: 0 calc(var(--entry-margin) * 2);
    margin-bottom: 20px;
    opacity: 0;
    height: 100vh;
    overflow: hidden;
}

.project_entry {
    display: inline-block;
    vertical-align: top;
    width: var(--entry-width);
    height: 0;
    padding-bottom: var(--entry-height);
    margin: var(--entry-margin);
    overflow: hidden;
    background-color: #fff;
    position: relative;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(58, 48, 37, 0.08);
}

.grid_width2 { width: var(--entry-width-double); }
.grid_height2 { height: 0; padding-bottom: var(--entry-height-double); }

/* === PROJECT THUMBNAILS === */
.project_entry .project_thumb {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: 50% 50%;
    display: block;
    position: absolute;
    top: 0; left: 0; right: 0;
}

.project_entry .project_thumb.mini {
    background-size: 65%;
}

.project_entry .project_thumb:before {
    position: absolute;
    display: block;
    content: '';
    width: 100%;
    height: 100%;
    transition: all 0.3s ease-in-out;
}

.project_entry:hover .project_thumb:before {
    background: rgba(20, 18, 15, 0.08);
}

.project_entry .project-chip {
    position: absolute;
    left: 14px;
    bottom: 14px;
    z-index: 2;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(38, 33, 27, 0.1);
    color: #383128;
    font-size: 8.5pt;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    line-height: 1;
    opacity: 0.92;
    transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.project_entry:hover .project-chip {
    opacity: 0.35;
    transform: translateY(-1px);
}

.intro .project-chip,
.grid_width2_placeholder.intro .project-chip {
    display: none;
}

/* === HOVER CAPTION === */
.project_entry .caption {
    position: absolute;
    top: 0; bottom: 0; left: 0; right: 0;
    text-align: center;
    backface-visibility: hidden;
    background: rgba(255, 255, 255, 0.85);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease-in-out;
}

.project_entry .caption.visible-caption {
    opacity: 1;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.94) 100%);
}

.project_entry .caption.visible-caption h4,
.project_entry .caption.visible-caption p {
    visibility: visible;
    transform: translateY(0);
}

.project_entry .caption h4 {
    visibility: hidden;
    color: #000;
    font-variant: small-caps;
    position: absolute;
    bottom: 50%;
    right: 0; left: 0;
    letter-spacing: 2px;
    font-size: 15pt;
    margin: 0 10px;
    padding: 0 0 10px 0;
    transition: all 0.3s;
    transform: translateY(30pt);
    transition-timing-function: cubic-bezier(0, 0, 0, 1);
    transition-delay: 0.05s;
}

.project_entry .caption p {
    visibility: hidden;
    color: #000;
    position: absolute;
    top: 50%;
    right: 0; left: 0;
    font-style: italic;
    padding: 10px 5px;
    margin: 0 10px;
    font-size: 11pt;
    border-top: 1px solid rgba(0, 0, 0, 0.5);
    transition: all 0.3s;
    transform: translateY(40pt);
    transition-timing-function: cubic-bezier(0, 0, 0, 1);
    transition-delay: 0;
}

.grid_width2 .caption p { margin: 0 40px; }

.project_entry:hover .caption { opacity: 1; }
.project_entry:hover h4 { visibility: visible; }
.project_entry:hover p { visibility: visible; }

.project_entry:hover .caption h4 {
    transform: translateY(0);
    transition-delay: 0;
}

.project_entry:hover .caption p {
    transform: translateY(0);
    transition-delay: 0.08s;
}

/* === INTRO TILE === */
.intro {
    background: linear-gradient(145deg, #f2ece4 0%, #e4dbcf 100%) !important;
    font-size: 22pt;
    line-height: 0;
    cursor: default;
}

.intro > div:first-child {
    position: absolute;
    top: 50px;
    left: 40px;
    right: 40px;
    text-align: left;
}

.intro p { margin: 0 0 24px; }

.intro .intro-lead {
    font-size: 16pt;
    line-height: 1.5;
    max-width: 40ch;
}

.intro .intro-meta {
    font-size: 12pt;
    line-height: 1.7;
    color: #5f574d;
    text-align: justify;
}

.intro .intro-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.intro .intro-link {
    display: inline-block;
    padding: 10px 16px;
    border: 1px solid rgba(41, 35, 29, 0.18);
    border-radius: 999px;
    color: #2f2a23;
    background: rgba(255, 255, 255, 0.45);
    font-size: 11pt;
    line-height: 1.2;
    letter-spacing: 0.5px;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.intro .intro-link:hover {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(41, 35, 29, 0.32);
    text-decoration: none;
    transform: translateY(-1px);
}

.grid_width2_placeholder.intro {
    font-size: 18pt;
    line-height: 30pt;
}

/* === FILTER BUTTONS === */
#intro-filters {
    position: absolute;
    bottom: 40px;
    left: 40px;
    right: 40px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.filter-label {
    font-size: 8pt;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: rgba(41, 35, 29, 0.4);
    margin-right: 4px;
}

.filter-btn {
    display: inline-block;
    padding: 5px 13px;
    border: 1px solid rgba(41, 35, 29, 0.22);
    border-radius: 999px;
    background: transparent;
    font-size: 9pt;
    color: rgba(41, 35, 29, 0.65);
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
    font-family: inherit;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(41, 35, 29, 0.4);
    color: rgba(41, 35, 29, 0.9);
}

.filter-btn.active {
    background: rgba(41, 35, 29, 0.85);
    border-color: transparent;
    color: #fff;
}

/* === TILE DIMMING === */
.project_entry:not(.intro) {
    transition: opacity 0.25s ease, filter 0.25s ease, transform 0.25s ease;
}

.project_entry.dimmed {
    opacity: 0.08;
    filter: grayscale(100%);
    transform: scale(0.92);
}

.grid_width2_placeholder.intro p { margin: 0 auto; }
.grid_width2_placeholder.intro p.nowrap { white-space: nowrap; }
.grid_width2_placeholder.intro > div:first-child { margin: 30px; margin-top: 40px; }

/* === PROJECT PAGE (MODAL) === */
#project-page {
    width: 100%;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    display: none;
    opacity: 0;
    overflow-y: auto;
    background: #ffffff;
}

#project-page h1 { line-height: 30pt; }

#project-page.hidescrollbar { overflow-y: hidden; }
#project-page.show { display: block; }

#project-shell {
    position: relative;
    max-width: 1120px;
    margin: 0 auto;
    background: #ffffff;
    opacity: 0;
    transform: translateY(24px);
    min-height: 100vh;
}

#project-nav {
    position: sticky;
    top: 0;
    z-index: 103;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid rgba(50, 45, 38, 0.1);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 52px;
    padding: 0 52px;
}

.project-overview {
    display: flex;
    flex-wrap: wrap;
    gap: 20px 40px;
    padding: 20px 24px;
    background: #f8f7f4;
    border-radius: 6px;
    margin-bottom: 36px;
}

.project-overview-tldr {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(41, 35, 29, 0.12);
}

.project-overview-tldr .project-overview-label {
    font-size: 14pt;
    font-weight: bold;
    text-transform: none;
    letter-spacing: 0;
    color: #2f2a23;
}

.project-tldr-text {
    margin: 0;
    font-size: 12pt;
    line-height: 1.6;
    color: #2f2a23;
}

.project-overview-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.project-overview-label {
    font-size: 8.5pt;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #9a958d;
}

.project-overview-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.project-tag {
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(41, 35, 29, 0.07);
    font-size: 11.5pt;
    color: #2f2a23;
    line-height: 1.4;
}

#project-back {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 0;
    color: #2f2922;
    font-family: "Slabo 27px", "Trebuchet MS", Helvetica, Arial, sans-serif;
    font-size: 12pt;
    cursor: pointer;
    letter-spacing: 0.4px;
}

#project-back:hover {
    text-decoration: underline;
}

#project-page #page-content {
    max-width: 940px;
    position: relative;
    opacity: 0;
    margin: 0 auto;
    z-index: 1;
    padding: 52px 52px 84px;
}

#project-page #loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.projects_container a, #project-page a { color: #08c; }

/* === PROJECT DETAIL CONTENT === */
#page-content img {
    max-width: 100%;
    height: auto;
}

#page-content h1 {
    font-size: 30pt;
    margin: 0 0 14px;
    text-align: center;
    line-height: 1.2;
}

#page-content h4.project-sub {
    margin: 0 auto 42px;
    text-align: center;
    color: #9a958d;
    font-size: 17pt;
    font-weight: normal;
    max-width: 42ch;
    line-height: 1.55;
}

#page-content .project-body p {
    margin-bottom: 22px;
    line-height: 1.9;
    text-align: justify;
    text-wrap: pretty;
    color: #24211d;
}

#page-content .project-body h3 {
    font-size: 16pt;
    margin: 42px 0 12px;
    text-align: left;
    letter-spacing: 0.4px;
    color: #2a251f;
}

#page-content .project-body img {
    display: block;
    margin: 20px auto;
    border-radius: 4px;
}

#page-content .project-body figure {
    margin: 20px auto;
    display: table;
}

#page-content .project-body figure img {
    margin: 0 0 6px;
}

#page-content .project-body figcaption {
    display: table-caption;
    caption-side: bottom;
    font-size: 10pt;
    font-style: italic;
    color: #7b756d;
    line-height: 1.5;
    text-align: center;
}

/* === PAPER CALLOUT (top banner) === */
.paper-callout {
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, #eef6ff 0%, #e6f0fa 100%);
    border: 1px solid #bcd4ee;
    border-left: 4px solid #6df;
    border-radius: 6px;
    padding: 16px 20px;
    margin: 0 auto 40px;
}

.paper-callout-icon {
    font-size: 22px;
    flex-shrink: 0;
    line-height: 1;
}

.paper-callout-text {
    font-size: 10.5pt;
    color: #2a3a4a;
    line-height: 1.55;
}

.paper-callout-label {
    display: inline-block;
    font-size: 8pt;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #4a7fa8;
    margin-right: 8px;
    vertical-align: middle;
}

.paper-callout-link {
    display: inline-block;
    margin-left: 8px;
    color: #4a7fa8;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.paper-callout-link:hover {
    color: #6df;
    text-decoration: underline;
}

/* === PAPER SECTION (bottom citation block) === */
.paper-section {
    margin: 52px auto 8px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #f4f1eb 0%, #ede7de 100%);
    border: 1px solid rgba(35, 30, 26, 0.14);
    border-radius: 8px;
    text-align: center;
}

.paper-section h3 {
    margin-top: 0 !important;
    margin-bottom: 12px !important;
    font-size: 15pt !important;
    color: #2a251f !important;
}

.paper-section p {
    font-size: 10.5pt;
    color: #5a534a;
    margin-bottom: 14px !important;
}

.paper-cite {
    display: block;
    margin: 0 auto 22px;
    max-width: 58ch;
    font-size: 10pt;
    font-style: italic;
    color: #6b6359;
    border-left: 3px solid rgba(35, 30, 26, 0.18);
    padding-left: 16px;
    text-align: left;
    line-height: 1.7;
}

.paper-btn {
    display: inline-block;
    padding: 10px 24px;
    background: #2a251f;
    color: #fff;
    border-radius: 4px;
    text-decoration: none;
    font-size: 10.5pt;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: background 0.18s ease, color 0.18s ease;
}

.paper-btn:hover {
    background: #6df;
    color: #1a1612;
}

.skill-group {
    padding: 0 0 18px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(35, 30, 26, 0.12);
}

.skill-group:last-child {
    border-bottom: 0;
    margin-bottom: 0;
    padding-bottom: 0;
}

.timeline-item {
    display: grid;
    grid-template-columns: 90px 1fr;
    column-gap: 20px;
    padding: 14px 0 18px;
    border-bottom: 1px solid rgba(35, 30, 26, 0.1);
}

.timeline-item:last-child {
    border-bottom: 0;
}

.timeline-divider {
    border-top: 3px solid #c8bfb0;
    margin: 12px 0 24px;
}

.timeline-item:has(+ .timeline-divider) {
    border-bottom: 0;
}

.timeline-year {
    font-size: 11pt;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #7b756d;
    padding-top: 4px;
}

/* === FOOTER === */
#footerwrap {
    max-width: 2100px;
    margin: 0 auto;
}

#footer {
    margin-bottom: 20px;
    float: right;
    margin-right: 55px;
    font-size: 10pt;
    color: #999;
}

table {
    width: 100%;
    text-align: center;
    border-collapse: collapse;
    margin-bottom: 5px;
}

@media (max-width: 900px) {
    #header {
        margin: 0 24px;
        height: auto;
        padding: 24px 0;
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
    }

    #container {
        padding: 0 24px;
    }

    .intro {
        height: auto !important;
        padding-bottom: 0 !important;
        overflow: visible;
        display: flex;
        flex-direction: column;
    }

    .intro > div:first-child {
        position: static;
        margin: 30px 24px 0;
    }

    #intro-filters {
        position: static;
        margin: 16px 24px 30px;
    }

    #project-page #page-content {
        padding: 36px 24px 52px;
    }

    #project-shell {
        max-width: 100%;
    }

    #project-nav {
        padding: 0 24px;
    }

    .timeline-item {
        grid-template-columns: 1fr;
        row-gap: 6px;
    }


}
    #page-content .project-body img.project-image,
    #page-content .project-body video.project-image {
        max-width: 100%;
        height: auto;
    }

    #page-content .project-body img.image-right {
        float: right;
        margin: 8px 0 18px 24px;
    }

    #page-content .project-body img.image-left {
        float: left;
        margin: 8px 24px 18px 0;
    }

    #page-content .project-body figure.figure-right {
        float: right;
        margin: 8px 0 18px 24px;
    }

    #page-content .project-body figure.figure-left {
        float: left;
        margin: 8px 24px 18px 0;
    }

    #page-content .project-body img.medium,
    #page-content .project-body video.medium {
        width: 380px;
    }

    #page-content .project-body img.small,
    #page-content .project-body video.small {
        width: 220px;
    }

    #page-content .project-body img.large,
    #page-content .project-body video.large {
        width: 560px;
    }

    #page-content .project-body img.very-large,
    #page-content .project-body video.very-large {
        width: 100%;
    }

    #page-content .project-body .img-aside {
        display: flex;
        align-items: center;
        gap: 24px;
        margin-bottom: 22px;
    }

    #page-content .project-body .img-aside > img,
    #page-content .project-body .img-aside > figure {
        flex-shrink: 0;
    }

    #page-content .project-body .img-aside p {
        margin-top: 0;
        margin-bottom: 22px;
    }

    #page-content .project-body .img-aside p:last-of-type {
        margin-bottom: 0;
    }

    #page-content .project-body .wrap-block {
        overflow: hidden;
        margin-bottom: 22px;
    }

    #page-content .project-body .wrap-block p {
        margin-bottom: 0;
    }


    @media (max-width: 700px) {
        #page-content .project-body img.image-right,
        #page-content .project-body img.image-left,
        #page-content .project-body figure.figure-right,
        #page-content .project-body figure.figure-left {
            float: none;
            display: block;
            margin: 16px auto;
            width: 100% !important;
            max-width: 100%;
        }

        #page-content .project-body .img-aside {
            flex-direction: column;
        }

        #page-content .project-body .img-aside > img {
            width: 100% !important;
            max-width: 100%;
        }

        #page-content .project-body .wrap-block-side {
            grid-template-columns: 1fr;
        }

    }

    