/* ============================================================
   PORTFOLIO PAGE — Luxury Design System
   ============================================================ */

/* ---------- Page Shell ---------- */
.pf-section {
    padding: 120px 0 80px;
    background: var(--cine-bg);
    position: relative;
}

.pf-section::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: radial-gradient(var(--cine-grid) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    z-index: 0;
}

/* Ensure all direct children sit above the dot grid */
.pf-section > * {
    position: relative;
    z-index: 1;
}

/* ---------- Page Hero ---------- */
.pf-hero {
    padding: 0 20px 80px;
}

.pf-eyebrow {
    font-family: 'Poppins', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--first-color);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pf-eyebrow::before {
    content: '';
    display: inline-block;
    width: 28px;
    height: 1px;
    background: var(--first-color);
    flex-shrink: 0;
}

.pf-hero-title {
    font-family: 'Kiona', sans-serif;
    font-size: clamp(2.5rem, 7vw, 6rem);
    line-height: 1.05;
    color: var(--cine-text);
    margin: 0;
}

.pf-hero-title em {
    font-style: normal;
    background: linear-gradient(135deg, var(--first-color), hsl(355, 70%, 78%));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---------- Portfolio Intro ---------- */
.pf-intro {
    padding: 0 20px 60px;
    max-width: 720px;
}

.pf-intro-text {
    font-family: 'Poppins', sans-serif;
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.8;
    border-left: 2px solid var(--first-color);
    padding-left: 20px;
    margin: 0;
}

/* ---------- Sticky Nav Bar (jump to a stage) ---------- */
.pf-nav-bar {
    position: sticky;
    top: 130px;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;            /* never wrap into a tall, overlapping block */
    overflow-x: auto;            /* scroll horizontally instead (narrow screens) */
    overflow-y: hidden;
    scrollbar-width: none;       /* hide the scrollbar */
    gap: 12px 18px;
    margin: 60px auto 80px;
    padding: 14px 22px;
    max-width: min(1000px, 94vw);
    border-radius: 999px;
    background: rgba(10, 8, 16, 0.92);   /* opaque enough that content can't bleed through */
    backdrop-filter: blur(22px) saturate(1.4);
    -webkit-backdrop-filter: blur(22px) saturate(1.4);
    border: 1px solid var(--cine-border-soft);
    box-shadow:
        0 30px 80px -20px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 var(--cine-border-soft);
}

.pf-nav-bar::-webkit-scrollbar { display: none; }
.pf-nav-group, .pf-nav-btn, .pf-nav-divider, .pf-nav-label { flex-shrink: 0; }

.pf-nav-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pf-nav-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--first-color, #e23744);   /* accent → clearly a group header (Web vs App) */
    margin-right: 8px;
}
.pf-nav-label i { font-size: 1rem; opacity: 0.95; }

.pf-nav-divider {
    width: 1px;
    height: 30px;
    margin: 0 4px;
    background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.28), transparent);
}

.pf-nav-btn {
    --accent-h: 200;
    --accent-s: 70%;
    --accent-l: 58%;
    font-family: 'Poppins', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: rgba(255, 255, 255, 0.78);
    background: var(--cine-glass-soft);
    border: 1px solid var(--cine-border-soft);
    padding: 8px 16px;
    border-radius: 999px;
    cursor: pointer;
    transition:
        background 0.3s ease,
        border-color 0.3s ease,
        color 0.3s ease,
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

.pf-nav-btn:hover {
    color: var(--cine-text);
    background: hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.14);
    border-color: hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.45);
    transform: translateY(-1px);
}

.pf-nav-btn--active {
    color: var(--cine-text);
    background: linear-gradient(135deg,
        hsl(var(--accent-h) var(--accent-s) var(--accent-l)),
        hsl(var(--accent-h) var(--accent-s) calc(var(--accent-l) - 12%)));
    border-color: hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.65);
    box-shadow:
        0 8px 24px -6px hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

@media (max-width: 860px) {
    .pf-nav-bar {
        position: static;        /* don't stick + overlap content on small screens */
        justify-content: flex-start;
        padding: 10px 14px;
        gap: 8px;
        border-radius: 24px;
    }
    .pf-nav-divider { display: none; }
    .pf-nav-label { display: none; }
    .pf-nav-btn { font-size: 0.7rem; padding: 6px 12px; }
}

/* ---------- Subsection Ghost Numbers ---------- */
.pf-subsection {
    position: relative;
    overflow-x: clip;
    overflow-y: visible;
    padding-bottom: 60px;
}

/* Allow sticky descendants on portfolio subsections — need a scrolling-friendly ancestor chain */
body:has(.pf-stage) .main {
    overflow-x: clip;
    overflow-y: visible;
}

.pf-subsection::before {
    content: attr(data-number);
    font-family: 'Kiona', sans-serif;
    font-size: 16rem;
    line-height: 1;
    color: var(--cine-text);
    opacity: 0.025;
    position: absolute;
    top: -20px;
    right: -20px;
    pointer-events: none;
    user-select: none;
    z-index: 0;
}

/* ---------- Section Headers ---------- */
.pf-section-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 50px;
    position: relative;
    z-index: 1;
}

.pf-section-title {
    font-family: 'Kiona', sans-serif;
    font-size: clamp(1.4rem, 4vw, 2rem);
    color: var(--cine-text);
    white-space: nowrap;
    margin: 0;
}

.pf-title-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, rgba(255,255,255,0.10), transparent);
}

/* ---------- Brand-Accent Stage (per website) — sticky bg reveal ---------- */
.pf-stage {
    --accent-h: 200;
    --accent-s: 70%;
    --accent-l: 58%;
    --accent: hsl(var(--accent-h) var(--accent-s) var(--accent-l));
    --accent-soft: hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.30);
    --accent-glow: hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.55);
    position: relative;
    margin: 0;
    /* Full-bleed so the accent glow reaches the screen edges (no dark gap).
       The centred mockup is unaffected; text/cards stay put via the overlay
       max-width below. */
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    height: 170vh;
    view-timeline-name: --pf-stage;
    view-timeline-axis: block;
    contain: layout paint;
}

/* Sticky frame: keeps the bg website pinned to viewport while you scroll through */
.pf-stage-sticky {
    --pf-header-h: 200px;
    position: sticky;
    top: var(--pf-header-h);
    height: calc(100vh - var(--pf-header-h));
    max-height: calc(100vh - var(--pf-header-h));
    width: 100%;
    overflow: hidden;
    isolation: isolate;
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}


/* Big decorative project name — pinned inside the sticky stage frame, fades on scroll */
.pf-stage-watermark {
    --wm-size: clamp(5rem, 14vw, 15rem);
    --wm-spacing: 0.02em;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    font-family: 'Kiona', sans-serif;
    font-weight: 800;
    font-size: var(--wm-size);
    line-height: 0.82;
    letter-spacing: var(--wm-spacing);
    text-transform: uppercase;
    text-align: center;
    /* Soft neon glow rather than crisp outlined letters: faint fill + a large,
       far-reaching halo + a light blur so the edges dissolve into the bg. */
    color: hsl(var(--accent-h) var(--accent-s) calc(var(--accent-l) + 12%) / 0.12);
    text-shadow:
        0 0 18px hsl(var(--accent-h) 100% 62% / 0.85),
        0 0 45px hsl(var(--accent-h) 100% 60% / 0.6),
        0 0 90px hsl(var(--accent-h) 100% 56% / 0.4),
        0 0 160px hsl(var(--accent-h) 100% 50% / 0.25);
    filter: blur(6px);
    user-select: none;
    white-space: nowrap;
    opacity: 0;
}

