/* ==========================================================================
   Project detail page (projects/detail.html)
   Builds on the tokens and components in core.css.
   ========================================================================== */

.pd-container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

/* --- Hero -------------------------------------------------------------- */
.pd-hero .page-hero__inner > * {
    max-width: none;
}

.pd-hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: clamp(2rem, 4vw, 3.5rem);
    align-items: center;
}

.pd-hero__copy {
    max-width: 600px;
}

.pd-hero__copy .tag {
    margin-bottom: 1.1rem;
}

.pd-hero__media {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: #000;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(var(--accent-rgb), 0.06);
}

.pd-hero__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- Facts ------------------------------------------------------------- */
.pd-facts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: clamp(2.5rem, 5vw, 3.5rem);
    list-style: none;
}

.pd-fact {
    display: flex;
    gap: 0.9rem;
    align-items: center;
    padding: 1.1rem 1.25rem;
    border-radius: var(--radius);
    background: var(--surface-2);
    border: 1px solid var(--border);
    min-width: 0;
}

.pd-fact .icon-badge {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    font-size: 1rem;
    border-radius: 10px;
}

.pd-fact > div {
    min-width: 0;
}

.pd-fact__label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-subtle);
}

.pd-fact__value {
    display: block;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pd-fact__value a {
    color: var(--accent-strong);
}

/* --- Sections ---------------------------------------------------------- */
.pd-section {
    padding: clamp(3rem, 6vw, 5rem) 0;
}

.pd-section + .pd-section {
    padding-top: 0;
}

.pd-section--alt {
    background: rgba(255, 255, 255, 0.018);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.pd-section--alt + .pd-section {
    padding-top: clamp(3rem, 6vw, 5rem);
}

.pd-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem 2rem;
    flex-wrap: wrap;
    margin-bottom: 1.75rem;
}

.pd-head h2 {
    font-size: clamp(1.5rem, 2.6vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* --- Gallery ----------------------------------------------------------- */
.pd-gallery__stage {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: #000;
}

.pd-gallery__track {
    display: flex;
    height: 100%;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.pd-gallery__slide {
    flex: 0 0 100%;
    height: 100%;
}

.pd-gallery__slide img,
.pd-gallery__slide video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.pd-gallery__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    color: #fff;
    background: rgba(5, 11, 26, 0.7);
    backdrop-filter: blur(8px);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.pd-gallery__nav:hover {
    background: rgba(var(--accent-rgb), 0.25);
    border-color: var(--border-accent);
}

.pd-gallery__nav--prev { left: 1rem; }
.pd-gallery__nav--next { right: 1rem; }

.pd-gallery__counter {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    background: rgba(5, 11, 26, 0.7);
    backdrop-filter: blur(8px);
}

.pd-gallery__thumbs {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.9rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    scrollbar-width: thin;
}

.pd-gallery__thumb {
    position: relative;
    flex: 0 0 auto;
    width: 132px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    padding: 0;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    background: #000;
    cursor: pointer;
    opacity: 0.55;
    transition: opacity 0.2s ease, border-color 0.2s ease;
}

.pd-gallery__thumb:hover {
    opacity: 0.85;
}

.pd-gallery__thumb.is-active {
    opacity: 1;
    border-color: var(--accent);
}

.pd-gallery__thumb img,
.pd-gallery__thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.pd-gallery__thumb-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
    background: rgba(0, 0, 0, 0.35);
}

/* --- Card grids (news, more projects) ---------------------------------- */
.pd-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

.pd-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    color: inherit;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.pd-card:hover {
    color: inherit;
    transform: translateY(-3px);
    border-color: var(--border-accent);
    box-shadow: var(--shadow-accent);
}

.pd-card__media {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000;
}

.pd-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.pd-card:hover .pd-card__media img {
    transform: scale(1.04);
}

.pd-card__body {
    padding: 1.15rem 1.3rem 1.35rem;
}

.pd-card__eyebrow {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-strong);
}

.pd-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
}

.pd-card p {
    margin-top: 0.4rem;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-muted);
}

/* --- Download ---------------------------------------------------------- */
.pd-head__sub {
    margin-top: 0.35rem;
    color: var(--text-subtle);
    font-size: 0.95rem;
}

.pd-stores {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}

