/* ===== PROJECTS PAGE ===== */

/* Hero is full bleed from top — no padding on main */
main.page-content {
    padding-top: 0;
    min-height: 100vh;
}

/*
   Body gets padding-top from the maintenance strip JS.
   That pushes content down by --maint-h + --maint-gap (36px by default).
   We pull the hero up by --maint-gap so it sits flush under the strip
   with no gap — touching edge to edge.
*/
.proj-hero-wrap {
    margin-top: calc(-1 * var(--maint-gap, 6px));
    position: relative;
    width: 100%;
    height: 68vh;
    min-height: 520px;
    max-height: 800px;
    overflow: hidden;
    background: #070709;
}


/* ============================================================
   FEATURED CARD — fills the hero completely
   href and --feat-accent updated by JS on each slide change
============================================================ */
.proj-featured-card {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    /* No border, no border-radius — it's full bleed */
}

/* Image layer — fills entire hero */
.proj-feat-img {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: #070709;
}

/* Flip grid — JS populates */
.proj-feat-grid {
    position: absolute;
    inset: 0;
    display: grid;
}

/* Individual flip tiles */
.proj-feat-tile {
    position: relative;
    transform-style: preserve-3d;
    will-change: transform;
}
.proj-feat-tile-front,
.proj-feat-tile-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}
.proj-feat-tile-back    { transform: rotateY(180deg); }
.proj-feat-tile.flipped { transform: rotateY(180deg); }
.proj-feat-tile.flip-blur {
    animation: proj-feat-blur var(--flip-dur, 400ms) cubic-bezier(0.42, 0, 0.22, 1) forwards;
}
@keyframes proj-feat-blur {
    0%   { filter: blur(0px); }
    45%  { filter: blur(5px); }
    55%  { filter: blur(5px); }
    100% { filter: blur(0px); }
}

/* Gradient overlay — left for text, bottom for dots */
.proj-feat-img::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to right, rgba(10,10,15,0.96) 0%, rgba(10,10,15,0.60) 42%, rgba(10,10,15,0.06) 100%),
        linear-gradient(to top,   rgba(10,10,15,0.60) 0%, transparent 40%);
    z-index: 2;
    pointer-events: none;
}

/* ============================================================
   TEXT OVERLAY
   pointer-events: none so card link works through it.
   Transitions opacity only for the fade in/out on slide change.
============================================================ */
.proj-feat-content {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2.8rem 3.2rem 2.8rem 5.5rem;
    /* Left padding clears the prev arrow (40px wide at 1.5rem from edge) */
    /* Push content below navbar — navbar sits at ~36px + ~56px tall */
    padding-top: 120px;
    max-width: 640px;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.18s ease;
}
/* JS adds this class at start of transition, removes after flip completes */
.proj-feat-content.content-out {
    opacity: 0;
}

/* Eyebrow row */
.proj-feat-eyebrow {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 0.9rem;
    flex-wrap: wrap;
}

.proj-feat-badge {
    font-family: 'Roboto', sans-serif;
    font-size: 0.58rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    background: var(--green);
    color: #000;
    padding: 0.2rem 0.7rem;
    border-radius: 2px;
    font-weight: 700;
}

.proj-feat-status {
    display: flex;
    align-items: center;
    gap: 0.38rem;
    font-family: 'Roboto', sans-serif;
    font-size: 0.58rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-gray);
}

.proj-feat-date {
    font-family: 'Roboto', sans-serif;
    font-size: 0.58rem;
    letter-spacing: 0.12em;
    color: var(--text-dim);
}

