﻿:root {
    /* Global Colors */
    --text-primary: #121212;
    --text-secondary: #666666;
    --text-highlight: #AAAAAA;
    /* for 'Politecnico di Milano' */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F4F4F4;

    /* Typography */
    --font-sans: 'Funnel Sans', sans-serif;
}

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

html {
    scroll-behavior: smooth;
    scrollbar-gutter: stable;
    cursor: none;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.4;
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    cursor: none;
}

/* Custom Cursor */
#custom-cursor {
    position: fixed;
    width: 32px;
    height: 32px;
    background-color: transparent;
    border: 1.5px solid #FFFFFF;
    border-radius: 50%;
    pointer-events: none;
    z-index: 99999;
    transform: translate(-50%, -50%);
    transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1), height 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 1.2s ease, border 1.2s ease, backdrop-filter 1.2s ease;
    mix-blend-mode: difference;
    display: flex;
    align-items: center;
    justify-content: center;
}

#custom-cursor::after {
    content: "(OPEN)";
    font-size: 13px;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: 0.05em;
    opacity: 0;
    transition: opacity 0.2s ease 0s;
}

#custom-cursor.hovering {
    width: 90px;
    height: 90px;
    background-color: #121212;
    mix-blend-mode: normal;
    border: none;
    transform: translate(calc(-100% + 16px), -50%);
    transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0s, height 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0s, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0s, background-color 0.8s ease 0s, border 0.8s ease 0s, backdrop-filter 0.8s ease 0s;
}

#custom-cursor.hovering::after {
    opacity: 1;
    transition: opacity 0.3s ease 0.2s;
}

#custom-cursor.hovering-small {
    width: 48px;
    height: 48px;
    background-color: #FFFFFF;
    border: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    mix-blend-mode: difference;
}

a, button, .project-card, .theme-dot {
    cursor: none !important;
}

/* Typography Defaults */
a {
    color: var(--text-primary);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

a:hover {
    opacity: 0.7;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 4rem;
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--bg-primary);
    transition: background-color 0.4s ease;
}





.logo {
    font-weight: 600;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.desktop-link {
    font-weight: 600;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
    position: relative;
}

.desktop-link::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: var(--text-primary);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1); /* Slower animation */
}

.desktop-link:hover {
    opacity: 1; /* Override a:hover */
}

.desktop-link:hover::after {
    transform: scaleX(1);
}

.menu-toggle {
    display: none;
}

/* Hero Section */
.top-header {
    padding: 0.5rem 4rem 0;
    display: flex;
    flex-direction: column;
}

.hero-section {
    padding: 2rem 4rem 2rem;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 220px);
    justify-content: flex-end;
    position: relative;
    overflow: hidden;
}

.blob-canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; /* Above background, below text */
    overflow: hidden;
}

.blob-canvas-container canvas {
    display: block;
    width: 100%;
    height: 100%;
    outline: none;
    cursor: grab;
}

.blob-canvas-container canvas:active {
    cursor: grabbing;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: calc(11.6vw - 0.928rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.05em;
    margin-bottom: 0;
    white-space: nowrap;
    width: 100%;
}

.hero-bottom-area {
    display: block;
    padding-top: 2rem;
}

.hero-caption {
    font-size: clamp(1.5rem, 4vw, 4.5rem);
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: -0.04em;
    text-align: left;
    color: var(--text-primary);
    max-width: 100%;
}

.gray-text {
    color: #808285;
    transition: color 0.3s ease;
    text-decoration: none;
    cursor: none !important;
}

.gray-text:hover {
    color: #FF6433;
    opacity: 1 !important;
}

.available-link {
    color: #808285;
    transition: color 0.3s ease;
    cursor: none !important;
    text-decoration: none;
}

.available-link:hover {
    color: #FF6433;
    opacity: 1 !important;
}

.site-footer .available-link:hover {
    color: var(--text-primary);
}

/* Work Section */
.work-section {
    padding: 0 4rem 0;
}

.work-divider {
    width: 100%;
    margin-top: 5rem;
    margin-bottom: 3rem;
}

.section-line {
    border: none;
    border-top: 1px solid var(--text-primary);
    height: 0;
    background-color: transparent;
    width: 100%;
    margin-bottom: 1rem;
}

.section-label {
    font-size: 16px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    
    display: flex;
    align-items: center;
    gap: 10px;
}

.large-dot {
    display: inline-block;
    width: 13px;
    height: 13px;
    background-color: var(--text-primary);
    border-radius: 50%;
}

/* --- New Word Cloud Work Section --- */
.work-cloud-section {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* Scrolling Blurred Background (Random Scattered) */
.work-bg-blur-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.work-bg-scroller {
    width: 100%;
    height: 600vh; /* Two groups of 300vh */
    animation: vertical-marquee-up 18s linear infinite; /* Twice as fast */
}

.bg-group {
    position: relative;
    width: 100%;
    height: 300vh;
}

.bg-scroll-img {
    position: absolute;
    height: auto;
    object-fit: contain;
    opacity: 0.8; /* Make them pop a bit more since they are less blurry */
    filter: blur(10px); /* Much less blur */
}

/* Random positioning, straight and explicitly calculated to NEVER overlap */
.img-1 { top: 2%; left: 8%; width: 28vw; }
.img-2 { top: 16%; left: 65%; width: 24vw; }
.img-3 { top: 30%; left: 12%; width: 30vw; }
.img-4 { top: 44%; left: 68%; width: 26vw; }
.img-5 { top: 58%; left: 5%; width: 28vw; }
.img-6 { top: 72%; left: 62%; width: 30vw; }
.img-7 { top: 85%; left: 35%; width: 24vw; } /* Stops well before 100% to avoid overlapping img-1 of the next loop */

@keyframes vertical-marquee-up {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50%); } /* Scrolls by exactly 100vh to loop perfectly */
}

