/* ============================================
   PROJECTS PAGE — Full Portfolio Browser
   Reuses proj-section--compact from all-projects.css
   ============================================ */

/* ---- HERO: Split layout ---- */
.projects-hero {
    padding-top: 120px;
    padding-bottom: 0;
    background: #F5F5F5;
    overflow: hidden;
}

.projects-hero__inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-10);
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
    align-items: center;
}

@media (min-width: 1024px) {
    .projects-hero__inner {
        grid-template-columns: 1fr 1.2fr;
        gap: var(--space-16);
        padding-top: var(--space-10);
        padding-bottom: var(--space-16);
    }
}

/* Text side */
.projects-hero__text {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.projects-hero__eyebrow {
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    letter-spacing: var(--tracking-widest);
    text-transform: uppercase;
    color: var(--color-orange);
}

.projects-hero__title {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.projects-hero__title-main {
    font-family: var(--font-heading);
    font-size: clamp(3rem, 6vw, 5.5rem);
    font-weight: var(--font-semibold);
    line-height: var(--leading-none);
    letter-spacing: -0.6px;
    color: var(--color-text-primary);
    display: block;
}

/* "Built to Last" — Dancing Script with gold brush underline */
.projects-hero__title-script {
    font-family: 'Dancing Script', cursive;
    /* Floor bumped from 1.8rem → 2.4rem so the cursive subhead doesn't
       shrink to body-text size on phones. */
    font-size: clamp(2.4rem, 5vw, 3.2rem);
    font-weight: 700;
    line-height: 1;
    color: var(--color-text-primary);
    display: block;
    position: relative;
    padding-bottom: 0.2em;
    margin-top: 0.15em;
}

.projects-hero__title-script::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 0.18em;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 16' preserveAspectRatio='none'%3E%3Cpath d='M 4,8 C 50,3 130,2 200,6 C 270,10 350,8 396,5 C 350,11 270,15 200,12 C 130,9 50,12 4,13 Z' fill='%23FF1A0F' opacity='0.92'/%3E%3Cpath d='M 12,10 C 70,7 150,6 210,9 C 270,12 360,10 390,8' stroke='%23FF1A0F' stroke-width='1' fill='none' opacity='0.45' stroke-linecap='round'/%3E%3C/svg%3E");
    background-size: 100% 100%;
    background-repeat: no-repeat;
}

.projects-hero__subtitle {
    font-family: var(--font-body);
    font-size: var(--text-lg);
    color: var(--color-text-secondary);
    line-height: var(--leading-normal);
    max-width: 480px;
}

/* Stats row */
.projects-hero__stats {
    display: flex;
    align-items: center;
    gap: var(--space-6);
    margin-top: var(--space-4);
}

.projects-hero__stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.projects-hero__stat-number {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--color-text-primary);
    letter-spacing: -0.6px;
    line-height: 1;
}

.projects-hero__stat-label {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: var(--font-semibold);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
    color: var(--color-gray-300);
}

.projects-hero__stat-divider {
    width: 1px;
    height: 32px;
    background: var(--color-border);
}

/* Map side */
.projects-hero__map-wrap {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #F5E6D3;
    z-index: 0;
}

.projects-hero__map {
    width: 100%;
    height: 100%;
}

/* Hide Leaflet attribution */
.projects-hero__map .leaflet-control-attribution {
    display: none;
}

@media (max-width: 1023px) {
    .projects-hero__map-wrap {
        aspect-ratio: 16 / 9;
        margin: 0 calc(var(--container-padding) * -1);
        border-radius: 0;
    }
}

/* ============================================================
   Hero entrance animation (page load)
   - Title lines mask-reveal (rise from beneath baseline)
   - Subtitle + stats fade up
   - Brush underline draws in left → right
   - Map: simple fade in (no transform — Leaflet's tile rendering
     dislikes being scaled/translated mid-init)
   ============================================================ */

