/* work-coverflow.css — "Selected Projects" rebuilt as a 3D coverflow.
   Replaces the old 730vh scroll-jacked .cinema (WorkShowcase JS bails when it
   finds no .cinema-cover, so no JS conflict). This section is NOT pinned: the
   coverflow is driven by drag / click / arrows / rail / horizontal-wheel, so it
   never fights Lenis or ScrollTrigger. All classes are namespaced .cf-* . */

/* ── Scroll-locked pin: a tall section with a sticky viewport. Vertical scroll
   through it drives the coverflow automatically (JS maps scroll progress →
   panel position). Unclipped (the old portal circle is gone). ─────────────── */
.section-work-showcase {
    height: 520vh !important;
    min-height: 0 !important;
    overflow: clip;
}
.section-work-showcase::after { display: none !important; }
.work-showcase-viewport {
    position: sticky !important;
    top: 0 !important;
    height: 100vh !important;
    min-height: 0 !important;
    clip-path: none !important;
    overflow: hidden;
    will-change: auto;
}
@media (max-width: 860px) {
    .section-work-showcase { height: 440vh !important; }
}

/* ── Root ────────────────────────────────────────────────────────────────── */
.cf {
    --accent: #5e7099;
    --accent-deep: #1b2233;
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(290px, 33%) 1fr;
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
        "head head"
        "info stage"
        "rail rail";
    column-gap: clamp(1.5rem, 4vw, 4.5rem);
    row-gap: clamp(1.2rem, 3vh, 2.4rem);
    padding: clamp(4.5rem, 10vh, 7.5rem) clamp(1.5rem, 6vw, 5.5rem) clamp(2.5rem, 6vh, 4rem);
    overflow: hidden;
    background:
        radial-gradient(ellipse 70% 55% at 50% 32%, color-mix(in oklab, var(--accent) 16%, transparent) 0%, transparent 60%),
        radial-gradient(ellipse 120% 80% at 50% 120%, color-mix(in oklab, var(--accent-deep) 40%, transparent) 0%, transparent 60%),
        linear-gradient(170deg, #0c0c10 0%, #08080b 70%, #060608 100%);
    color: var(--paper, #f4ead0);
    transition: background 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    isolation: isolate;
}
.cf::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(ellipse 80% 60% at 50% 50%, transparent 40%, rgba(0, 0, 0, 0.5) 100%);
}

/* ── Head: eyebrow + github ─────────────────────────────────────────────── */
.cf-head {
    position: relative;
    z-index: 4;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.cf-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--accent) 55%, #fff);
}
.cf-eyebrow-num { color: rgba(244, 234, 208, 0.45); }
.cf-eyebrow-rule { width: clamp(1.6rem, 4vw, 3rem); height: 1px; background: currentColor; opacity: 0.45; }
.cf-head .cf-gh {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.5rem 0.95rem;
    border: 1px solid rgba(244, 234, 208, 0.14);
    border-radius: 999px;
    font-family: var(--font-mono, monospace);
    font-size: 0.6rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(244, 234, 208, 0.66);
    text-decoration: none;
    transition: border-color 0.3s, color 0.3s, transform 0.3s;
}
.cf-head .cf-gh:hover { border-color: color-mix(in srgb, var(--accent) 60%, transparent); color: var(--paper); transform: translateY(-1px); }
.cf-head .cf-gh svg { width: 14px; height: 14px; }
.cf-head .cf-gh .cf-gh-arrow { transition: transform 0.3s; }
.cf-head .cf-gh:hover .cf-gh-arrow { transform: translateX(3px); }

/* ── 3D stage ───────────────────────────────────────────────────────────── */
.cf-stage {
    position: relative;
    z-index: 2;
    align-self: center;
    width: 100%;
    height: clamp(250px, 43vh, 470px);
    perspective: 1900px;
    perspective-origin: 50% 46%;
    touch-action: pan-y;
    cursor: grab;
}
.cf-stage.is-dragging { cursor: grabbing; }
.cf-track {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
}

/* Each panel is centred; JS sets its per-frame transform inline. */
.cf-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    width: clamp(280px, 46vw, 760px);
    aspect-ratio: 16 / 10.5;
    margin: 0;
    border-radius: 14px;
    overflow: hidden;
    background: #0a0a0f;
    transform: translate(-50%, -50%);
    transform-style: preserve-3d;
    will-change: transform, opacity;
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.7s ease, box-shadow 0.7s ease;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.07),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 40px 80px -34px rgba(0, 0, 0, 0.85);
    backface-visibility: hidden;
}
.cf-panel.is-center {
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--p-accent) 38%, rgba(255, 255, 255, 0.1)),
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 30px 60px -30px color-mix(in oklab, var(--p-accent) 55%, #000),
        0 70px 150px -40px rgba(0, 0, 0, 0.9);
    cursor: pointer;
}
.cf-panel:not(.is-center) { cursor: pointer; }