/* Word Cloud Foreground (Elisava Clone) */
.topics-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1400px;
    padding: 0 5vw;
    display: flex;
    justify-content: center;
    align-items: center;
}

.topics {
    text-align: center;
    line-height: 0.85;
    letter-spacing: -0.05em;
    display: block;
    text-transform: lowercase;
}

.topic {
    text-decoration: none;
    color: #B3B3B3; /* Inactive light gray (grigino) */
    font-weight: 800;
    font-size: clamp(3.5rem, 10vw, 8.5rem); /* All the same size */
    transition: color 0.3s ease;
    display: inline-block;
    margin: 10px 20px;
    position: relative;
}

h1.topic.page-title {
    color: var(--text-primary); /* White by default */
    margin: 10px 20px;
    cursor: default;
}

.topic:hover:not(.page-title) {
    color: #FF6433;
    opacity: 1;
}

.count {
    font-size: 0.25em;
    vertical-align: top;
    font-weight: 300;
    position: absolute;
    top: -0.1em;
    right: -1.5em;
    color: inherit; /* Inherit the color of the parent word so it fades too */
    letter-spacing: 0;
}


.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6rem;
}

.project-card:nth-child(even) {
    margin-top: 8rem;
}

.project-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    group: hover;
    align-self: start;
}

.project-card:hover {
    opacity: 1;
}

.project-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    position: relative;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, filter 0.5s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.05);
    filter: blur(8px);
}

.project-image.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.project-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.project-title {
    font-size: 1.50rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    transition: color 0.3s ease;
}

.project-card:hover .project-title {
    color: #FF6433;
}

