/* ===========================
   PROJECTS PAGE — HERO
=========================== */
.pj-hero {
    padding: 8rem 0 7rem;
    background: #faf9f7;
    position: relative;
    overflow: hidden;
}

/* Spinning mandala — decorative, right side of hero */
.pj-mandala-wrap {
    position: absolute;
    right: -100px;
    top: 58%;
    transform: translateY(-50%);
    width: 580px;
    height: 580px;
    pointer-events: none;
    transition: transform 1.2s ease;
}

.pj-hero:hover .pj-mandala-wrap {
    transform: translateY(-50%) scale(1.06);
}

.pj-mandala {
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0.13;
    animation: pjMandalaSpin 35s linear infinite;
    transition: opacity 0.9s ease;
}

.pj-hero:hover .pj-mandala {
    opacity: 0.2;
}

@keyframes pjMandalaSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.pj-hero-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(3.2rem, 6vw, 5.8rem);
    line-height: 1.08;
    letter-spacing: -0.02em;
    color: #1c1c1e;
    margin: 1.4rem 0 2.2rem;
}

.pj-hero-title em {
    font-style: italic;
    font-weight: 300;
}

.pj-hero-sub {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: 1rem;
    color: #8a8480;
    line-height: 1.85;
    max-width: 500px;
}

/* ===========================
   STATS STRIP
=========================== */
.pj-stats {
    background: #111110;
    padding: 4.5rem 0;
}

.pj-stats-row {
    display: flex;
    align-items: center;
}

.pj-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pj-stat-num {
    display: block;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: 3.8rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1;
    letter-spacing: -0.02em;
}

.pj-stat-lbl {
    display: block;
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.28);
}

.pj-stat-divider {
    width: 1px;
    height: 56px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 3.5rem;
    flex-shrink: 0;
}

/* ===========================
   FILTER BAR
=========================== */
.pj-filter-bar {
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.6rem 0;
    border-top: 1px solid #ede9e3;
    border-bottom: 1px solid #ede9e3;
    position: sticky;
    top: 0;
    z-index: 50;
    transition: box-shadow 0.3s ease;
}

.pj-filter-bar.pj-bar-stuck {
    box-shadow: 0 4px 28px rgba(0,0,0,0.07);
}

.pj-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.pj-filter-btn {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: 0.65rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #9e9890;
    background: none;
    border: 1px solid #e8e2da;
    padding: 0.38rem 0.9rem;
    cursor: pointer;
    transition: color 0.25s ease, border-color 0.25s ease,
                background 0.25s ease, transform 0.18s ease;
    line-height: 1;
}

.pj-filter-btn:hover {
    color: #1c1c1e;
    border-color: #c8c0b4;
    transform: translateY(-1px);
}

.pj-filter-btn.active {
    color: #faf9f7;
    background: #1c1c1e;
    border-color: #1c1c1e;
}

/* ===========================
   APPLE-STYLE SCROLL GALLERY
   — The whole section is a tall scroll zone.
   — The sticky stage stays fixed while you scroll.
=========================== */
.pj-scroll-gallery {
    /* height set by JS: projects.length × 100vh */
    position: relative;
}

/* The sticky viewport — stays pinned during the scroll zone */
.pj-stage {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(to right, #ffffff 60%, #0d0d0d 60%);
}

/* ── Slide: one per project, all stacked in the same space ── */
.pj-slide {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}

.pj-slide.active {
    opacity: 1;
    pointer-events: auto;
}

/* ── Image panel ── */
.pj-slide-img-wrap {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pj-slide-img {
    position: absolute;
    inset: 0;
    background-size: contain;
    background-position: center center;
    background-repeat: no-repeat;
    background-color: #ffffff;
}

/* Fallback when no image */
.pj-slide-img.no-img {
    background: #1c1c1e;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pj-slide-img.no-img::before {
    content: attr(data-letter);
    font-family: 'Cormorant Garamond', serif;
    font-size: 18vw;
    font-weight: 300;
    color: rgba(255,255,255,0.04);
    position: absolute;
    user-select: none;
}

/* ── Info panel ── */
.pj-slide-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3.5rem 4rem 3.5rem 3rem;
    position: relative;
    z-index: 2;
    background: #0d0d0d;
}

/* Single compact meta line: index · category */
.pj-slide-meta {
    font-family: 'Inter', sans-serif;
    font-size: 0.58rem;
    font-weight: 300;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.28);
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s ease 0.05s, transform 0.5s cubic-bezier(0.22,1,0.36,1) 0.05s;
}

.pj-slide-meta-sep {
    width: 1px;
    height: 10px;
    background: rgba(255,255,255,0.15);
    flex-shrink: 0;
}

.pj-slide-meta-cat {
    color: var(--cat-color, #b01c0a);
}

/* title */
.pj-slide-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(1.8rem, 2.8vw, 2.6rem);
    color: rgba(255,255,255,0.88);
    line-height: 1.15;
    letter-spacing: -0.01em;
    margin-bottom: 1rem;
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s ease 0.14s, transform 0.6s cubic-bezier(0.22,1,0.36,1) 0.14s;
}

