@import url('https://fonts.googleapis.com/css2?family=Inter:wght@900&family=Space+Mono:wght@400;700&family=Playfair+Display:ital,wght@0,900;1,900&display=swap');

:root {
    --bg-color: #FAFAFC;
    --text-color: #050505;
    --accent-yellow: #B7D51A;
    --accent-red: #9F2207;
    --font-mono: 'Space Mono', monospace;
    --font-serif: 'Playfair Display', serif;
    --header-h: 21px;
    --line-weight: 0.8px;
    --grid-config: 0.5fr 1.5fr 1fr 1fr;
    /* ICON+NAME (0.5) | WIDE BUFFER (1.5) | 50% LINE | #NUM (1) | DATE (1) */
    --line-color: #C2C9D3;
}

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

html,
body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-mono);
    transition: opacity 0.8s ease, background-color 0.8s ease;
}

/* Global overflow lock on body/html only */
html,
body {
    max-width: 100vw;
    overflow-x: hidden;
}

body.intro-active {
    background-color: #000;
}

#intro-video {
    opacity: 0;
    transition: opacity 1.2s ease-in;
}

#intro-video.fade-in {
    opacity: 1;
}

/* No global html background to avoid glitches */

body.transitioning {
    opacity: 0;
}

/* Gray gradient transition overlay */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, var(--bg-color) 0%, transparent 100%);
    z-index: 20000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s ease;
}

body.transition-gray-grad::after {
    opacity: 1;
}

body.transition-gray-grad {
    pointer-events: none;
}

#intro {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: transform 1.2s cubic-bezier(0.77, 0, 0.175, 1);
    overflow: hidden;
}

#intro-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
    /* Ensure black background if video loads slowly */
}

#intro.slide-up {
    transform: translateY(-100%);
}

/* --- Truly Global Nav --- */
.global-nav {
    position: fixed;
    top: 0;
    right: 0;
    display: flex;
    height: var(--header-h);
    z-index: 9500;
}

.get-on-list {
    background: var(--accent-yellow);
    height: 100%;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    border: var(--line-weight) solid #000;
    color: #000;
    cursor: pointer;
    transition: background 0.3s ease;
}

.get-on-list:hover {
    background: #fff;
}

.menu-btn {
    background: #000;
    color: #fff;
    height: 100%;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 3px;
    cursor: pointer;
}

.menu-btn span {
    width: 14px;
    height: 1px;
    background: #fff;
}



.marquee-strip {
    position: fixed;
    bottom: 0px;
    left: 0;
    width: 100%;
    height: 28px;
    background: var(--accent-yellow);
    border-top: var(--line-weight) solid #000;
    display: flex;
    align-items: center;
    overflow: hidden;
    z-index: 8500;
    font-weight: 700;
    color: #000;
    font-size: 11px;
}

.marquee-content {
    display: flex;
    white-space: nowrap;
    animation: marquee 20s linear infinite;
}

.marquee-content span {
    padding: 0 3rem;
}

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

    to {
        transform: translateX(-50%);
    }
}

/* --- GLOBAL STATIC GRID LINES --- */
.grid-lines-v {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: var(--grid-config);
    z-index: 2000;
    pointer-events: none;
}

.grid-lines-v div {
    border-right: var(--line-weight) solid var(--line-color);
}

.grid-lines-v div:last-child {
    border-right: none;
}

.grid-line-h {
    position: fixed;
    left: 0;
    width: 100%;
    height: var(--line-weight);
    background: var(--line-color);
    z-index: 2000;
    pointer-events: none;
}

.grid-line-h.h-50 {
    top: 50%;
}

/* --- PROJECT HEADER --- */
/* --- PROJECT HEADER --- */
.project-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-h);
    background: transparent;
    border-top: var(--line-weight) solid #222222;
    z-index: 3000;
    visibility: hidden;
    cursor: pointer;
    pointer-events: auto;
}

.project-header.docked {
    background: var(--bg-color);
    border-top: var(--line-weight) solid #222222;
}