/* Status LEDs */
.proj-status-led {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}
.proj-status-led.active {
    background: #24FF72;
    animation: proj-led-pulse 1.8s ease-in-out infinite;
}
.proj-status-led.completed {
    background: var(--feat-accent, var(--card-accent, #24FF72));
    box-shadow: 0 0 5px var(--feat-accent, var(--card-accent, #24FF72));
}
@keyframes proj-led-pulse {
    0%   { box-shadow: 0 0 0 0   rgba(36,255,114,0.7); }
    55%  { box-shadow: 0 0 0 5px rgba(36,255,114,0.0); }
    100% { box-shadow: 0 0 0 0   rgba(36,255,114,0.0); }
}

/* Title */
.proj-feat-title {
    font-family: 'Sugar Snow', cursive;
    font-size: clamp(2rem, 3.4vw, 3.2rem);
    font-weight: normal;
    color: var(--text-light);
    line-height: 1.1;
    margin-bottom: 0.9rem;
}

/* Description */
.proj-feat-desc {
    font-size: 0.92rem;
    color: var(--text-gray);
    line-height: 1.78;
    margin-bottom: 1.4rem;
    font-weight: 300;
    max-width: 480px;
}

.proj-feat-footer {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.proj-feat-tags {
    display: flex;
    gap: 0.36rem;
    flex-wrap: wrap;
}

.proj-feat-tag {
    font-family: 'Roboto', sans-serif;
    font-size: 0.57rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--feat-accent, var(--green));
    border: 1px solid color-mix(in srgb, var(--feat-accent, var(--green)) 45%, transparent);
    background: color-mix(in srgb, var(--feat-accent, var(--green)) 12%, transparent);
    padding: 0.18rem 0.55rem;
    border-radius: 2px;
}

.proj-feat-tools {
    display: flex;
    gap: 0.28rem;
    flex-wrap: wrap;
}

.proj-feat-tool {
    font-family: 'Roboto', sans-serif;
    font-size: 0.58rem;
    letter-spacing: 0.05em;
    color: color-mix(in srgb, var(--green) 55%, transparent);
    border: 1px solid color-mix(in srgb, var(--green) 30%, transparent);
    padding: 0.14rem 0.5rem;
    border-radius: 100px;
}

/* ============================================================
   DECORATIVE INDEX + DOTS — bottom right corner
============================================================ */
.proj-feat-index {
    position: absolute;
    bottom: 1.8rem;
    right: 2rem;
    z-index: 4;
    font-size: 7rem;
    font-weight: 900;
    font-family: 'Roboto', sans-serif;
    color: rgba(255, 255, 255, 0.035);
    letter-spacing: -0.04em;
    line-height: 1;
    pointer-events: none;
    /* sits behind dots */
}

/* Dots sit above the index, bottom right */
.proj-feat-dots {
    position: absolute;
    bottom: 1.4rem;
    right: 1.6rem;
    z-index: 10;
    display: flex;
    gap: 0.45rem;
    align-items: center;
}
.proj-feat-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    position: relative;
    z-index: 11;
}
.proj-feat-dot.active {
    background: var(--feat-accent, var(--green));
    width: 20px;
    border-radius: 3px;
}


/* ============================================================
   PREV / NEXT ARROWS
============================================================ */
.proj-feat-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10,10,15,0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 50%;
    color: rgba(255,255,255,0.70);
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
    pointer-events: auto;
}
.proj-feat-prev { left: 1.5rem; }
.proj-feat-next { right: 1.5rem; }

.proj-feat-nav:hover {
    background: rgba(10,10,15,0.80);
    border-color: var(--feat-accent, var(--green));
    color: var(--feat-accent, var(--green));
}


/* ============================================================
   STICKY BAR — title left, filters right
   Scrolls with page then sticks under the navbar.
   --navbar-bottom = maint-strip height + gap + navbar pill height (~56px)
============================================================ */
.proj-sticky-bar {
    position: sticky;
    top: 92px; /* approx: 30px strip + 6px gap + 56px navbar */
    z-index: 100;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border-subtle);
    padding: 28px 20px;
}

.proj-header-inner {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
}

.section-header {
    text-align: left;
    margin-bottom: 0;
}

.section-header .page-title {
    font-family: 'Sugar Snow', cursive;
    font-size: 3.5rem;
    color: var(--text-light);
    margin-bottom: 10px;
    font-weight: normal;
}

.section-header .page-subtitle {
    font-size: 1.05rem;
    color: var(--text-gray);
    line-height: 1.8;
}

/* Filter bar — right side of sticky bar */
.proj-filter-bar {
    display: flex;
    align-items: flex-end;
    padding-bottom: 4px;
    flex-shrink: 0;
}

.proj-filter-inner {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.proj-filter-btn {
    padding: 7px 16px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.15);
    color: var(--text-gray);
    font-size: 0.78rem;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: 'Roboto', sans-serif;
    letter-spacing: 0.04em;
}
.proj-filter-btn:hover {
    border-color: var(--green);
    color: var(--text-light);
}
.proj-filter-btn.active {
    background: var(--green);
    border-color: var(--green);
    color: var(--bg-dark);
}


/* ============================================================
   LISTING SECTION
============================================================ */
.projects-listing-section {
    padding: 0 40px 120px;
    background: var(--bg-dark);
}

/*
   No max-width cap here. The grid uses the full available width
   so 3 cards fill the same space that 2 cards previously left
   with large empty margins on both sides.
*/
.projects-listing-section .container {
    max-width: none;
}


/* ============================================================
   SECTION DIVIDER
============================================================ */
.proj-section-divide {
    display: flex;
    align-items: center;
    gap: 1.4rem;
    margin: 2.4rem 0 0;
    opacity: 0;
    transition: opacity 0.5s ease 0.1s;
}
.proj-section-divide.proj-visible { opacity: 1; }
.proj-section-divide span {
    font-family: 'Roboto', sans-serif;
    font-size: 0.6rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-dim);
    white-space: nowrap;
}
.proj-section-divide::before,
.proj-section-divide::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}


