.project-showcase-page {
    background: var(--bg-dark);
}

.project-showcase-page .navbar .logo-img {
    height: 50px;
}

.project-hero {
    padding: 8.5rem 2rem 4rem;
    background:
        radial-gradient(circle at 20% 0%, rgba(124, 58, 237, 0.28) 0%, transparent 55%),
        radial-gradient(circle at 85% 20%, rgba(107, 180, 45, 0.2) 0%, transparent 50%),
        var(--bg-darker);
}

.project-hero-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    width: fit-content;
    padding: 0.65rem 1.15rem;
    border-radius: 12px;
    border: 2px solid var(--accent-purple);
    background: rgba(255, 255, 255, 0.04);
    transition: all 0.2s ease;
}

.back-link:hover {
    color: var(--text-primary);
    border-color: var(--accent-purple);
    background: rgba(124, 58, 237, 0.12);
    transform: translateY(-1px);
}

.project-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    grid-template-areas:
        "media header"
        "media details";
    gap: 2.5rem;
    align-items: start;
}

.project-hero-header {
    grid-area: header;
}

.project-hero-media-wrap {
    grid-area: media;
}

.project-hero-details {
    grid-area: details;
}

.project-hero-media-wrap {
    position: relative;
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: var(--bg-card);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.project-hero-media-wrap:has(.project-hero-media-panel) {
    overflow: visible;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.project-showcase-page.has-product-viewer .project-hero {
    padding-left: 0;
    padding-right: 0;
}

.project-showcase-page.has-product-viewer .project-hero-container {
    gap: 2rem;
}

.project-showcase-page.has-product-viewer .back-link {
    margin-left: 2rem;
}

.project-showcase-page.has-product-viewer .project-hero-grid {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    align-items: stretch;
}

.project-showcase-page.has-product-viewer .project-hero-header {
    order: 1;
    padding: 0 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.project-showcase-page.has-product-viewer .project-hero-media-wrap.is-full-bleed {
    order: 2;
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-shadow: none;
}

.project-showcase-page.has-product-viewer .project-hero-details {
    order: 3;
    padding: 0 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.project-hero-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

.project-hero-media-panel {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.hero-media-stack {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 14px;
    background: var(--bg-card);
}

.hero-media-image,
.hero-media-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.hero-media-image {
    object-fit: cover;
    transition: opacity 0.35s ease;
}

.hero-media-image.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.hero-media-video {
    opacity: 0;
    pointer-events: none;
}

.hero-media-video.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.project-trailer-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.95rem 1.5rem;
    border: none;
    border-radius: 12px;
    background: var(--accent-purple);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

.project-trailer-btn:hover {
    background: #6d28d9;
    transform: translateY(-1px);
}

.project-coming-soon-box {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: min(42vh, 480px);
    padding: 2.5rem;
    border-radius: 22px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.project-coming-soon-box p {
    margin: 0;
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    color: var(--text-secondary);
    text-align: center;
}

.project-showcase-page.is-details-coming-soon .project-hero-grid {
    grid-template-columns: 1fr;
}

.project-showcase-page.is-details-coming-soon .project-hero-header {
    max-width: 900px;
}

.project-showcase-page.is-details-coming-soon .project-summary:empty {
    display: none;
}

.project-hero-viewer {
    width: 100%;
    min-height: min(62vh, 720px);
    height: 62vh;
    display: block;
    background: transparent;
}

.project-viewer-stage {
    position: relative;
    width: 100%;
    min-height: min(62vh, 720px);
    height: 62vh;
    background: var(--bg-card);
}

.project-viewer-poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2;
    transition: opacity 0.45s ease;
}

.project-viewer-poster.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.project-showcase-page.has-product-viewer .project-viewer-stage {
    min-height: min(72vh, 820px);
    height: 72vh;
}

.project-showcase-page.has-product-viewer .project-hero-viewer {
    min-height: min(72vh, 820px);
    height: 72vh;
    touch-action: pan-y;
}

.viewer-hint {
    position: absolute;
    left: 50%;
    bottom: 1rem;
    transform: translateX(-50%);
    z-index: 3;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    font-size: 0.78rem;
    color: #e7e7f2;
    background: rgba(5, 5, 8, 0.68);
    border: 1px solid rgba(255, 255, 255, 0.14);
    pointer-events: none;
}

.project-chip {
    display: inline-block;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent-purple);
    margin-bottom: 0.9rem;
    font-weight: 700;
}

.project-hero-header h1 {
    font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 1.08;
    margin-bottom: 1rem;
}

.project-summary {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 1.3rem;
}

.project-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.3rem;
}

.project-meta-grid .meta-card[hidden] {
    display: none;
}

.meta-card {
    background: rgba(18, 18, 24, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 1rem;
}

.meta-card h3 {
    font-size: 0.76rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.meta-card p {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.project-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.project-detail-platforms {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.project-platform-group {
    width: 100%;
}

.project-platform-group--legacy .project-platforms-label {
    display: block;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.55rem;
    font-weight: 600;
}

.project-detail-platform-icons {
    width: 100%;
}

.project-platform-link {
    display: block;
    flex: 1 1 7.25rem;
    min-width: 6.75rem;
    max-width: 100%;
    text-decoration: none;
}

.project-platform-link.is-unavailable {
    opacity: 0.5;
    cursor: default;
}

.project-detail-platform-icons .project-platform-icon {
    width: 100%;
    height: 2.75rem;
    object-fit: contain;
    object-position: center;
    padding: 0.35rem 0.5rem;
    box-sizing: border-box;
    border-radius: 10px;
    background: rgba(124, 58, 237, 0.14);
    border: 1px solid rgba(124, 58, 237, 0.35);
    display: block;
}

.project-detail-platform-icons .project-platform-link.platform-icon--primary {
    flex: 1 1 100%;
    min-width: 100%;
}

.project-detail-platform-icons .project-platform-icon.platform-icon--primary {
    height: 3.35rem;
    padding: 0.45rem 0.65rem;
    background: rgba(124, 58, 237, 0.22);
    border-color: rgba(124, 58, 237, 0.5);
}

.project-link-btn {
    padding: 0.7rem 1.1rem;
    border-width: 2px;
}

.project-game-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.75rem 1.15rem;
    border-radius: 12px;
    border: 2px solid var(--accent-green);
    background: rgba(107, 180, 45, 0.12);
    color: var(--text-primary);
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.project-game-page-link:hover {
    background: rgba(107, 180, 45, 0.22);
    border-color: var(--accent-green);
    transform: translateY(-1px);
}

.project-section {
    padding: 4rem 2rem;
    background: var(--bg-dark);
}

.project-section:nth-of-type(even) {
    background: var(--bg-darker);
}

.project-section h2 {
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    margin-bottom: 1.5rem;
}

.project-rich-text {
    max-width: 960px;
}

.project-rich-text p {
    color: var(--text-secondary);
    line-height: 1.9;
    margin-bottom: 1rem;
}

.project-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.gallery-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    overflow: hidden;
    --gallery-aspect-ratio: 16/9;
}

.gallery-image,
.gallery-video {
    width: 100%;
    aspect-ratio: var(--gallery-aspect-ratio);
    object-fit: cover;
    display: block;
}

.gallery-image-expandable {
    cursor: zoom-in;
    transition: opacity 0.2s ease;
}

.gallery-image-expandable:hover {
    opacity: 0.92;
}

body.gallery-lightbox-open {
    overflow: hidden;
}

.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.gallery-lightbox[hidden] {
    display: none;
}

.gallery-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 5, 8, 0.94);
    cursor: zoom-out;
}

.gallery-lightbox-dialog {
    position: relative;
    z-index: 1;
    width: min(96vw, 1400px);
    max-height: 96vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-lightbox-figure {
    margin: 0;
    max-width: 100%;
    max-height: 96vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.gallery-lightbox-image {
    max-width: 100%;
    max-height: calc(96vh - 4rem);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.gallery-lightbox-caption {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    text-align: center;
    max-width: 60ch;
}

.gallery-lightbox-close,
.gallery-lightbox-prev,
.gallery-lightbox-next {
    border: 2px solid rgba(124, 58, 237, 0.45);
    background: rgba(18, 18, 24, 0.88);
    color: var(--text-primary);
    cursor: pointer;
    line-height: 1;
    transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
    z-index: 2;
}

.gallery-lightbox-close:hover,
.gallery-lightbox-prev:hover,
.gallery-lightbox-next:hover {
    background: rgba(124, 58, 237, 0.85);
    border-color: rgba(124, 58, 237, 0.85);
}

.gallery-lightbox-close {
    position: absolute;
    top: -0.25rem;
    right: -0.25rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    font-size: 1.75rem;
}

.gallery-lightbox-prev,
.gallery-lightbox-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 999px;
    font-size: 2.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.gallery-lightbox-prev:hover,
.gallery-lightbox-next:hover {
    transform: translateY(-50%) scale(1.05);
}

.gallery-lightbox-prev {
    left: max(1rem, env(safe-area-inset-left));
}

.gallery-lightbox-next {
    right: max(1rem, env(safe-area-inset-right));
}

@media (max-width: 900px) {
    .gallery-lightbox-prev,
    .gallery-lightbox-next {
        width: 2.75rem;
        height: 2.75rem;
        font-size: 1.85rem;
    }

    .gallery-lightbox-prev {
        left: max(0.65rem, env(safe-area-inset-left));
    }

    .gallery-lightbox-next {
        right: max(0.65rem, env(safe-area-inset-right));
    }

    .gallery-lightbox-close {
        top: 0.5rem;
        right: 0.5rem;
    }
}

.gallery-video {
    background: #000;
    object-fit: contain;
}

.gallery-caption {
    padding: 0.75rem 1rem;
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.gallery-caption a {
    color: var(--text-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.gallery-caption a:hover {
    color: var(--accent-primary);
}

.gallery-empty {
    color: var(--text-secondary);
}

.project-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.highlight-card {
    padding: 1.1rem;
    border-radius: 14px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.highlight-card h3 {
    font-size: 1rem;
    margin-bottom: 0.45rem;
    color: var(--text-primary);
}

.highlight-card p {
    color: var(--text-secondary);
    line-height: 1.75;
}

.related-projects-section .projects-grid {
    margin-top: 0.25rem;
}

.project-split-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2.5rem;
}

.project-split-grid h2 {
    margin-bottom: 1rem;
}

.project-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.75rem;
}

.project-list li {
    position: relative;
    padding-left: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.project-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.7em;
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 50%;
    background: var(--accent-green, #6bb42d);
}

.project-capability-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.project-capability-list li {
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(18, 18, 24, 0.9);
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.project-closing {
    max-width: 860px;
    margin: 0;
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--text-primary);
    border-left: 3px solid var(--accent-green, #6bb42d);
    padding-left: 1.25rem;
}

.project-section[hidden] {
    display: none;
}

@media (max-width: 920px) {
    .project-hero-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "media"
            "details";
    }

    .project-meta-grid {
        grid-template-columns: 1fr;
    }

    .project-split-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}