/* Title mask reveal */
.projects-hero__title-main,
.projects-hero__title-script {
    display: inline-block;
    overflow: hidden;
    padding: 0.05em 0.04em;
    margin: -0.05em -0.04em;
}
.projects-hero__title-inner {
    display: inline-block;
    transform: translateY(110%);
    will-change: transform;
    animation: projectsHeroLineRise 700ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.projects-hero__title-main   .projects-hero__title-inner { animation-delay: 100ms; }
.projects-hero__title-script .projects-hero__title-inner { animation-delay: 220ms; }

/* Brush underline draws in after the script line lands.
   Reveal at natural width via clip-path (no horizontal stretching). */
.projects-hero__title-script::after {
    clip-path: inset(0 100% 0 0);
    animation: projectsHeroBrush 1100ms cubic-bezier(0.22, 1, 0.36, 1) 600ms forwards;
}

/* Subtitle — pure opacity fade (no translate). Text-element translate
   animations re-rasterize fonts at subpixel offsets each frame, which
   shimmers even with GPU promotion. Fade alone is glitch-free. */
.projects-hero__subtitle {
    opacity: 0;
    animation: projectsHeroFadeIn 600ms cubic-bezier(0.22, 1, 0.36, 1) 480ms forwards;
}

/* Stats row — pure opacity fade for the same reason */
.projects-hero__stats > * {
    opacity: 0;
    animation: projectsHeroFadeIn 550ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.projects-hero__stats > *:nth-child(1) { animation-delay: 580ms; }
.projects-hero__stats > *:nth-child(2) { animation-delay: 630ms; }
.projects-hero__stats > *:nth-child(3) { animation-delay: 680ms; }
.projects-hero__stats > *:nth-child(4) { animation-delay: 730ms; }
.projects-hero__stats > *:nth-child(5) { animation-delay: 780ms; }

/* Map — plain fade only (no transform) */
.projects-hero__map-wrap {
    opacity: 0;
    animation: projectsHeroMapFade 900ms cubic-bezier(0.22, 1, 0.36, 1) 280ms forwards;
}

@keyframes projectsHeroLineRise {
    from { transform: translateY(110%); }
    to   { transform: translateY(0); }
}
@keyframes projectsHeroBrush {
    from { clip-path: inset(0 100% 0 0); }
    to   { clip-path: inset(0 0 0 0); }
}
@keyframes projectsHeroFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes projectsHeroMapFade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .projects-hero__title-inner,
    .projects-hero__title-script::after,
    .projects-hero__subtitle,
    .projects-hero__stats > *,
    .projects-hero__map-wrap {
        animation: none;
    }
    .projects-hero__title-inner             { transform: none; }
    .projects-hero__title-script::after     { clip-path: inset(0 0 0 0); }
    .projects-hero__subtitle                { opacity: 1; }
    .projects-hero__stats > *               { opacity: 1; }
    .projects-hero__map-wrap                { opacity: 1; }
}


/* ---- FILTER BAR ---- */
.projects-filter {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    background: rgba(245, 245, 245, 0.92);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-4) 0;
}

/* On mobile, the filter bar (search + pills + refine) shouldn't follow
   the page as you scroll — let it sit in normal flow and scroll away. */
@media (max-width: 768px) {
    .projects-filter {
        position: static;
    }
}

.projects-filter__inner {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
    flex-wrap: wrap;
}

/* Search input */
.projects-filter__search {
    position: relative;
    flex: 0 1 320px;
    min-width: 200px;
}

.projects-filter__search-icon {
    position: absolute;
    left: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    color: var(--color-gray-300);
    pointer-events: none;
}

.projects-filter__input {
    width: 100%;
    padding: 10px var(--space-4) 10px 40px;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--color-text-primary);
    background: var(--color-pure-white);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-pill);
    outline: none;
    transition: border-color var(--duration-base) var(--ease-out),
                box-shadow var(--duration-base) var(--ease-out);
}