/* description */
.pj-slide-desc {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.38);
    line-height: 1.75;
    max-width: 300px;
    margin-bottom: 0.8rem;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.6s ease 0.22s, transform 0.6s cubic-bezier(0.22,1,0.36,1) 0.22s;
}

/* scope of work */
.pj-slide-scope {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
    margin-bottom: 1.4rem;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.6s ease 0.28s, transform 0.6s cubic-bezier(0.22,1,0.36,1) 0.28s;
}

.pj-slide-scope-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.52rem;
    font-weight: 400;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.55);
    white-space: nowrap;
}

.pj-slide-scope-label::after {
    display: none;
}

.pj-slide-scope-val {
    font-family: 'Inter', sans-serif;
    font-size: 0.6rem;
    font-weight: 400;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(200, 169, 106, 0.75);
}

/* location — plain comma-separated text, no boxes */
.pj-slide-locs {
    font-family: 'Inter', sans-serif;
    font-size: 0.58rem;
    font-weight: 300;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.55);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.55s ease 0.28s, transform 0.55s cubic-bezier(0.22,1,0.36,1) 0.28s;
    line-height: 1.8;
}

/* When slide becomes active → text animates in */
.pj-slide.active .pj-slide-meta,
.pj-slide.active .pj-slide-title,
.pj-slide.active .pj-slide-desc,
.pj-slide.active .pj-slide-scope,
.pj-slide.active .pj-slide-locs {
    opacity: 1;
    transform: translateY(0);
}

/* ===========================
   PROJECT NAVIGATOR — compact tick column
   Numbers + ticks float freely. Active item gets an iOS glass pill.
=========================== */
.pj-project-nav {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    z-index: 20;
    max-height: 80vh;
    overflow-y: auto;
    overflow-x: visible;
    scrollbar-width: none;
    /* no panel background — items float freely over the content */
}

.pj-project-nav::-webkit-scrollbar { display: none; }

/* The inner wrapper (keeps the overflow-x visible for tooltips) */
.pj-project-nav-inner {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    overflow: visible;
    padding: 0.5rem 0;
}

/* ── Each navigator row ── */
.pj-nav-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    cursor: pointer;
    border: none;
    background: transparent;
    padding: 4px 0;
    border-radius: 24px;
    transition: padding 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

/* iOS Dynamic Island – style glass pill for the active item */
.pj-nav-item.active {
    /* frosted glass capsule */
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 24px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.28), /* top gloss highlight */
        inset 0 -1px 0 rgba(0, 0, 0, 0.18),      /* bottom depth */
        0 8px 28px rgba(0, 0, 0, 0.28),           /* outer drop shadow */
        0 0 0 0.5px rgba(255,255,255,0.06);       /* micro-border */
    padding: 5px 10px 5px 10px;
}

/* ── Tick mark (right-most element) ── */
.pj-nav-tick {
    display: block;
    width: 16px;
    height: 2px;
    background: rgba(255,255,255,0.35);
    border-radius: 1px;
    transition: width 0.25s cubic-bezier(0.22,1,0.36,1),
                background 0.25s ease;
    flex-shrink: 0;
}

.pj-nav-item:hover .pj-nav-tick {
    width: 20px;
    background: rgba(255,255,255,0.7);
}

.pj-nav-item.active .pj-nav-tick {
    width: 24px;
    background: var(--cat-color, #b01c0a);
}

/* ── Index number ── */
.pj-nav-num {
    font-family: 'Inter', sans-serif;
    font-size: 0.5rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    color: rgba(255,255,255,0.55);
    line-height: 1;
    transition: color 0.2s ease;
    flex-shrink: 0;
    min-width: 1.4rem;
    text-align: right;
}

.pj-nav-item:hover .pj-nav-num {
    color: rgba(255,255,255,0.9);
}

.pj-nav-item.active .pj-nav-num {
    color: var(--cat-color, #b01c0a);
    font-weight: 500;
}

/* ── Name: floating tooltip that appears to the LEFT on hover ──
   For the active item it's always visible and inline (not floating).
=================================================================== */
.pj-nav-name {
    position: absolute;
    right: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%) translateX(6px);
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
    font-size: 0.6rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    color: #ffffff;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid rgba(255,255,255,0.14);
    padding: 0.28rem 0.65rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.16s ease, transform 0.16s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 30;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

/* Show tooltip on hover */
.pj-nav-item:hover .pj-nav-name {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* Active item: name is ALWAYS visible, rendered inline (not floating) */
.pj-nav-item.active .pj-nav-name {
    position: relative;
    right: auto;
    top: auto;
    transform: none;
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
    opacity: 1;
    pointer-events: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    color: rgba(255,255,255,0.88);
    font-weight: 300;
    font-size: 0.6rem;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    order: -1;
}
/* ===========================
   KEYBOARD NAV HINT
=========================== */
.pj-kbd-hint {
    position: absolute;
    bottom: 4.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.55rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.22);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 10;
    white-space: nowrap;
}

.pj-kbd-hint.show {
    opacity: 1;
}

.pj-kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.3rem;
    height: 1.3rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 3px;
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1;
}

/* ── Scroll hint arrow at bottom ── */
.pj-scroll-hint {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    z-index: 10;
    opacity: 1;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.pj-scroll-hint.hidden {
    opacity: 0;
}

.pj-scroll-hint-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.55rem;
    font-weight: 300;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.25);
}

