:root {
    color-scheme: dark;
    --bg: #0b1020;
    --surface: #141b2d;
    --line: #29334a;
    --text: #f3f6fc;
    --muted: #9ba8bf;
    --accent: #7380ff
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

html,
body {
    min-height: 100%
}

body {
    min-width: 320px;
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    background: radial-gradient(circle at 15% -10%, #28346b 0, transparent 31rem), var(--bg)
}

.header {
    min-height: 92px;
    display: flex;
    align-items: center;
    padding: 22px max(5vw, 28px);
    border-bottom: 1px solid rgba(155, 168, 191, .16);
    background: rgba(11, 16, 32, .74);
    backdrop-filter: blur(18px)
}

.header h1 {
    font-size: clamp(1.35rem, 2.5vw, 2rem);
    font-weight: 700;
    letter-spacing: -.045em
}

.header h1::after {
    content: " / odabrani radovi";
    color: var(--muted);
    font-size: .48em;
    font-weight: 500;
    letter-spacing: .01em
}

.gallery {
    width: min(1440px, 92%);
    margin: 42px auto 64px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
    gap: clamp(14px, 2vw, 24px)
}

.photo {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    cursor: pointer;
    isolation: isolate;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    transition: transform .24s ease, border-color .24s ease, box-shadow .24s ease
}

.photo::after {
    content: "Pogledaj fotografiju ↗";
    position: absolute;
    inset: auto 14px 13px;
    z-index: 1;
    color: #fff;
    font-size: .75rem;
    font-weight: 650;
    opacity: 0;
    transform: translateY(8px);
    transition: .24s ease
}

.photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(.88) contrast(1.04);
    transition: transform .5s ease, filter .3s ease
}

.photo:hover {
    border-color: var(--accent);
    box-shadow: 0 16px 36px rgba(0, 0, 0, .28);
    transform: translateY(-5px)
}

.photo:hover img {
    filter: saturate(1) contrast(1.05) brightness(.64);
    transform: scale(1.045)
}

.photo:hover::after {
    opacity: 1;
    transform: translateY(0)
}

.viewer {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 28px 92px;
    background: rgba(4, 7, 15, .92);
    backdrop-filter: blur(12px)
}

.viewer.active {
    display: flex
}

.image-frame {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(1120px, 100%);
    height: min(80vh, 760px);
    overflow: hidden;
    border: 1px solid #34405c;
    border-radius: 12px;
    background: #080b13;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .5)
}

.image-frame img {
    display: block;
    max-width: 100%;
    max-height: 100%
}

.close,
.navigation {
    position: absolute;
    z-index: 1002;
    display: grid;
    place-items: center;
    border: 1px solid #3c4966;
    border-radius: 10px;
    color: #f5f7ff;
    background: #192238;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, transform .18s ease
}

.close:hover,
.navigation:hover {
    border-color: #8490ff;
    background: #29345a
}

.close {
    top: 24px;
    right: 28px;
    width: 44px;
    height: 44px;
    font-size: 27px
}

.navigation {
    top: 50%;
    width: 50px;
    height: 64px;
    font-size: 35px;
    transform: translateY(-50%)
}

.navigation:hover {
    transform: translateY(-50%) scale(1.04)
}

.previous {
    left: 24px
}

.next {
    right: 24px
}

.counter {
    position: absolute;
    bottom: 14px;
    left: 50%;
    padding: 7px 11px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 7px;
    transform: translateX(-50%);
    color: #e6ebfa;
    background: rgba(12, 17, 30, .8);
    font-size: .78rem;
    font-variant-numeric: tabular-nums
}

@media(max-width:700px) {
    .header {
        min-height: 76px
    }

    .header h1::after {
        display: none
    }

    .gallery {
        margin-top: 24px;
        grid-template-columns: repeat(2, 1fr);
        gap: 11px
    }

    .viewer {
        padding: 20px 54px
    }

    .image-frame {
        height: 72vh
    }

    .navigation {
        width: 38px;
        height: 54px;
        font-size: 28px
    }

    .previous {
        left: 8px
    }

    .next {
        right: 8px
    }

    .close {
        top: 12px;
        right: 14px
    }
}

/* Sprječava povlačenje fotografije izravno iz preglednika. */
.photo img,
.image-frame img {
    user-select: none;
    -webkit-user-drag: none
}

.purchase-note {
    width: min(1440px, 92%);
    margin: -28px auto 64px;
    padding: 22px 24px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(20, 27, 45, .72);
    color: var(--muted);
    font-size: .92rem;
    line-height: 1.55
}

.purchase-note p:first-child {
    color: var(--text);
    font-size: 1rem;
    font-weight: 650
}

.purchase-note p+p {
    margin-top: 3px
}

.photo::before,
.image-frame::after {
    content: "© Kreatura by C4L1M3R0";
    position: absolute;
    right: 12px;
    bottom: 11px;
    z-index: 2;
    color: rgba(255, 255, 255, .88);
    font-size: .66rem;
    font-weight: 650;
    letter-spacing: .025em;
    text-shadow: 0 1px 8px #000;
    pointer-events: none
}

.image-frame::after {
    right: 16px;
    bottom: 15px;
    font-size: .75rem
}

.photo:hover::before {
    opacity: 0
}

#footer {
    width: min(1440px, 92%);
    margin: 0 auto 28px;
    padding: 22px 24px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(20, 27, 45, .72);
    color: var(--muted);
    font-size: .88rem;
    line-height: 1.55
}

.footer p:first-child {
    color: var(--text);
    font-size: .96rem;
    font-weight: 650
}

.footer p+p {
    margin-top: 3px
}
