/*
 * All builds (index.html): one glass slab per release, newest first, its files in a column per
 * system. On top of styles.css: its colors, type, .glass, .chunky-type, the footer and the toast.
 * The latest release is the one people come for: bigger, its files drawn as buttons.
 */

.top {
    width: min(960px, 100% - 32px);
    margin: 0 auto;
    padding-top: 16px;
}

.top__logo {
    width: 150px;
    margin-block: -14px -10px;
    filter: drop-shadow(0 8px 14px rgb(20 4 40 / 0.6));
}

.builds {
    width: min(960px, 100% - 32px);
    margin: 0 auto;
    padding: clamp(24px, 5vh, 48px) 0 80px;
}

.builds h1 {
    font-size: clamp(2.75rem, 7vw, 4.5rem);
}

.builds__lead {
    max-width: 52ch;
    margin-top: 14px;
    color: var(--lavender);
    font-size: 1.125rem;
}

/* ---------------------------------------------------------------- the filter */

.filter {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 28px;
    padding: 5px;
    border-radius: 18px;
    background: rgb(23 11 58 / 0.55);
    border: 1px solid rgb(255 255 255 / 0.14);
}

.filter button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 16px;
    border: 0;
    border-radius: 13px;
    background: none;
    color: var(--lavender);
    font: 800 0.9375rem/1 var(--body);
    cursor: pointer;
}

.filter button img {
    width: 16px;
    height: 16px;
    filter: invert(1);
    opacity: 0.75;
}

.filter button:hover {
    color: var(--moon);
    background: rgb(255 255 255 / 0.08);
}

.filter button[aria-pressed="true"] {
    background: linear-gradient(180deg, #fde047, var(--gold) 45%, #f59e0b);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.5), 0 3px 0 var(--gold-edge);
    color: var(--gold-ink);
}

.filter button[aria-pressed="true"] img {
    filter: none;
}

/* ---------------------------------------------------------------- releases */

.releases {
    display: grid;
    gap: 16px;
    margin: 28px 0 0;
    padding: 0;
    list-style: none;
}

.release {
    padding: 22px clamp(18px, 3vw, 28px) 24px;
    border-radius: 26px;
}

.release__head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px 14px;
}

.release__head h2 {
    font-size: 2rem;
}

.release--latest .release__head h2 {
    font-size: 3rem;
}

.release__tag {
    align-self: center;
    padding: 5px 12px;
    border-radius: 999px;
    background: linear-gradient(180deg, #fde047, var(--gold));
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.5), 0 2px 0 var(--gold-edge);
    color: var(--gold-ink);
    font-size: 0.875rem;
    font-weight: 900;
}

.release__head time {
    margin-left: auto;
    color: var(--lavender);
    font-size: 0.9375rem;
}

.release__notes {
    margin-top: 10px;
}

.release__notes summary {
    display: inline-block;
    padding: 4px 0;
    color: var(--lavender);
    font-weight: 800;
    cursor: pointer;
    list-style: none;
}

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

.release__notes summary::after {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-left: 9px;
    border: solid currentColor;
    border-width: 0 2px 2px 0;
    rotate: 45deg;
    translate: 0 -3px;
    transition: rotate 160ms ease, translate 160ms ease;
}

.release__notes[open] summary::after {
    rotate: 225deg;
    translate: 0 1px;
}

.release__notes summary:hover {
    color: var(--moon);
}

.release__notes ul {
    max-width: 64ch;
    margin: 6px 0 0;
    padding-left: 1.2em;
}

.release__notes li + li {
    margin-top: 4px;
}

.release__notes li::marker {
    color: var(--gold);
}

/* ---------------------------------------------------------------- files */

.release__files {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid rgb(255 255 255 / 0.1);
}

.platform h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font: 900 0.9375rem/1 var(--body);
    color: var(--lavender);
}

.platform h3 img {
    width: 16px;
    height: 16px;
    filter: invert(1);
    opacity: 0.75;
}

.platform ul {
    display: grid;
    gap: 6px;
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}

.file {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 9px 14px 10px;
    border-radius: 12px;
    background: rgb(255 255 255 / 0.06);
    text-decoration: none;
    font-weight: 800;
}

.file:hover {
    background: rgb(255 255 255 / 0.13);
}

.file__meta {
    color: var(--lavender);
    font-size: 0.875rem;
    font-weight: 700;
}

/* The latest files are buttons, like the landing's. */
.release--latest .file {
    border: 1px solid rgb(76 29 149 / 0.6);
    background:
        linear-gradient(180deg, rgb(255 255 255 / 0.3), rgb(255 255 255 / 0) 52%),
        var(--violet);
    box-shadow:
        inset 0 2px 0 rgb(255 255 255 / 0.35),
        0 3px 0 #3b1578;
}

.release--latest .file:hover {
    filter: brightness(1.08);
}

.release--latest .file:active {
    translate: 0 2px;
    box-shadow: inset 0 2px 0 rgb(255 255 255 / 0.35), 0 1px 0 #3b1578;
}

.release--latest .file__meta {
    color: rgb(255 255 255 / 0.8);
}

.platform__none {
    margin-top: 10px;
    padding: 10px 0;
    color: rgb(201 191 232 / 0.6);
    font-size: 0.9375rem;
}

/* One system picked: its column only, its files in a row. */
.builds:not([data-show="all"]) .release__files {
    grid-template-columns: 1fr;
}

.builds[data-show="mac"] .platform:not([data-platform="mac"]),
.builds[data-show="windows"] .platform:not([data-platform="windows"]),
.builds[data-show="linux"] .platform:not([data-platform="linux"]) {
    display: none;
}

.builds:not([data-show="all"]) .platform ul {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

/* ---------------------------------------------------------------- phones */

@media (max-width: 720px) {
    .release__files {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .release__head time {
        flex-basis: 100%;
        margin-left: 0;
    }

    .filter {
        display: flex;
    }

    .filter {
        flex-wrap: nowrap;
    }

    .filter button {
        flex: 1 1 auto;
        justify-content: center;
        gap: 6px;
        padding: 0 8px;
        font-size: 0.875rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .release__notes summary::after {
        transition: none;
    }
}