/* Full-viewport radial glow — smooth GPU-rendered gradient, no banding */
.pf-stage-watermark::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(
            ellipse farthest-corner at 50% 50%,
            hsl(var(--accent-h) 100% 55% / 0.28) 0%,
            hsl(var(--accent-h) 100% 55% / 0.18) 15%,
            hsl(var(--accent-h) 100% 55% / 0.10) 35%,
            hsl(var(--accent-h) 100% 50% / 0.055) 55%,
            hsl(var(--accent-h) 100% 45% / 0.03) 75%,
            hsl(var(--accent-h) 100% 40% / 0.018) 100%),
        hsl(var(--accent-h) 100% 35% / 0.04);
    z-index: -1;
    pointer-events: none;
    transform: translateZ(0);
}

.pf-stage-watermark--short {
    --wm-spacing: 0.35em;
}

.pf-stage-watermark em {
    font-style: normal;
    color: hsl(var(--accent-h) var(--accent-s) calc(var(--accent-l) + 14%) / 0.25);
}

/* Scroll-driven fade: text stays still, fades in → holds → fades out */
@supports (animation-timeline: view()) {
    .pf-stage-watermark {
        animation: pf-wm-fade linear both;
        animation-timeline: --pf-stage;
        animation-range: cover 0% cover 100%;
    }

    @keyframes pf-wm-fade {
        0%, 10% { opacity: 0; }
        28%, 72% { opacity: 1; }
        90%, 100% { opacity: 0; }
    }
}

/* Background website image — sharp, fills viewport, animates in via scroll */
.pf-stage-bg {
    position: absolute;
    inset: 0;
    z-index: 2;
    overflow: visible;
    perspective: 2400px;
    transform-style: preserve-3d;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 60px 60px;
    box-sizing: border-box;
}

/* Wrapper for the laptop frame stack (front + back ghost) */
.pf-bg-frame-stack {
    position: relative;
    flex: 0 1 auto;
    width: min(82vw, calc((100vh - 360px) * 16 / 10), 1240px);
    aspect-ratio: 16 / 10;
    max-height: calc(100vh - 360px);
    transform-style: preserve-3d;
    transform-origin: center center;
    transform:
        translateY(80vh)
        rotateY(10deg)
        rotateX(6deg)
        rotateZ(-2deg)
        scale(0.82);
    opacity: 0;
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    z-index: 2;
}
.pf-stage-bg--right .pf-bg-frame-stack {
    transform:
        translateY(80vh)
        rotateY(-10deg)
        rotateX(6deg)
        rotateZ(2deg)
        scale(0.82);
}

/* Back-laptop ghost — second frame, offset/tilted, lower opacity */
.pf-bg-frame-ghost {
    position: absolute;
    inset: 0;
    border-radius: 18px;
    overflow: hidden;
    background: var(--cine-surface);
    border: 1px solid hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.30);
    box-shadow:
        0 60px 140px -40px hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.45),
        inset 0 0 0 1px var(--cine-grid);
    transform-origin: center center;
    transform:
        translate(11%, -8%)
        rotateZ(5deg)
        scale(0.78);
    pointer-events: none;
    z-index: 1;
}
.pf-bg-frame-ghost img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
    filter: saturate(0.85) brightness(0.55);
}
.pf-bg-frame-ghost::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
        hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.10),
        var(--media-scrim-mid));
}
.pf-stage-bg--right .pf-bg-frame-ghost {
    transform:
        translate(-11%, -8%)
        rotateZ(-5deg)
        scale(0.78);
}

/* Browser-style laptop frame for website screenshots */
.pf-bg-frame {
    position: absolute;
    inset: 0;
    border-radius: 18px;
    overflow: hidden;
    background: var(--cine-surface);
    border: 1px solid hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.45);
    box-shadow:
        0 100px 220px -40px hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.65),
        0 0 0 1px var(--cine-border-soft),
        inset 0 0 0 1px var(--cine-glass-soft);
    display: flex;
    flex-direction: column;
    z-index: 2;
}

.pf-bg-frame-chrome {
    flex-shrink: 0;
    position: relative;
    height: 38px;
    background: linear-gradient(180deg, var(--cine-surface-3), var(--cine-surface-2));
    border-bottom: 1px solid var(--cine-border-soft);
    display: flex;
    align-items: center;
    padding: 0 16px;
}

.pf-bg-frame-dots {
    position: relative;
    width: 54px;
    height: 12px;
    background-image:
        radial-gradient(circle 6px at 6px 6px, #ff5f57 99%, transparent 100%),
        radial-gradient(circle 6px at 26px 6px, #febc2e 99%, transparent 100%),
        radial-gradient(circle 6px at 46px 6px, #28c840 99%, transparent 100%);
    background-repeat: no-repeat;
}

.pf-bg-frame-url {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Poppins', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.55);
    background: var(--cine-glass-soft);
    padding: 4px 18px;
    border-radius: 8px;
    border: 1px solid var(--cine-border-soft);
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pf-bg-frame-screen {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.pf-bg-frame-screen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}

/* Pixelation-reveal canvas (js/pf-pixel-reveal.js) — sits over the
   screenshot and resolves it from blocky cells → sharp on scroll. */
.pf-bg-frame-screen .pf-pixel {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 1;
}
/* Once the canvas is rendering, drop the underlying <img> from view (kept
   in the DOM for alt text / layout). */
.pf-bg-frame-screen.has-pixel img {
    opacity: 0;
}

/* Scroll-driven slide-through: frame enters from below, holds center, exits top */
@supports (animation-timeline: view()) {
    .pf-stage-bg .pf-bg-frame-stack {
        animation: pf-bg-slide linear both;
        animation-timeline: --pf-stage;
        animation-range: cover 0% cover 100%;
    }
    .pf-stage-bg--right .pf-bg-frame-stack {
        animation-name: pf-bg-slide-right;
    }

    /* The frame now holds near-centre — the pixelation reveal
       (js/pf-pixel-reveal.js) is the transition, not a slide. Just a
       gentle settle + soft 3D tilt for depth and an opacity fade at the
       very edges where the screenshot has dissolved back into blocks. */
    @keyframes pf-bg-slide {
        0% {
            opacity: 0;
            transform:
                translateY(6vh)
                rotateY(8deg)
                rotateX(3deg)
                scale(0.965);
        }
        20% { opacity: 1; }
        40%, 60% {
            opacity: 1;
            transform:
                translateY(0)
                rotateY(-2deg)
                rotateX(1deg)
                scale(1);
        }
        80% { opacity: 1; }
        100% {
            opacity: 0;
            transform:
                translateY(-6vh)
                rotateY(-8deg)
                rotateX(-3deg)
                scale(0.965);
        }
    }

    @keyframes pf-bg-slide-right {
        0% {
            opacity: 0;
            transform:
                translateY(6vh)
                rotateY(-8deg)
                rotateX(3deg)
                scale(0.965);
        }
        20% { opacity: 1; }
        40%, 60% {
            opacity: 1;
            transform:
                translateY(0)
                rotateY(2deg)
                rotateX(1deg)
                scale(1);
        }
        80% { opacity: 1; }
        100% {
            opacity: 0;
            transform:
                translateY(-6vh)
                rotateY(8deg)
                rotateX(-3deg)
                scale(0.965);
        }
    }

    /* Overlay also fades in / out with the slide */
    .pf-stage-overlay {
        animation: pf-overlay-fade linear both;
        animation-timeline: --pf-stage;
        animation-range: cover 0% cover 100%;
    }

    @keyframes pf-overlay-fade {
        0%, 18% {
            opacity: 0;
            transform: translateY(40px);
        }
        35%, 65% {
            opacity: 1;
            transform: translateY(0);
        }
        82%, 100% {
            opacity: 0;
            transform: translateY(-40px);
        }
    }
}


/* ---------- Overlay info on top of bg website ---------- */
.pf-stage-overlay {
    position: absolute;
    inset: 0;
    max-width: 1240px;        /* keep text/cards centred while the glow goes full-bleed */
    margin-inline: auto;
    z-index: 3;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 90px 80px 60px;
    pointer-events: none;
}

.pf-stage-overlay > * {
    pointer-events: auto;
}

.pf-overlay-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.pf-overlay-eyebrow {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--accent);
    font-family: 'Poppins', sans-serif;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.65);
}

.pf-overlay-eyebrow .eyebrow-1 {
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.01em;
}

.pf-overlay-eyebrow .eyebrow-2 {
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.65);
}

.pf-overlay-tag {
    font-family: 'Poppins', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    padding: 10px 18px;
    border-radius: 999px;
    background: hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.12);
    border: 1px solid hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.45);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.pf-overlay-bottom {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    flex-wrap: wrap;
}