.pj-scroll-hint-line {
    width: 1px;
    height: 36px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.25), transparent);
    animation: scrollHintPulse 1.8s ease-in-out infinite;
}

@keyframes scrollHintPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.8); }
    50%       { opacity: 1;   transform: scaleY(1); }
}

/* ── Counter badge — bottom left ── */
.pj-stage-counter {
    position: absolute;
    bottom: 2.2rem;
    left: 2.5rem;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    font-weight: 300;
    color: #c8c0b4;
    letter-spacing: 0.08em;
    z-index: 10;
    pointer-events: none;
}

.pj-stage-counter-cur {
    color: #1c1c1e;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
    transition: color 0.3s ease;
}

/* ── Filter badge shown on stage (when filter active) ── */
.pj-active-filter-badge {
    position: absolute;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Inter', sans-serif;
    font-size: 0.58rem;
    font-weight: 400;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 0.35rem 0.9rem;
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pj-active-filter-badge.visible {
    opacity: 1;
}

/* ===========================
   QUOTE STRIP
=========================== */
.pj-quote {
    background: #111110;
    padding: 9rem 0;
}

.pj-pull-quote {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.7rem, 3.2vw, 2.7rem);
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.55;
    letter-spacing: -0.01em;
    margin: 0 0 2rem;
    max-width: 840px;
    border: none;
    padding: 0;
}

.pj-pull-cite {
    display: block;
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: 0.68rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.28);
    font-style: normal;
}

/* ===========================
   CTA SECTION
=========================== */
.pj-cta {
    background: #EDE6D8;
    padding: 9rem 0;
}

.pj-cta .section-label {
    color: #B0A090;
}

.pj-cta .section-title {
    color: #1C1A16;
}

.pj-cta-tagline {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: 0.8rem;
    color: #b0a898;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    margin-top: -2rem;
}

/* ===========================
   MOBILE — max-width: 768px
=========================== */
@media (max-width: 768px) {

    /* Hero */
    .pj-hero {
        padding: 5rem 0 3.5rem;
    }
    .pj-mandala-wrap {
        width: 260px;
        height: 260px;
        right: -60px;
        top: 50%;
    }

    /* Stats strip — wrap to 2×2 */
    .pj-stats {
        padding: 3rem 0;
    }
    .pj-stats-row {
        flex-wrap: wrap;
        gap: 0;
    }
    .pj-stat {
        flex: 0 0 50%;
        padding: 1.4rem 1.4rem 1.4rem 0;
    }
    .pj-stat:nth-child(even) {
        padding-left: 1.4rem;
        padding-right: 0;
        border-left: 1px solid rgba(255,255,255,0.08);
    }
    .pj-stat-divider {
        display: none;
    }
    .pj-stat-num {
        font-size: 2.6rem;
    }

    /* Filter bar — single row horizontal scroll */
    .pj-filter-bar {
        padding: 0.5rem 0 !important;
    }
    .pj-filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 0 1.4rem;
        gap: 0.4rem;
    }
    .pj-filters::-webkit-scrollbar { display: none; }
    .pj-filter-btn {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 0.45rem 1rem;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* Stage background — vertical split for stacked layout */
    .pj-stage {
        background: linear-gradient(to bottom, #ffffff 52%, #0d0d0d 52%);
    }

    /* Scroll gallery — stack image on top, info below */
    .pj-slide {
        grid-template-columns: 1fr;
        grid-template-rows: 52vh 1fr;
    }
    .pj-slide-info {
        padding: 1.8rem 1.4rem calc(1.8rem + 90px + env(safe-area-inset-bottom, 0px)) 1.4rem;
        justify-content: flex-start;
    }
    .pj-slide-title {
        font-size: clamp(1.5rem, 6vw, 2rem);
    }
    .pj-slide-desc {
        max-width: 100%;
    }

    /* Project nav — hide on mobile (too many items) */
    .pj-project-nav {
        display: none;
    }

    /* Counter — position over white image area, dark text */
    .pj-stage-counter {
        bottom: auto;
        top: 1.2rem;
        left: 1.4rem;
    }

    /* Scroll hint — clear bottom nav */
    .pj-scroll-hint {
        bottom: calc(1.4rem + 90px + env(safe-area-inset-bottom, 0px));
    }

    /* Hide keyboard hint on mobile */
    .pj-kbd-hint {
        display: none;
    }

    /* Quote */
    .pj-quote {
        padding: 4.5rem 0;
    }

    /* CTA */
    .pj-cta {
        padding: 4.5rem 0;
        padding-bottom: calc(4.5rem + 90px + env(safe-area-inset-bottom, 0px));
    }

    /* Footer */
    footer {
        padding-bottom: calc(3rem + 90px + env(safe-area-inset-bottom, 0px));
    }
}
