/* =========================================
   GLOBAL RESET & VARIABLES
========================================= */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    -webkit-text-size-adjust: 100%; 
    text-size-adjust: 100%; 
    letter-spacing: -0.04em;
}

:root {
    --text-base: clamp(16px, 1.2vw, 18px); 
    --line-height-base: 1.6; 
    
    --text-hero-title: clamp(32px, 3.5vw, 56px);
    --text-section-headline: clamp(24px, 3vw, 32px); 
    --color-text: #000000;
    --color-grey-placeholder: #f5f5f5;
    --color-accessible-grey: #595959; 
}

body {
    background-color: #fff;
    color: var(--color-text);
    font-family: 'JetBrains Mono', monospace; 
    font-size: var(--text-base);
    line-height: var(--line-height-base);
    width: 100vw;
    height: 100dvh;
    overflow: hidden;
}

a, button {
    color: inherit;
    text-decoration: none;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    text-transform: uppercase;
}

a:focus-visible, button:focus-visible {
    outline: 2px solid #000;
    outline-offset: 4px;
}

/* =========================================
   INDEX PAGE: THEME TRANSITION
========================================= */
body.index-page {
    background-color: #000;
    color: #fff;
    transition: background-color 0.8s ease, color 0.8s ease;
}

body.index-page.theme-white {
    background-color: #fff;
    color: #000;
}

body.index-page.theme-white .canvas-wrapper canvas {
    filter: invert(1);
}

/* =========================================
   INDEX PAGE: HEADER & NAVIGATION
========================================= */
header {
    position: fixed; top: 0; left: 0; width: 100vw; padding: 2rem;
    display: flex; justify-content: center;
    align-items: flex-start;
    z-index: 100; pointer-events: none;
}

header > * { pointer-events: auto; }

.nav-center { 
    display: flex; 
    gap: 1.5rem; 
    align-items: center; 
}

.nav-link { 
    opacity: 0.5; 
    transition: opacity 0.3s; 
    padding: 0; 
    line-height: 1; 
    display: inline-block;
    font-weight: normal; 
    letter-spacing: -0.04em; 
}

.nav-link:hover, .nav-link.active { 
    opacity: 1; 
    font-weight: normal; 
}

/* =========================================
   INDEX PAGE: MAIN SCROLLER & LAYOUT
========================================= */
.main-container {
    height: 100dvh; width: 100vw;
    overflow-y: scroll; overflow-x: hidden;
    scroll-snap-type: y mandatory; scroll-behavior: smooth;
    transition: opacity 0.5s;
}

section {
    height: 100dvh; width: 100vw;
    scroll-snap-align: start; position: relative; overflow: hidden;
}

#info-view {
    display: block; 
    position: relative;
    width: 100%;
    height: 100%;
}

.info-layout {
    width: 100%; 
    height: 100%;
    position: absolute;
    top: 0; left: 0;
    pointer-events: none;
    z-index: 10;
}

/* ANIMATED TEXT POSITIONING */
.centered-intro-text {
    position: absolute;
    top: 15%; 
    left: 50%;
    transform: translate(-50%, 0);
    text-align: center;
    width: max-content; 
    max-width: 90vw; 
    white-space: nowrap; 
    font-size: 1.1rem;
    line-height: 1.6;
    padding: 0;
    transition: top 1.5s ease-in-out, transform 1.5s ease-in-out;
}

.centered-intro-text.shift-down {
    top: 40%; 
    transform: translate(-50%, -50%);
}

.mobile-text { display: none; }
.desktop-text { display: inline; }

/* FULL SCREEN CANVAS FOR PARTICLES */
.canvas-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.scroll-hint {
    position: absolute; bottom: 2rem; left: 0; width: 100%; text-align: center;
    font-size: 0.9rem; animation: bounce 2s infinite; z-index: 20;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-5px);}
    60% {transform: translateY(-3px);}
}

/* =========================================
   INDEX PAGE: WORK SLIDER (SAFARI OPTIMIZED)
========================================= */
#work-view {
    display: flex; 
    overflow-x: scroll; 
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    contain: layout;
}

#work-view::-webkit-scrollbar { display: none; }