.pf-overlay-meta {
    display: flex;
    align-items: center;
    gap: 22px;
    max-width: 60%;
    padding: 22px 28px;
    border-radius: 22px;
    background: var(--cine-glass);
    backdrop-filter: blur(22px) saturate(1.3);
    -webkit-backdrop-filter: blur(22px) saturate(1.3);
    border: 1px solid hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.30);
    box-shadow: 0 24px 60px -20px hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.35);
}

.pf-overlay-logo {
    flex-shrink: 0;
    width: 68px;
    height: 68px;
    border-radius: 18px;
    overflow: hidden;
    background: var(--cine-border-soft);
    border: 1px solid hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.45);
    display: grid;
    place-items: center;
}

.pf-overlay-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
    box-sizing: border-box;
}

.pf-overlay-text {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pf-overlay-title {
    font-family: 'Kiona', sans-serif;
    font-size: 1.8rem;
    line-height: 1;
    color: var(--cine-text);
    letter-spacing: 0.01em;
}

.pf-overlay-desc {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    font-size: 0.86rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.78);
    max-width: 42ch;
}

.pf-overlay-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.pf-overlay-chips span {
    font-family: 'Poppins', sans-serif;
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.82);
    padding: 5px 11px;
    border-radius: 999px;
    background: hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.15);
    border: 1px solid hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.35);
}

.pf-overlay-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 28px;
    border-radius: 999px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-decoration: none;
    color: var(--cine-text);
    background: linear-gradient(135deg,
        hsl(var(--accent-h) var(--accent-s) var(--accent-l)),
        hsl(var(--accent-h) var(--accent-s) calc(var(--accent-l) - 12%)));
    border: 1px solid hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.6);
    box-shadow:
        0 16px 40px -10px hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pf-overlay-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 24px 56px -12px hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.75),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.pf-overlay-btn i {
    font-size: 1.05rem;
}

/* ---------- Phone Device Frame for App Stages ---------- */

/* Frame stack — positions the phone + ghost as a unit, animated via scroll */
.pf-phone-stack {
    position: relative;
    flex: 0 1 auto;
    height: min(calc(100vh - 300px), 640px);
    aspect-ratio: 9 / 19.5;
    transform-style: preserve-3d;
    transform-origin: center center;
    transform: translateY(80vh) rotateY(10deg) rotateX(6deg) scale(0.82);
    opacity: 0;
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    z-index: 2;
}
.pf-stage-bg--right .pf-phone-stack {
    transform: translateY(80vh) rotateY(-10deg) rotateX(6deg) scale(0.82);
}

/* Ghost phone — offset behind main device */
.pf-phone-ghost {
    position: absolute;
    inset: 0;
    border-radius: 38px;
    overflow: hidden;
    background: var(--cine-surface);
    border: 2px solid hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.25);
    box-shadow: 0 40px 100px -20px hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.35),
        inset 0 0 0 1px var(--cine-grid);
    transform: translate(10%, -7%) rotateZ(5deg) scale(0.82);
    pointer-events: none;
    z-index: 1;
}
.pf-stage--right .pf-phone-ghost {
    transform: translate(-10%, -7%) rotateZ(-5deg) scale(0.82);
}
.pf-phone-ghost img {
    width: 100%; height: 100%;
    object-fit: cover; object-position: top center;
    display: block;
    filter: saturate(0.85) brightness(0.5);
}
.pf-phone-ghost::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
        hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.10),
        var(--media-scrim-mid));
}

/* Main phone device */
.pf-phone-device {
    position: absolute;
    inset: 0;
    border-radius: 38px;
    overflow: hidden;
    background: var(--cine-surface);
    border: 3px solid hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.50);
    box-shadow:
        0 80px 180px -30px hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.55),
        0 0 0 1px var(--cine-border-soft),
        inset 0 0 0 1px var(--cine-glass-soft);
    z-index: 2;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
}
.pf-phone-device img {
    width: 100%; height: 100%;
    object-fit: cover; object-position: top center;
    display: block;
}

/* Home indicator bar */
.pf-phone-device::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 2px;
    z-index: 3;
}

/* Scroll-driven 3D slide for phone stack */
@supports (animation-timeline: view()) {
    .pf-phone-stack {
        animation: pf-phone-enter linear both;
        animation-timeline: --pf-stage;
        animation-range: cover 0% cover 100%;
    }
    .pf-stage-bg--right .pf-phone-stack {
        animation-name: pf-phone-enter-right;
    }

    @keyframes pf-phone-enter {
        0% {
            opacity: 0;
            transform: translateY(80vh) rotateY(14deg) rotateX(8deg) scale(0.82);
        }
        22% { opacity: 1; }
        38%, 62% {
            opacity: 1;
            transform: translateY(0) rotateY(-4deg) rotateX(2deg) scale(1);
        }
        78% { opacity: 1; }
        100% {
            opacity: 0;
            transform: translateY(-90vh) rotateY(-14deg) rotateX(-8deg) scale(0.82);
        }
    }

    @keyframes pf-phone-enter-right {
        0% {
            opacity: 0;
            transform: translateY(80vh) rotateY(-14deg) rotateX(8deg) scale(0.82);
        }
        22% { opacity: 1; }
        38%, 62% {
            opacity: 1;
            transform: translateY(0) rotateY(4deg) rotateX(2deg) scale(1);
        }
        78% { opacity: 1; }
        100% {
            opacity: 0;
            transform: translateY(-90vh) rotateY(14deg) rotateX(-8deg) scale(0.82);
        }
    }
}

/* JS fallback for phone stack */
.pf-stage.pf-stage-in .pf-phone-stack {
    opacity: 1;
    transform: translateY(0) rotateY(-4deg) rotateX(2deg) scale(1);
    transition:
        transform 1.4s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

/* App stages: overlay sits to the side of the phone */
.pf-stage--app .pf-stage-overlay {
    padding: 90px 80px 80px;
}

.pf-stage--app .pf-overlay-bottom {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 18px;
    max-width: 380px;
}

.pf-stage--app .pf-overlay-meta {
    max-width: 100%;
}

.pf-stage--app .pf-overlay-top {
    max-width: 100%;
}

/* Right-aligned variant for app stages — overlay on the left, phone right */
.pf-stage--app.pf-stage--right .pf-overlay-top {
    flex-direction: row-reverse;
}
.pf-stage--app.pf-stage--right .pf-overlay-bottom {
    align-items: flex-end;
    margin-left: auto;
}

/* ---------- Meta row inside info panel ---------- */
.pf-meta-row {
    list-style: none;
    margin: 4px 0 0 0;
    padding: 14px 0 4px;
    display: flex;
    gap: 24px;
    border-top: 1px solid var(--cine-border-soft);
    flex-wrap: wrap;
}

.pf-meta-row li {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pf-meta-row li span {
    font-family: 'Poppins', sans-serif;
    font-size: 0.62rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
}

.pf-meta-row li strong {
    font-family: 'Poppins', sans-serif;
    font-size: 0.84rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    letter-spacing: 0.01em;
}

/* ---------- Feature chips inside info panel ---------- */
.pf-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
}

.pf-chip {
    font-family: 'Poppins', sans-serif;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: rgba(255, 255, 255, 0.78);
    padding: 6px 12px;
    border-radius: 999px;
    background: hsl(var(--accent-h, 0) var(--accent-s, 0%) var(--accent-l, 100%) / 0.06);
    border: 1px solid hsl(var(--accent-h, 0) var(--accent-s, 0%) var(--accent-l, 100%) / 0.18);
    transition: all 0.25s ease;
}

.pf-chip:hover {
    background: hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.18);
    border-color: hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.55);
    color: var(--cine-text);
}

