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

:root {
    --primary-color: #EF4E23;
    --white: #fff;
    --text: #E7E7E7;
    --offwhite: #FFFFFF80;
    --accent-color: #BDBDBD;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: "Syne", sans-serif;
}

body {
    font-family: "Inter", sans-serif;
    font-weight: 400;
    overflow: hidden;
    background: #111;
}

/* ─── HERO ─── */
.hero {
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 0;
}

section.hero::before {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    background: radial-gradient(63.37% 63.37% at 50% 50%,
            rgba(0, 0, 0, 0.312) 0.96%,
            rgba(0, 0, 0, 0.6) 51.45%,
            rgba(4, 4, 4, 0.8) 100%);
    position: absolute;
    z-index: 9;
}

.hero img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%;
    min-height: 100%;
    object-fit: cover;
}

/* ─── LOGO ─── */
/*
 * z-index must be high enough to clear BOTH:
 *   • .overlay (z-index 300) which has will-change: clip-path
 *   • will-change creates a stacking context — children/siblings at any
 *     lower z-index get pulled into it regardless of what you set.
 * Solution: keep logo OUT of overlay in the DOM (it already is) and set
 * z-index high enough. 400 beats 300 fine as long as overlay has no
 * opacity/transform/filter set in CSS (only via GSAP inline style).
 * We also add isolation: isolate so its own stacking context is clean.
 */
.kevin-logo {
    position: fixed;
    z-index: 400;
    width: 80px;
    isolation: isolate;
    /* GSAP owns top/left/transform */
}

/* ─── LANGUAGE TOGGLE ─── */
.lang-toggle {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--white);
    font-size: 1rem;
    line-height: 1;
    opacity: 1;
    cursor: pointer;
    font-family: "Inter", sans-serif;
    white-space: nowrap;
    transition: opacity 0.45s ease;
}

.lang-toggle:hover {
    opacity: 0.7;
}

.details-wrapper {
    position: fixed;
    bottom: 2rem;
    left: 10%;
    color: var(--white);
    z-index: 999;
}

.content-wrapper .details-wrapper {
    display: none;
}

.details-wrapper p {
    font-size: 0.75rem;
    line-height: 1.2;
    font-style: italic;
    opacity: 0.4;
}

/* .overlay-open .details-wrapper {
    opacity: 0.5;
} */


/* Dim lang toggle when overlay open */
.overlay-open .lang-toggle {
    opacity: 0.5;
}

.lang-toggle svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

/* ─── CONTENT WRAPPER ─── */
.content-wrapper {
    position: fixed;
    top: 10%;
    left: 10%;
    right: 10%;
    bottom: 10%;
    z-index: 999;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.content-wrapper-left,
.content-wrapper-right {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
}

/* Vertical rule lines */
.content-wrapper-left::before {
    content: '';
    background: var(--offwhite);
    width: 1px;
    top: 0.5rem;
    bottom: 0;
    left: -2.575rem;
    position: absolute;
}

.content-wrapper-right::after {
    content: '';
    background: var(--offwhite);
    width: 1px;
    top: 0.5rem;
    bottom: 0;
    right: -2.575rem;
    position: absolute;
}

/* ─── NAV LIST ITEMS ─── */
.portfolio-list-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
    cursor: pointer;
    pointer-events: all;
    transition: opacity 0.2s ease;
}

/* Dim all nav items when overlay is open */
.overlay-open .portfolio-list-items {
    opacity: 0.5;
    /* pointer-events: none; */
}

/*
 * Active item: show ONLY the number, hide the name text.
 * The item stays in flow so spacing doesn't jump.
 * opacity stays at 0.2 to match the dimmed siblings.
 */
.overlay-open .portfolio-list-items.is-active {
    opacity: 0.5;
    /* pointer-events: none; */
}

.overlay-open .portfolio-list-items.is-active .list-name {
    opacity: 0;
    pointer-events: none;
}

/* Also hide the ripple dot on the active item */
.overlay-open .portfolio-list-items.is-active .portfolio-dot {
    opacity: 0;
}

