.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 28px;
    max-width: 1550px;
    margin: 0 auto;
    padding: 0 20px;
}

.case-card {
    background: #0a0a0a;
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.06);
}

.case-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 45px -10px rgba(0, 0, 0, 0.8);
    border-color: rgba(255,255,255,0.15);
}

.image-area {
    height: 235px;
    position: relative;
    background: #111;
}

.image-area img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.75);
    transition: transform 0.5s ease, filter 0.5s ease;
}

.case-card:hover .image-area img {
    transform: scale(1.07);
    filter: brightness(1);
}

.content-area {
    padding: 26px 28px 30px 28px;
    position: relative;
}

.case-title {
    font-size: 1.72rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 8px;
}

.case-desc {
    color: #999;
    font-size: 0.95rem;
    line-height: 1.45;
}

/* ===================== SHOWCASE GRID ===================== */
.showcase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

.showcase-card {
    background: #111;
    border-radius: 24px;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.08);
    display: block;
    text-decoration: none;
    /* NO forced aspect-ratio — card now automatically matches the image's natural ratio */
}

.showcase-card img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;   /* keeps original proportions (square, rectangle or panoramic) */
}

/* ===================== PURE CSS LIGHTBOX (unchanged) ===================== */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.98);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.lightbox:target {
    display: flex;
}

.lightbox-content {
    max-width: 95%;
    max-height: 95vh;
    position: relative;
}

.lightbox-content img {
    max-width: 80%;
    max-height: 95vh;
    border-radius: 16px;
    box-shadow: 0 0 80px rgba(0,0,0,0.9);
    object-fit: contain;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.15);
    color: white;
    font-size: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    text-decoration: none;
    transition: all 0.3s ease;
    z-index: 10;
}

.lightbox-nav:hover {
    background: rgba(255,255,255,0.35);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev { left: -80px; }
.lightbox-next { right: 90px; }

.lightbox-close {
    position: absolute;
    top: -50px;
    left: 700px;
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.1);
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
    text-decoration: none;
    transition: all 0.2s ease;
}

.lightbox-close:hover {
    background: rgba(255,255,255,0.25);
    transform: rotate(90deg);
}

.lightbox-counter {
    position: absolute;
    bottom: -50px;
    left: 40%;
    transform: translateX(-50%);
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 18px;
    padding: 6px 18px;
    border-radius: 9999px;
    font-weight: 600;
}

/* ===================== INLINE CAROUSEL (banner pages) ===================== */

/*
 * Radio-button driven carousel — no JS, no scroll jump.
 *
 * HTML structure required:
 *   <input type="radio" id="banner-s1" name="banner-slider" checked class="hidden">
 *   <input type="radio" id="banner-s2" name="banner-slider" class="hidden">
 *   <div class="inline-carousel-wrapper">
 *     <label for="banner-s1" class="inline-carousel__nav inline-carousel__prev">‹</label>
 *     <div class="inline-carousel">
 *       <div class="inline-carousel__track">
 *         <div class="inline-carousel__slide">...</div>
 *         <div class="inline-carousel__slide">...</div>
 *       </div>
 *     </div>
 *     <label for="banner-s2" class="inline-carousel__nav inline-carousel__next">›</label>
 *   </div>
 *   <div class="inline-carousel__dots">
 *     <label for="banner-s1" class="inline-carousel__dot"></label>
 *     <label for="banner-s2" class="inline-carousel__dot"></label>
 *   </div>
 */

/* Outer wrapper: arrow | image box | arrow, all in a row */
.inline-carousel-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* The clipping box that hides the off-screen slide */
.inline-carousel {
    flex: 1;
    overflow: hidden;
    border-radius: 24px;
}

/* Flex row: track is explicitly 2× the container so each slide fills it exactly.
 * translateX(-50%) moves by exactly one container width — no overshoot. */
.inline-carousel__track {
    display: flex;
    width: calc(100% * 2);
    align-items: flex-start; /* each slide sizes to its own content height */
    transition: transform 0.5s ease;
}

.inline-carousel__slide {
    width: calc(100% / 2);
    flex-shrink: 0;
}

/* Images display at their natural aspect ratio — no forced square */
.inline-carousel__slide img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 24px;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
}

/* ---- Slide positions driven by radio state ---- */
#banner-s1:checked ~ .inline-carousel-wrapper .inline-carousel .inline-carousel__track { transform: translateX(0%); }
#banner-s2:checked ~ .inline-carousel-wrapper .inline-carousel .inline-carousel__track { transform: translateX(-50%); }

/* ---- Hide the arrow that doesn't apply to the current slide ---- */
#banner-s1:checked ~ .inline-carousel-wrapper .inline-carousel__prev { visibility: hidden; }
#banner-s2:checked ~ .inline-carousel-wrapper .inline-carousel__next { visibility: hidden; }

/* ---- Arrow buttons — static in the flex row, not overlaid ---- */
.inline-carousel__nav {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    backdrop-filter: blur(4px);
    user-select: none;
}

.inline-carousel__nav:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.1);
}

/* ---- Dot navigation ---- */
.inline-carousel__dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 14px;
    padding: 0 calc(52px + 50px);

}

.inline-carousel__dot {
    width: 10px;
    height: 10px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.35);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    display: block;
}

.inline-carousel__dot:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Active dot matches the checked radio */
#banner-s1:checked ~ .inline-carousel__dots .inline-carousel__dot:nth-child(1),
#banner-s2:checked ~ .inline-carousel__dots .inline-carousel__dot:nth-child(2) {
    background: white;
    border-color: white;
}