/* ---------- 3D Tilt for Browser Frame ---------- */
.pf-showcase-media {
    perspective: 1600px;
}

.pf-showcase .browser-frame {
    transform-origin: center center;
    will-change: transform;
    transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

@supports (animation-timeline: view()) {
    .pf-showcase:not(.pf-showcase--flip) .browser-frame {
        animation: pf-frame-tilt linear both;
        animation-timeline: view();
        animation-range: entry 0% cover 50%;
    }
    .pf-showcase--flip .browser-frame {
        animation: pf-frame-tilt-flip linear both;
        animation-timeline: view();
        animation-range: entry 0% cover 50%;
    }

    @keyframes pf-frame-tilt {
        from {
            transform: perspective(1600px) rotateY(14deg) rotateX(6deg) translateZ(-40px);
        }
        to {
            transform: perspective(1600px) rotateY(0deg) rotateX(0deg) translateZ(0);
        }
    }

    @keyframes pf-frame-tilt-flip {
        from {
            transform: perspective(1600px) rotateY(-14deg) rotateX(6deg) translateZ(-40px);
        }
        to {
            transform: perspective(1600px) rotateY(0deg) rotateX(0deg) translateZ(0);
        }
    }
}

@media (max-width: 860px) {
    .pf-stage {
        height: 200vh;
        margin: 0;
    }
    .pf-stage-sticky {
        --pf-header-h: 120px;
    }

    /* Reduce stage bg padding */
    .pf-stage-bg {
        padding: 20px 16px 40px;
    }

    /* Browser frame sizing for mobile */
    .pf-bg-frame-stack {
        width: min(92vw, calc((100vh - 300px) * 16 / 10));
        max-height: calc(100vh - 300px);
    }

    /* Smaller browser chrome */
    .pf-bg-frame-chrome {
        height: 28px;
        padding: 0 10px;
    }
    .pf-bg-frame-dots {
        width: 40px;
        height: 9px;
        background-image:
            radial-gradient(circle 4.5px at 4.5px 4.5px, #ff5f57 99%, transparent 100%),
            radial-gradient(circle 4.5px at 19px 4.5px, #febc2e 99%, transparent 100%),
            radial-gradient(circle 4.5px at 33.5px 4.5px, #28c840 99%, transparent 100%);
    }
    .pf-bg-frame-url {
        font-size: 0.58rem;
        padding: 3px 12px;
    }

    /* Watermark text smaller on mobile */
    .pf-stage-watermark {
        --wm-size: clamp(3rem, 12vw, 8rem);
    }

    /* Overlay — extra bottom padding to clear chat widget */
    .pf-stage-overlay {
        padding: 14px 20px 64px;
    }
    .pf-overlay-top {
        flex-direction: row;
        gap: 10px;
        align-items: center;
    }
    .pf-overlay-eyebrow .eyebrow-1 { font-size: 1rem; }
    .pf-overlay-eyebrow .eyebrow-2 { font-size: 0.6rem; }
    .pf-overlay-tag { font-size: 0.58rem; padding: 6px 12px; }
    .pf-overlay-bottom {
        gap: 12px;
    }
    .pf-overlay-meta {
        max-width: 100%;
        padding: 14px 16px;
        gap: 12px;
    }
    .pf-overlay-logo { width: 44px; height: 44px; }
    .pf-overlay-title { font-size: 1.2rem; }
    .pf-overlay-desc { font-size: 0.72rem; }
    .pf-overlay-chips span { font-size: 0.58rem; padding: 3px 8px; }
    .pf-overlay-btn { padding: 10px 16px; font-size: 0.74rem; }

    /* Phone sizing */
    .pf-phone-stack {
        height: min(calc(100vh - 340px), 440px);
    }
    .pf-phone-device,
    .pf-phone-ghost {
        border-radius: 28px;
    }
    .pf-phone-device::after {
        width: 80px;
        bottom: 6px;
    }

    /* App stages: stack overlay full-width */
    .pf-stage--app .pf-stage-overlay {
        padding: 14px 20px 64px;
    }
    .pf-stage--app .pf-overlay-bottom {
        max-width: 100%;
        align-items: stretch;
    }
    .pf-stage--app.pf-stage--right .pf-overlay-bottom {
        align-items: stretch;
        margin-left: 0;
    }
    .pf-stage--app.pf-stage--right .pf-overlay-top {
        flex-direction: column;
    }

    /* Phone ghost offset smaller on mobile */
    .pf-phone-ghost {
        transform: translate(8%, -5%) rotateZ(4deg) scale(0.84);
    }
    .pf-stage--right .pf-phone-ghost {
        transform: translate(-8%, -5%) rotateZ(-4deg) scale(0.84);
    }
}

/* ---------- Showcase Cards — Websites ---------- */
.pf-showcase {
    display: grid;
    grid-template-columns: 55% 1fr;
    min-height: 420px;
    background: var(--cine-grid);
    border: 1px solid var(--cine-border-soft);
    border-radius: 24px;
    overflow: hidden;
    margin: 0 20px 40px;
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
    position: relative;
    z-index: 1;
}

.pf-showcase:hover {
    border-color: hsl(355 70% 58% / 0.45);
    box-shadow: 0 0 48px hsl(355 70% 58% / 0.12);
}

/* Flipped card — text left, media right */
.pf-showcase--flip {
    grid-template-columns: 1fr 55%;
}

.pf-showcase--flip .pf-showcase-media { order: 2; }
.pf-showcase--flip .pf-showcase-info  { order: 1; }

/* ---------- Media Side ---------- */
.pf-showcase-media {
    overflow: hidden;
    position: relative;
}

/* Shimmer sweep on hover */
.pf-showcase-media::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        105deg,
        transparent 40%,
        var(--cine-glass-soft) 50%,
        transparent 60%
    );
    transform: translateX(-120%);
    transition: transform 0.65s ease;
    z-index: 2;
    pointer-events: none;
}

.pf-showcase:hover .pf-showcase-media::before {
    transform: translateX(120%);
}

/* Right-edge fade on normal cards */
.pf-showcase:not(.pf-showcase--flip) .pf-showcase-media::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 70px; height: 100%;
    background: linear-gradient(to right, transparent, var(--media-scrim-mid));
    pointer-events: none;
    z-index: 1;
}

/* Left-edge fade on flipped cards */
.pf-showcase--flip .pf-showcase-media::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 70px; height: 100%;
    background: linear-gradient(to left, transparent, var(--media-scrim-mid));
    pointer-events: none;
    z-index: 1;
}

/* ---------- Browser Frame ---------- */
.browser-frame {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--cine-surface-2);
}

.browser-frame::before {
    content: '';
    flex-shrink: 0;
    display: block;
    height: 34px;
    background-color: var(--cine-surface-2);
    background-image:
        radial-gradient(circle at center, #ff5f57 50%, transparent 50%),
        radial-gradient(circle at center, #febc2e 50%, transparent 50%),
        radial-gradient(circle at center, #28c840 50%, transparent 50%),
        linear-gradient(var(--cine-border-soft), var(--cine-border-soft));
    background-size:  10px 10px, 10px 10px, 10px 10px, 46% 18px;
    background-position: 14px center, 30px center, 46px center, center center;
    background-repeat: no-repeat;
    border-bottom: 1px solid var(--cine-border-soft);
}

/* ---------- Image Inner (shared by browser & phone) ---------- */
.pf-img-inner {
    flex: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pf-img-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: transform 0.6s ease;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
}

.pf-showcase:hover .pf-img-inner img {
    transform: scale(1.04);
}

/* ---------- Showcase Info Panel ---------- */
.pf-showcase-info {
    padding: 40px 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
}

/* ---------- Tag Badge ---------- */
.pf-tag {
    display: inline-block;
    font-family: 'Poppins', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--first-color);
    background: hsl(355 70% 58% / 0.08);
    border: 1px solid hsl(355 70% 58% / 0.30);
    border-radius: 20px;
    padding: 4px 12px;
    width: fit-content;
}

/* ---------- Logo Badge ---------- */
.pf-logo-badge {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--cine-border-soft);
    border: 1px solid rgba(255,255,255,0.10);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    flex-shrink: 0;
}

.pf-logo-badge img {
    width: 70%;
    height: 70%;
    object-fit: contain;
    pointer-events: none;
}

/* ---------- Item Title & Description ---------- */
.pf-item-title {
    font-family: 'Kiona', sans-serif;
    font-size: clamp(1.4rem, 3vw, 2rem);
    color: var(--cine-text);
    margin: 0;
    line-height: 1.1;
}

.pf-item-desc {
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    line-height: 1.7;
    color: rgba(255,255,255,0.5);
    margin: 0;
}

/* ---------- Actions Row ---------- */
.pf-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 4px;
}