/* Screens — several shots per project; the centred panel cross-fades through
   them as you scroll (driven by work-coverflow.js). */
.cf-screens { position: absolute; inset: 0; }
.cf-screen {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    opacity: 0;
    transition: opacity 0.7s ease;
    filter: saturate(0.96) contrast(1.03);
}
.cf-screen.is-on { opacity: 1; }
.cf-art { background-size: cover; background-position: center; }
.cf-art-1 { background:
    radial-gradient(ellipse 95% 75% at 72% 24%, color-mix(in oklab, var(--p-accent) 52%, transparent) 0%, transparent 62%),
    radial-gradient(ellipse 80% 65% at 18% 92%, color-mix(in oklab, var(--p-accent-deep) 84%, transparent) 0%, transparent 58%),
    linear-gradient(140deg, var(--p-accent-deep) 0%, #07060a 92%); }
.cf-art-2 { background:
    radial-gradient(ellipse 80% 80% at 24% 30%, color-mix(in oklab, var(--p-accent) 56%, transparent) 0%, transparent 60%),
    radial-gradient(ellipse 90% 70% at 88% 82%, color-mix(in oklab, var(--p-accent-deep) 74%, transparent) 0%, transparent 58%),
    linear-gradient(200deg, var(--p-accent-deep) 0%, #08070b 90%); }
.cf-art-3 { background:
    conic-gradient(from 220deg at 60% 40%, color-mix(in oklab, var(--p-accent) 44%, transparent) 0deg, transparent 120deg, color-mix(in oklab, var(--p-accent-deep) 64%, transparent) 260deg, transparent 360deg),
    linear-gradient(160deg, var(--p-accent-deep) 0%, #06060a 94%); }
.cf-art-4 { background:
    radial-gradient(ellipse 85% 65% at 82% 60%, color-mix(in oklab, var(--p-accent) 50%, transparent) 0%, transparent 60%),
    radial-gradient(ellipse 60% 70% at 12% 22%, color-mix(in oklab, var(--p-accent-deep) 68%, transparent) 0%, transparent 56%),
    linear-gradient(245deg, var(--p-accent-deep) 0%, #08070b 92%); }
.cf-panel-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.5) 26%, rgba(0, 0, 0, 0.12) 50%, transparent 68%),
        linear-gradient(to right, rgba(0, 0, 0, 0.5) 0%, transparent 42%);
}
.cf-panel-glass {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(133deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.02) 16%, transparent 36%);
}
.cf-panel-letter {
    position: absolute;
    right: -0.06em;
    bottom: -0.28em;
    font-family: var(--font-serif, Georgia, serif);
    font-style: italic;
    font-weight: 200;
    font-size: clamp(9rem, 22vw, 20rem);
    line-height: 0.7;
    color: rgba(255, 255, 255, 0.06);
    pointer-events: none;
    user-select: none;
}
.cf-panel-head {
    position: absolute;
    left: clamp(1.1rem, 2.4vw, 2.2rem);
    bottom: clamp(1rem, 2.4vw, 1.9rem);
    right: clamp(1.1rem, 2.4vw, 2.2rem);
    z-index: 2;
}
.cf-panel-kind {
    display: block;
    font-family: var(--font-mono, monospace);
    font-size: clamp(0.5rem, 0.72vw, 0.64rem);
    font-weight: 500;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--p-accent) 60%, #fff);
    margin-bottom: 0.55rem;
}
.cf-panel-title {
    margin: 0;
    font-family: var(--font-serif, Georgia, serif);
    font-weight: 200;
    font-size: clamp(1.6rem, 3vw, 3rem);
    line-height: 0.94;
    letter-spacing: -0.035em;
    color: #fff;
    text-shadow: 0 2px 22px rgba(0, 0, 0, 0.6);
}
.cf-panel-title span {
    display: block;
    margin-top: 0.18em;
    font-size: 0.42em;
    font-style: italic;
    letter-spacing: 0;
    color: rgba(244, 234, 208, 0.7);
}
.cf-panel-status {
    position: absolute;
    top: clamp(0.9rem, 2vw, 1.5rem);
    right: clamp(0.9rem, 2vw, 1.5rem);
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-mono, monospace);
    font-size: 0.54rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(244, 234, 208, 0.72);
}
.cf-panel-status::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--p-accent) 70%, #fff);
    box-shadow: 0 0 8px color-mix(in srgb, var(--p-accent) 80%, transparent);
}
/* Side panels are dimmed so the centre reads as the focus. */
.cf-panel:not(.is-center) .cf-panel-head,
.cf-panel:not(.is-center) .cf-panel-status { opacity: 0; transition: opacity 0.4s ease; }
.cf-panel:not(.is-center)::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 3;
    background: rgba(6, 6, 10, 0.26);
    transition: background 0.6s ease;
}