.project-slide {
    min-width: 100vw; 
    height: 100%; 
    scroll-snap-align: center;
    display: flex; 
    justify-content: center; 
    align-items: center; 
    position: relative;
    /* Forces dedicated compositing layer in WebKit */
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    will-change: transform;
}

.project-card { 
    width: 80%; 
    max-width: 600px; 
    cursor: pointer; 
    transition: transform 0.3s ease;
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.project-card:hover { 
    transform: scale(1.02) translate3d(0, 0, 0); 
}

.image-container {
    width: 100%; 
    height: 450px; 
    margin-bottom: 1.5rem;
    background-color: transparent; 
    border: none;
    border-radius: 12px; 
    overflow: hidden; 
    position: relative;
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
}

.image-container img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    display: block; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.15); 
    /* Prevents Safari from unloading textures */
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    will-change: transform, opacity;
}

.project-info {
    display: flex; justify-content: space-between;
    font-size: 1.0rem; text-transform: uppercase; letter-spacing: 1px;
}

.project-info .right { text-align: right; }

.work-footer {
    position: fixed; bottom: 0; left: 0; width: 100%; padding: 2rem;
    display: flex; justify-content: space-between; align-items: flex-end;
    z-index: 100; pointer-events: none; opacity: 0; transition: opacity 0.5s;
}

.work-footer.visible { opacity: 1; }
.work-footer > * { pointer-events: auto; }

.pagination {
    position: absolute; left: 50%; transform: translateX(-50%);
    display: flex; gap: 1rem;
}

.page-num { opacity: 0.3; }
.page-num.active { opacity: 1; }

/* =========================================
   PROJECT PAGE: LAYOUT & HERO
========================================= */
.project-page-body {
    overflow-y: auto; 
    overflow-x: hidden;
    height: auto;
}

.project-page-header {
    position: absolute; 
    background: transparent;
    backdrop-filter: none;
}

.project-container {
    display: flex;
    width: 100%;
    padding: 6rem 0 6rem 0; 
}

.project-sidebar {
    width: 250px;
    padding-left: 4rem; 
    flex-shrink: 0;
    position: sticky;
    top: 6rem; 
    height: fit-content;
}

.project-sidebar .back-btn {
    display: block;
    margin-bottom: 3rem;
    font-size: 0.9rem;
    opacity: 0.5;
    text-transform: uppercase;
}
.project-sidebar .back-btn:hover {
    opacity: 1;
}

.project-sidebar ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.project-sidebar a.toc-link {
    font-size: 0.9rem;
    text-transform: uppercase; 
    color: var(--color-accessible-grey);
    transition: color 0.3s;
}

.project-sidebar a.toc-link.active,
.project-sidebar a.toc-link:hover {
    color: var(--color-text);
}

.project-content-wrapper {
    flex-grow: 1;
    display: flex;
    justify-content: center; 
}

.project-content {
    width: 100%;
    max-width: 750px;
    padding-right: 4rem; 
    display: flex;
    flex-direction: column;
}

.project-title-wrapper {
    margin-bottom: 3rem; 
}

.project-hero-title {
    font-size: 3rem; 
    font-weight: normal;
    line-height: 1.2;
    text-transform: none;
    margin-bottom: 1.5rem;
}

.content-subtitle {
    font-size: 1.4rem;
    font-weight: normal;
    line-height: 1.4;
    text-transform: none;
}

.content-meta {
    display: flex;
    gap: 10rem; 
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.meta-col { display: flex; flex-direction: column; gap: 0.25rem; }
.meta-right { margin-left: auto; }
.meta-col span { text-transform: none; color: #999; } 

.project-hero {
    aspect-ratio: auto;
    margin-bottom: 2rem;
}

/* =========================================
   HERO WEB LINK
========================================= */
.hero-link-wrapper {
    margin-bottom: 4rem; 
    position: relative;
    z-index: 20; 
    display: flex;
    justify-content: flex-end; 
}

.hero-link {
    font-size: 1.25rem;
    color: #000000; 
    transition: color 0.3s ease;
    text-transform: uppercase;
    letter-spacing: -0.04em; 
    font-weight: normal;
}

.hero-link:hover {
    color: var(--color-text);
}

/* =========================================
   PROJECT PAGE: TYPOGRAPHY & SECTIONS
========================================= */
.content-section {
    display: flex;
    flex-direction: column;
    padding-top: 4rem; 
    padding-bottom: 4rem; 
    border-top: 1px solid #EAEAEA;
}

.content-section > *:last-child {
    margin-bottom: 0 !important;
}

#context-problem, #opportunity { 
    border-top: none; 
    padding-top: 6rem; 
}

#context-problem .section-headline, #opportunity .section-headline {
    margin-bottom: 2.5rem; 
}