/* Normalize btn-ask-ai inside actions row */
.pf-actions .btn-ask-ai {
    padding: 10px 24px;
    font-size: 0.85rem;
    margin-top: 0;
}

.pf-visit-btn {
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--first-color);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background-color: var(--cine-border-soft);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1.5px solid rgba(var(--accent-rgb), 0.55);
    border-radius: 30px;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.1);
}

.pf-visit-btn:hover {
    background-color: var(--first-color);
    color: var(--cine-text);
    box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.45);
    transform: translateY(-2px);
}

/* ---------- Apps Grid ---------- */
.pf-apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 28px;
    justify-content: center;
    padding: 0 20px;
    position: relative;
    z-index: 1;
    max-width: 1320px;
    margin: 0 auto;
}

/* ---------- App Card ---------- */
.pf-app-card {
    background: var(--cine-grid);
    border: 1px solid var(--cine-border-soft);
    border-radius: 28px;
    padding: 30px 24px 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    position: relative;
    transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
    overflow: hidden;
}

.pf-app-card:hover {
    transform: translateY(-8px);
    border-color: hsl(355 70% 58% / 0.45);
    box-shadow: 0 0 48px hsl(355 70% 58% / 0.12);
}

/* ---------- App Radial Glow ---------- */
.pf-app-glow {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, var(--first-color), transparent 68%);
    opacity: 0.07;
    border-radius: 50%;
    pointer-events: none;
    transition: opacity 0.4s ease;
    z-index: 0;
}

.pf-app-card:hover .pf-app-glow {
    opacity: 0.18;
}

/* App card logo sits above glow */
.pf-app-card > .pf-logo-badge {
    position: relative;
    z-index: 2;
}

/* ---------- Phone Frame ---------- */
.phone-frame {
    border-radius: 32px;
    border: 8px solid var(--cine-surface-2);
    box-shadow:
        0 0 0 1px var(--cine-border-soft),
        inset 0 0 0 1px var(--cine-glass-soft),
        0 24px 60px rgba(0,0,0,0.60),
        0 4px 16px rgba(0,0,0,0.40);
    overflow: hidden;
    background: var(--cine-bg);
    width: 180px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

/* Notch */
.phone-frame::before {
    content: '';
    display: block;
    height: 24px;
    background: var(--cine-surface-2);
    background-image: radial-gradient(ellipse at center, var(--cine-bg) 65%, transparent 65%);
    background-size: 80px 18px;
    background-position: center;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

/* Home indicator */
.phone-frame::after {
    content: '';
    display: block;
    height: 22px;
    background: var(--cine-surface-2);
    background-image: radial-gradient(ellipse at center, var(--cine-surface-3) 50%, transparent 50%);
    background-size: 50px 5px;
    background-position: center;
    background-repeat: no-repeat;
}

/* Screen area inside phone */
.phone-frame .pf-img-inner {
    height: 300px;
    flex: unset;
    display: block;
    overflow: hidden;
}

.phone-frame .pf-img-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

/* ---------- App Info ---------- */
.pf-app-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    position: relative;
    z-index: 1;
    width: 100%;
}

.pf-app-info .pf-item-title {
    font-size: 1.25rem;
}

.pf-app-info .pf-item-desc {
    font-size: 0.85rem;
}

/* ---------- Float Animation ---------- */
@keyframes pf-float {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-8px); }
}

/* Float only when card is in view AND not hovered */
.pf-app-card.pf-in:not(:hover) .phone-frame {
    animation: pf-float 5s ease-in-out infinite;
}

/* ---------- Scroll Animations ---------- */
.pf-animate {
    opacity: 0;
    transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--delay, 0s);
}

[data-anim="slide-right"] { transform: translateX(-60px) scale(0.96); }
[data-anim="slide-left"]  { transform: translateX(60px) scale(0.96); }
[data-anim="rise"]        { transform: translateY(60px) scale(0.92); }

.pf-animate.pf-in {
    opacity: 1;
    transform: none;
}

/* ---------- Scroll-Linked Zoom (Kahnguide / Ballettschule-style) ---------- */
.pf-zoom-scroll {
    transform-origin: center center;
    will-change: transform, opacity;
}

@supports (animation-timeline: view()) {
    .pf-zoom-scroll {
        animation: pf-zoom-in linear both;
        animation-timeline: view();
        animation-range: entry 0% cover 45%;
    }

    @keyframes pf-zoom-in {
        from {
            transform: scale(0.78);
            opacity: 0.35;
            filter: blur(2px);
        }
        to {
            transform: scale(1);
            opacity: 1;
            filter: blur(0);
        }
    }
}

/* JS-driven progressive zoom for browsers without scroll-timeline */
@supports not (animation-timeline: view()) {
    .pf-zoom-scroll {
        transform: scale(var(--pf-zoom, 0.82));
        opacity: var(--pf-zoom-op, 0.4);
        transition: transform 0.15s linear, opacity 0.15s linear;
    }
}

/* ---------- Placeholder (Coming Soon) ---------- */
.pf-placeholder {
    flex-direction: column;
    gap: 12px;
    background: var(--cine-grid);
}

.pf-placeholder i {
    font-size: 3rem;
    color: rgba(255,255,255,0.15);
}

.pf-placeholder span {
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.25);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Placeholder inside phone needs explicit height */
.phone-frame .pf-placeholder {
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- Breakpoint: ≤860px — Stack showcase cards ---------- */
@media (max-width: 860px) {
    .pf-showcase,
    .pf-showcase--flip {
        grid-template-columns: 1fr;
        min-height: unset;
        margin: 0 0 30px;
    }

    .pf-showcase-media {
        height: 260px;
        order: 0 !important;
    }

    .pf-showcase-info {
        order: 1 !important;
        padding: 24px 22px;
    }

    /* Hide edge-fade gradients on stacked layout */
    .pf-showcase-media::after {
        display: none !important;
    }

    .pf-apps-grid {
        padding: 0;
    }
}

/* ========== Portfolio Intro (above grid) ========== */
.portfolio-intro {
    padding: 9rem 1.5rem 4rem;
    text-align: center;
    background: var(--cine-bg);
}

.portfolio-intro__container {
    max-width: 720px;
}

.portfolio-intro__eyebrow {
    font-family: 'Kiona', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--first-color);
    margin: 0 0 1.2rem 0;
    opacity: 0.85;
}

.portfolio-intro__title {
    font-family: 'Kiona', sans-serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: var(--cine-text);
    margin: 0 0 1.2rem 0;
    line-height: 1.1;
    font-weight: normal;
}

