/* Homepage composition. Keep the existing NEWRPG tokens, typography and controls. */
.home-page {
    overflow: clip;
}

.home-page .download-alt-row {
    gap: 0 12px;
    min-height: 0;
    padding-top: 0;
}

.home-page .download-alt-desktop,
.home-page .download-alt-mobile {
    display: contents;
}

.home-page .download-alt-divider {
    display: block;
    height: 16px;
    margin: 0;
    background: var(--border-strong);
}

.home-page .download-alt-link {
    min-height: 32px;
    gap: 5px;
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, .035);
    font-size: .75rem;
    white-space: nowrap;
}

.home-page .download-alt-icon svg {
    width: 13px;
    height: 13px;
}

.home-page .download-alt-link:hover {
    background: rgba(255, 255, 255, .08);
    border-color: var(--border-strong);
    color: var(--text);
}

@media (pointer: coarse) {
    .home-page .download-alt-link {
        min-height: 44px;
    }
}

/* Keep the existing theme viewer, arranged as a clear preview gallery. */
.home-page .themes-intro-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
}

.home-page .themes-intro-copy {
    max-width: 780px;
    margin: 0 auto;
    text-align: center;
}

.home-page .themes-intro-copy .lead {
    max-width: 72ch;
    font-size: 1rem;
}

.home-page .themes-stack {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
    max-width: none;
    min-height: 0;
    margin: 0;
}

.home-page .theme-shot {
    position: relative;
    inset: auto;
    width: 100%;
    margin: 0;
    transform: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: visible;
    transition: border-color .2s ease;
}

.home-page .theme-shot img {
    aspect-ratio: 4 / 3;
    object-fit: cover;
    object-position: 72% center;
    border-radius: var(--radius);
    transition: none;
}

.home-page .theme-shot:hover,
.home-page .theme-shot:focus-within {
    border-color: var(--border-strong);
}

.home-experience {
    background: var(--bg-soft);
    border-block: 1px solid var(--border);
}

.experience-tabs {
    display: flex;
    justify-content: center;
    width: fit-content;
    max-width: 100%;
    gap: 4px;
    margin: 0 auto 32px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
}

.experience-tabs button {
    min-height: 44px;
    padding: 10px 24px;
    border: 0;
    border-radius: 999px;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    font-size: .875rem;
    font-weight: 600;
    transition: color .15s ease, background-color .15s ease;
}

.experience-tabs button:hover {
    color: var(--text);
    background: rgba(255, 255, 255, .06);
}

.experience-tabs button[aria-selected='true'] {
    background: var(--accent);
    color: var(--on-accent);
}

.experience-screen {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.experience-screen img {
    width: 100%;
    height: auto;
    aspect-ratio: 1600 / 980;
    object-fit: contain;
}

.experience-copy {
    max-width: 820px;
    margin: 28px auto 0;
    text-align: center;
}

.experience-copy h3 {
    font-size: 1.125rem;
    margin: 0 0 10px;
}

.experience-copy p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: .9375rem;
}

.home-page .home-faq .container {
    max-width: 880px;
}

.home-faq .section-sub a {
    color: var(--text);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.home-questions {
    display: grid;
    gap: 12px;
}

.home-questions details {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .035);
}

.home-questions summary {
    position: relative;
    padding: 22px 56px 22px 24px;
    list-style: none;
    cursor: pointer;
    font-size: .9375rem;
    font-weight: 600;
}

.home-questions summary::-webkit-details-marker {
    display: none;
}

.home-questions summary::after {
    content: '+';
    position: absolute;
    right: 24px;
    color: var(--muted);
    font-size: 1.25rem;
    line-height: 1.2;
}

.home-questions details[open] summary::after {
    content: '−';
}

.home-questions summary:hover {
    background: rgba(255, 255, 255, .035);
    border-radius: var(--radius);
}

.home-questions details p {
    margin: 0;
    padding: 0 24px 24px;
    color: var(--muted);
    font-size: .9375rem;
    line-height: 1.7;
}

.home-closing {
    padding: 80px 0 96px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.home-closing img {
    margin: 0 auto 24px;
}

.home-closing h2 {
    margin: 0;
    font-size: clamp(28px, 3vw, 40px);
}

.home-closing p {
    margin: 16px 0 28px;
    color: var(--muted);
}

.home-closing .btn {
    min-height: 48px;
    min-width: 240px;
}

.home-creator {
    display: block;
    width: fit-content;
    margin: 24px auto 0;
    padding: 8px;
    color: var(--muted);
    font-size: .8125rem;
}

.home-creator:hover {
    color: var(--text);
    text-decoration: underline;
}

@media (max-width: 640px) {
    .home-page .download-alt-row {
        column-gap: 4px;
    }

    .home-page .download-alt-link {
        gap: 3px;
        padding-inline: 3px;
        font-size: .65625rem;
    }

    .home-page .download-alt-icon svg {
        width: 12px;
        height: 12px;
    }

    .home-page .themes-stack {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .experience-tabs {
        width: 100%;
        gap: 2px;
        padding: 4px;
    }

    .experience-tabs button {
        flex: 1 1 0;
        min-width: 0;
        padding: 10px 5px;
        font-size: .75rem;
        overflow-wrap: anywhere;
    }

    .experience-screen {
        border-radius: var(--radius-sm);
    }

    .home-questions summary {
        padding: 20px 48px 20px 20px;
    }

    .home-questions details p {
        padding: 0 20px 20px;
    }

    .home-closing {
        padding: 64px 0;
    }
}