#reflection, #outcomes-learning { padding-bottom: 0; }

.section-label {
    font-size: 0.85rem; 
    color: var(--color-accessible-grey); 
    font-weight: 700; 
    margin-bottom: 2.25rem; 
    text-transform: uppercase; 
    letter-spacing: 0.05em; 
}

.section-headline {
    font-size: var(--text-section-headline); 
    font-weight: normal;
    line-height: 1.3;
    margin-bottom: 6rem; 
    text-transform: none;
}

.content-subhead {
    font-size: var(--text-section-headline); 
    font-weight: normal;
    line-height: 1.3;
    margin-top: 4rem; 
    margin-bottom: 1rem; 
    text-transform: none;
}

.section-label + .content-subhead,
.section-headline + .content-subhead {
    margin-top: 0;
}

.content-paragraph {
    font-size: var(--text-base);
    line-height: var(--line-height-base);
    color: var(--color-text);
    margin-bottom: 1.25rem;
    text-transform: none;
}

.content-paragraph + .content-block,
.content-paragraph + .grid-2-cols {
    margin-top: 2.5rem;
}

.content-list {
    padding-left: 1.25rem;
    font-size: var(--text-base);
    line-height: var(--line-height-base);
    color: var(--color-text);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.25rem;
    text-transform: none;
}

/* =========================================
   PROJECT PAGE: BLOCKS & GRIDS
========================================= */
.content-block {
    position: relative;
    overflow: hidden;
    width: 100%;
    background-color: var(--color-grey-placeholder);
    margin-bottom: 1.25rem;
}

.placeholder-light { border: 1px solid #eaeaea; }

.content-block img, 
.content-block video {
    width: 100%; 
    height: auto; 
    display: block;
}

.stat-image img,
.vertical-feature img {
    position: absolute;
    top: 0; 
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.grid-2-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 1.25rem;
}

.feature-col {
    display: flex;
    flex-direction: column;
}

.vertical-feature {
    aspect-ratio: 400 / 465;
    margin-bottom: 0.75rem; 
}

/* Base caption: left-aligned for grids */
.caption-text {
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--color-text);
    text-transform: none;
    text-align: left;
}

/* Modifier class: center-aligned for standalone zoom hints */
.center-caption {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    display: block;
}

/* =========================================
   PROJECT PAGE: STATS & DATA
========================================= */
.insight-stats-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    margin-top: 1rem;
    margin-bottom: 2rem;
}

.stat-image { aspect-ratio: 3 / 4; margin-bottom: 0; }
.stat-content { display: flex; flex-direction: column; gap: 2rem; }

.stat-quote {
    font-size: 1.25rem;
    font-style: italic;
    line-height: 1.4;
    text-transform: none;
}

.stat-row-group {
    display: flex; flex-direction: column; gap: 1.5rem;
    border-top: 1px solid #000; padding-top: 1.5rem;
}

.stat-row { display: flex; gap: 1.5rem; align-items: flex-start; }
.stat-number { font-size: clamp(40px, 4vw, 64px); font-weight: normal; line-height: 1; }
.stat-desc { font-size: 0.9rem; line-height: 1.4; margin-top: 0.25rem; text-transform: none; }

/* =========================================
   LIGHTBOX OVERLAY (ZOOM FEATURE)
========================================= */
.zoomable img, .zoomable video { 
    cursor: zoom-in; 
}