.portfolio-intro__sub {
    font-size: 1rem;
    color: var(--cine-text-dim);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ========== Portfolio CTA (below grid) ========== */
.portfolio-cta {
    padding: 5rem 1.5rem 6rem;
    text-align: center;
    background: var(--cine-bg);
    border-top: 1px solid var(--cine-border-soft);
}

.portfolio-cta__container {
    max-width: 600px;
}

.portfolio-cta__title {
    font-family: 'Kiona', sans-serif;
    font-size: clamp(1.6rem, 4vw, 2.5rem);
    color: var(--cine-text);
    margin: 0 0 1rem 0;
    line-height: 1.2;
    font-weight: normal;
}

.portfolio-cta__sub {
    font-size: 1rem;
    color: var(--cine-text-dim);
    margin: 0 0 2rem 0;
    line-height: 1.6;
}

.portfolio-cta__btn {
    display: inline-block;
    padding: 0.85rem 2.5rem;
    border: 2px solid var(--first-color);
    border-radius: 2rem;
    color: var(--first-color);
    font-family: 'Kiona', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-decoration: none;
    text-transform: uppercase;
    transition: background 0.25s, color 0.25s;
}

.portfolio-cta__btn:hover {
    background: var(--first-color);
    color: var(--cine-text);
}

/* ---------- Breakpoint: ≤500px ---------- */
@media (max-width: 500px) {
    .pf-hero-title {
        font-size: 2.4rem;
    }

    .pf-apps-grid {
        grid-template-columns: 1fr;
        max-width: 320px;
        margin: 0 auto;
    }

    .pf-showcase {
        margin: 0 0 24px;
        border-radius: 18px;
    }

    .pf-stage-sticky {
        --pf-header-h: 80px;
    }

    /* Even tighter stage bg on small phones */
    .pf-stage-bg {
        padding: 16px 8px 28px;
    }
    .pf-bg-frame-chrome {
        height: 22px;
        padding: 0 8px;
    }
    .pf-bg-frame-dots {
        width: 32px;
        height: 8px;
        background-image:
            radial-gradient(circle 4px at 4px 4px, #ff5f57 99%, transparent 100%),
            radial-gradient(circle 4px at 16px 4px, #febc2e 99%, transparent 100%),
            radial-gradient(circle 4px at 28px 4px, #28c840 99%, transparent 100%);
    }
    .pf-bg-frame-url {
        font-size: 0.5rem;
        padding: 2px 8px;
    }
    .pf-bg-frame,
    .pf-bg-frame-ghost {
        border-radius: 12px;
    }

    .pf-stage-watermark {
        --wm-size: clamp(2.4rem, 11vw, 5rem);
    }

    .pf-stage-overlay {
        padding: 50px 14px 70px;
    }
    .pf-overlay-bottom {
        gap: 10px;
    }
    .pf-overlay-meta {
        padding: 12px 12px;
        gap: 10px;
        border-radius: 16px;
    }
    .pf-overlay-logo { width: 40px; height: 40px; border-radius: 12px; }
    .pf-overlay-title { font-size: 1.1rem; }
    .pf-overlay-desc { font-size: 0.7rem; max-width: 32ch; }
    .pf-overlay-chips span { font-size: 0.55rem; padding: 3px 7px; }
    .pf-overlay-btn { padding: 10px 16px; font-size: 0.72rem; }
    .pf-overlay-tag { font-size: 0.6rem; padding: 7px 12px; }

    .pf-phone-stack {
        height: min(calc(100vh - 360px), 380px);
    }
    .pf-phone-device,
    .pf-phone-ghost {
        border-radius: 22px;
    }
    .pf-phone-device::after {
        width: 60px;
        height: 3px;
        bottom: 5px;
    }

    .pf-stage--app .pf-stage-overlay {
        padding: 50px 14px 70px;
    }
}


/* ============================================================
   VIDEO PORTFOLIO PAGE (portfolio.html)
   — filter buttons, grid, items, references
   ============================================================ */

/* ---------- Section ---------- */
.portfolio-section {
    padding: 60px 20px 80px;
    color: var(--cine-text);
    background: var(--cine-bg);
}

/* ---------- Filter Buttons Row ---------- */
.portfolio-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 50px;
}

.filter-btn {
    background: var(--cine-border-soft);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1.5px solid var(--cine-border);
    color: var(--cine-text-dim);
    padding: 9px 26px;
    border-radius: 30px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.25s ease;
    outline: none;
}

.filter-btn:hover {
    background: rgba(var(--accent-rgb), 0.1);
    border-color: rgba(var(--accent-rgb), 0.5);
    color: var(--first-color);
    box-shadow: 0 0 14px rgba(var(--accent-rgb), 0.15);
}

.filter-btn.active {
    background: rgba(var(--accent-rgb), 0.12);
    border-color: var(--first-color);
    color: var(--first-color);
    box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.25);
    font-weight: 600;
}

/* ---------- Portfolio Grid ---------- */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    transition: opacity 0.4s ease;
}

.portfolio-grid.fade-out {
    opacity: 0;
}

/* ---------- Portfolio Item (image / video card) ---------- */
.portfolio-item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: var(--cine-grid);
    border: 1px solid var(--cine-border-soft);
    aspect-ratio: 16 / 9;
    opacity: 0;
    /* No translateY slide — the pixelation reveal (js/portfolio-pixel-reveal.js)
       is the transition now. Just a soft opacity fade-in. */
    transition: opacity 0.5s ease,
                border-color 0.3s ease, box-shadow 0.3s ease;
}

.portfolio-item.visible {
    opacity: 1;
}

.portfolio-item:hover {
    border-color: rgba(var(--accent-rgb), 0.4);
    box-shadow: 0 0 30px rgba(var(--accent-rgb), 0.1);
}

.portfolio-item img,
.portfolio-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.portfolio-item:hover img,
.portfolio-item:hover video {
    transform: scale(1.04);
}

/* Pixelation-reveal canvas (js/portfolio-pixel-reveal.js) — same effect as
   the web-portfolio stages, applied per grid tile. Covers the tile, never
   intercepts the click that opens the lightbox. */
.portfolio-item .pf-pixel {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 1;
    pointer-events: none;
    transition: transform 0.5s ease;
}
.portfolio-item:hover .pf-pixel {
    transform: scale(1.04);
}
/* While the canvas is live, hide the underlying media (kept in the DOM so
   it keeps decoding/playing as the pixelation source). */
.portfolio-item.has-pixel img,
.portfolio-item.has-pixel video {
    opacity: 0;
}
/* Keep the hover hint above the reveal canvas. */
.portfolio-item .portfolio-item-hint {
    z-index: 2;
}

/* ════════════════════════════════════════════════════════════
   VIEW TOGGLE  (Grid ⇄ Cinema)  +  full-screen CINEMA view
   (js/portfolio-cinema.js)
   ════════════════════════════════════════════════════════════ */
.pf-view-toggle {
    display: inline-flex;
    gap: 4px;
    margin: 0 0 22px;
    padding: 4px;
    border-radius: 999px;
    background: var(--cine-glass-soft, rgba(255,255,255,0.05));
    border: 1px solid var(--cine-border-soft, rgba(255,255,255,0.1));
    backdrop-filter: blur(8px);
}
.pf-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-color, #cdd3e0);
    font: 600 0.82rem/1 'Poppins', sans-serif;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease;
}
.pf-view-btn i { font-size: 1rem; }
.pf-view-btn.is-active {
    background: linear-gradient(135deg,
        rgba(var(--accent-rgb,80,140,255), 0.95),
        rgba(var(--accent-rgb,80,140,255), 0.75));
    color: #fff;
    box-shadow: 0 6px 18px -6px rgba(var(--accent-rgb,80,140,255), 0.6);
}

/* The toggle, repositioned for inside the full-screen cinema overlay. */
.pf-cinema-toggle {
    position: absolute;
    top: clamp(16px, 3vh, 28px);
    left: clamp(16px, 3vw, 28px);
    z-index: 6;
    margin: 0;
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(10px);
}
/* Always-light text on the dark cinema backdrop (the inactive button uses the
   page --text-color, which is too dark over video). */
.pf-cinema-toggle .pf-view-btn { color: rgba(255, 255, 255, 0.82); }

body.pf-cinema-open { overflow: hidden; }

.pf-cinema {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #05060a;
    opacity: 0;
    transition: opacity 0.35s ease;
}
.pf-cinema.is-open { opacity: 1; }