.projects-filter__input:focus {
    border-color: var(--color-gold);
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.15);
}

.projects-filter__input::placeholder {
    color: var(--color-gray-300);
}

/* Sector pills */
.projects-filter__pills {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.projects-filter__pills::-webkit-scrollbar {
    display: none;
}

/* Sliding indicator — house motion pattern */
.projects-filter__pill-indicator {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 0;
    background: var(--color-text-primary);
    border-radius: var(--radius-pill);
    transform: translateX(0);
    transition: transform 520ms cubic-bezier(0.4, 0, 0.1, 1),
                width 520ms cubic-bezier(0.4, 0, 0.1, 1);
    pointer-events: none;
    z-index: 0;
}

.projects-filter__pill {
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    padding: 8px 20px;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: var(--font-semibold);
    letter-spacing: 0.02em;
    color: var(--color-text-primary);
    background: transparent;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: color var(--duration-base) var(--ease-out),
                border-color var(--duration-base) var(--ease-out);
    white-space: nowrap;
}

.projects-filter__pill:hover {
    border-color: var(--color-text-primary);
}

.projects-filter__pill--active,
.projects-filter__pill--active:hover {
    color: var(--color-pure-white);
    border-color: transparent;
}

/* Count */
.projects-filter__count {
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--color-gray-300);
    letter-spacing: var(--tracking-wide);
    white-space: nowrap;
    margin-left: auto;
}

/* Refine button — matches search input height */
.projects-filter__refine {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
    background: var(--color-pure-white);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all var(--duration-base) var(--ease-out);
    white-space: nowrap;
    flex-shrink: 0;
}

.projects-filter__refine:hover {
    border-color: var(--color-text-primary);
}

.projects-filter__refine i {
    font-size: 1.1rem;
}

/* Clear all button — appears when filters are active */
.projects-filter__clear-all {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--color-gray-300);
    background: transparent;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all var(--duration-base) var(--ease-out);
    white-space: nowrap;
    flex-shrink: 0;
}

.projects-filter__clear-all:hover {
    color: var(--color-text-primary);
    border-color: var(--color-text-primary);
}

.projects-filter__clear-all i {
    font-size: 0.85rem;
}

.projects-filter__clear-all[hidden] {
    display: none;
}

@media (max-width: 768px) {
    /* Mobile: just the search box. Sector pills, project count, and
       the "Refine your search" button are hidden — the filter bar
       collapses to a single full-width search field. */
    .projects-filter__inner {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-3);
        padding: 0 var(--container-padding);
    }

    .projects-filter__search {
        flex: 1 1 100%;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .projects-filter__pills,
    .projects-filter__count,
    .projects-filter__refine {
        display: none !important;
    }
}


/* ---- PROJECT GRID — uses proj-section--compact from all-projects.css ---- */
.projects-grid-section {
    background: #F5F5F5;
    padding: clamp(20px, 2.5vw, 36px) clamp(16px, 2vw, 32px) var(--section-padding);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(14px, 1.4vw, 22px);
    /* Cap + center so the card grid doesn't stretch on ultra-wide displays.
       Matches the 1600px cap on the hero / filter bar above it. Below
       1600px viewport this is inert, so phone/tablet layouts are unchanged. */
    max-width: 1600px;
    margin-inline: auto;
}