/* ============================================================
   PROJECTS GRID — 3 columns
============================================================ */
.proj-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin: 1.5rem auto 0;
}

.proj-no-results {
    display: none;
    grid-column: 1 / -1;
    padding: 3rem;
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-dim);
    letter-spacing: 0.08em;
    font-family: 'Roboto', sans-serif;
}
.proj-no-results.visible { display: block; }


/* ============================================================
   PROJECT CARD — image fills entire card, text overlays bottom
============================================================ */
.proj-card {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    transition: border-color 0.3s ease,
                transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    /* No box-shadow on hover — border + lift only */
}
.proj-card:hover {
    border-color: var(--card-accent, var(--green));
    transform: translateY(-4px);
}

/* Card image fills entire card */
.proj-card-img {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #0a0a0f;
}

.proj-card-placeholder {
    position: absolute;
    inset: 0;
    transition: transform 0.6s ease;
}
.proj-card:hover .proj-card-placeholder { transform: scale(1.04); }

.proj-card-img img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}
.proj-card:hover .proj-card-img img { transform: scale(1.04); }

/* Gradient: transparent top → dark at bottom for text */
.proj-card-img::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(10,10,15,0.25) 40%,
        rgba(10,10,15,0.92) 100%
    );
    pointer-events: none;
    z-index: 1;
}

/* Status badge — top left */
.proj-card-status {
    position: absolute;
    top: 0.9rem;
    left: 0.9rem;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.58rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-family: 'Roboto', sans-serif;
    background: rgba(10,10,15,0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.09);
    padding: 0.22rem 0.55rem;
    border-radius: 100px;
    color: var(--text-light);
}

/* Text overlay — bottom of card, above gradient */
.proj-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 3;
    padding: 1rem 1.2rem 1.3rem;
}

/* Category tags */
.proj-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.55rem;
}

.proj-tag {
    font-size: 0.57rem;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--card-accent, var(--green));
    border: 1px solid color-mix(in srgb, var(--card-accent, var(--green)) 40%, transparent);
    background: color-mix(in srgb, var(--card-accent, var(--green)) 10%, transparent);
    padding: 0.15rem 0.5rem;
    border-radius: 2px;
    transition: background 0.2s;
}
.proj-card:hover .proj-tag {
    background: color-mix(in srgb, var(--card-accent, var(--green)) 17%, transparent);
}