.project-role {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* About Section */
.about-section {
    padding: 0 4rem 6rem;
}

.about-section .work-divider {
    margin-top: 7rem;
}

.about-headline {
    font-size: clamp(1.5rem, 4vw, 4.5rem);
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: -0.04em;
    text-align: left;
    color: var(--text-primary);
    margin-bottom: 5rem;
    max-width: 100%;
}

.about-headline .highlight {
    color: var(--text-highlight);
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px 40px;
    align-items: start;
}

.about-portrait {
    width: 100%;
    aspect-ratio: 1 / 1;
    min-height: 240px;
    overflow: hidden;
}

.portrait-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.about-text-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.about-label {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.about-desc {
    font-size: clamp(1rem, 1.2vw, 1.2rem);
    line-height: 1.5;
    font-weight: 600;
    letter-spacing: normal;
    color: var(--text-primary);
    margin-bottom: 2rem;
}

.resume-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 1.5rem; /* Testo più grande */
    line-height: 1;
    width: fit-content;
    margin-top: 1.5rem;
    text-decoration: none;
    position: relative;
    padding-bottom: 2px;
}

.resume-button::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    bottom: 0;
    left: 0;
    background-color: var(--text-primary);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.resume-button:hover::after {
    transform: scaleX(1);
}

.resume-button:hover {
    opacity: 1; /* Override a:hover */
    color: var(--text-primary);
}

.resume-button svg {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.resume-button:hover svg {
    transform: translateX(6px);
}

/* Contact Section */
.contact-section {
    width: 100%;
    padding: 8rem 4rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.contact-headline {
    font-size: clamp(2.5rem, 11.5vw, 12rem);
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 1;
    display: flex;
    align-items: center;
    gap: 3vw;
    flex-wrap: nowrap;
    justify-content: space-between;
    width: 100%;
}

.contact-text-left,
.contact-text-right {
    white-space: nowrap;
}

.contact-loop-link {
    flex-grow: 1;
    height: clamp(120px, 20vw, 240px);
    overflow: hidden;
    display: block;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

.contact-loop-link:hover,
.contact-loop-link:active {
    transform: rotate(-3deg);
    opacity: 1;
}

.contact-loop-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease, filter 0.5s ease;
}

.contact-loop-link:hover .contact-loop-img,
.contact-loop-link:active .contact-loop-img {
    transform: scale(1.05);
    filter: blur(8px);
}

/* Footer */
.site-footer {
    padding: 6rem 4rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.footer-top-area {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4rem;
}

.footer-right-cols {
    display: flex;
    gap: 8rem;
    /* space between pages and socials */
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-col a,
.footer-col p {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.footer-col a {
    text-decoration: none;
    position: relative;
    width: fit-content;
}

.footer-col a::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: var(--text-primary);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.footer-col a:hover {
    opacity: 1; /* Override a:hover */
}

.footer-col a:hover::after {
    transform: scaleX(1);
}

.footer-col .footer-label {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary) !important;
    margin-bottom: 0.5rem;
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.huge-name {
    font-size: clamp(2rem, 8vw, 8rem);
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 0.9;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
}

.footer-line {
    border: none;
    height: 1px;
    background-color: var(--text-primary); opacity: 0.12;
    width: 100%;
    margin: 1.5rem 0 1rem;
}

.footer-copyright-area {
    width: 100%;
    text-align: left;
}

.copyright {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Responsive */
@media (max-width: 1480px) {


    .footer-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .about-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .aim-column {
        display: none;
    }
}

@media (max-width: 768px) {
    .project-sidebar {
        display: none;
    }
    
    .project-split-layout {
        display: flex;
        flex-direction: column;
        gap: 3rem;
    }

    .mobile-section-title {
        display: block;
    }
    .navbar {
        padding: 1rem 2rem;
    }
    .desktop-link:not(.logo) {
        display: none;
    }

    .navbar.nav-open {
        background-color: var(--bg-primary);
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 3rem;
        z-index: 1000;
    }

    .navbar.nav-open .desktop-link:not(.logo) {
        display: block;
        font-size: 2.5rem;
    }

    .navbar.nav-open .menu-toggle {
        position: absolute;
        top: 1.45rem;
        right: 2rem;
    }

    .navbar.nav-open .logo {
        position: absolute;
        top: 1rem;
        left: 2rem;
    }

        .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 10px;
        background: transparent;
        border: none;
        cursor: pointer;
        position: relative;
    }
    .menu-toggle::before {
        content: "";
        position: absolute;
        top: -20px;
        right: -20px;
        bottom: -20px;
        left: -20px;
    }

        .menu-toggle span {
        width: 100%;
        height: 2px;
        background-color: var(--text-primary);
        transition: transform 0.3s ease;
    }

    .navbar.nav-open .menu-toggle span:first-child {
        transform: translateY(4px) rotate(45deg);
    }

    .navbar.nav-open .menu-toggle span:last-child {
        transform: translateY(-4px) rotate(-45deg);
    }

    .hero-section {
        padding: 2rem 2rem 2rem;
    }

    .hero-bottom-area {
        justify-content: flex-end;
        padding-right: 0;
    }

    .hero-caption {
        font-size: clamp(1.5rem, 6vw, 2.5rem);
    }
    .hero-caption .available-link {
        display: block;
    }

    .work-section {
        padding: 0 2rem 0;
    }

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

    .project-card {
        grid-column: 1 / -1 !important;
    }
    .project-card:nth-child(even) {
        margin-top: 0;
    }

    .about-section {
        padding: 0 2rem 4rem;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .about-portrait {
        max-width: 400px;
    }

    .about-headline {
        margin-bottom: 3rem;
    }



    .about-headline {
        font-size: 6vw;
        line-height: 1.05;
        margin-bottom: 3rem;
    }

    .contact-section {
    width: 100%;
        padding: 4rem 2rem;
    }

    .contact-headline {
        flex-direction: column;
        align-items: stretch;
        gap: 2rem;
    }

    .contact-text-left {
        text-align: left;
        white-space: nowrap;
    }

    .contact-text-right {
        text-align: right;
        white-space: nowrap;
    }

    .contact-loop-link {
        width: 100%;
        height: auto;
        aspect-ratio: 4 / 3;
    }

    .site-footer {
        padding: 4rem 2rem 2rem;
    }
}

/* About Page Specific Styles */
.about-hero-section {
    padding: 0rem 4rem 4rem;
}

.about-hero-title {
    font-size: clamp(4rem, 22vw, 25rem);
    font-weight: 800;
    line-height: 0.8;
    letter-spacing: -0.05em;
    margin-bottom: 3rem;
    white-space: nowrap;
    width: 100%;
}

.about-intro-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 4rem;
    align-items: start;
}

.about-intro-text {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.about-intro-text p {
    font-size: clamp(1.2rem, 2.25vw, 32px);
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.about-intro-image {
    width: 100%;
    aspect-ratio: 1 / 1.1;
    overflow: hidden;
}

.about-intro-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* CV Sections */
.cv-section {
    padding: 2rem 4rem 4rem;
    scroll-margin-top: 48px;
}

.cv-section-title {
    font-size: clamp(2.5rem, 7vw, 7rem);
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 1;
    margin-bottom: 3rem;
}

.cv-list {
    display: flex;
    flex-direction: column;
    border-top: 1px solid rgba(18, 18, 18, 0.12);
}

.cv-item {
    display: grid;
    grid-template-columns: 1.5fr 3fr 1fr;
    gap: 2rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(18, 18, 18, 0.12);
}

.cv-col-1 {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.cv-col-1 h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.cv-col-1 span {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.cv-col-2 p {
    font-size: 1.125rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text-secondary);
    max-width: 380px;
    margin: 0 auto;
}

.cv-col-3 {
    display: flex;
    justify-content: flex-end;
}

.cv-col-3 span {
    font-size: 1.125rem;
    font-weight: 600;
}

@media (max-width: 1024px) {
    .about-intro-grid {
        grid-template-columns: 1fr;
    }
        .cv-item {
        grid-template-columns: 1fr auto;
        gap: 0.25rem 1rem;
        align-items: baseline;
    }
    .cv-col-1 {
        display: contents;
    }
    .cv-col-1 h3 {
        grid-column: 1 / 2;
        grid-row: 1 / 2;
    }
    .cv-col-1 span {
        grid-column: 1 / 3;
        grid-row: 2 / 3;
    }
    .cv-col-2 {
        display: none;
    }
    .cv-col-3 {
        grid-column: 2 / 3;
        grid-row: 1 / 2;
        justify-content: flex-end;
    }
}
}

@media (max-width: 768px) {
    .project-sidebar {
        display: none;
    }
    
    .project-split-layout {
        display: flex;
        flex-direction: column;
        gap: 3rem;
    }

    .mobile-section-title {
        display: block;
    }
    .navbar {
        padding: 1rem 2rem;
    }
    .about-hero-section {
        padding: 0 2rem 2rem;
    }
    .cv-section {
        padding: 2rem 2rem;
    }
}/* --- Work Page Interactions (Topic Selected State) --- */

body.work-page {
    overflow: hidden;
    height: 100vh;
    margin: 0;
}

body.work-page.topic-selected {
    overflow-y: auto !important;
    height: auto;
}

.work-page-main {
    height: calc(100vh - 100px); /* Adjust for navbar height */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: justify-content 0.6s ease, height 0.6s ease;
}

body.work-page.topic-selected .work-page-main {
    justify-content: flex-start;
    height: auto;
    min-height: calc(100vh - 100px);
}

.work-cloud-section {
    min-height: auto;
    height: 100%;
    width: 100%;
    transition: height 0.6s cubic-bezier(0.16, 1, 0.3, 1), padding 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

body.work-page.topic-selected .work-cloud-section {
    height: auto;
    padding-top: 2rem;
    padding-bottom: 2rem;
}

body.work-page.topic-selected .work-bg-blur-container {
    animation: fade-out 0.4s ease forwards !important;
    pointer-events: none;
}

body.work-page.topic-selected .topic {
    font-size: clamp(1.5rem, 4vw, 3rem); /* Shrunk size */
    margin: 5px 10px;
}

body.work-page.topic-selected .topic.page-title {
    display: none; /* Hide the title to focus on topics */
}

/* Projects Grid Container */
.projects-grid-container {
    width: 100%;
    padding: 0 4rem 4rem;
    opacity: 1;
    transition: opacity 0.6s ease;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    margin-top: 2rem;
    padding-top: 4rem;
}


.projects-grid-container.hidden {
    opacity: 0;
    pointer-events: none;
    display: none;
}
.projects-grid-container .projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6rem;
}

.projects-grid-container .project-card {
    grid-column: span 1 !important;
}

@media (max-width: 768px) {
    .project-sidebar {
        display: none;
    }
    
    .project-split-layout {
        display: flex;
        flex-direction: column;
        gap: 3rem;
    }

    .mobile-section-title {
        display: block;
    }
    .navbar {
        padding: 1rem 2rem;
    }
    .projects-grid-container .projects-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

/* --- Page Transitions --- */
@keyframes page-enter-up {
    0% {
        opacity: 0;
        transform: translateY(100px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

main, footer, .navbar > a, .navbar > button {
    opacity: 0;
    animation: page-enter-up 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    will-change: transform, opacity;
}

@keyframes page-exit-up {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-20px);
    }
}

body.work-page.topic-selected .navbar {
    background-color: var(--bg-primary) !important;
}

/* --- Project Pages --- */
body.dark-theme {
    --bg-primary: #111111;
    --bg-secondary: #1a1a1a;
    --text-primary: #F0F0F0;
}

.project-page-main {
    padding: 2rem 4rem 4rem;
}

.project-header {
    display: flex;
    flex-direction: column;
    gap: 5rem;
    margin-bottom: 1.5rem;
}

.project-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 4rem;
}

.project-title-row .huge-name {
    font-size: clamp(4rem, 11vw, 12rem);
    font-weight: 900;
    line-height: 0.8;
    margin: 0;
    letter-spacing: -0.04em;
    flex: 1;
    overflow: visible;
    width: auto;
    padding-bottom: 0.15em;
}

.project-subtitle {
    flex: 1;
    font-size: clamp(1.2rem, 1.5vw, 1.5rem);
    max-width: 600px;
    line-height: 1.4;
    margin-bottom: clamp(0.6rem, 1.65vw, 1.8rem);
}

.project-meta strong {
    font-weight: 700;
}

.project-hero img, .project-media img, .project-hero video, .project-media video {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 4rem;
}

.project-overview {
    margin-bottom: 4rem;
}

.overview-text {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 500;
    line-height: 1.2;
    margin-top: 1rem;
}

.project-details-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 6rem;
}

.detail-col h4 {
    font-size: 0.9rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
}

.detail-col p {
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.4;
    text-wrap: balance;
}

.project-split-text {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 4rem;
}

.project-split-text p {
    font-size: clamp(1rem, 1.2vw, 1.2rem);
    line-height: 1.5;
}

.double-img {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.double-img img {
    margin-bottom: 0;
}

.other-projects {
    margin-top: 8rem;
    border-top: 1px solid var(--text-primary);
    padding-top: 4rem;
}

.other-projects .huge-name {
    font-size: clamp(3rem, 8vw, 8rem);
    margin-bottom: 4rem;
}

@media (max-width: 768px) {
    .project-sidebar {
        display: none;
    }
    
    .project-split-layout {
        display: flex;
        flex-direction: column;
        gap: 3rem;
    }

    .mobile-section-title {
        display: block;
    }
    .navbar {
        padding: 1rem 2rem;
    }
    .project-page-main {
        padding: 1rem 2rem 4rem;
    }
    .project-title-row {
        flex-direction: column;
        gap: 2rem;
        align-items: flex-start;
    }
    .project-details-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .project-split-text {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .double-img {
        grid-template-columns: 1fr;
    }
}
.projects-grid.reverse-stagger .project-card:nth-child(even) {
    margin-top: 0;
}
.projects-grid.reverse-stagger .project-card:nth-child(odd) {
    margin-top: 8rem;
}
@media (max-width: 768px) {
    .project-sidebar {
        display: none;
    }
    
    .project-split-layout {
        display: flex;
        flex-direction: column;
        gap: 3rem;
    }

    .mobile-section-title {
        display: block;
    }
    .navbar {
        padding: 1rem 2rem;
    }
    .projects-grid.reverse-stagger .project-card:nth-child(odd) {
        margin-top: 0;
    }
}


.see-all-link {
    font-size: clamp(1rem, 1.5vw, 1.5rem);
    font-weight: 700;
    text-transform: lowercase;
    text-decoration: none;
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.see-all-link:hover {
    color: #FF6433;
}
.other-projects-header .resume-button {
    margin-top: 0;
    font-size: clamp(1rem, 1.5vw, 1.5rem);
    text-transform: lowercase;
    font-weight: 700;
}
.other-projects-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: nowrap;
    margin-bottom: 4rem;
}
.other-projects-header .huge-name {
    width: auto;
    line-height: 1.1;
    margin-bottom: 0;
    padding-bottom: 0.1em;
}

@media (max-width: 768px) {
    .project-sidebar {
        display: none;
    }
    
    .project-split-layout {
        display: flex;
        flex-direction: column;
        gap: 3rem;
    }

    .mobile-section-title {
        display: block;
    }
    .navbar {
        padding: 1rem 2rem;
    }
    .other-projects-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}
.other-projects-header .huge-name {
    padding-right: 0.1em;
}

.project-meta, .detail-col h4 {
    color: #808285;
    font-weight: 500;
}
.project-page-main .section-label {
    color: var(--text-primary);
    font-weight: 500;
}
.project-meta strong {
    color: var(--text-primary);
}
.double-img {
    margin-bottom: 4rem;
}
.project-split-text {
    align-items: start;
}
.project-split-text .section-label,
.project-split-text p {
    margin-top: 0;
}




.section-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
.work-bg-blur-container {
    animation: fade-in 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes slide-bg-up {
    0% { transform: translateY(100vh); }
    100% { transform: translateY(0); }
}







/* Dark BG Slide Effect */
body.dark-theme {
    background-color: transparent !important;
}
.dark-bg-slide {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background-color: #111111;
    z-index: -1;
    animation: slide-bg-up 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes slide-bg-up {
    0% { transform: translateY(100vh); }
    100% { transform: translateY(0); }
}

@keyframes fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}










@keyframes hero-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
.top-header {
    opacity: 0;
    animation: hero-fade-in 0.8s ease forwards;
}

@keyframes hero-fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Personas Grid */
.personas-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
    margin-bottom: 6rem;
}
.persona-card {
    background-color: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
}
.persona-tag {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    display: block;
}
.persona-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}
.persona-text {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.5;
}
@media (max-width: 768px) {
    .project-sidebar {
        display: none;
    }
    
    .project-split-layout {
        display: flex;
        flex-direction: column;
        gap: 3rem;
    }

    .mobile-section-title {
        display: block;
    }
    .navbar {
        padding: 1rem 2rem;
    }
    .personas-grid {
        grid-template-columns: 1fr;
    }
}













/* Experimental Split Layout */
.project-split-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 6rem;
    align-items: start;
    margin-bottom: 8rem;
}

.project-sidebar {
    position: sticky;
    top: 120px;
}

.project-index ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.project-index a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 1rem;
    text-transform: uppercase;
    
    letter-spacing: 0.05em;
    transition: color 0.3s ease;
}

.project-index a:not(.active):hover {
    color: #FF6433 !important;
    opacity: 1 !important;
}

.project-content {
    display: flex;
    flex-direction: column;
    gap: 6rem; /* Vertical rhythm */
}

/* Override fixed margins when inside flex gap container */
.project-content .project-media,
.project-content .project-media video,
.project-content .project-media img,
.project-content .project-details-grid,
.project-content .project-split-text,
.project-content .project-overview,
.project-content .personas-grid,
.project-content .project-quote {
    margin-bottom: 0 !important;
}

/* Pull the first video closer to the details grid */
.project-content .project-details-grid {
    margin-bottom: -4rem !important;
}

/* Adjust split text to be full width since container is smaller */
.experimental-layout .project-split-text {
    grid-template-columns: 1fr;
    gap: 1rem;
}


/* Experimental Index Styles */
.project-index a {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.project-index a::before {
    content: "";
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: currentColor;
    position: absolute;
    left: -20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.project-index a.active {
    color: var(--text-primary);
}
.project-index a.active:hover {
    opacity: 1 !important;
    color: var(--text-primary) !important;
}
.project-index a.active::before {
    opacity: 1;
}

/* Fix alignment and scroll margin for experimental layout */
.experimental-layout .project-content > section {
    scroll-margin-top: 120px; /* Prevents navbar from hiding the text when clicking anchor links */
}

.experimental-layout .overview-text {
    margin-top: 0; /* Align perfectly with the sidebar index */
}



















/* Outcomes Data Table */
.outcomes-data {
    margin-top: 4rem;
    display: flex;
    flex-direction: column;
}
.data-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--text-primary);
    align-items: start;
}
.data-row:last-child {
    border-bottom: 1px solid var(--text-primary);
}
.data-question {
    font-weight: 600;
    font-size: clamp(1rem, 1.2vw, 1.1rem);
    line-height: 1.4;
}
.data-answers {
    color: var(--text-secondary);
    font-size: clamp(0.9rem, 1.1vw, 1rem);
    line-height: 1.5;
}
@media (max-width: 768px) {
    .project-sidebar {
        display: none;
    }
    
    .project-split-layout {
        display: flex;
        flex-direction: column;
        gap: 3rem;
    }

    .mobile-section-title {
        display: block;
    }
    .navbar {
        padding: 1rem 2rem;
    }
    .data-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}




/* Work Page Footer Logic */
body.topic-selected #work-page-footer,
body.topic-selected .work-page-contact {
    display: flex !important;
}





.project-meta {
    display: flex;
    gap: 1rem;
    font-size: clamp(1rem, 1.2vw, 1.1rem);
    text-transform: lowercase;
    flex-wrap: wrap;
    align-items: baseline;
}

.other-projects .projects-grid .project-card:nth-child(n+3) {
    display: none;
}














@media (max-width: 768px) {
    .project-sidebar {
        display: none;
    }
    
    .project-split-layout {
        display: flex;
        flex-direction: column;
        gap: 3rem;
    }

    .mobile-section-title {
        display: block;
    }
    .top-header {
        padding: 0.5rem 2rem 0;
    }
    .hero-title {
        font-size: calc(11.6vw - 0.464rem);
        letter-spacing: -0.06em;
    }
}




.mobile-section-title {
    display: none;
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-primary);
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    align-items: center;
    gap: 10px;
}

.mobile-section-title::before {
    content: "";
    display: block;
    width: 10px;
    height: 10px;
    flex-shrink: 0;
    border-radius: 50%;
    background-color: currentColor;
}


@media (max-width: 768px) {
    .mobile-section-title {
        display: flex !important;
    }
}





@media (max-width: 768px) {
    .about-hero-title {
        font-size: 19vw;
        letter-spacing: -0.05em;
    }
}

@media (max-width: 768px) {
    .about-intro-text p {
        font-size: 1.125rem !important;
        text-align: left;
    }
}

@media (max-width: 768px) {
    .about-hero-section {
        padding: 0 2rem 2rem !important;
    }
    .cv-section {
        padding: 2rem 2rem !important;
    }
}







@media (max-width: 768px) {
    .topics-container {
        justify-content: flex-start !important;
        padding: 0 !important;
    }
    .topics {
        text-align: left !important;
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: flex-start !important;
        gap: 35px 15px !important;
    }
    .topic {
        margin: 0 !important;
        line-height: 1 !important;
        font-size: 2.5rem !important;
        width: auto !important;
    }
    
    .count {
        font-size: 0.4em !important;
        position: relative !important;
        top: -1em !important;
        right: auto !important;
        margin-left: 0.2em !important;
    }
}





@media (max-width: 768px) {
    .img-1 { width: 55vw !important; left: 5% !important; }
    .img-2 { width: 48vw !important; left: 45% !important; }
    .img-3 { width: 60vw !important; left: 10% !important; }
    .img-4 { width: 52vw !important; left: 40% !important; }
    .img-5 { width: 55vw !important; left: -5% !important; }
    .img-6 { width: 60vw !important; left: 35% !important; }
    .img-7 { width: 48vw !important; left: 25% !important; }
}




@media (max-width: 768px) {
    .projects-grid-container {
        padding: 4rem 2rem 4rem !important;
    }
}






@media (max-width: 768px) {
    #custom-cursor {
        display: none !important;
    }
    html, body {
        cursor: auto !important;
    }
    a, button, .project-card, .theme-dot, .gray-text, .available-link {
        cursor: pointer !important;
    }
}
