@font-face { font-family: 'Gilroy'; src: url('fonts/Gilroy-Regular.woff') format('woff'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Gilroy'; src: url('fonts/Gilroy-Bold.woff') format('woff'); font-weight: 700; font-display: swap; }
.ph-bold { font-style: normal; }
.ph-arrow-left::before { content: '←'; }
.ph-arrow-right::before { content: '→'; }
.ph-x::before { content: '×'; }
.ph-caret-left::before { content: '‹'; }
.ph-caret-right::before { content: '›'; }
.ph-arrows-out::before { content: '⤢'; }
:root {
    --portfolio-purple: #251f5b;
    --portfolio-purple-dark: #0b091d;
    --portfolio-accent: #f0cdaf;
    --portfolio-white: #ffffff;
    --portfolio-border: rgba(255, 255, 255, 0.09);
    --portfolio-muted: rgba(255, 255, 255, 0.58);
    --portfolio-radius: 12px;
}

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

html {
    color-scheme: dark;
    background: var(--portfolio-purple-dark);
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    background: transparent;
    color: var(--portfolio-white);
    font-family: 'Gilroy', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    font: inherit;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.portfolio-background,
.portfolio-background__slide,
.portfolio-background__overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.portfolio-background {
    z-index: 0;
    overflow: hidden;
    background: var(--portfolio-purple-dark);
}

.portfolio-background__slide {
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    filter: blur(52px) brightness(0.34) saturate(1.1);
    opacity: 0;
    transform: scale(1.15);
    transition: opacity 1.8s ease;
    will-change: opacity;
}

.portfolio-background__slide.is-visible {
    opacity: 1;
}

.portfolio-background__overlay {
    z-index: 1;
    background:
        radial-gradient(circle at 50% 0%, rgba(69, 57, 144, 0.22), transparent 54%),
        linear-gradient(180deg, rgba(7, 6, 19, 0.88), rgba(10, 8, 27, 0.94));
}

.portfolio-nav {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    height: 58px;
    padding: 0 clamp(16px, 4vw, 48px);
    border-bottom: 1px solid var(--portfolio-border);
    background: rgba(8, 7, 20, 0.46);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 7px 15px;
    border: 1px solid var(--portfolio-border);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.055);
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-decoration: none;
    transition: color 0.3s ease, background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.back-link:hover {
    border-color: transparent;
    background: var(--portfolio-accent);
    color: var(--portfolio-purple-dark);
    transform: translateY(-1px);
}

main,
.portfolio-footer {
    position: relative;
    z-index: 2;
}

.portfolio-grid {
    max-width: 1440px;
    min-height: 70vh;
    margin: 0 auto;
    padding: 82px clamp(12px, 4vw, 48px) 0;
}

.portfolio-group {
    margin-bottom: clamp(46px, 7vw, 86px);
}

.portfolio-group:last-child {
    margin-bottom: 0;
}

.portfolio-group__header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 16px;
    padding: 0 2px 12px;
    border-bottom: 1px solid var(--portfolio-border);
}

.portfolio-group__title {
    color: var(--portfolio-white);
    font-size: clamp(1rem, 1.6vw, 1.28rem);
    font-weight: 750;
    letter-spacing: -0.02em;
}

.portfolio-group__count {
    color: var(--portfolio-muted);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.portfolio-group__grid {
    column-count: 1;
    column-gap: 16px;
}

.portfolio-card {
    position: relative;
    display: inline-block;
    width: 100%;
    margin: 0 0 16px;
    overflow: hidden;
    break-inside: avoid;
    border: 1px solid rgba(255, 255, 255, 0.045);
    border-radius: var(--portfolio-radius);
    background: rgba(255, 255, 255, 0.025);
    box-shadow: 0 12px 42px rgba(0, 0, 0, 0.48);
    color: var(--portfolio-white);
    cursor: zoom-in;
    opacity: 0;
    text-align: left;
    transform: translateY(18px);
    transition: opacity 0.65s ease, transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

.portfolio-card.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.portfolio-card img {
    display: block;
    width: 100%;
    height: auto;
    background: rgba(255, 255, 255, 0.035);
    filter: brightness(0.96);
    transition: filter 0.6s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.portfolio-card__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 16px;
    background: linear-gradient(180deg, transparent 58%, rgba(8, 6, 20, 0.74) 100%);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.portfolio-card__icon {
    display: grid;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 50%;
    background: rgba(20, 16, 53, 0.66);
    color: var(--portfolio-accent);
    font-size: 0.85rem;
    place-items: center;
    transform: translateY(7px);
    transition: background 0.3s ease, transform 0.3s ease;
}

.portfolio-card:hover img,
.portfolio-card:focus-visible img {
    filter: brightness(1);
    transform: scale(1.025);
}

.portfolio-card:hover .portfolio-card__overlay,
.portfolio-card:focus-visible .portfolio-card__overlay {
    opacity: 1;
}

.portfolio-card:hover .portfolio-card__icon,
.portfolio-card:focus-visible .portfolio-card__icon {
    background: rgba(37, 31, 91, 0.88);
    transform: translateY(0);
}

.back-link:focus-visible,
.portfolio-card:focus-visible,
.portfolio-cta__button:focus-visible,
.lightbox button:focus-visible {
    outline: 3px solid var(--portfolio-accent);
    outline-offset: 3px;
}

.no-script {
    position: relative;
    z-index: 2;
    padding: 120px 24px;
    color: var(--portfolio-muted);
    text-align: center;
}

.portfolio-cta {
    max-width: 760px;
    margin: 0 auto;
    padding: 72px 24px 96px;
    text-align: center;
}

.portfolio-cta__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    min-height: 54px;
    padding: 15px 32px;
    border-radius: 999px;
    background: var(--portfolio-accent);
    box-shadow: 0 8px 28px rgba(240, 205, 175, 0.18);
    color: var(--portfolio-purple-dark);
    font-size: 0.92rem;
    font-weight: 800;
    text-decoration: none;
    transition: background 0.35s ease, box-shadow 0.35s ease, transform 0.35s ease;
}

.portfolio-cta__button i {
    font-size: 1.2rem;
}

.portfolio-cta__button:hover {
    background: var(--portfolio-white);
    box-shadow: 0 12px 34px rgba(240, 205, 175, 0.3);
    transform: translateY(-3px);
}

.portfolio-footer {
    padding: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.055);
    background: rgba(7, 6, 19, 0.76);
    color: rgba(255, 255, 255, 0.38);
    font-size: 0.68rem;
    letter-spacing: 0.03em;
    text-align: center;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 4, 14, 0.975);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.lightbox.is-open {
    opacity: 1;
    pointer-events: auto;
}

.lightbox__topbar {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: linear-gradient(180deg, rgba(5, 4, 14, 0.68), transparent);
}

.lightbox__counter {
    color: rgba(255, 255, 255, 0.48);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.lightbox__close,
.lightbox__nav {
    display: grid;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.055);
    color: rgba(255, 255, 255, 0.62);
    cursor: pointer;
    place-items: center;
    transition: color 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}

.lightbox__close {
    width: 38px;
    height: 38px;
}

.lightbox__nav {
    position: absolute;
    top: 50%;
    z-index: 4;
    width: 42px;
    height: 42px;
    transform: translateY(-50%);
}

.lightbox__nav--previous {
    left: 22px;
}

.lightbox__nav--next {
    right: 22px;
}

.lightbox__close:hover,
.lightbox__nav:hover {
    border-color: rgba(240, 205, 175, 0.42);
    background: rgba(240, 205, 175, 0.08);
    color: var(--portfolio-accent);
}

.lightbox__content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.lightbox__glow {
    position: absolute;
    inset: -120px;
    z-index: 0;
    background-position: center;
    background-size: cover;
    filter: blur(140px);
    opacity: 0.2;
    pointer-events: none;
    transition: background-image 0.4s ease;
}

.lightbox__image {
    position: relative;
    z-index: 1;
    width: auto;
    height: auto;
    max-width: calc(100vw - 128px);
    max-height: calc(100vh - 88px);
    border-radius: 9px;
    box-shadow: 0 24px 90px rgba(0, 0, 0, 0.62);
    object-fit: contain;
    opacity: 0;
    transform: scale(0.975);
    transition: opacity 0.38s ease, transform 0.38s ease;
}

.lightbox__image.is-loaded {
    opacity: 1;
    transform: scale(1);
}

body.lightbox-open {
    overflow: hidden;
}

@media (min-width: 641px) {
    .portfolio-group__grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
        column-count: auto;
    }

    .portfolio-card {
        display: block;
        aspect-ratio: 4 / 3;
        margin: 0;
    }

    .portfolio-card img {
        position: relative;
        z-index: 1;
        width: 100%;
        height: 100%;
        background: transparent;
        object-fit: cover;
    }

    .portfolio-card__overlay {
        z-index: 2;
    }
}

@media (min-width: 1100px) {
    .portfolio-group__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 24px;
    }
}

@media (max-width: 640px) {
    .portfolio-nav {
        height: 52px;
    }

    .back-link {
        padding: 6px 12px;
        font-size: 0.68rem;
    }

    .portfolio-grid {
        padding: 66px 10px 0;
    }

    .portfolio-group {
        margin-bottom: 42px;
    }

    .portfolio-group__header {
        margin: 0 2px 11px;
        padding: 0 1px 9px;
    }

    .portfolio-group__title {
        font-size: 0.96rem;
    }

    .portfolio-group__count {
        font-size: 0.6rem;
    }

    .portfolio-card {
        margin-bottom: 10px;
        border-radius: 9px;
    }

    .portfolio-cta {
        padding: 48px 20px 72px;
    }

    .portfolio-cta__button {
        width: 100%;
        padding: 14px 20px;
    }

    .lightbox__topbar {
        padding: 12px 14px;
    }

    .lightbox__nav {
        width: 36px;
        height: 36px;
    }

    .lightbox__nav--previous {
        left: 8px;
    }

    .lightbox__nav--next {
        right: 8px;
    }

    .lightbox__image {
        max-width: 100vw;
        max-height: 86vh;
        border-radius: 0;
    }

    .lightbox__glow {
        inset: -60px;
        filter: blur(82px);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