/* Card title */
.proj-card-title {
    font-family: 'Sugar Snow', cursive;
    font-size: 1.3rem;
    font-weight: normal;
    color: var(--text-light);
    line-height: 1.15;
    margin-bottom: 0.4rem;
    transition: color 0.25s ease;
}
.proj-card:hover .proj-card-title {
    color: var(--card-accent, var(--green));
}

/* Card description */
.proj-card-desc {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.50);
    line-height: 1.65;
    margin-bottom: 0.85rem;
    font-weight: 300;
}

/* Card footer */
.proj-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

.proj-card-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 0.28rem;
}

.proj-tool {
    font-size: 0.58rem;
    letter-spacing: 0.05em;
    font-family: 'Roboto', sans-serif;
    color: color-mix(in srgb, var(--green, #24FF72) 48%, transparent);
    border: 1px solid color-mix(in srgb, var(--green, #24FF72) 26%, transparent);
    padding: 0.14rem 0.48rem;
    border-radius: 100px;
    transition: border-color 0.2s;
}
.proj-card:hover .proj-tool {
    border-color: color-mix(in srgb, var(--green, #24FF72) 52%, transparent);
}

.proj-card-arrow {
    font-size: 1rem;
    color: rgba(255,255,255,0.28);
    transition: transform 0.3s ease, color 0.25s ease;
    flex-shrink: 0;
}
.proj-card:hover .proj-card-arrow {
    transform: translateX(5px);
    color: var(--card-accent, var(--green));
}


/* ============================================================
   SCROLL-IN ANIMATION
   Featured card: already visible on load (proj-visible added in HTML)
   Grid cards: fade up on scroll
============================================================ */
.proj-card {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.55s ease,
                transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                border-color 0.3s ease;
}
.proj-card.proj-visible {
    opacity: 1;
    transform: translateY(0);
}
.proj-card.proj-visible:hover {
    transform: translateY(-4px);
}


/* ============================================================
   RESPONSIVE
============================================================ */

/* Tablet */
@media (max-width: 1024px) {
    .proj-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
    .proj-hero-wrap {
        height: 62vh;
        min-height: 460px;
    }
    .proj-feat-content {
        max-width: 520px;
        padding: 2rem 2.4rem 2rem 5rem;
        padding-top: 100px;
    }
    .proj-sticky-bar { top: 82px; }
}

/* Mobile */
@media (max-width: 768px) {
    .proj-hero-wrap {
        height: 72vw;
        min-height: 340px;
        max-height: 520px;
    }
    .proj-feat-content {
        padding: 1.4rem 1.6rem;
        padding-top: 72px;
        max-width: 100%;
        justify-content: flex-end;
    }
    .proj-feat-desc { display: none; }
    .proj-feat-index { display: none; }
    .proj-feat-nav { width: 34px; height: 34px; }
    .proj-feat-prev { left: 0.8rem; }
    .proj-feat-next { right: 0.8rem; }

    .proj-sticky-bar { top: 70px; padding: 20px 16px; }
    .proj-header-inner {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    .section-header { text-align: center; }
    .section-header .page-title { font-size: 2.4rem; }
    .proj-filter-bar { width: 100%; justify-content: center; }
    .proj-filter-inner { justify-content: center; }
    .proj-filter-btn { padding: 7px 14px; font-size: 0.75rem; }

    .proj-grid { grid-template-columns: 1fr; }
    .projects-listing-section { padding: 0 20px 80px; }
}

/* Small phones */
@media (max-width: 480px) {
    .section-header .page-title { font-size: 2rem; }
    .proj-feat-title { font-size: 1.5rem; }
    .proj-card-title { font-size: 1.15rem; }
    .proj-card-overlay { padding: 0.9rem 1rem 1.1rem; }
}