.content-wrapper-right .portfolio-list-items {
    align-items: flex-end;
}

/* ─── DOT + RIPPLE ─── */
.portfolio-dot {
    position: absolute;
    left: -2.813rem;
    top: 50%;
    width: 0.5rem;
    height: 0.5rem;
    transform: translateY(-50%);
    transition: opacity 0.45s ease;
}

.content-wrapper-right .portfolio-dot {
    left: unset;
    right: -2.813rem;
}

.dot,
.ripple {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    transform-origin: center center;
}

.dot {
    width: 0.5rem;
    height: 0.5rem;
    background: rgb(239 78 35 / 89%);
    z-index: 3;
}

.ripple {
    /* background: rgb(239 78 35 / 9%); */
    background: rgb(239 78 35 / 18%);
    opacity: 0;
}

.ripple-1 {
    z-index: 2;
}

.ripple-2 {
    z-index: 1;
}

/* ─── NAV TEXT ─── */
.list-number {
    font-size: 0.875rem;
    color: var(--accent-color);
    line-height: 1;
    letter-spacing: 0.05em;
}

.list-name h4 {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.33;
    color: var(--white);
    text-transform: uppercase;
    transform-origin: left center;
    will-change: transform, color;
    white-space: nowrap;
    display: inline-block;
    transition: opacity 0.35s ease;
}

.content-wrapper-right .list-name h4 {
    transform-origin: right center;
}

/* ─── OVERLAY ─── */
.overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    overflow: hidden;
    pointer-events: none;
    clip-path: circle(0% at 0% 0%);
    will-change: clip-path;
}

.overlay.is-open {
    pointer-events: all;
}

.overlay-bg {
    position: absolute;
    inset: 0;
}

.overlay-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/*
 * ─── OVERLAY SCRIM ───
 * Figma reference: the overlay is heavily darkened overall.
 * The photo is barely visible — dark edges push almost to black,
 * with only a faint centre lift. Not a bright radial; a dark vignette.
 * Layer 1: solid dark base so the whole image is heavily dimmed
 * Layer 2: subtle radial that lifts just the very centre slightly
 */
.overlay-scrim {
    position: absolute;
    inset: 0;
    background:
        /* Subtle centre lift — only middle 40% gets slightly less dark */
        radial-gradient(55% 55% at 50% 50%,
            rgba(0, 0, 0, 0.45) 0%,
            rgba(0, 0, 0, 0.72) 50%,
            rgba(0, 0, 0, 0.88) 100%);
}

.overlay.content-right .overlay-scrim {
    background:
        radial-gradient(55% 55% at 50% 50%,
            rgba(0, 0, 0, 0.45) 0%,
            rgba(0, 0, 0, 0.72) 50%,
            rgba(0, 0, 0, 0.88) 100%);
}

/* ─── CONTENT PANEL ─── */
.overlay-content {
    position: absolute;
    max-width: 480px;
    opacity: 0;
    /* top / left injected per-item by GSAP */
}

/* ─── TITLE ROW ─── */
.overlay-title-row {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.overlay-title-row h2 {
    font-family: "Syne", sans-serif;
    font-size: clamp(1.4rem, 2.2vw, 2.5rem);
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1;
}

/* ─── CLOSE BUTTON ─── */
.overlay-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    flex-shrink: 0;
    transition: opacity 0.2s ease;
}

.overlay-close:hover .close-icon {
    opacity: 0.6;
}

.close-icon {
    display: block;
    width: 1.25rem;
    height: 1.25rem;
    position: relative;
    transition: opacity 0.2s ease;
}

.close-icon::before,
.close-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1.125rem;
    height: 1.5px;
    background: var(--white);
    border-radius: 1px;
}

.close-icon::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.close-icon::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* ─── BODY TEXT ─── */
.overlay-content p {
    font-size: 1rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.80);
    margin-bottom: 1.25rem;
}

/* ─── GRID LINES ─── */
.grid-lines {
    position: fixed;
    inset: 0;
    z-index: 999;
    pointer-events: none;
    opacity: 0.12;
}