/* Media pool — every project's <video>/<img> lives here behind the canvas,
   present only so it decodes and can be sampled into the canvas. */
.pf-cinema-pool { position: absolute; inset: 0; z-index: 0; }
.pf-cinema-src {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0;               /* the canvas is the visible layer */
}

/* The single fixed full-screen render surface. The videos do NOT move —
   only the distortion drawn here travels bottom→top. */
.pf-cinema-canvas {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
}

/* Cinematic vignette over the canvas. */
.pf-cinema::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: radial-gradient(ellipse at center,
        transparent 55%, rgba(0,0,0,0.5) 100%);
}

/* Transparent scroll-snap layer — only captures scroll distance (one snap
   per project); the canvas beneath shows through. */
.pf-cinema-scroll {
    position: absolute;
    inset: 0;
    z-index: 3;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.pf-cinema-scroll::-webkit-scrollbar { display: none; }
.pf-cinema-snap {
    height: 100vh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

/* Project index / category, lower-left like an editorial reel */
.pf-cinema-info {
    position: absolute;
    left: clamp(20px, 5vw, 64px);
    bottom: clamp(28px, 7vh, 72px);
    z-index: 4;
    color: #fff;
    text-shadow: 0 2px 24px rgba(0,0,0,0.6);
    pointer-events: none;
}
.pf-cinema-index {
    font: 800 clamp(2.4rem, 7vw, 5.5rem)/0.9 'Kiona', sans-serif;
    letter-spacing: 0.01em;
}
.pf-cinema-index span {
    font-size: 0.32em;
    font-weight: 600;
    opacity: 0.7;
    vertical-align: super;
    margin-left: 0.2em;
}
.pf-cinema-cat {
    margin-top: 10px;
    font: 600 0.85rem/1 'Poppins', sans-serif;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(var(--accent-rgb,80,140,255), 1);
}

.pf-cinema-close {
    position: absolute;
    top: clamp(16px, 3vh, 28px);
    right: clamp(16px, 3vw, 28px);
    z-index: 6;
    width: 48px;
    height: 48px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(10px);
    color: #fff;
    font-size: 1.4rem;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.25s ease;
}
.pf-cinema-close:hover { background: rgba(255,255,255,0.18); transform: rotate(90deg); }

.pf-cinema-hint {
    position: absolute;
    left: 50%;
    bottom: clamp(20px, 4vh, 40px);
    transform: translateX(-50%);
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: rgba(255,255,255,0.65);
    font: 600 0.68rem/1 'Poppins', sans-serif;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    pointer-events: none;
    animation: pf-cinema-bob 1.8s ease-in-out infinite;
}
.pf-cinema-hint i { font-size: 1.1rem; }
@keyframes pf-cinema-bob {
    0%, 100% { transform: translate(-50%, 0); opacity: 0.5; }
    50%      { transform: translate(-50%, 6px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .pf-cinema, .pf-cinema-hint { transition: none; animation: none; }
}

/* ---------- References Grid (YouTube iframes) ---------- */
#references-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

#references-grid .portfolio-item {
    aspect-ratio: 16 / 9;
    border-radius: 16px;
    overflow: hidden;
    background: var(--cine-surface-2);
    border: 1px solid var(--cine-border-soft);
}

#references-grid .portfolio-item iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* ---------- Hover hint overlay on grid items ---------- */
.portfolio-item-hint {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
    cursor: pointer;
    border-radius: inherit;
}

.portfolio-item-hint i {
    font-size: 2.8rem;
    color: var(--cine-text);
    opacity: 0;
    transform: scale(0.65);
    transition:
        opacity 0.3s ease,
        transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.8));
}

.portfolio-item:hover .portfolio-item-hint {
    background: rgba(0, 0, 0, 0.4);
}

.portfolio-item:hover .portfolio-item-hint i {
    opacity: 1;
    transform: scale(1);
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
    .portfolio-grid,
    #references-grid {
        grid-template-columns: 1fr;
    }

    .filter-btn {
        padding: 8px 18px;
        font-size: 0.78rem;
    }
}


/* ============================================================
   LIGHTBOX
   ============================================================ */

.lb-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;

    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.lb-overlay.lb-active {
    opacity: 1;
    pointer-events: all;
}

/* Blurred dark backdrop */
.lb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    transition: backdrop-filter 0.4s ease;
}

/* Wrapper holds [prev] [stage] [next] in a row */
.lb-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1280px;
    gap: 16px;
}

/* ── Stage (the media container) ── */
.lb-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    will-change: transform, opacity, filter;

    /* Default: hidden, ready to animate in */
    opacity: 0;
    transform: scale(0.88) translateX(calc(var(--lb-dir, 0) * 48px));
    filter: blur(8px);
    transition:
        opacity  0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        transform 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        filter   0.35s ease;
}

.lb-stage.lb-enter {
    opacity: 1;
    transform: scale(1) translateX(0);
    filter: blur(0);
}

.lb-stage.lb-switching {
    opacity: 0;
    transform: scale(0.94) translateX(calc(var(--lb-dir, 0) * -24px));
    filter: blur(4px);
    transition:
        opacity   0.18s ease-out,
        transform 0.18s ease-out,
        filter    0.18s ease-out;
}

/* Media inside stage */
.lb-stage img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 14px;
    object-fit: contain;
    box-shadow:
        0 8px 40px var(--media-scrim-strong),
        0 0 0 1px var(--cine-border-soft);
    display: block;
}

.lb-stage video {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 14px;
    object-fit: contain;
    box-shadow:
        0 8px 40px var(--media-scrim-strong),
        0 0 0 1px var(--cine-border-soft);
    display: block;
    background: var(--cine-bg);
}

.lb-stage iframe {
    width: min(940px, 90vw);
    height: min(529px, calc(min(940px, 90vw) * 9 / 16));
    border: none;
    border-radius: 14px;
    display: block;
    box-shadow:
        0 8px 40px var(--media-scrim-strong),
        0 0 0 1px var(--cine-border-soft);
}

/* ── Navigation arrows ── */
.lb-nav {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--cine-border-soft);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    outline: none;
}

.lb-nav:hover {
    background: rgba(var(--accent-rgb), 0.15);
    border-color: var(--first-color);
    color: var(--first-color);
    box-shadow: 0 0 22px rgba(var(--accent-rgb), 0.25);
    transform: scale(1.08);
}

.lb-nav:disabled {
    opacity: 0.18;
    cursor: default;
    pointer-events: none;
    transform: none;
}

/* ── Close button ── */
.lb-close {
    position: absolute;
    top: -56px;
    right: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.09);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    outline: none;
}

.lb-close:hover {
    background: var(--first-color);
    border-color: var(--first-color);
    color: var(--cine-text);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.4);
}

/* ── Counter (1 / 12) ── */
.lb-counter {
    position: relative;
    z-index: 1;
    margin-top: 18px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.35);
    user-select: none;
}

/* ── Dot indicators ── */
.lb-dots {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 6px;
    margin-top: 12px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 300px;
}

.lb-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.lb-dot.lb-dot-active {
    background: var(--first-color);
    box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.6);
    transform: scale(1.4);
}

.lb-dot:hover:not(.lb-dot-active) {
    background: rgba(255, 255, 255, 0.5);
}

/* ── Responsive ── */
@media (max-width: 700px) {
    .lb-wrapper {
        gap: 8px;
    }

    .lb-nav {
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
    }

    .lb-close {
        top: -48px;
        width: 38px;
        height: 38px;
    }

    .lb-stage img,
    .lb-stage video {
        border-radius: 10px;
    }

    .lb-stage iframe {
        border-radius: 10px;
    }
}

