/* =================================================================
   FEATURED WORK — template-parts/home/featured-work/featured-work.css
   Loaded only on front page via inc/enqueue.php
   All :root vars already defined in global.css — not repeated here.
================================================================= */

.featured-title-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: clamp(20px, 4vw, 40px);
    text-align: center;
    margin-top: clamp(20px, 4vw, 40px);
    margin-bottom: clamp(30px, 6vw, 60px);
    width: 100%;
    overflow: hidden;
}

.featured-title-link {
    font-family: var(--font-primary);
    font-size: clamp(2rem, 10vw, 7rem);
    font-weight: 800;
    text-decoration: none;
    color: #C7C8CC;
    display: block;
    width: 100%;
    text-align: center;
    line-height: 0.95;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: keep-all;
    hyphens: none;
}

.featured-work {
    position: relative;
    isolation: isolate;
    min-height: auto;
    padding: 40px 0 72px;
    overflow: hidden;
    background-color: #050505;
    background-image: var(--featured-work-bg);
    background-position: center;
    background-size: cover;
}

.featured-work::before {
    z-index: -2;
    background: #050505;
}

.featured-work::after {
    z-index: -1;
    background:
        linear-gradient(90deg, rgba(0,0,0,.72), transparent 24%, transparent 76%, rgba(0,0,0,.72)),
        linear-gradient(180deg, rgba(0,0,0,.7), rgba(0,0,0,.32) 42%, rgba(0,0,0,.88));
}

.featured-work__inner {
    position: relative;
    z-index: 1;
    width: min(100%, 1280px);
    margin: 0 auto;
}

.section-kicker,
.section-heading {
    width: min(100% - 40px, 760px);
    margin: 0 auto;
    text-align: center;
    text-transform: uppercase;
}

.section-kicker {
    display: grid;
    place-items: center;
    gap: 18px;
    color: var(--muted);
}

.section-kicker p {
    position: relative;
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 8px;
}

.section-kicker p::before,
.section-kicker p::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 48px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.55));
}

.section-kicker p::before {
    right: calc(100% + 22px);
}

.section-kicker p::after {
    left: calc(100% + 14px);
    transform: rotate(180deg);
}

.reticle {
    position: relative;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(255,255,255,.34);
    border-radius: 50%;
    background: rgba(255,255,255,.04);
}

.reticle::before,
.reticle::after {
    content: "";
    position: absolute;
    inset: 50% auto auto 50%;
    width: 42px;
    height: 1px;
    background: rgba(255,255,255,.42);
    transform: translate(-50%, -50%);
}

.reticle::after {
    width: 1px;
    height: 42px;
}

.section-heading {
    margin-top: 20px;
}

.section-heading h1 {
    margin: 0;
    font-family: var(--font-primary);
    font-size: 74px;
    line-height: 0.92;
    font-weight: 800;
    letter-spacing: 0;
    text-shadow: 0 18px 48px rgba(0,0,0,.72);
}

.section-heading p {
    width: max-content;
    max-width: 100%;
    margin: 22px auto 0;
    padding: 0 20px 16px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 4px;
    border-bottom: 1px solid rgba(255,255,255,.5);
}

.portfolio-shell {
    position: relative;
    margin-top: 45px;
    overflow: hidden;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.portfolio-track {
    --card-gap: 20px;
    --card-width: clamp(235px, 16vw, 270px);
    --loop-distance: 0px;
    --loop-duration: 18s;
    display: flex;
    width: max-content;
    gap: var(--card-gap);
    will-change: transform;
    animation: portfolio-marquee var(--loop-duration) linear infinite;
    transform: translate3d(0, 0, 0);
}

.portfolio-shell:hover .portfolio-track,
.portfolio-shell:focus-within .portfolio-track {
    animation-play-state: paused;
}

@keyframes portfolio-marquee {
    from { transform: translate3d(0, 0, 0); }
    to   { transform: translate3d(calc(var(--loop-distance) * -1), 0, 0); }
}

.portfolio-fade {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 3;
    width: 8%;
    pointer-events: none;
}

.portfolio-fade--left {
    left: 0;
    background: linear-gradient(90deg, rgba(0,0,0,.84), transparent);
}

.portfolio-fade--right {
    right: 0;
    background: linear-gradient(270deg, rgba(0,0,0,.84), transparent);
}

.project-card {
    position: relative;
    flex: 0 0 var(--card-width);
    container-type: inline-size;
    min-height: 0;
    height: calc(var(--card-width) * 1.78);
    overflow: hidden;
    border: 1px solid var(--line);
    background:
        linear-gradient(180deg, rgba(255,255,255,.08), transparent 42%),
        rgba(7,7,7,.72);
    box-shadow: 0 30px 90px rgba(0,0,0,.36);
    transform: translateZ(0);
    transition:
        transform 700ms var(--cinema-ease),
        border-color 700ms var(--cinema-ease),
        box-shadow 700ms var(--cinema-ease);
}

.project-card:hover,
.project-card:focus-within {
    border-color: rgba(255,255,255,.46);
    box-shadow: 0 34px 110px rgba(0,0,0,.56), inset 0 0 0 1px rgba(255,255,255,.05);
    transform: translate3d(0, -10px, 0) scale(1.03);
    z-index: 2;
}

.project-card::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, transparent 34%, rgba(0,0,0,.2) 58%, rgba(0,0,0,.9));
}

