
/*
  home.css — home-only layout additions
  Load after style.css, games.css, music.css, and makes.css.
*/

/* ==========================================================================
   Home Music Feature
========================================================================== */

body.home .home-music-section {
    padding-top: 0;
}

body.home .home-music-card {
    --card-glow: rgba(4, 126, 255, 0.10);

    display: grid;
    grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.28fr);
    gap: 1.35rem;
    align-items: stretch;
}

body.home .home-music-player,
body.home .home-music-selector {
    position: relative;
    z-index: 1;
    min-width: 0;
}

body.home .home-music-player {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

body.home .home-music-player h3,
body.home .home-music-selector h3 {
    margin: 0.35rem 0 0.45rem;
    font-size: clamp(1.7rem, 2.5vw, 2.35rem);
    line-height: 0.98;
    letter-spacing: -0.045em;
}

body.home .home-music-player p,
body.home .home-music-selector p {
    max-width: 34rem;
    margin: 0 0 1rem;
    color: #aaa;
    font-size: 0.92rem;
}

body.home .home-music-actions {
    margin-top: 1rem;
}

body.home .home-music-selector {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

body.home .home-music-selector .music-track-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    max-height: calc((96px * 3.2) + 0.75rem);
    overflow-y: auto;
    overflow-x: hidden;
    padding-top: 0.1rem;
    padding-right: 0.85rem;
    scrollbar-gutter: stable;
}

.home-music-feature {
    --accent: #047eff;
    --accent-soft: rgba(4, 126, 255, 0.14);
    --accent-faint: rgba(4, 126, 255, 0.055);
    --accent-text: #ffffff;
}

/* ==========================================================================
   Home Featured Builds
========================================================================== */

body.home .home-builds-section {
    padding-top: 0;
}

body.home .featured-builds-shell {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: minmax(0, 1.42fr) minmax(280px, 0.58fr);
    grid-template-rows: auto minmax(0, 1fr);
    gap: 1rem 1.35rem;
    align-items: stretch;
    padding: 1.15rem;
    border: 1px solid rgba(210, 215, 220, 0.14);
    border-radius: 22px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 -1px 0 rgba(255, 255, 255, 0.03),
        0 14px 32px rgba(0, 0, 0, 0.42);
    overflow: hidden;
}

body.home .featured-builds-shell::before {
    content: "";
    position: absolute;
    right: -12rem;
    top: -10rem;
    z-index: -1;
    pointer-events: none;
    width: 34rem;
    height: 24rem;
    border-radius: 999px;
    background: rgba(210, 215, 220, 0.075);
    filter: blur(90px);
}

body.home .featured-builds-heading {
    grid-column: 1;
    grid-row: 1;
    align-self: end;
    min-width: 0;
}

body.home .featured-builds-heading h2 {
    margin: 0.45rem 0 0;
    font-size: clamp(1.35rem, 2vw, 1.85rem);
    line-height: 1.02;
    letter-spacing: -0.035em;
}

body.home .featured-builds-main {
    position: relative;
    grid-column: 1;
    grid-row: 2;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
    min-width: 0;
    overflow: visible;
    border-radius: 16px;
}

body.home .featured-builds-viewport {
    grid-column: 2;
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

body.home .featured-builds-track {
    display: flex;
    width: 100%;
    transition: transform 420ms ease;
    will-change: transform;
}

body.home .featured-build-slide {
    min-width: 100%;
    flex: 0 0 100%;
}

body.home .featured-build-images {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
}

body.home .featured-build-images.single-image {
    grid-template-columns: 1fr;
}

body.home .featured-build-image-button {
    display: block;
    width: 100%;
    min-width: 0;
    aspect-ratio: 4 / 5;
    padding: 0;
    border: 1px solid rgba(210, 215, 220, 0.12);
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.28);
    cursor: zoom-in;
    overflow: hidden;
}

body.home .featured-build-image-button img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: scale(1.01);
    transition: transform 420ms ease, filter 420ms ease;
}

body.home .featured-build-image-button:hover img,
body.home .featured-build-image-button:focus-visible img {
    transform: scale(1.04);
    filter: brightness(1.08);
}

body.home .featured-builds-meta {
    grid-column: 2;
    grid-row: 1 / span 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-width: 0;
    min-height: 100%;
    padding: 0.2rem 0.2rem 0.2rem 0;
}

body.home .featured-builds-copy {
    margin-top: auto;
}

body.home .featured-builds-copy h3 {
    max-width: 12ch;
    margin: 0.55rem 0 0.5rem;
    font-size: clamp(1.7rem, 2.8vw, 2.4rem);
    line-height: 0.98;
    letter-spacing: -0.045em;
}