/* ── Prev / next — removed for a cleaner surface (scroll + dots navigate). ── */
.cf-nav { display: none !important; }
.cf-nav-legacy {
    position: absolute;
    top: 50%;
    z-index: 6;
    width: clamp(42px, 4vw, 56px);
    height: clamp(42px, 4vw, 56px);
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    border: 1px solid rgba(244, 234, 208, 0.16);
    border-radius: 50%;
    background: rgba(10, 10, 14, 0.5);
    backdrop-filter: blur(6px);
    color: var(--paper, #f4ead0);
    cursor: pointer;
    transition: border-color 0.3s, background 0.3s, transform 0.25s;
}
.cf-nav:hover { border-color: color-mix(in srgb, var(--accent) 60%, transparent); background: rgba(14, 14, 20, 0.7); }
.cf-nav:active { transform: translateY(-50%) scale(0.94); }
.cf-nav:disabled { opacity: 0.28; pointer-events: none; }
.cf-nav svg { width: 22px; height: 22px; }
.cf-prev { left: clamp(0.4rem, 2vw, 1.6rem); }
.cf-next { right: clamp(0.4rem, 2vw, 1.6rem); }

/* ── Detail strip for the centred project ───────────────────────────────── */
.cf-detail {
    position: relative;
    z-index: 4;
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(2rem, 6vw, 5rem);
    max-width: 1180px;
    width: 100%;
    margin: 0 auto;
}
/* Panel carries only the title overlay; the kind/eyebrow lives in the detail
   strip below so the image stays clean. */
.cf-panel-kind { display: none; }

.cf-detail-main { position: relative; min-width: 0; padding-top: 1.25rem; }
.cf-detail-main::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 2.6rem;
    height: 2px;
    background: var(--accent);
    opacity: 0.85;
    transition: background 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.cf-detail-kind {
    display: block;
    font-family: var(--font-mono, monospace);
    font-size: 0.6rem;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--accent) 60%, #fff);
    margin-bottom: 0.6rem;
}
.cf-detail-lead {
    margin: 0;
    font-family: var(--font-serif, Georgia, serif);
    font-style: italic;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.05vw, 1.05rem);
    line-height: 1.7;
    color: rgba(244, 234, 208, 0.82);
    max-width: 46ch;
    text-wrap: pretty;
}
.cf-detail-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    gap: 1.4rem;
}
.cf-detail-metric { display: flex; align-items: baseline; gap: 0.8rem; }
.cf-detail-metric-num {
    font-family: var(--font-serif, Georgia, serif);
    font-weight: 200;
    font-size: clamp(2.4rem, 4.5vw, 4rem);
    line-height: 0.9;
    letter-spacing: -0.03em;
    color: #fff;
}
.cf-detail-metric-label {
    font-family: var(--font-mono, monospace);
    font-size: 0.58rem;
    line-height: 1.6;
    letter-spacing: 0.06em;
    color: rgba(244, 234, 208, 0.5);
    text-transform: uppercase;
}
.cf-detail-meta {
    font-family: var(--font-mono, monospace);
    font-size: 0.58rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(244, 234, 208, 0.42);
}
.cf-cta {
    display: inline-flex;
    align-items: center;
    gap: 1.1rem;
    padding: 0.55rem 0.6rem 0.55rem 1.7rem;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--accent) 45%, rgba(244, 234, 208, 0.2));
    background: color-mix(in srgb, var(--accent) 13%, transparent);
    color: var(--paper, #f4ead0);
    font-family: var(--font-mono, monospace);
    font-size: 0.74rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.35s, border-color 0.35s, transform 0.2s, box-shadow 0.35s;
}
.cf-cta:hover {
    background: color-mix(in srgb, var(--accent) 26%, transparent);
    border-color: color-mix(in srgb, var(--accent) 78%, transparent);
    box-shadow: 0 14px 36px -14px color-mix(in oklab, var(--accent) 65%, #000);
}
.cf-cta:active { transform: translateY(1px) scale(0.99); }
.cf-cta-ico {
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: color-mix(in srgb, var(--accent) 88%, #fff);
    color: #0c0c10;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.cf-cta:hover .cf-cta-ico { transform: translateX(4px); }
.cf-cta-ico svg { width: 19px; height: 19px; }

/* ── Clean centred caption (gallery-style: label sits below the image) ────── */
/* Editorial layout: info column (left, vertically centred) + coverflow (right). */
.cf-head { grid-area: head; }
.cf-stage { grid-area: stage; align-self: center; }
.cf-rail { grid-area: rail; }

.cf-caption {
    grid-area: info;
    position: relative;
    z-index: 120;            /* above the coverflow panels so the text stays clean */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    align-self: center;
    gap: clamp(1rem, 2.4vh, 1.7rem);
    transition: opacity 0.32s ease, transform 0.32s ease;
}
/* Left-fade scrim so a left-peeking panel never muddies the text. */
.cf-caption::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: -14vh;
    bottom: -14vh;
    left: -50vw;
    width: calc(50vw + 118%);
    background: linear-gradient(to right, #0a0a0e 0%, #0a0a0e 88%, rgba(10, 10, 14, 0) 100%);
    pointer-events: none;
}
.cf-caption.is-swapping { opacity: 0; transform: translateY(10px); }
.cf-cap-title { margin: 0; font-family: var(--font-serif, Georgia, serif); font-weight: 200; line-height: 0.96; }
.cf-cap-name {
    display: block;
    font-size: clamp(2.6rem, 4.6vw, 5rem);
    letter-spacing: -0.04em;
    color: #fff;
}
.cf-cap-sub {
    display: block;
    margin-top: 0.1em;
    font-style: italic;
    font-size: clamp(1.15rem, 2.1vw, 1.85rem);
    letter-spacing: -0.015em;
    color: color-mix(in srgb, var(--accent) 66%, #fff);
    transition: color 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.cf-cap-meta {
    font-family: var(--font-mono, monospace);
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: rgba(244, 234, 208, 0.42);
}
.cf-caption .cf-cta { margin-top: 0.6rem; }

/* Pure-image panels: no text overlay, lighter scrim so the screenshot stays clean */
.cf-panel-glass {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(133deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.02) 15%, transparent 34%);
}

/* Crossfade detail content on change */
.cf-detail.is-swapping .cf-detail-main,
.cf-detail.is-swapping .cf-detail-side { opacity: 0; transform: translateY(6px); }
.cf-detail-main, .cf-detail-side { transition: opacity 0.32s ease, transform 0.32s ease; }

/* ── Rail / progress ────────────────────────────────────────────────────── */
.cf-rail {
    position: relative;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
    font-family: var(--font-mono, monospace);
    font-size: 0.64rem;
    letter-spacing: 0.12em;
    color: rgba(244, 234, 208, 0.5);
    font-variant-numeric: tabular-nums;
}
.cf-rail-dots { display: inline-flex; align-items: center; gap: 0.6rem; }
.cf-dot {
    width: 9px; height: 9px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(244, 234, 208, 0.18);
    cursor: pointer;
    transition: background 0.3s, transform 0.3s, box-shadow 0.3s;
}
.cf-dot:hover { background: rgba(244, 234, 208, 0.4); }
.cf-dot.is-active {
    background: color-mix(in srgb, var(--accent) 75%, #fff);
    transform: scale(1.35);
    box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 70%, transparent);
}
.cf-rail-curr { color: var(--paper, #f4ead0); }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
    .cf {
        grid-template-columns: 1fr;
        grid-template-areas: "head" "stage" "info" "rail";
        row-gap: clamp(1.2rem, 3.5vh, 2.2rem);
    }
    .cf-stage { height: clamp(230px, 38vh, 360px); perspective: 1200px; }
    .cf-panel { width: min(82vw, 460px); }
    .cf-caption { align-items: center; text-align: center; align-self: auto; }
    .cf-caption::before { display: none; }
    .cf-cap-name { font-size: clamp(2rem, 8vw, 2.8rem); }
    .cf-cap-sub { font-size: clamp(1.05rem, 4.5vw, 1.4rem); }
    .cf-nav { display: none; }
    .cf-head .cf-gh span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .cf-panel, .cf, .cf-detail-main, .cf-detail-side { transition-duration: 0.001ms !important; }
}