/*===============================================================
  STAGE ENTRANCE — staggered overlay text + ghost-frame reveal
  Hooks onto `.pf-stage-in` (toggled by the stage IntersectionObserver
  in web-portfolio.html). Each overlay element rises + fades in with a
  small per-element delay as the stage centers in view.
===============================================================*/
.pf-stage .pf-overlay-eyebrow,
.pf-stage .pf-overlay-tag,
.pf-stage .pf-overlay-logo,
.pf-stage .pf-overlay-title,
.pf-stage .pf-overlay-desc,
.pf-stage .pf-overlay-chips {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.pf-stage.pf-stage-in .pf-overlay-eyebrow { opacity: 1; transform: none; transition-delay: 0.05s; }
.pf-stage.pf-stage-in .pf-overlay-tag    { opacity: 1; transform: none; transition-delay: 0.10s; }
.pf-stage.pf-stage-in .pf-overlay-logo   { opacity: 1; transform: none; transition-delay: 0.16s; }
.pf-stage.pf-stage-in .pf-overlay-title  { opacity: 1; transform: none; transition-delay: 0.22s; }
.pf-stage.pf-stage-in .pf-overlay-desc   { opacity: 1; transform: none; transition-delay: 0.30s; }
.pf-stage.pf-stage-in .pf-overlay-chips  { opacity: 1; transform: none; transition-delay: 0.38s; }

/* Ghost frame behind the device/website — eases in slightly after the stage centers */
.pf-stage .pf-bg-frame-ghost,
.pf-stage .pf-phone-ghost {
    opacity: 0;
    transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.12s;
}
.pf-stage.pf-stage-in .pf-bg-frame-ghost,
.pf-stage.pf-stage-in .pf-phone-ghost {
    opacity: 1;
}

/*===============================================================
  ACTIVE-STAGE ACCENT ATMOSPHERE
  A fixed, full-viewport accent glow behind the stages that
  smoothly shifts to the active stage's accent hue as you scroll.
  The stage observer (web-portfolio.html) writes --glow-h/s/l onto
  .pf-section from the centered stage's --accent-*. @property lets
  the hue/sat/lightness interpolate instead of snapping.
===============================================================*/
@property --glow-h { syntax: '<number>';     inherits: true; initial-value: 280; }
@property --glow-s { syntax: '<percentage>'; inherits: true; initial-value: 80%; }
@property --glow-l { syntax: '<percentage>'; inherits: true; initial-value: 60%; }

.pf-section {
    --glow-h: 280;
    --glow-s: 80%;
    --glow-l: 60%;
    transition: --glow-h 0.8s var(--ease-out, ease),
                --glow-s 0.8s var(--ease-out, ease),
                --glow-l 0.8s var(--ease-out, ease);
}

.pf-section::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0; /* above the dot-grid ::before + bg, below content (z-index:1) */
    pointer-events: none;
    background:
        radial-gradient(60% 55% at 18% 22%,
            hsl(var(--glow-h) var(--glow-s) var(--glow-l) / 0.11) 0%, transparent 62%),
        radial-gradient(55% 50% at 84% 82%,
            hsl(var(--glow-h) var(--glow-s) var(--glow-l) / 0.08) 0%, transparent 60%);
}

/* Slightly stronger atmosphere in light theme so it reads on the dark gallery */
[data-theme="light"] .pf-section::after {
    background:
        radial-gradient(60% 55% at 18% 22%,
            hsl(var(--glow-h) var(--glow-s) var(--glow-l) / 0.14) 0%, transparent 62%),
        radial-gradient(55% 50% at 84% 82%,
            hsl(var(--glow-h) var(--glow-s) var(--glow-l) / 0.10) 0%, transparent 60%);
}

/*===============================================================
  WALKREEL AMBIENT — splat-world fly-through behind the device.
  Only the WalkReel stage has a .pf-ambient video. It sits behind
  the watermark + phone (z-index 0), screen-blends so the dark
  splat points glow, reveals when the stage is active, and drifts
  slowly (tasteful parallax that doesn't fight the foreground).
===============================================================*/
.pf-ambient {
    position: absolute;
    inset: -8%;
    width: 116%;
    height: 116%;
    object-fit: cover;
    z-index: 0;
    opacity: 0;
    pointer-events: none;
    mix-blend-mode: screen;
    filter: saturate(1.1) brightness(0.85);
    transition: opacity 1.3s var(--ease-out);
    animation: pf-ambient-drift 22s ease-in-out infinite alternate;
    will-change: transform, opacity;
}
.pf-stage.pf-stage-in .pf-ambient {
    opacity: 0.45;
}
@keyframes pf-ambient-drift {
    from { transform: scale(1.04) translate3d(0, 1.5%, 0); }
    to   { transform: scale(1.13) translate3d(0, -1.5%, 0); }
}
@media (prefers-reduced-motion: reduce) {
    .pf-ambient { animation: none; }
}

/*===============================================================
  NAMED PROJECT ACCENTS — apply a class instead of inline HSL.
  Each sets the --accent-h/s/l the stage/nav-button reads. Future
  stages reference one of these, not raw HSL.
===============================================================*/
.acc-kahnguide { --accent-h: 200; --accent-s: 75%; --accent-l: 58%; } /* blue  */
.acc-puton     { --accent-h: 285; --accent-s: 80%; --accent-l: 62%; } /* purple*/
.acc-motai     { --accent-h: 212; --accent-s: 85%; --accent-l: 58%; } /* blue  */
.acc-nuklid    { --accent-h: 160; --accent-s: 75%; --accent-l: 55%; } /* green */
.acc-walkreel  { --accent-h: 30;  --accent-s: 90%; --accent-l: 58%; } /* amber */

/*===============================================================
  LIGHT THEME — portfolio gallery (web-portfolio + videography)
  Page frame, nav, intro/section text, overlay glass cards and the
  watermark go light; the device/browser/phone FRAMES stay dark
  (mockups showing dark apps/sites). Scoped to the portfolio
  wrappers so other --cine-* pages are untouched.
===============================================================*/
[data-theme="light"] .pf-section,
[data-theme="light"] .portfolio-section,
[data-theme="light"] .portfolio-intro,
[data-theme="light"] .portfolio-cta {
  /* flip the glass/text/border/grid tokens (NOT --cine-surface*, which
     keeps device/browser frames dark) */
  --cine-text: hsl(228, 30%, 12%);
  --cine-text-dim: hsl(228, 12%, 40%);
  --cine-glass: hsla(0, 0%, 100%, 0.72);
  --cine-glass-soft: hsla(228, 30%, 14%, 0.05);
  --cine-grid: hsla(228, 30%, 14%, 0.05);
  --cine-border: hsla(228, 30%, 14%, 0.14);
  --cine-border-soft: hsla(228, 30%, 14%, 0.08);
  background: var(--body-color);
}

/* hardcoded white page text → dark on the light page */
[data-theme="light"] .pf-intro-text,
[data-theme="light"] .pf-overlay-desc { color: hsl(228, 12%, 38%); }
/* The nav pill is intentionally dark in BOTH themes, so its text stays light. */
[data-theme="light"] .pf-nav-label { color: var(--first-color, #e23744); }
[data-theme="light"] .pf-nav-btn { color: rgba(255, 255, 255, 0.82); }
[data-theme="light"] .pf-overlay-eyebrow .eyebrow-2 { color: hsl(228, 12%, 42%); }
/* chips: white text is invisible on the light glass card → dark text + clearer pill */
[data-theme="light"] .pf-overlay-chips span {
    color: hsl(228, 24%, 24%);
    background: hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.16);
    border-color: hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.50);
}
[data-theme="light"] .pf-overlay-eyebrow { text-shadow: 0 2px 16px rgba(255,255,255,0.65); }

/* watermark: gentler neon on a light bg (full strength would glare) */
[data-theme="light"] .pf-stage-watermark {
  color: hsl(var(--accent-h) var(--accent-s) calc(var(--accent-l) - 8%) / 0.10);
  text-shadow:
      0 0 40px hsl(var(--accent-h) 85% 55% / 0.30),
      0 0 110px hsl(var(--accent-h) 85% 50% / 0.16);
}
[data-theme="light"] .pf-stage-watermark::before { opacity: 0.55; }
