.project-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-muted);
    margin: 64px 0 28px;
    transition: color .18s ease, transform .18s ease;
}

.project-back:hover {
    color: var(--accent-2);
    transform: translateX(-3px);
}

.project-hero {
    /* matches base.css's generic section rhythm (88px 0),
       same top/bottom spacing as the index page sections */
    padding: 88px 0;
    /* no display:grid here — this is the outer <section>, and .wrap
       is its only child, so grid buys nothing but breaks .wrap's
       normal block-level "fill full width" sizing/centering.
       Spacing between eyebrow/h1/desc/hero-row/widget-slot is
       already handled by their own margin-top values. */
}

.project-hero .eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
}

.project-hero .eyebrow .tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.project-hero .eyebrow .tags span {
    font-family: var(--font-mono);
    font-size: 11.5px;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 4px 10px;
    border-radius: 20px;
}

.project-hero h1 {
    font-size: clamp(36px, 5.2vw, 60px);
    line-height: 1.05;
    color: var(--text);
}

.project-hero .project-desc {
    max-width: 62ch;
    color: var(--text-muted);
    font-size: clamp(15px, 1.4vw, 17px);
}

.project-hero .btn-row {
    display: flex;
    gap: 14px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.project-hero-row {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
    gap: 20px;
    align-items: stretch;
    margin-top: 8px;
    max-width: 100%;
}

.project-frame {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    aspect-ratio: 16/9;
    background: var(--surface);
    min-width: 0;
    width: 100%;
}

.project-frame img,
.project-frame iframe,
.project-frame .video-poster {
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: cover;
    border: 0;
    display: block;
}

.project-frame .video-poster {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.project-frame .video-play-btn {
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    border: 0;
    border-radius: 999px;
    background: rgba(16, 19, 26, 0.8);
    color: white;
    font-size: 24px;
    cursor: pointer;
    z-index: 2;
}

.project-frame .video-play-btn:hover {
    background: rgba(244, 97, 87, 0.95);
}

.project-frame .float-tag {
    position: absolute;
    bottom: 18px;
    right: 18px;
}

.project-side {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 22px;
    min-width: 0;
    overflow: hidden;
}

.side-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.side-row:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.side-label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
}

.side-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    text-align: right;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.side-row.platforms-row {
    align-items: center;
}

.platform-icons {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.platform-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;

    padding: 6px 10px;

    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 999px;

    color: var(--text);
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;

    transition:
        background .2s ease,
        border-color .2s ease,
        color .2s ease,
        transform .2s ease;
}

.platform-link .icon {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    display: block;
    filter: brightness(0) saturate(100%) invert(1);
    transition: filter .2s ease;
}

.platform-arrow {
    font-size: 14px;
    font-weight: 1000;
    margin-left: 2px;
    color: var(--text-faint);
    transition:
        color .2s ease,
        transform .2s ease;
}

.platform-link:hover {
    background: rgba(244, 97, 87, .12);
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

.platform-link:hover .icon {
    filter: brightness(0) saturate(100%) invert(49%) sepia(70%) saturate(2092%) hue-rotate(329deg) brightness(99%) contrast(94%);
}

.platform-link:hover .platform-arrow {
    color: var(--accent);
    transform: translate(1px, -1px);
}

.platform-link:active {
    transform: translateY(0);
}

.icon-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.icon-label .icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    display: block;
    filter: brightness(0) saturate(100%) invert(1);
}

.platform-item {
    font-size: 12px;
    color: var(--text-muted);
}

.widget-slot {
    margin: 20px 0 0;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    width: 100%;
}

.widget-slot-label {
    font-family: var(--font-mono);
    font-size: 11.5px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.widget-slot iframe.fluid-embed {
    width: 100%;
    border: 0;
    display: block;
    border-radius: calc(var(--radius) - 4px);
}

.store-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.store-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 4px);
    transition: border-color .2s ease, transform .2s ease, background .2s ease;
    flex: 0 0 auto;
    width: fit-content;
}

.store-link:hover {
    border-color: var(--accent);
    background: var(--surface-hover);
    transform: translateY(-2px);
}

.store-link .icon {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    filter: brightness(0) saturate(100%) invert(1);
}

.store-link-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.store-link-store {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text);
}

.store-link-cta {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-faint);
    transition: color .2s ease;
}

.store-link:hover .store-link-cta {
    color: var(--accent);
}

.project-gallery {
    padding: 88px 0;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.gallery-grid .g-item {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    aspect-ratio: 4/3;
    background: var(--surface);
}

.gallery-grid .g-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}

.gallery-grid .g-item:hover img {
    transform: scale(1.04);
}

.gallery-grid .g-item.wide {
    grid-column: span 2;
    aspect-ratio: 8/3;
}

.project-details-section {
    padding: 88px 0;
}

.project-details {
    display: grid;
    grid-template-columns: 0.9fr 1.4fr;
    gap: 56px;
    align-items: start;
}

.project-details h2 {
    font-size: clamp(26px, 3vw, 36px);
    color: var(--text);
    margin-top: 10px;
    line-height: 1.15;
}

.project-details .project-desc {
    color: var(--text-muted);
    font-size: clamp(15px, 1.4vw, 17px);
    max-width: 60ch;
    margin-top: 16px;
}

.detail-chips {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    align-self: center; /* centers this block vertically in the parent */
}

.detail-chips .chip {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    color: var(--text);
    font-size: 14.5px;
    line-height: 1.45;
}

@media (max-width: 900px) {
    .project-hero-row {
        grid-template-columns: 1fr;
    }

    .project-side {
        justify-content: flex-start;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-grid .g-item.wide {
        grid-column: span 2;
    }

    .project-details {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .detail-chips {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .project-back {
        margin: 44px 0 24px;
    }
}

@media (max-width: 560px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .gallery-grid .g-item.wide {
        grid-column: span 1;
        aspect-ratio: 4/3;
    }

    .side-row {
        flex-wrap: wrap;
    }

    .side-value {
        text-align: left;
    }

    .platform-icons {
        justify-content: flex-start;
    }

    .platform-link {
        width: 100%;
        justify-content: flex-start;
    }
}