@media (max-width: 1500px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1100px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 720px) {
    /* Phone: image-only grid. Two-up, every card is just its primary
       image — title, description, meta, CTA all hidden. Tapping the
       card navigates to the project (or plays the video for cards
       that have one — the existing video click handler still fires
       since it lives on the hero-wrap inside this image-only layout). */
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .projects-grid .proj-section--compact,
    .projects-grid .proj-section--compact.proj-section--flipped {
        grid-template-columns: 1fr;
        background: transparent;
        border: 0;
        border-radius: 12px;
        box-shadow: none;
        overflow: hidden;
        padding: 0;
        cursor: pointer;
    }

    .projects-grid .proj-section--compact:hover {
        transform: none;
        box-shadow: none;
    }

    /* Strip everything that isn't the primary image */
    .projects-grid .proj-section--compact .proj-section__info {
        display: none !important;
    }

    .projects-grid .proj-section--compact .proj-section__thumb {
        display: none !important;
    }

    /* Image side fills the card. The film-strip is normally a flex row
       sized to `min-width: max-content` so the strip can scroll
       horizontally — we have to undo that and switch to a single block
       so width:100% on the hero actually resolves to the card width. */
    .projects-grid .proj-section--compact .proj-section__images,
    .projects-grid .proj-section--compact .proj-section__drawing {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 12px;
        overflow: hidden;
    }

    .projects-grid .proj-section--compact .proj-section__film-strip,
    .projects-grid .proj-section--compact .proj-section__film-track {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        gap: 0 !important;
    }

    .projects-grid .proj-section--compact .proj-section__drawing::before,
    .projects-grid .proj-section--compact .proj-section__film-strip::before,
    .projects-grid .proj-section--compact .proj-section__film-strip::after {
        display: none !important;
    }

    .projects-grid .proj-section--compact .proj-section__hero-wrap {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 1 / 1 !important;
        cursor: pointer;
    }

    .projects-grid .proj-section--compact .proj-section__hero-img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover;
        display: block;
    }

    /* Play button: smaller, still visible for video cards */
    .projects-grid .proj-section--compact .proj-section__play-btn {
        width: 44px;
        height: 44px;
    }
}

/* Cards stack vertically in the 4-col grid — image on top, info below.
   Sliding-pill aesthetic (matches .co-about__indicator + map popup):
   white bg, soft warm border, 18px radius, soft elevated shadow,
   house motion curve on hover lift. */
.projects-grid .proj-section--compact {
    grid-template-columns: 1fr;
    background: var(--color-pure-white);
    border: 0.5px solid #d8d8d4;
    border-radius: 18px;
    box-shadow: 0 22px 50px -28px rgba(0, 0, 0, 0.22),
                0 2px 6px rgba(0, 0, 0, 0.04);
    transition: transform 520ms cubic-bezier(0.4, 0, 0.1, 1),
                box-shadow 520ms cubic-bezier(0.4, 0, 0.1, 1);
}

.projects-grid .proj-section--compact:hover {
    transform: translateY(-4px);
    box-shadow: 0 30px 60px -28px rgba(0, 0, 0, 0.28),
                0 4px 10px rgba(0, 0, 0, 0.05);
}

.projects-grid .proj-section--compact .proj-section__images {
    order: -1;
}

/* Flipped cards also stack the same way */
.projects-grid .proj-section--compact.proj-section--flipped {
    grid-template-columns: 1fr;
}

/* ── Vertical alignment across cards ──
   Image is fixed height, grid stretches all cards in a row to equal height,
   and the info side becomes a flex column so the sector / paragraph / meta /
   CTA sit at identical Y positions regardless of description length.
   - Sector reserves a fixed slot even when absent.
   - Paragraph is clamped to 3 lines AND given a fixed reserved height.
   - CTA is pushed to the bottom with margin-top: auto. */
.projects-grid .proj-section--compact .proj-section__info {
    align-items: stretch;
}