.project-card__media {
    position: absolute;
    inset: 0;
    background: #0a0a0a;
}

.media-fallback {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.yt-embed-wrap {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: #000;
}

.yt-embed-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.project-card.is-playing .play-button {
    opacity: 0;
    pointer-events: none;
}

.media-fallback {
    background:
        linear-gradient(180deg, rgba(255,255,255,.18), transparent 42%),
        linear-gradient(135deg, var(--fallback-a), var(--fallback-b));
    filter: grayscale(1) saturate(.35) contrast(1.25) brightness(.72);
    transform: scale(1.01);
}

.media-fallback::after {
    content: attr(data-title);
    position: absolute;
    left: 26px;
    right: 26px;
    top: 132px;
    max-width: calc(100% - 52px);
    color: rgba(255,255,255,.1);
    font-family: var(--font-primary);
    font-size: clamp(26px, 12cqw, 40px);
    line-height: 0.92;
    letter-spacing: 0;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
}

.project-number {
    position: absolute;
    z-index: 2;
    top: 28px;
    left: 28px;
    color: rgba(255,255,255,.66);
    font-family: var(--font-primary);
    font-size: clamp(38px, 18cqw, 54px);
    line-height: 1;
}

.play-button {
    position: absolute;
    z-index: 4;
    top: 38%;
    left: 50%;
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    padding: 0;
    color: #fff;
    border: 1px solid rgba(255,255,255,.58);
    border-radius: 50%;
    background: rgba(0,0,0,.24);
    cursor: pointer;
    transform: translate3d(-50%, -50%, 0);
    transition:
        transform 500ms var(--cinema-ease),
        background 500ms var(--cinema-ease),
        border-color 500ms var(--cinema-ease);
}

.play-button svg {
    width: 24px;
    height: 24px;
    margin-left: 2px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.project-card:hover .play-button,
.project-card:focus-within .play-button,
.project-card.is-playing .play-button {
    border-color: rgba(255,255,255,.9);
    background: rgba(255,255,255,.12);
    transform: translate3d(-50%, -50%, 0) scale(1.12);
}

.project-card.is-playing .play-button {
    opacity: 0;
    pointer-events: none;
}

.project-card__content {
    position: absolute;
    z-index: 3;
    right: clamp(18px, 8cqw, 28px);
    bottom: clamp(20px, 8cqw, 28px);
    left: clamp(18px, 8cqw, 28px);
}

.project-card__content,
.project-number {
    transition:
        opacity 400ms var(--cinema-ease),
        transform 400ms var(--cinema-ease);
}

.project-card.is-playing .project-card__content {
    opacity: 0;
    transform: translateY(16px);
    pointer-events: none;
}

.project-card.is-playing .project-number {
    opacity: 0;
    transform: translateY(-10px);
}

.project-category,
.project-client {
    margin: 0;
}

.project-category {
    color: var(--muted);
    font-size: clamp(8.5px, 3.8cqw, 11px);
    font-weight: 600;
    letter-spacing: clamp(1.2px, .75cqw, 2.5px);
    text-transform: uppercase;
}

.project-card h2 {
    margin: 11px 0 0;
    color: #fff;
    font-family: var(--font-primary);
    font-size: clamp(20px, 10.5cqw, 32px);
    line-height: 1.04;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
}

.project-client {
    margin-top: 10px;
    color: rgba(255,255,255,.66);
    font-size: clamp(10.5px, 4.8cqw, 13px);
    line-height: 1.35;
}

.project-link,
.view-all {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
    font-size: clamp(9px, 3.8cqw, 11px);
    font-weight: 700;
    letter-spacing: clamp(1.5px, .75cqw, 2.4px);
    text-decoration: none;
    text-transform: uppercase;
}

.project-link {
    width: 100%;
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,.16);
}

.project-link svg,
.view-all svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.6;
    transition: transform 400ms var(--cinema-ease);
}