body.home .featured-builds-copy p {
    max-width: 28rem;
    margin: 0;
    color: rgba(232, 235, 238, 0.72);
    font-size: 0.94rem;
}

body.home .project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

body.home .project-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 1.75rem;
    padding: 0.25rem 0.65rem;
    border: 1px solid rgba(210, 215, 220, 0.13);
    border-radius: 999px;
    color: rgba(232, 235, 238, 0.72);
    font-size: 0.76rem;
    text-transform: capitalize;
}

body.home .featured-builds-count {
    margin-top: 0.75rem !important;
    color: rgba(232, 235, 238, 0.52) !important;
    font-size: 0.86rem;
}

body.home .featured-builds-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.6rem;
}

body.home .carousel-dots {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

body.home .carousel-dot {
    width: 0.56rem;
    height: 0.56rem;
    padding: 0;
    border: 1px solid rgba(210, 215, 220, 0.28);
    border-radius: 999px;
    background: rgba(232, 235, 238, 0.18);
    cursor: pointer;
}

body.home .carousel-dot.active,
body.home .carousel-dot[aria-current="true"] {
    background: #9aa0a6;
    border-color: rgba(232, 235, 238, 0.65);
}

body.home .carousel-button {
    position: static;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 1px solid rgba(210, 215, 220, 0.18);
    border-radius: 999px;
    background: rgba(7, 8, 10, 0.72);
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.45rem;
    line-height: 1;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

body.home .carousel-button:hover,
body.home .carousel-button:focus-visible {
    background: rgba(154, 160, 166, 0.26);
    border-color: rgba(210, 215, 220, 0.26);
}

/* ==========================================================================
   Makes Lightbox on Home
========================================================================== */

body.home .build-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 3.5rem 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.86);
    backdrop-filter: blur(10px);
}

body.home .build-lightbox[hidden] {
    display: none;
}

body.home .lightbox-figure {
    width: min(1100px, 92vw);
    max-height: 86vh;
    margin: 0;
}

body.home .lightbox-figure img {
    display: block;
    width: 100%;
    max-height: 78vh;
    object-fit: contain;
    border-radius: 18px;
    background: rgba(0, 0, 0, 0.35);
}

body.home .lightbox-figure figcaption {
    margin-top: 0.85rem;
    color: rgba(232, 235, 238, 0.76);
    text-align: center;
}

body.home .lightbox-close,
body.home .lightbox-nav {
    position: fixed;
    z-index: 1001;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(210, 215, 220, 0.18);
    border-radius: 999px;
    background: rgba(12, 13, 15, 0.78);
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    backdrop-filter: blur(10px);
}

body.home .lightbox-close {
    top: 1rem;
    right: 1rem;
    width: 2.75rem;
    height: 2.75rem;
    font-size: 1.8rem;
}

body.home .lightbox-nav {
    top: 50%;
    width: 3rem;
    height: 3rem;
    font-size: 2rem;
    transform: translateY(-50%);
}

body.home .lightbox-prev {
    left: 1rem;
}

body.home .lightbox-next {
    right: 1rem;
}

body.home .lightbox-close:hover,
body.home .lightbox-close:focus-visible,
body.home .lightbox-nav:hover,
body.home .lightbox-nav:focus-visible {
    background: rgba(154, 160, 166, 0.28);
}

/* ==========================================================================
   Responsive
========================================================================== */

@media (max-width: 980px) {
    body.home .home-music-card,
    body.home .featured-builds-shell {
        grid-template-columns: 1fr;
    }

    body.home .featured-builds-heading,
    body.home .featured-builds-main,
    body.home .featured-builds-meta {
        grid-column: 1;
        grid-row: auto;
    }

    body.home .featured-builds-meta {
        padding: 0.15rem;
    }

    body.home .featured-builds-copy h3 {
        max-width: none;
    }
}

@media (max-width: 760px) {
    body.home .home-music-selector .music-track-list {
        grid-template-columns: 1fr;
    }

    body.home .featured-build-images {
        grid-template-columns: 1fr;
    }

    body.home .featured-build-image-button {
        aspect-ratio: 16 / 10;
    }

    body.home .featured-builds-main {
        grid-template-columns: minmax(0, 1fr);
    }

    body.home .carousel-button {
        display: none;
    }

    body.home .featured-builds-viewport {
        grid-column: 1;
    }
}

@media (max-width: 640px) {
    body.home .custom-audio-controls {
        grid-template-columns: auto 1fr;
    }

    body.home .music-time,
    body.home .music-volume {
        grid-column: 1 / -1;
    }
}