.projects-grid .proj-section--compact .proj-section__text {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.projects-grid .proj-section--compact .proj-section__sector {
    min-height: 0.85em;
}

.projects-grid .proj-section--compact:not(:has(.proj-section__sector)) .proj-section__text::before {
    content: "";
    display: block;
    min-height: calc(0.85em + var(--space-2));
}

.projects-grid .proj-section--compact .proj-section__inline {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(3em * 1.35);
    margin-bottom: clamp(12px, 1.5vw, 20px);
}

.projects-grid .proj-section--compact .proj-section__meta {
    margin-bottom: clamp(12px, 1.5vw, 18px);
}

.projects-grid .proj-section--compact .proj-section__cta {
    margin-top: auto;
}

@media (max-width: 900px) {
    .projects-grid .proj-section--compact {
        border-right: none;
    }
}


/* ---- EMPTY STATE ---- */
.projects-empty[hidden] { display: none; }

.projects-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    padding: var(--space-32) var(--container-padding);
    text-align: center;
    background: #fff;
}

.projects-empty__icon {
    font-size: 3rem;
    color: var(--color-gray-300);
}

.projects-empty__text {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
    letter-spacing: -0.6px;
}

.projects-empty__reset {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-pure-white);
    background: var(--color-text-primary);
    border: none;
    padding: 10px 28px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: background var(--duration-base) var(--ease-out);
}

.projects-empty__reset:hover {
    background: var(--color-gold-dark);
}


/* ============================================
   REFINE PANEL — Slide-out right drawer
   ============================================ */

/* ---- Fixed side tab — right edge ---- */
.refine-tab {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%) translateX(100%);
    z-index: var(--z-sticky);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 22px 32px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 700;
    -webkit-text-stroke: 0.5px currentColor;
    letter-spacing: var(--tracking-wide);
    color: var(--color-pure-white);
    background: var(--color-orange);
    border: none;
    border-radius: 16px 0 0 16px;
    cursor: pointer;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.18);
    transition: transform 0.4s var(--ease-out-expo), background 0.2s ease;
    white-space: nowrap;
}

.refine-tab i {
    font-size: 2rem;
}

.refine-tab--visible {
    transform: translateY(-50%) translateX(0);
}

.refine-tab:hover {
    background: var(--color-orange-dark);
}

/* Hide the floating right-edge refine tab on mobile */
@media (max-width: 768px) {
    .refine-tab {
        display: none !important;
    }
}

/* Overlay */
.refine-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal-backdrop);
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s var(--ease-out), visibility 0.35s;
}

.refine-overlay--open {
    opacity: 1;
    visibility: visible;
}

/* Panel */
.refine-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-modal);
    width: 420px;
    max-width: 90vw;
    background: var(--color-pure-white);
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.4s var(--ease-out-expo);
}

.refine-panel--open {
    transform: translateX(0);
}

/* Header */
.refine-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-6) var(--space-8);
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.refine-panel__title {
    font-family: var(--font-body);
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--color-text-primary);
    letter-spacing: -0.02em;
    margin: 0;
}

.refine-panel__close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--color-text-primary);
    font-size: 1.4rem;
    border-radius: var(--radius-md);
    transition: background var(--duration-fast) var(--ease-out);
}

.refine-panel__close:hover {
    background: var(--color-gray-50);
}

/* Body — scrollable */
.refine-panel__body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-6) var(--space-8);
}

/* Search inside panel */
.refine-panel__search {
    position: relative;
    margin-bottom: var(--space-2);
}

.refine-panel__search-icon {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.3rem;
    color: var(--color-gray-300);
    pointer-events: none;
}

.refine-panel__search-input {
    width: 100%;
    padding: var(--space-3) 0 var(--space-3) 36px;
    font-family: var(--font-body);
    font-size: var(--text-base);
    color: var(--color-text-primary);
    background: transparent;
    border: none;
    border-bottom: 1.5px solid var(--color-border);
    outline: none;
    transition: border-color var(--duration-base) var(--ease-out);
}

.refine-panel__search-input:focus {
    border-color: var(--color-text-primary);
}

.refine-panel__search-input::placeholder {
    color: var(--color-gray-300);
}

/* Clear all */
.refine-panel__clear {
    display: block;
    margin-left: auto;
    margin-bottom: var(--space-8);
    padding: 0;
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
    background: none;
    border: none;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    transition: color var(--duration-fast) var(--ease-out);
}