.header-cols {
    display: grid;
    grid-template-columns: var(--grid-config);
    width: 100%;
    height: 100%;
}

.header-cols>div {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    font-size: 11px;
    /* Slightly smaller font for compact look */
    text-transform: uppercase;
    color: var(--text-color);
    border-right: none;
    /* Removed to avoid double-printing over global grid */
}

/* ALIGN PROJECT NUMBER TO THE LEFT OF THE COLUMN (AFTER MIDDLE LINE) */
.header-cols>div:nth-child(3) {
    justify-content: flex-start;
}

/* PROJECT NUMBER INVERSION: Grey on background, white-ish over images */
.project-num {
    color: #8C8C8E;
    mix-blend-mode: difference;
    display: inline-block;
}

.project-header.docked .project-num {
    color: #8C8C8E;
    mix-blend-mode: difference;
}

.header-cols>div:last-child {
    border-right: none;
}

.col-icon {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    flex-shrink: 0;
}

.col-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* --- Static Center UI - Original Blur Version --- */
.static-center-ui {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2500;
    pointer-events: auto;
}

.project-label {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(25px) saturate(160%);
    -webkit-backdrop-filter: blur(25px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    color: var(--accent-red);
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    outline: none;
    z-index: 5;
}

.project-label:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.project-label:active {
    transform: scale(0.95);
}

.static-outer-circle {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    border: var(--line-weight) solid #C2C9D3;
    border-radius: 50%;
    z-index: 2400;
    pointer-events: none;
}

/* --- GALLERY ROWS --- */
.project-row {
    height: 100vh;
    width: 100%;
    position: relative;
    background: transparent;
}

.project-media-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 5;
}

.project-media-content img {
    max-width: 50%;
    max-height: 70%;
    object-fit: contain;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.15);
    z-index: 5;
}

.row-footer-info {
    position: absolute;
    bottom: 40px;
    left: 1rem;
    z-index: 2100;
}

.latest-button {
    background: #fff;
    border: var(--line-weight) solid #999;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 700;
}

@media (max-width: 768px) {
    :root {
        --grid-config: 2.2fr 0 0.4fr 0.4fr;
        /* More space for title, hide wide buffer, small num/date */
    }

    #intro-video {
        object-fit: contain;
        /* Prevent logo zooming in splash */
    }

    .project-media-content img {
        max-width: 92%;
    }

    .header-cols>div {
        padding: 0 0.4rem;
        font-size: 9px;
        /* Smaller font for tight horizontal space */
    }

    .hide-mobile {
        display: none;
    }

    .col-icon {
        width: 10px;
        height: 10px;
        margin-right: 3px;
    }

    .static-center-ui {
        width: 90px;
        height: 90px;
    }

    .static-center-ui .project-label {
        font-size: 7px;
    }

    .static-outer-circle {
        width: 280px;
        height: 280px;
    }
}

/* --- CV Page Styles --- */
.cv-page {
    background: #000;
    color: #fff;
    overflow-x: hidden;
}

.cv-page .grid-lines-v,
.cv-page .grid-line-h,
.cv-page .static-outer-circle,
.cv-page .grid-container-base {
    display: none !important;
}

.cv-container {
    padding-top: calc(var(--header-h) * 4);
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 10;
    background: #000;
}

.cv-hero {
    width: 100%;
    max-width: 1200px;
    padding: 2rem;
    margin-bottom: 4rem;
    position: relative;
}

#fluid-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.cv-label,
.cv-name,
.cv-stats {
    position: relative;
    z-index: 2;
}

.cv-label {
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 2rem;
    text-transform: uppercase;
}

.cv-name {
    font-family: 'Inter', sans-serif;
    font-weight: 900;
    font-size: clamp(4rem, 12vw, 10rem);
    line-height: 0.9;
    letter-spacing: -0.05em;
    text-transform: none;
    margin: 0;
    margin-left: -0.05em;
}

.cv-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    font-size: 1.2rem;
    font-weight: 700;
}

.cv-stats .v-line {
    width: 1.5px;
    height: 1.2rem;
    background: var(--accent-red);
}