.grid-lines::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(to right,
            rgba(255, 255, 255, 0.4) 0,
            rgba(255, 255, 255, 0.4) 1px,
            transparent 1px,
            transparent calc(100% / 26)),
        repeating-linear-gradient(to bottom,
            rgba(255, 255, 255, 0.4) 0,
            rgba(255, 255, 255, 0.4) 1px,
            transparent 1px,
            transparent calc(100% / 14));
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */

@media (min-width: 1920px) {

    .kevin-logo,
    .overlay-open .kevin-logo {
        width: 110px !important;
    }


    .list-name h4 {
        font-size: 1.425rem;
    }

    .overlay-content {
        max-width: 580px;
    }

    .overlay-content p {
        font-size: 1.25rem;
    }

    .close-icon::before,
    .close-icon::after {
        width: 1.525rem;
    }

    .list-number {
        font-size: 1.175rem;
    }
}

@media (max-width:1440px) {
    .overlay-content p {
        font-size: 0.875rem;
    }

    .list-name h4 {
        font-size: 1.125rem;
    }

    .list-number {
        font-size: 0.75rem;
    }
}

@media (max-width: 1280px) {
    .content-wrapper {
        left: 7%;
        right: 7%;
    }

    .content-wrapper-left::before {
        left: -2rem;
    }

    .content-wrapper-right::after {
        right: -2rem;
    }

    .portfolio-dot {
        left: -2.25rem;
    }

    .content-wrapper-right .portfolio-dot {
        right: -2.25rem;
    }

    .list-name h4 {
        font-size: 1rem;
    }

    .overlay-content {
        max-width: 420px;
    }
}

@media (max-width: 1024px) {
    .content-wrapper {
        left: 5%;
        right: 5%;
        top: 8%;
        bottom: 8%;
    }

    .content-wrapper-left::before {
        left: -1.75rem;
    }

    .content-wrapper-right::after {
        right: -1.75rem;
    }

    .portfolio-dot {
        left: -2rem;
    }

    .content-wrapper-right .portfolio-dot {
        right: -2rem;
    }

    .list-name h4 {
        font-size: 1rem;
    }

    .overlay-content {
        max-width: 380px;
    }

    .overlay-content p {
        font-size: 0.8125rem;
    }
}