.refine-panel__clear:hover {
    color: var(--color-gold-dark);
}

/* Accordion groups */
.refine-panel__group {
    border-top: 1px solid var(--color-border);
}

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

.refine-panel__group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: var(--space-5) 0;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    color: var(--color-text-primary);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
    background: none;
    border: none;
    cursor: pointer;
    transition: color var(--duration-fast) var(--ease-out);
}

.refine-panel__group-header:hover {
    color: var(--color-gold-dark);
}

.refine-panel__group-header[aria-expanded="true"] {
    color: var(--color-text-primary);
}

.refine-panel__chevron {
    font-size: 1rem;
    transition: transform 0.3s var(--ease-out);
}

/* Body — animated height */
.refine-panel__group-body {
    overflow: hidden;
    max-height: 0;
    padding-bottom: 0;
    opacity: 0;
    transition: max-height 0.4s var(--ease-out-expo),
                opacity 0.3s var(--ease-out),
                padding-bottom 0.4s var(--ease-out-expo);
}

.refine-panel__group-body--open {
    max-height: 300px;
    padding-bottom: var(--space-5);
    opacity: 1;
}

/* Tags */
.refine-panel__tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.refine-panel__tag {
    padding: 8px 18px;
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    color: var(--color-text-secondary);
    background: transparent;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all var(--duration-base) var(--ease-out);
    white-space: nowrap;
}

.refine-panel__tag:hover {
    border-color: var(--color-text-primary);
}

.refine-panel__tag--active {
    background: var(--color-text-primary);
    border-color: var(--color-text-primary);
    color: var(--color-pure-white);
    font-weight: var(--font-semibold);
}

/* Footer */
.refine-panel__footer {
    flex-shrink: 0;
    padding: var(--space-5) var(--space-8);
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: center;
}

.refine-panel__apply {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    padding: 0;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
    color: var(--color-text-primary);
    background: none;
    border: none;
    cursor: pointer;
    transition: gap var(--duration-base) var(--ease-out), color var(--duration-base) var(--ease-out);
}

.refine-panel__apply:hover {
    gap: var(--space-4);
    color: var(--color-gold-dark);
}

.refine-panel__apply i {
    font-size: 1.1rem;
    color: var(--color-text-primary);
}


/* ============================================
   PAGINATION
   ============================================ */
.projects-pagination {
    background: #fff;
    border-top: 1px solid var(--color-border);
    padding: var(--space-8) var(--container-padding);
}

.projects-pagination__inner {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-6);
    flex-wrap: wrap;
}

.projects-pagination__info {
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--color-gray-300);
    letter-spacing: var(--tracking-wide);
    white-space: nowrap;
}

.projects-pagination__buttons {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.projects-pagination__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 var(--space-2);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
    background: transparent;
    border: 1.5px solid transparent;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all var(--duration-base) var(--ease-out);
}

.projects-pagination__btn:hover:not(:disabled):not(.projects-pagination__btn--active) {
    border-color: var(--color-border);
    background: var(--color-pure-white);
}

.projects-pagination__btn--active {
    background: var(--color-text-primary);
    border-color: var(--color-text-primary);
    color: var(--color-pure-white);
    cursor: default;
}

.projects-pagination__btn--arrow {
    border-color: var(--color-border);
}

.projects-pagination__btn--arrow:hover:not(:disabled) {
    border-color: var(--color-text-primary);
}

.projects-pagination__btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.projects-pagination__dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 40px;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--color-gray-300);
    letter-spacing: 2px;
    user-select: none;
}

@media (max-width: 480px) {
    .projects-pagination__inner {
        flex-direction: column;
        gap: var(--space-4);
    }

    .projects-pagination__btn {
        min-width: 36px;
        height: 36px;
        font-size: var(--text-xs);
    }
}