.project-link:hover svg,
.project-link:focus-visible svg,
.view-all:hover svg,
.view-all:focus-visible svg {
    transform: translate3d(3px, -3px, 0);
}

.view-all {
    width: min(280px, calc(100% - 40px));
    min-height: 62px;
    margin: 42px auto 0;
    padding: 0 28px;
    border: 1px solid rgba(255,255,255,.36);
    background: rgba(0,0,0,.28);
    backdrop-filter: blur(18px);
    transition:
        border-color 450ms var(--cinema-ease),
        background 450ms var(--cinema-ease);
}

.view-all:hover,
.view-all:focus-visible {
    border-color: rgba(255,255,255,.72);
    background: rgba(255,255,255,.06);
}

.reveal-item,
.reveal-card {
    opacity: 0;
    filter: blur(14px);
    transform: translate3d(0, 34px, 0);
}

.featured-work.is-visible .reveal-item,
.featured-work.is-visible .reveal-card {
    animation: fw-fade-up-focus 1050ms var(--cinema-ease) forwards;
}

.featured-work.is-visible .section-heading {
    animation-delay: 120ms;
}

.featured-work.is-visible .portfolio-shell {
    animation-delay: 240ms;
}

.featured-work.is-visible .view-all {
    animation-delay: 420ms;
}

.featured-work.is-visible .reveal-card {
    animation-delay: var(--reveal-delay, 0ms);
}

@keyframes fw-fade-up-focus {
    to {
        opacity: 1;
        filter: blur(0);
        transform: translate3d(0, 0, 0);
    }
}

/* ── Responsive ── */
@media (min-width: 981px) {
    .featured-work__inner {
        width: min(100%, 1100px);
    }

    .portfolio-track {
        --card-gap: clamp(18px, 1.4vw, 24px);
        --card-width: clamp(235px, 17vw, 270px);
    }

    .project-card {
        min-height: 0;
        height: calc(var(--card-width) * 1.78);
    }

    .section-heading h1 {
        font-size: clamp(74px, 6vw, 92px);
    }
}

@media (max-width: 980px) {
    .featured-work {
        padding-top: 76px;
    }

    .section-heading h1 {
        font-size: 62px;
    }

    .portfolio-track {
        --card-gap: 24px;
        --card-width: clamp(240px, 32vw, 300px);
    }

    .project-card {
        min-height: 0;
        height: calc(var(--card-width) * 1.78);
    }
}

@media (max-width: 640px) {
    .featured-title-wrap {
        padding-inline: 12px;
    }

    .featured-title-link {
        font-size: clamp(2rem, 9vw, 3.8rem);
    }

    .view-all {
        display: flex;
        margin-left: auto;
        margin-right: auto;
        width: fit-content;
        min-width: 220px;
        justify-content: center;
        gap: 12px;
    }

    .featured-work {
        padding: 64px 0 54px;
        background-position: center top;
    }

    .section-kicker,
    .section-heading {
        width: calc(100% - 32px);
    }

    .section-kicker p {
        font-size: 11px;
        letter-spacing: 5px;
    }

    .section-kicker p::before,
    .section-kicker p::after {
        width: 28px;
    }

    .section-heading h1 {
        font-size: 48px;
    }

    .section-heading p {
        font-size: 11px;
        letter-spacing: 2.8px;
    }

    .portfolio-shell {
        margin-top: 34px;
    }

    .portfolio-track {
        --card-gap: 18px;
        --card-width: min(260px, calc(100vw - 80px));
        animation-duration: 25s;
    }

    .portfolio-fade {
        width: 0%;
    }

    .project-card {
        min-height: 0;
        height: calc(var(--card-width) * 1.78);
    }

    .project-card:hover,
    .project-card:focus-within {
        transform: translate3d(0, -6px, 0) scale(1.015);
    }

    .project-card__content {
        right: 22px;
        bottom: 22px;
        left: 22px;
    }

    .project-card h2 {
        font-size: clamp(27px, 8.2vw, 34px);
        line-height: 1.04;
    }

    .media-fallback::after {
        left: 22px;
        right: 22px;
        max-width: calc(100% - 44px);
        font-size: clamp(34px, 10vw, 48px);
    }
}

@media (max-width: 380px) {
    .featured-title-link {
        font-size: clamp(1.75rem, 8.5vw, 2.2rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }

    .portfolio-track {
        animation: none;
    }

    .reveal-item,
    .reveal-card {
        opacity: 1;
        filter: none;
        transform: none;
    }
}