@media (max-width: 768px) {

    /* ─── BODY: relative so absolute children (logo, toggle) scroll with content ─── */
    body {
        overflow-y: auto;
        overflow-x: hidden;
        position: relative;
        /* NEW: makes body the containing block for absolute children */
    }

    /* ─── LOGO: absolute so it scrolls away with the page instead of staying fixed ─── */
    .kevin-logo {
        position: absolute !important;
        /* CHANGED from fixed → scrolls with content */
        top: 1rem !important;
        left: 1rem !important;
        width: 4.5rem !important;
        transform: none !important;
    }

    /* ─── LANG TOGGLE: absolute so it scrolls away with the page instead of staying fixed ─── */
    .lang-toggle {
        position: absolute;
        /* CHANGED from fixed → scrolls with content */
        top: 2.4rem;
        right: 1.1rem;
        bottom: auto;
        left: auto;
        transform: none;
        font-size: 0.969rem;
        z-index: 1001;
    }

    /* ─── LAYOUT: single scrollable column ─── */

    /* The content-wrapper becomes a normal block that grows with content.
       Remove fixed positioning so it can scroll with the page.            */
    .content-wrapper {
        position: relative;
        /* out of fixed flow so page can scroll */
        top: auto;
        left: 0;
        right: 0;
        bottom: auto;
        width: 100%;
        min-height: 100vh;
        padding: 7rem 1.25rem 3rem 3.5rem;
        /* top clears logo+lang bar */
        display: block;
        /* single column — no flex side-by-side */
    }

    /* Left column: block, full width, natural flow */
    .content-wrapper-left {
        display: flex;
        flex-direction: column;
        gap: 2.75rem;
        margin-bottom: 2.75rem;
        position: relative;
        width: 100%;
    }

    /* Right column: same as left, flows directly below */
    .content-wrapper-right {
        display: flex;
        flex-direction: column;
        gap: 2.75rem;
        position: relative;
        width: 100%;
        align-items: flex-start;
        /* override desktop right-align */
    }

    /* Single continuous vertical line spanning BOTH columns.
       We put it on the content-wrapper itself via a pseudo-element.      */
    .content-wrapper::before {
        content: '';
        position: absolute;
        left: 1.85rem;
        /* aligns with the dots */
        top: 7rem;
        /* starts at first item */
        bottom: 3rem;
        width: 1px;
        background: var(--offwhite);
    }

    /* Hide the desktop column rules — the wrapper pseudo handles it */
    .content-wrapper-left::before,
    .content-wrapper-right::after {
        display: none;
    }

    /* ─── NAV ITEMS: natural stack, no space-between ─── */
    .portfolio-list-items {
        display: flex;
        flex-direction: column;
        gap: 0.3rem;
        padding: 1rem 0;
        position: relative;
        width: 100%;
        align-items: flex-start !important;
        cursor: pointer;
        pointer-events: all;
        transition: opacity 0.45s ease;
    }

    /* All dots on the left side of the wrapper padding */
    .portfolio-dot {
        position: absolute;
        left: -1.85rem !important;
        right: auto !important;
        top: 50%;
        width: 0.5rem;
        height: 0.5rem;
        transform: translateY(-50%);
    }

    .dot {
        width: 0.5rem;
        height: 0.5rem;
    }

    /* ─── TEXT ─── */
    .list-number {
        font-size: 0.875rem;
        line-height: 1;
        color: var(--accent-color);
    }

    .list-name h4 {
        font-size: 1rem;
        line-height: 1.5;
        white-space: nowrap;
        transform-origin: left center !important;
    }

    /* ─── DIMMING WHEN OVERLAY OPEN ─── */
    .overlay-open .portfolio-list-items {
        opacity: 0.1;
        pointer-events: none;
    }

    .overlay-open .portfolio-list-items.is-active {
        opacity: 0.15;
    }

    .overlay-open .portfolio-list-items.is-active .list-name {
        opacity: 0;
    }

    .overlay-open .portfolio-list-items.is-active .portfolio-dot {
        opacity: 0;
    }

    /* ─── OVERLAY SCRIM: much darker to match Figma ─── */
    /* Heavy top darkness where content lives, easing slightly toward bottom */
    .overlay-scrim,
    .overlay.content-right .overlay-scrim {
        /* background: linear-gradient(to bottom,
                rgba(0, 0, 0, 0.97) 0%,
                rgba(0, 0, 0, 0.95) 30%,
                rgba(0, 0, 0, 0.88) 60%,
                rgba(0, 0, 0, 0.72) 100%); */
        background:
            linear-gradient(#000000D9, #000000D9),
            radial-gradient(63.37% 63.37% at 50% 50%,
                rgba(0, 0, 0, 0.312) 0.96%,
                rgba(0, 0, 0, 0.6) 40.89%,
                rgba(4, 4, 4, 0.8) 83.56%);
    }

    /* ─── OVERLAY CONTENT: fixed, always starts near the top ─── */
    /* JS will set top to the clicked item's position via getBoundingClientRect */
    .overlay-content {
        position: fixed !important;
        left: 3.5rem !important;
        right: 1.25rem !important;
        width: auto !important;
        max-width: none !important;
        bottom: auto !important;
        top: 16% !important;
    }

    .overlay-title-row {
        margin-bottom: 0.875rem;
    }

    .overlay-title-row h2 {
        font-size: 1.15rem;
    }

    .overlay-content p {
        font-size: 0.8125rem;
        line-height: 1.65;
        margin-bottom: 0.75rem;
    }

    /* Prevent body scroll lock from blocking overlay scroll */
    .overlay-open {
        overflow: hidden;
    }

    .grid-lines {
        display: none !important;
    }

    .details-wrapper {
        display: none;
    }

    .content-wrapper .details-wrapper {
        position: relative;
        display: block;
        bottom: 0;
        left: 0;
    }

    .content-wrapper .details-wrapper p {
        opacity: 0.7;
    }
}