/* ─────────────────────────────────────────────────
   NAVIGATION
───────────────────────────────────────────────── */

.site-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;

    @media (min-width: 48rem) {
        width: fit-content;
        margin-inline: auto;
        justify-content: center;
        gap: clamp(1.15rem, 1.6vw, 1.75rem);
        padding: 0.5rem 1.35rem 0.5rem 0.6rem;
        background: var(--color-hero-surface);
        border-radius: 999px;
        box-shadow: 0 18px 48px rgba(0, 0, 0, 0.14);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }
}

/* Logo mark */
.nav-logo {
    display: flex;
    align-items: center;

    & img {
        width: 2rem;
        height: 2rem;
        display: block;

        @media (min-width: 48rem) {
            width: clamp(2rem, 2.45vw, 2.65rem);
            height: clamp(2rem, 2.45vw, 2.65rem);
        }
    }
}

/* Desktop nav links — hidden on mobile */
.nav-links {
    display: none;

    @media (min-width: 48rem) {
        display: flex;
        align-items: center;
        gap: clamp(1.15rem, 1.6vw, 1.75rem);

        & a {
            font-family: var(--font-ui);
            font-size: clamp(0.8125rem, 0.92vw, 0.9375rem);
            font-weight: 600;
            color: var(--color-fg);
            letter-spacing: 0;
            transition: opacity var(--duration-fast) var(--ease-out);

            &:hover { opacity: 0.5; }
        }
    }
}

/* Hamburger toggle — hidden on desktop */
.nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 2.5rem;
    height: 2.5rem;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.4rem;

    & span {
        display: block;
        width: 100%;
        height: 1.5px;
        background: var(--color-fg);
        border-radius: 2px;
        transition: transform var(--duration-fast) var(--ease-out),
                    opacity var(--duration-fast) var(--ease-out);
    }

    @media (min-width: 48rem) {
        display: none;
    }
}

@media (max-width: 47.999rem) {
    .site-header .site-nav .nav-logo img {
        filter: invert(1);
    }

    .site-header .site-nav .nav-toggle span {
        background: #fff;
    }
}

/* X close button inside mobile menu */
.nav-toggle--close {
    & span:first-child {
        transform: translateY(3.25px) rotate(45deg);
    }
    & span:last-child {
        transform: translateY(-3.25px) rotate(-45deg);
    }
}


/* ─────────────────────────────────────────────────
   MOBILE MENU OVERLAY
───────────────────────────────────────────────── */

.mobile-menu {
    position: fixed;
    inset: 0;
    z-index: var(--z-menu);
    background: var(--color-bg);
    display: flex;
    flex-direction: column;
    padding: 1rem 1.25rem 2rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--duration-med) var(--ease-out);

    &.is-open {
        opacity: 1;
        pointer-events: auto;
    }
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1rem;
}

.mobile-menu-nav {
    flex: 1;
    display: flex;
    align-items: center;

    & ul {
        display: flex;
        flex-direction: column;
        gap: 0;
        width: 100%;
    }

    & a {
        display: block;
        font-family: var(--font-sans);
        font-size: clamp(2.25rem, 8vw, 3.75rem);
        font-weight: 800;
        letter-spacing: -0.02em;
        line-height: 1.1;
        color: var(--color-fg);
        padding: 0.35em 0;
        transition: opacity var(--duration-fast) var(--ease-out);

        &:hover { opacity: 0.4; }
    }
}

.mobile-menu-footer {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding-top: 1.5rem;

    & p {
        font-family: var(--font-mono);
        font-size: 0.6875rem;
        color: var(--color-muted);
    }
}


/* ─────────────────────────────────────────────────
   BUTTONS
───────────────────────────────────────────────── */

.button {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    font-family: var(--font-mono);
    font-size: clamp(0.75rem, 2.2vw, 1rem);
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.75em 1.5em;
    border-radius: 100px;
    cursor: pointer;
    touch-action: manipulation;
    transition: background var(--duration-fast) var(--ease-out),
                color var(--duration-fast) var(--ease-out),
                border-color var(--duration-fast) var(--ease-out);

    &.button--primary {
        background: #fff;
        color: #0e0e0e;

        &:hover { background: rgba(255, 255, 255, 0.82); }
        &:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
    }

    &.button--outline {
        border: 1.5px solid rgba(255, 255, 255, 0.22);
        color: #fff;
        background: rgba(255, 255, 255, 0.10);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);

        @media (min-width: 48rem) {
            border-color: rgba(255, 255, 255, 0.18);
        }

        &:hover {
            background: rgba(255, 255, 255, 0.22);
            color: #fff;
        }
        &:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
    }
}


/* ─────────────────────────────────────────────────
   SECTION LABELS
───────────────────────────────────────────────── */

.section-label,
.h2-micro {
    font-family: var(--font-mono);
    font-size: clamp(0.75rem, 1.1vw, 1rem);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--color-muted);
    margin-bottom: 0.3em;
}


