/* Arts page (arts.html): masonry gallery and lightbox. */

.section.gallery-page { max-width: 1250px; padding-bottom: 100px; }

.gallery { column-count: 4; column-gap: 14px; }

.art {
    position: relative;
    display: block;
    width: 100%;
    margin: 0 0 14px;
    break-inside: avoid;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface);
    cursor: zoom-in;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .6s ease, transform .6s cubic-bezier(0.16, 1, 0.3, 1), border-color .25s;
}

.art.is-in { opacity: 1; transform: none; }
.art:hover { border-color: #55505f; }
.art:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.art img { display: block; width: 100%; height: auto; transition: transform .5s cubic-bezier(0.16, 1, 0.3, 1); }
.art:hover img { transform: scale(1.03); }

.state { text-align: center; color: var(--muted); font-size: 13px; padding: 60px 0; }

/* Mod icons: small pixel-art tiles */

.icons-section { margin-top: 88px; }
.icons-section .section-heading { margin-bottom: 36px; }
.icons-section .section-heading h2 { font-size: 28px; }

.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    gap: 10px;
}

.icon-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 18px 8px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--muted);
    font-family: inherit;
    font-size: 11.5px;
    line-height: 1.3;
    text-align: center;
    cursor: zoom-in;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .5s ease, transform .5s cubic-bezier(0.16, 1, 0.3, 1), border-color .2s, color .2s, background-color .2s;
}

.icon-tile.is-in { opacity: 1; transform: none; }
.icon-tile:hover { border-color: rgba(167, 139, 250, 0.35); background: var(--surface-hover); color: var(--text); }
.icon-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.icon-tile img {
    width: 48px;
    height: 48px;
    image-rendering: pixelated;
    transition: transform .25s cubic-bezier(0.16, 1, 0.3, 1);
}

.icon-tile:hover img { transform: scale(1.12); }

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: rgba(4, 4, 6, 0.88);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}

.lightbox.is-open { opacity: 1; visibility: visible; }

.lightbox img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 10px;
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.08);
    transform: scale(0.96);
    transition: transform .35s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox.is-open img { transform: scale(1); }

.lightbox figure { display: flex; flex-direction: column; align-items: center; gap: 16px; max-width: 100%; max-height: 100%; margin: 0; }
.lightbox img.is-pixel { width: min(320px, 70vw); height: auto; image-rendering: pixelated; box-shadow: none; }
.lb-caption { color: var(--text-soft); font-size: 14px; font-weight: 500; }

.lb-btn {
    position: absolute;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    cursor: pointer;
    font-size: 18px;
    font-family: inherit;
    transition: background-color .2s;
}

.lb-btn:hover { background: rgba(255, 255, 255, 0.1); }
.lb-close { top: 20px; right: 20px; }
.lb-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 20px; top: 50%; transform: translateY(-50%); }

@media (max-width: 1100px) { .gallery { column-count: 3; } }

@media (max-width: 760px) {
    .gallery { column-count: 2; column-gap: 10px; }
    .art { margin-bottom: 10px; }
    .lb-prev, .lb-next { display: none; }
    .lightbox { padding: 16px; }
}

@media (max-width: 420px) { .gallery { column-count: 1; } }

@media (prefers-reduced-motion: reduce) {
    .art { opacity: 1; transform: none; transition: none; }
    .art img, .lightbox, .lightbox img { transition: none; }
    .icon-tile { opacity: 1; transform: none; transition: none; }
}