.cv-page .static-center-ui {
    left: auto;
    right: 5%;
    transform: translateY(-50%);
}

.cv-page .project-label {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-red);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px) saturate(140%);
}

.cv-details {
    width: 100%;
    max-width: 1200px;
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 4rem;
    padding: 3rem 2rem;
    border-top: var(--line-weight) solid #333;
}

.cv-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-red);
    margin-bottom: 2rem;
    letter-spacing: 0.1em;
}

.cv-item {
    margin-bottom: 2.5rem;
    width: 100%;
}

.cv-services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    width: 100%;
}

.cv-date {
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 0.5rem;
    opacity: 0.6;
}

.cv-role {
    font-weight: 900;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.cv-desc {
    font-size: 14px;
    line-height: 1.4;
    max-width: 45ch;
    opacity: 0.7;
}

.cv-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cv-list span {
    font-weight: 900;
    font-size: 1.8rem;
}

#intro-profile {
    border-top: none !important;
    padding-top: 0 !important;
}

@media (max-width: 768px) {
    .cv-details {
        display: block !important;
        padding: 1.5rem 1rem !important;
        width: 100% !important;
    }

    .cv-section {
        display: block !important;
        width: 100% !important;
        margin-bottom: 2.5rem !important;
    }

    .cv-item {
        display: block !important;
        width: 100% !important;
        margin-bottom: 2rem !important;
    }

    .cv-name {
        font-size: clamp(2.3rem, 14vw, 4.5rem) !important;
        word-break: break-word !important;
        line-height: 0.9 !important;
    }

    .sub-role {
        font-size: 0.85rem !important;
        margin-top: -0.2rem !important;
        opacity: 0.7 !important;
    }

    .cv-role {
        font-size: 1.2rem !important;
        overflow-wrap: break-word !important;
        word-wrap: break-word !important;
        word-break: break-word !important;
        hyphens: auto !important;
        white-space: normal !important;
        max-width: 100% !important;
        display: block !important;
        line-height: 1.2 !important;
    }

    .cv-desc {
        width: 100% !important;
        max-width: 100% !important;
        font-size: 14px !important;
        line-height: 1.4 !important;
        overflow-wrap: break-word !important;
    }

    .cv-desc ul,
    .cv-desc li {
        width: 100% !important;
        word-break: break-word !important;
        white-space: normal !important;
    }

    .cv-hero {
        padding: 4rem 1rem 1rem !important;
        width: 100% !important;
    }

    #fluid-canvas {
        width: 100vw !important;
        left: 0;
    }

    .cv-services-grid {
        display: block !important;
        width: 100% !important;
    }

    .cv-stats {
        flex-wrap: wrap;
        font-size: 0.8rem;
        gap: 0.3rem;
    }

    .skills-track span {
        font-size: 1.5rem !important;
        padding: 0 1.5rem !important;
    }

    /* Fixed Button UI Move to Bottom */
    .cv-page .static-center-ui {
        width: 80px !important;
        height: 80px !important;
        top: auto !important;
        bottom: 20px !important;
        right: 20px !important;
        left: auto !important;
        transform: none !important;
    }

    .cv-page .project-label {
        width: 70px !important;
        height: 70px !important;
        font-size: 6px !important;
        padding: 0.5rem !important;
        background: rgba(255, 255, 255, 0.1) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        backdrop-filter: blur(10px) !important;
    }

    .cv-page .static-outer-circle {
        display: none !important;
    }
}

/* Skills Carousel */
.skills-carousel-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    padding: 2rem 0;
    margin-top: 1rem;
    mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
}

.skills-track {
    display: flex;
    white-space: nowrap;
    width: max-content;
    animation: scroll 15s linear infinite;
}

.skills-track span {
    font-family: inherit;
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    padding: 0 3rem;
    color: var(--text-white);
    text-transform: uppercase;
}

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

    100% {
        transform: translateX(calc(-100% / 3));
    }
}

/* Adjusting CV Section for Carousel */
.cv-section.full-width {
    grid-column: 1 / -1;
}