/* -------------------------------------------------------------------------
 * dhumann.com — Slideshow & Center-Overlay Navigation (no jQuery)
 * ------------------------------------------------------------------------- */

*, *::before, *::after {
    box-sizing: border-box;
}

[hidden],
.is-hidden {
    display: none !important;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    font: normal 16px/1.4 'Poppins', sans-serif;
    color: #fff;
}

hr { outline: none; border: none; height: 1px; background-color: #333 !important; }

/* Background Slideshow */
.slideshow {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background: #000;
}

.slideshow__slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transform: scale(1);
    transition: opacity 0.8s ease-in-out, transform 6s ease-out;
    will-change: opacity, transform;
    pointer-events: none;
    user-select: none;
}

.slideshow__slide.is-zoom-in {
    transform: scale(1);
}

.slideshow__slide.is-zoom-in.is-animating {
    transform: scale(1.06);
}

.slideshow__slide.is-zoom-out {
    transform: scale(1.06);
}

.slideshow__slide.is-zoom-out.is-animating {
    transform: scale(1);
}

.slideshow__slide.is-active {
    opacity: 1;
}

/* First-image Loading Spinner */
.slideshow-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 36px;
    height: 36px;
    margin: -18px 0 0 -18px;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top-color: #ff9900;
    border-radius: 50%;
    animation: slideshow-spin 0.8s linear infinite;
    opacity: 1;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.slideshow-loader.is-hidden {
    opacity: 0;
}

@keyframes slideshow-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Idle UI Fade */
.ui-fade {
    transition: opacity 0.45s ease;
}

body.is-idle:not(.menu-open) .ui-fade {
    opacity: 0;
    pointer-events: none;
}