/* ─────────────────────────────────────────────────
   PROJECT CARDS
───────────────────────────────────────────────── */

.project-card {
    display: block;
    padding: 1.75rem 0;
    border-top: 1px solid var(--color-border);
    cursor: pointer;

    &:last-child {
        border-bottom: 1px solid var(--color-border);
    }

    /* Media container */
    & .media {
        width: 100%;
        aspect-ratio: 16 / 9;
        overflow: hidden;
        background-color: #f2f2f2;
        background-image: conic-gradient(#e7e7e7 25%, #f2f2f2 0 50%, #e7e7e7 0 75%, #f2f2f2 0);
        background-size: 9rem 9rem;
        border-radius: 0.75rem;
        margin-bottom: 1.25rem;
        transition: transform 220ms var(--ease-out);

        & img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
            transition: transform 220ms var(--ease-out);
        }

        /* Vimeo iframe wrapper */
        & .vimeo-wrapper {
            position: relative;
            width: 100%;
            height: 100%;

            & iframe {
                position: absolute;
                inset: 0;
                width: 100%;
                height: 100%;
                border: none;
                transition: transform 220ms var(--ease-out);
            }
        }
    }

    /* Card meta: top row (label + tags) + full-width heading */
    & .card-meta {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;

        /* Row 1: project micro-label left, tags right */
        & .card-top {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: 1rem;
        }

        & .h3-micro {
            font-family: var(--font-mono);
            font-size: 0.75rem;
            font-weight: 400;
            color: var(--color-muted);
            padding-top: 0.1em;
            flex-shrink: 0;
        }

        & .tag-layout {
            display: flex;
            flex-wrap: wrap;
            gap: 0.375rem;
            justify-content: flex-end;
        }

        & .tag {
            font-family: var(--font-mono);
            font-size: 0.625rem;
            color: var(--color-muted);
            white-space: nowrap;

            @media (min-width: 48rem) {
                font-size: clamp(0.6875rem, 0.8vw, 0.8125rem);
            }
        }

        /* Row 2: heading spans full width */
        & h3 {
            font-family: var(--font-sans);
            font-size: 1rem;
            font-weight: 700;
            line-height: 1.2;
            color: var(--color-fg);

            @media (min-width: 48rem) {
                font-size: clamp(1.375rem, 2vw, 1.875rem);
            }
        }
    }

    @media (min-width: 48rem) {
        padding: 0;
        border-top: 0;

        &:last-child {
            border-bottom: 0;
        }
    }
}

.project-card-link {
    display: block;
    color: inherit;
    text-decoration: none;

    & iframe {
        pointer-events: none;
    }

    &:focus-visible {
        outline: 2px solid var(--color-fg);
        outline-offset: 0.5rem;
        border-radius: 0.75rem;
    }

    @media (min-width: 48rem) {
        & .media {
            border-radius: 1.5rem;
            margin-bottom: 1.25rem;
        }

        & .card-meta {
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto;
            column-gap: 2rem;
            row-gap: 0;
            align-items: start;
            padding-inline: clamp(2rem, 3.4vw, 3rem);
        }

        & .card-meta .card-top {
            display: contents;
        }

        & .card-meta .h3-micro {
            grid-column: 1;
            grid-row: 1;
            font-family: var(--font-sans);
            font-size: clamp(1.125rem, 1.45vw, 1.5rem);
            font-weight: 700;
            line-height: 1.05;
        }

        & .card-meta .tag-layout {
            grid-column: 2;
            grid-row: 1 / span 2;
            flex-direction: column;
            align-items: flex-end;
            gap: 0.08rem;
            padding-top: 0.1rem;
            min-width: 11rem;
            text-align: right;
        }

        & .card-meta .tag {
            font-family: var(--font-mono);
            font-size: clamp(0.6875rem, 0.8vw, 0.8125rem);
            font-weight: 400;
            line-height: 1.25;
            color: var(--color-fg);
        }

        & .card-meta h3 {
            grid-column: 1;
            grid-row: 2;
            font-size: clamp(1.375rem, 2vw, 1.875rem);
            line-height: 1.05;
            max-width: 21ch;
        }
    }
}

.project-cursor-pill {
    position: fixed;
    top: 0;
    left: 0;
    z-index: calc(var(--z-menu) + 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4em;
    min-height: clamp(2.75rem, 3.1vw, 3.25rem);
    padding: 0.75em 1.5em;
    border-radius: 100px;
    background: #f2c8ff;
    color: #000;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
    font-family: var(--font-sans);
    font-size: clamp(0.75rem, 2.2vw, 1rem);
    font-weight: 700;
    line-height: 0.95;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translate3d(var(--cursor-x, -999px), var(--cursor-y, -999px), 0) scale(0.96);
    transition: opacity var(--duration-fast) var(--ease-out);
    will-change: transform;

    &.is-visible {
        opacity: 1;
        transform: translate3d(var(--cursor-x), var(--cursor-y), 0) scale(1);
    }

    &.is-coming-soon {
        background: #fff;
    }

    & .project-cursor-pill-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 1.2em;
        height: 1.2em;
        flex-shrink: 0;

        & svg {
            display: block;
            width: 100%;
            height: 100%;
        }
    }

    & .project-cursor-pill-icon--clock {
        display: none;
    }

    &.is-coming-soon .project-cursor-pill-icon--arrow {
        display: none;
    }

    &.is-coming-soon .project-cursor-pill-icon--clock {
        display: flex;
    }
}