.pd-store {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 220px;
    padding: 0.8rem 1.1rem;
    border-radius: var(--radius);
    color: var(--text);
    background: #000;
    border: 1px solid var(--border-strong);
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.pd-store:hover {
    color: var(--text);
    transform: translateY(-2px);
    border-color: var(--border-accent);
    box-shadow: var(--shadow-accent);
}

.pd-store > i:first-child {
    font-size: 1.7rem;
    width: 1.8rem;
    text-align: center;
}

.pd-store span {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.pd-store small {
    font-size: 0.72rem;
    color: var(--text-subtle);
}

.pd-store strong {
    font-size: 1.05rem;
    font-weight: 600;
}

.pd-store__ext {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--text-subtle);
}

.pd-platforms {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.25rem;
}

.pd-platform {
    min-width: 0;
    padding: 1.4rem;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.pd-platform.is-match {
    border-color: var(--border-accent);
    box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.15), var(--shadow-accent);
}

.pd-platform__head {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.pd-platform__head h3 {
    font-size: 1.2rem;
    font-weight: 600;
}

.pd-platform__head .tag {
    margin-left: auto;
}

.pd-platform__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    font-size: 1.35rem;
    color: var(--text);
    background: var(--surface-hover);
    border: 1px solid var(--border);
}

.pd-platform.is-match .pd-platform__icon {
    color: var(--accent-strong);
    background: rgba(var(--accent-rgb), 0.12);
    border-color: rgba(var(--accent-rgb), 0.3);
}

.pd-files {
    list-style: none;
    display: grid;
    gap: 0.6rem;
}

.pd-file {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 0.9rem;
    border-radius: var(--radius);
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.pd-file__info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.pd-file__info strong {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.pd-file__info span {
    font-size: 0.8rem;
    color: var(--text-subtle);
}

.pd-file .btn {
    flex-shrink: 0;
}

.pd-download__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem 2rem;
    margin-top: 1.25rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.pd-download__footer p i {
    margin-right: 0.4rem;
    color: var(--success);
}

.pd-checksums summary {
    cursor: pointer;
    color: var(--text-muted);
}

.pd-checksums summary:hover {
    color: var(--text);
}

.pd-checksums ul {
    list-style: none;
    display: grid;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.pd-checksums li {
    display: grid;
    gap: 0.15rem;
}

.pd-checksums span {
    font-size: 0.8rem;
    color: var(--text-subtle);
}

.pd-checksums code {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
    word-break: break-all;
    user-select: all;
}

/* --- System requirements ----------------------------------------------- */
.pd-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 1.25rem;
    padding: 0.3rem;
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.pd-tab {
    padding: 0.5rem 1.1rem;
    border: 0;
    border-radius: var(--radius-pill);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}

.pd-tab:hover {
    color: var(--text);
}

.pd-tab.is-active {
    color: #04121f;
    background: var(--gradient-button);
}

.pd-req__scroll {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.pd-req__table {
    width: 100%;
    min-width: 520px;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.pd-req__table th,
.pd-req__table td {
    padding: 0.9rem 1.2rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
}

.pd-req__table tbody tr:last-child th,
.pd-req__table tbody tr:last-child td {
    border-bottom: 0;
}

.pd-req__table thead th {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-strong);
    background: var(--surface-2);
}

.pd-req__table thead th:first-child {
    color: var(--text-subtle);
}

.pd-req__table tbody th {
    width: 28%;
    font-weight: 600;
    color: var(--text-muted);
}

.pd-req__table td {
    color: var(--text);
}

/* --- Version history --------------------------------------------------- */
.pd-releases {
    display: grid;
    gap: 0.75rem;
}

.pd-release {
    border-radius: var(--radius);
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.pd-release[open] {
    border-color: var(--border-strong);
}

.pd-release summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 0.85rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    list-style: none;
}

.pd-release summary::-webkit-details-marker {
    display: none;
}

.pd-release__version {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--text);
}

.pd-release__title {
    color: var(--text-muted);
}

.pd-release summary time {
    margin-left: auto;
    font-size: 0.85rem;
    color: var(--text-subtle);
}

.pd-release__chevron {
    font-size: 0.75rem;
    color: var(--text-subtle);
    transition: transform 0.2s ease;
}

.pd-release[open] .pd-release__chevron {
    transform: rotate(180deg);
}

.pd-release__body {
    padding: 0 1.25rem 1.25rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.pd-release__changelog p + p {
    margin-top: 0.6rem;
}

.pd-release__empty {
    font-style: italic;
    color: var(--text-subtle);
}

.pd-release__files {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.pd-release__file {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.8rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text);
    background: var(--surface-hover);
    border: 1px solid var(--border);
}

.pd-release__file:hover {
    color: var(--text);
    border-color: var(--border-accent);
}

.pd-release__file span {
    color: var(--text-subtle);
}

/* --- Responsive -------------------------------------------------------- */
@media (max-width: 1000px) {
    .pd-hero__grid {
        grid-template-columns: 1fr;
    }

    .pd-hero__copy {
        max-width: none;
    }

    .pd-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .pd-cards {
        grid-template-columns: 1fr;
    }

    .pd-gallery__nav {
        width: 38px;
        height: 38px;
    }

    .pd-gallery__thumb {
        width: 104px;
    }

    .pd-store {
        width: 100%;
        min-width: 0;
    }

    .pd-platforms {
        grid-template-columns: 1fr;
    }

    .pd-file {
        flex-wrap: wrap;
    }

    .pd-file .btn {
        width: 100%;
    }

    .page-hero__actions .btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pd-gallery__track,
    .pd-card,
    .pd-card__media img {
        transition: none;
    }
}