/* Top-Center Single-Line Navigation Bar */
.top-nav {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 16px 6px 8px;
    max-width: calc(100vw - 32px);
    overflow-x: auto;
    scrollbar-width: none;
    background: rgba(15, 15, 15, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    backdrop-filter: blur(10px);
    white-space: nowrap;
}

.top-nav__logo {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #6eae44 url('../img/humann-icon.svg') center center no-repeat;
    background-size: 72%;
    transition: transform 0.25s ease, background-color 0.25s ease;
}

.top-nav__logo:hover,
.top-nav__logo:focus-visible {
    background-color: #86d452;
    transform: scale(1.1);
    outline: none;
}

.top-nav__links {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.top-nav__link {
    padding: 4px 10px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.88rem;
    text-decoration: none;
    border-radius: 999px;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.top-nav__link:hover,
.top-nav__link:focus-visible {
    color: #ff9900;
    background: rgba(255, 255, 255, 0.08);
    outline: none;
}

body.menu-open .top-nav {
    opacity: 0;
    pointer-events: none;
}

/* Center Navigation Overlay */
.home {
    position: fixed;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s ease, background-color 0.35s ease, visibility 0.35s ease;
}

.home.is-open {
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.home-content {
    text-align: center;
    padding: 1.5rem;
    transform: translateY(8px);
    transition: transform 0.35s ease;
}

.home.is-open .home-content {
    transform: translateY(0);
}

/* Logo */
.logo {
    position: relative;
    display: inline-block;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: #6eae44 url('../img/humann-icon.svg') center center no-repeat;
    background-size: 75%;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0);
    cursor: pointer;
    transition: all 0.3s ease;
}

.logo:hover,
.logo:focus-visible {
    background-color: #86d452;
    box-shadow: 0 0 16px 8px rgba(255, 255, 255, 0.45);
    transform: scale(1.12);
    outline: none;
}

/* Navigation Pill */
.btn-group {
    max-width: 520px;
    margin: 1.75em auto 0;
    padding: 0.5em 1.25em;
    background-color: rgba(20, 20, 20, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 2em;
}

.btn {
    display: inline-block;
    min-width: 80px;
    margin: 0 2px;
    padding: 0.65em 0.4em;
    color: #fff;
    font-size: 1.05em;
    text-decoration: none;
    transition: color 0.25s ease;
}

.btn:hover,
.btn:focus-visible {
    color: #ff9900;
    outline: none;
}

/* Bottom-Center Unified Slideshow Dock */
.slideshow-dock {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    max-width: calc(100vw - 32px);
}

/* Responsive Thumbnail Grid Drawer */
.thumbnails {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%) translateY(0);
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    gap: 8px;
    padding: 10px;
    width: min(540px, calc(100vw - 32px));
    max-height: 45vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
    background: rgba(15, 15, 15, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    opacity: 1;
    visibility: visible;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

.thumbnails.is-collapsed {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-50%) translateY(6px);
}

.thumbnails__item {
    appearance: none;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
    line-height: 0;
    opacity: 0.65;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.thumbnails__item:hover,
.thumbnails__item:focus-visible,
.thumbnails__item.is-active {
    opacity: 1;
    outline: none;
}

.thumbnails__item.is-active {
    transform: scale(1.03);
}

.thumbnails__img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    border: 2px solid transparent;
    transition: border-color 0.2s ease;
}

.thumbnails__item:hover .thumbnails__img,
.thumbnails__item:focus-visible .thumbnails__img {
    border-color: rgba(255, 255, 255, 0.65);
}

.thumbnails__item.is-active .thumbnails__img {
    border-color: #ff9900;
}

/* Transport Controls Pill */
.slideshow-controls {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px 8px;
    background: rgba(15, 15, 15, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    backdrop-filter: blur(10px);
}

.slideshow-controls__btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.slideshow-controls__btn:hover,
.slideshow-controls__btn:focus-visible {
    background: rgba(255, 255, 255, 0.14);
    color: #ff9900;
    outline: none;
}

.slideshow-controls__btn.is-paused,
#btn-thumbs[aria-pressed="true"],
#btn-audio[aria-pressed="true"],
#btn-info[aria-expanded="true"] {
    color: #ff9900;
}

.slideshow-controls__counter {
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
    color: rgba(255, 255, 255, 0.75);
    padding: 0 8px;
    min-width: 52px;
    text-align: center;
    user-select: none;
}

/* Subtle 5s Countdown Bar */
.slideshow-progress {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 2px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.slideshow-progress__bar {
    height: 100%;
    width: 0%;
    background: #ff9900;
}

/* Subtle "Play music?" Callout Pill */
.audio-prompt {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px 4px 12px;
    background: rgba(15, 15, 15, 0.78);
    border: 1px solid rgba(255, 153, 0, 0.45);
    border-radius: 999px;
    backdrop-filter: blur(10px);
    white-space: nowrap;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
    animation: audio-prompt-in 0.3s ease;
}

.audio-prompt__play,
.audio-prompt__dismiss {
    appearance: none;
    border: 0;
    background: transparent;
    font-family: inherit;
    cursor: pointer;
    transition: color 0.2s ease;
}

.audio-prompt__play {
    padding: 3px 4px;
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.8rem;
}

.audio-prompt__play:hover,
.audio-prompt__play:focus-visible {
    color: #ff9900;
    outline: none;
}

.audio-prompt__dismiss {
    padding: 2px 6px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.95rem;
    line-height: 1;
}

.audio-prompt__dismiss:hover,
.audio-prompt__dismiss:focus-visible {
    color: #fff;
    outline: none;
}

@keyframes audio-prompt-in {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Info Modal */
.info-modal {
    position: fixed;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.info-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.info-modal__card {
    width: 100%;
    max-width: 460px;
    padding: 24px 26px;
    background: rgba(18, 18, 18, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    transform: translateY(8px);
    transition: transform 0.3s ease;
}

.info-modal.is-open .info-modal__card {
    transform: translateY(0);
}

.info-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.info-modal__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
}

.info-modal__close {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.info-modal__close:hover,
.info-modal__close:focus-visible {
    background: rgba(255, 255, 255, 0.18);
    color: #ff9900;
    outline: none;
}

.info-modal__body {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.82);
}

.info-modal__actions {
    margin-top: 18px;
}

.info-modal__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 999px;
    background: #6eae44;
    color: #fff;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.info-modal__cta:hover,
.info-modal__cta:focus-visible {
    background: #86d452;
    transform: translateY(-1px);
    outline: none;
}

/* Attribution (shown at bottom-center only when controls auto-hide) */
.attr {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    z-index: 2;
    pointer-events: none;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.45s ease;
}

body.is-idle:not(.menu-open) .attr {
    opacity: 1;
}

.attr p {
    margin: 0;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.38);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

@media (max-width: 768px) {
    .top-nav {
        gap: 6px;
        padding: 5px 12px 5px 7px;
    }
    .top-nav__logo {
        width: 24px;
        height: 24px;
    }
    .top-nav__link {
        padding: 4px 8px;
        font-size: 0.8rem;
    }
    .logo {
        width: 72px;
        height: 72px;
    }
    .btn-group {
        margin: 1.5em 1em 0;
        padding: 0.7em 0.9em;
    }
    .btn {
        min-width: 68px;
        font-size: 0.95em;
    }
}

@media (max-width: 480px) {
    .thumbnails {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 6px;
        padding: 8px;
    }
    .top-nav {
        top: 10px;
        gap: 4px;
        padding: 4px 10px 4px 6px;
    }
    .top-nav__logo {
        width: 22px;
        height: 22px;
    }
    .top-nav__links {
        gap: 2px;
    }
    .top-nav__link {
        padding: 3px 6px;
        font-size: 0.74rem;
    }
    .logo {
        width: 60px;
        height: 60px;
    }
    .btn-group {
        margin: 1.15em 0.75em 0;
        padding: 0.55em 0.75em;
    }
    .btn {
        min-width: 56px;
        padding: 0.5em 0.3em;
        font-size: 0.88em;
    }
    .slideshow-dock {
        bottom: 12px;
    }
    .slideshow-controls {
        gap: 2px;
        padding: 5px 8px 7px;
    }
    .slideshow-controls__btn {
        width: 28px;
        height: 28px;
    }
    .slideshow-controls__counter {
        font-size: 0.72rem;
        min-width: 44px;
        padding: 0 4px;
    }
    .info-modal__card {
        padding: 18px 20px;
    }
}

@media (max-height: 500px) {
    .top-nav {
        top: 8px;
    }
    .slideshow-dock {
        bottom: 8px;
    }
    .attr {
        bottom: 8px;
    }
    .logo {
        width: 54px;
        height: 54px;
    }
    .btn-group {
        margin-top: 1em;
        padding: 0.5em 0.85em;
    }
}

@media (prefers-reduced-motion: reduce) {
    .slideshow__slide {
        transition: opacity 0.4s ease;
        transform: none !important;
    }
    .slideshow__slide.is-animating {
        transform: none !important;
    }
    .slideshow-loader {
        animation: none;
    }
}