@media (hover: none), (pointer: coarse), (prefers-reduced-motion: reduce) {
    .project-cursor-pill {
        display: none;
    }
}

@media (hover: hover) and (pointer: fine) {
    .project-card {
        cursor: none;

        &:hover .media {
            transform: scale(0.99);
        }
    }
}


/* ─────────────────────────────────────────────────
   FOOTER
───────────────────────────────────────────────── */

.site-footer {
    background-color: var(--color-footer-bg);
    position: relative;
    overflow: hidden;
}

/* Logomark — large/centered on mobile, oversized/right on desktop */
.footer-logomark {
    display: flex;
    justify-content: center;
    order: -1;

    & img {
        width: clamp(14rem, 68vw, 20rem);
        height: auto;
        display: block;
    }

    @media (min-width: 48rem) {
        position: absolute;
        right: 2.5rem;
        bottom: 3rem;
        justify-content: flex-end;
        order: unset;

        & img {
            width: clamp(20rem, 30vw, 38rem);
            height: auto;
        }
    }

    @media (min-width: 64rem) {
        right: 3rem;
        bottom: 3.25rem;

        & img {
            width: clamp(20rem, 22vw, 23rem);
        }
    }
}

/* Footer text block */
.footer-text {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    max-width: 44rem;
}

/* Heading: label + email */
.footer-heading {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;

    & p {
        font-family: var(--font-mono);
        font-size: clamp(0.625rem, 2vw, 0.75rem);
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: 0.07em;
        color: var(--color-fg);

        @media (min-width: 48rem) {
            font-size: clamp(0.75rem, 0.9vw, 0.875rem);
        }
    }

    & .footer-email {
        font-family: var(--font-sans);
        font-size: clamp(1.375rem, 5vw, 2.5rem);
        font-weight: 700;
        line-height: 1.1;
        color: var(--color-fg);
        transition: opacity var(--duration-fast) var(--ease-out);

        &:hover { opacity: 0.6; }

        @media (min-width: 48rem) {
            font-size: clamp(2.25rem, 3.05vw, 3.5rem);
        }
    }
}

/* Mobile-only stacked links with arrows */
.footer-mobile-links {
    display: flex;
    flex-direction: column;

    @media (min-width: 48rem) {
        display: none;
    }

    & li {
        border-bottom: 1px solid rgba(0, 0, 0, 0.12);

        &:first-child { border-top: 1px solid rgba(0, 0, 0, 0.12); }

        & a {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-family: var(--font-sans);
            font-size: 1.125rem;
            font-weight: 500;
            color: var(--color-fg);
            padding: 0.875rem 0;
            transition: opacity var(--duration-fast) var(--ease-out);

            &:hover { opacity: 0.55; }
        }
    }
}

/* Desktop two-column link grid */
.footer-links {
    display: none;

    @media (min-width: 48rem) {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.35rem 5rem;
        width: fit-content;

        & a {
            font-family: var(--font-ui);
            font-size: clamp(0.8125rem, 0.9vw, 0.9375rem);
            font-weight: 400;
            color: var(--color-fg);
            padding: 0.25rem 0;
            transition: opacity var(--duration-fast) var(--ease-out);

            &:hover { opacity: 0.55; }
        }
    }
}

/* Social icon circles */
.footer-social {
    display: flex;
    flex-direction: row;
    gap: 0.625rem;

    & a {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 2.5rem;
        height: 2.5rem;
        border-radius: 50%;
        background: var(--color-fg);
        color: var(--color-footer-bg);
        transition: opacity var(--duration-fast) var(--ease-out);

        &:hover { opacity: 0.75; }
        &:focus-visible { outline: 2px solid var(--color-fg); outline-offset: 2px; }
    }

    & svg {
        width: 0.95rem;
        height: 0.95rem;
        display: block;
    }

    @media (min-width: 48rem) {
        gap: 0.45rem;

        & a {
            width: 2rem;
            height: 2rem;
        }

        & svg {
            width: 0.8rem;
            height: 0.8rem;
        }
    }
}


/* Footer bottom micro row */
.footer-micro {
    border-top: 0;
}

.footer-txt-sml {
    font-size: 1rem;
    color: var(--color-footer-muted);
    text-align: center;
    text-transform: capitalize;

    @media (min-width: 48rem) {
        font-size: clamp(0.6875rem, 0.85vw, 0.8125rem);
        text-align: left;
    }
}
