/* ==========================================================================
   PROJECT DETAIL (projects/*.html)
   Hero → feature sections (text + image) → gallery → changelog
   ========================================================================== */

/* ---------- Hero: project image with the title on top ---------- */

.project-hero {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: flex-end;
    min-height: min(70vh, 620px);
    padding-bottom: clamp(40px, 6vw, 72px);
    overflow: hidden;
}

.project-hero-bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Fades the image into the page so the text stays readable */
.project-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(90deg, rgb(11 11 20 / 85%) 0%, rgb(11 11 20 / 45%) 55%, transparent 100%),
        linear-gradient(0deg, var(--bg) 0%, rgb(11 11 20 / 60%) 45%, rgb(11 11 20 / 20%) 100%);
}

.project-hero-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    max-width: 760px;
}

.back-link {
    color: var(--text);
    font-family: var(--font-label);
    font-size: 0.9rem;
    font-weight: 500;
    text-shadow: 0 1px 8px rgb(0 0 0 / 80%);
    opacity: 0.85;
    transition: opacity .15s steps(2);
}

.back-link:hover {
    opacity: 1;
}

/* The game's name as a pixel title, like the home hero */
.project-hero h1 {
    font-family: var(--font-display);
    font-size: var(--fs-h1);
    font-weight: 400;
    line-height: 1;
    text-shadow:
        0.05em 0.05em 0 var(--brand-deep),
        0.1em 0.1em 0 #070d52;
}

.project-subtitle {
    color: var(--text-muted);
    font-size: 1.15rem;
}

.project-hero .btn-row {
    margin-top: 8px;
}

/* ---------- Feature sections: text + image side by side ---------- */

.feature {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(32px, 6vw, 80px);
    align-items: center;
}

.feature-text h2 {
    margin-bottom: 16px;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

.feature-text p:not(.eyebrow) {
    max-width: 560px;
    color: var(--text-muted);
    font-size: 1.02rem;
}

.feature-media img {
    width: 100%;
    border: 3px solid var(--edge);
    clip-path: var(--notch);
}

/* ---------- Gallery (click an image to open it in the pop-up) ---------- */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: 16px;
}

.gallery-item {
    overflow: hidden;
    border: 3px solid var(--edge);
    clip-path: var(--notch);
    background: var(--surface);
    cursor: zoom-in;
    transition: border-color .15s steps(2);
}

.gallery-item img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    transition: transform .3s steps(4);
}

.gallery-item:hover {
    border-color: var(--brand-light);
}

.gallery-item:hover img {
    transform: scale(1.04);
}

/* Full-screen viewer, opened by main.js */
.popup-img {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    background: rgb(0 0 0 / 90%);
}

.popup-img img {
    width: 100%;
    height: 100%;
    padding: 16px;
    object-fit: contain;
}

.popup-img i {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 1;
    padding: 6px;
    background: var(--brand);
    clip-path: var(--steps);
    box-shadow:
        inset 0 3px 0 rgb(255 255 255 / 20%),
        inset 0 -4px 0 rgb(0 0 0 / 35%);
    color: var(--text);
    font-size: 32px;
    cursor: pointer;
    transition: background .15s steps(2);
}

.popup-img i:hover {
    background: var(--brand-light);
}

/* ---------- Changelog ---------- */

.changelog {
    display: grid;
    gap: 16px;
}

.changelog-entry {
    padding: 24px 28px;
    background: var(--surface);
    border: 3px solid var(--edge);
    clip-path: var(--notch);
    transition: border-color .15s steps(2);
}

a .changelog-entry:hover {
    border-color: var(--brand-light);
}

.changelog-date {
    color: var(--text-muted);
    font-family: var(--font-label);
    font-size: 0.82rem;
}

.changelog-title {
    margin: 6px 0 10px;
    font-size: 1.15rem;
    font-weight: 600;
}

.changelog-entry p {
    color: var(--text-muted);
    line-height: 1.7;
}

.changelog-entry strong {
    color: var(--text);
    font-weight: 500;
}

/* ---------- Responsive ---------- */

@media (max-width: 795px) {
    .feature {
        grid-template-columns: 1fr;
    }

    /* Image goes below the text on mobile */
    .feature-media {
        order: 1;
    }
}