.lightbox {
    display: none; 
    position: fixed; 
    z-index: 10000; 
    left: 0; 
    top: 0; 
    width: 100vw; 
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.95); 
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    justify-content: center; 
    align-items: center; 
    cursor: zoom-out;
    opacity: 0; 
    transition: opacity 0.3s ease;
}

.lightbox.active { 
    display: flex; 
    opacity: 1; 
}

.lightbox img { 
    max-width: 90%; 
    max-height: 90vh; 
    border-radius: 8px; 
    box-shadow: 0 20px 50px rgba(0,0,0,0.15); 
    object-fit: contain; 
}

.lightbox-close { 
    position: absolute; 
    top: 2rem; 
    right: 3rem; 
    font-size: 3rem; 
    font-weight: 300; 
    color: #000; 
    cursor: pointer; 
    line-height: 1; 
    background: transparent;
    border: none;
}

/* =========================================
   MOBILE MENU OVERLAY
========================================= */
.desktop-nav { display: flex; gap: 1.5rem; }
.mobile-nav { display: none; }

.mobile-menu-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(255, 255, 255, 0.98); 
    backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
    z-index: 9999; display: flex; flex-direction: column;
    justify-content: center; align-items: center; gap: 2rem;
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active { 
    opacity: 1; pointer-events: auto; 
}

.close-menu-btn {
    position: absolute; top: 2rem; left: 50%; transform: translateX(-50%);
    font-size: 1rem; color: #000; z-index: 10000;
}

.mobile-menu-links {
    display: flex; flex-direction: column; gap: 2.5rem; text-align: center;
}

.mobile-menu-links a {
    font-size: 1.5rem; text-transform: uppercase; color: #000;
}

/* =========================================
   BACK TO TOP BUTTON
========================================= */
.back-to-top-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    padding-top: 4rem;
    padding-bottom: 2rem;
}

.back-to-top-btn {
    font-size: 0.9rem;
    color: var(--color-accessible-grey);
    transition: color 0.3s ease;
    text-transform: uppercase;
    letter-spacing: -0.04em; 
    font-weight: normal; 
}

.back-to-top-btn:hover {
    color: var(--color-text);
}

/* =========================================
   MOBILE RESPONSIVE ADJUSTMENTS
========================================= */
@media (max-width: 900px) {
    header { padding: 1.5rem; }
    
    .mobile-text { display: inline; }
    .desktop-text { display: none; }

    .centered-intro-text {
        /* Dynamically scales text based on screen width so it never gets cut off */
        font-size: clamp(0.65rem, 3.2vw, 0.9rem);
        width: 100%;
        /* FORCES the text to stay on exactly 3 lines by strictly obeying your <br> tags */
        white-space: nowrap; 
        top: 72%; 
        padding: 0; /* Removes padding to give the text the maximum possible width */
    }

    .centered-intro-text.shift-down {
        top: 55%; /* Slides UP to sit directly below the smaller name */
        transform: translate(-50%, 0);
    }

    .desktop-nav { display: none !important;}
    .mobile-nav { display: flex !important;}
    
    .scroll-hint { bottom: 2.5rem; }
    
    .project-slide { padding-bottom: 3rem; }
    .project-card { width: 85%; }
    .image-container { height: auto; aspect-ratio: 1 / 1; margin-bottom: 1.5rem !important; }
    .project-info { display: flex !important; width: 100%; font-size: 0.75rem;} 
    .work-footer { padding: 1.5rem 2rem; align-items: flex-end; }
    .work-footer .pagination { position: absolute; left: 50%; transform: translateX(-50%); bottom: 2rem; width: auto; justify-content: center; gap: 0.8rem; font-size: 0.9rem; }

    .work-footer .btm-left,
    .work-footer .btm-right {
        display: none !important;
    }

    .project-hero { aspect-ratio: 4 / 5; }
    .project-hero img { height: 100%; object-fit: cover; }

    .project-container {
        flex-direction: column;
        padding: 6rem 1.5rem 2rem 1.5rem;
        gap: 2rem;
    }
    
    .project-sidebar { display: none !important; }
    .project-content { padding-right: 0; }

    .grid-2-cols, .insight-stats-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .content-meta {
        flex-direction: column;
        gap: 1.5rem;
    }
    .meta-right { margin-left: 0; }
}