/* ============================================================
   PORTFOLIO PAGE — gkl-pro.ru/portfolio.html
   Использует токены и компоненты из styles.css
   ============================================================ */

.page-portfolio {
    background: var(--clr-bg);
}

.header__nav-link--active {
    color: var(--clr-purple-500);
}
.header__nav-link--active::after {
    width: 100% !important;
}

/* ---------- HERO ---------- */
.pf-hero {
    position: relative;
    overflow: hidden;
    padding: calc(var(--header-h) + 70px) 0 90px;
    color: #fff;
    isolation: isolate;
}

.pf-hero__bg {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.pf-hero__bg-img {
    position: absolute;
    inset: 0;
    background: url('/img_render/portfolio/spartak/01.webp') center/cover no-repeat;
    transform: scale(1.05);
    animation: pf-hero-zoom 30s ease-in-out infinite alternate;
}

@keyframes pf-hero-zoom {
    from { transform: scale(1.05); }
    to   { transform: scale(1.15); }
}

.pf-hero__bg-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(10, 20, 35, 0.78) 0%, rgba(10, 20, 35, 0.68) 45%, rgba(10, 20, 35, 0.92) 100%);
}

.pf-hero__inner {
    max-width: 720px;
}

.pf-hero__back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 28px;
    transition: color 0.2s, gap 0.2s;
}
.pf-hero__back:hover {
    color: #fff;
    gap: 12px;
}

.pf-hero__tag {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 100px;
    padding: 8px 18px;
    margin-bottom: 24px;
    backdrop-filter: blur(4px);
}

.pf-hero__title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(38px, 6vw, 68px);
    font-weight: 700;
    line-height: 1.08;
    margin: 0 0 22px;
}
.pf-hero__title span {
    color: var(--clr-purple-300);
}

.pf-hero__subtitle {
    font-size: clamp(15px, 1.6vw, 18px);
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.82);
    margin: 0 0 40px;
}

.pf-hero__stats {
    display: flex;
    gap: 44px;
    flex-wrap: wrap;
}
.pf-hero__stat strong {
    display: block;
    font-family: 'Playfair Display', serif;
    font-size: clamp(30px, 4vw, 44px);
    font-weight: 700;
    line-height: 1;
}
.pf-hero__stat strong::after { content: '+'; color: var(--clr-purple-300); }
.pf-hero__stat span {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 8px;
    display: block;
}

/* ---------- CATALOG ---------- */
.pf-catalog {
    background: var(--clr-bg);
}

.pf-catalog__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.pf-catalog__title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(26px, 3vw, 38px);
    font-weight: 700;
    color: var(--clr-text);
    margin: 0;
}

.pf-catalog__note {
    font-size: 14px;
    color: var(--clr-text-dim);
    margin: 0;
}

.pf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 30px 28px;
}

.pf-grid__loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 0;
    color: var(--clr-text-dim);
}

@media (min-width: 900px) {
    .pf-card--featured { grid-column: span 2; }
}

/* ---------- FOLDER CARD ---------- */
.pf-card {
    position: relative;
    cursor: pointer;
    padding-top: 18px;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.pf-card.is-visible {
    opacity: 1;
    transform: none;
}

/* язычок папки */
.pf-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 22px;
    width: 128px;
    height: 26px;
    background: var(--clr-card);
    border: 1px solid var(--clr-border);
    border-bottom: none;
    border-radius: 10px 14px 0 0;
    transform: skewX(-18deg);
    transform-origin: bottom left;
    box-shadow: var(--shadow-sm);
    transition: background 0.3s, border-color 0.3s;
    z-index: 0;
}

.pf-card__inner {
    position: relative;
    z-index: 1;
    border-radius: 4px 18px 18px 18px;
    overflow: hidden;
    background: var(--clr-card);
    border: 1px solid var(--clr-border);
    box-shadow: var(--shadow-md);
    transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.35s;
}

/* фото, выглядывающие из папки */
.pf-card__peek {
    position: absolute;
    inset: 18px 0 0 0;
    border-radius: 4px 18px 18px 18px;
    background-size: cover;
    background-position: center;
    box-shadow: var(--shadow-sm);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.4s;
    z-index: 0;
}

.pf-card:hover .pf-card__inner {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}
.pf-card:hover::before {
    background: var(--clr-purple-100);
    border-color: var(--clr-purple-200);
}
.pf-card:hover .pf-card__peek--1 {
    opacity: 1;
    transform: translateY(-4px) rotate(-4deg) translateX(-14px);
}
.pf-card:hover .pf-card__peek--2 {
    opacity: 1;
    transform: translateY(-2px) rotate(4deg) translateX(14px);
}

.pf-card__media {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--clr-bg-3);
}
.pf-card--featured .pf-card__media {
    aspect-ratio: 2.35 / 1;
}
@media (max-width: 899px) {
    .pf-card--featured .pf-card__media { aspect-ratio: 4 / 3; }
}

.pf-card__media img,
.pf-card__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.pf-card:hover .pf-card__media img,
.pf-card:hover .pf-card__video {
    transform: scale(1.06);
}

.pf-card__media::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10, 20, 35, 0) 35%, rgba(10, 20, 35, 0.78) 100%);
}

.pf-card__count {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: rgba(10, 20, 35, 0.5);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 11px;
    border-radius: 100px;
}

.pf-card__label {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 22px 24px;
    color: #fff;
}

.pf-card__tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #fff;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 100px;
    padding: 4px 10px;
    margin-bottom: 10px;
    backdrop-filter: blur(4px);
}

.pf-card__name {
    font-family: 'Playfair Display', serif;
    font-size: clamp(20px, 2vw, 26px);
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 4px;
}

.pf-card__place {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
    display: flex;
    align-items: center;
    gap: 5px;
}

.pf-card__open {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}
.pf-card__open span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--clr-text);
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 22px;
    border-radius: 100px;
    box-shadow: var(--shadow-md);
    transform: translateY(8px);
    transition: transform 0.3s;
}
.pf-card:hover .pf-card__open { opacity: 1; }
.pf-card:hover .pf-card__open span { transform: none; }

/* ---------- CTA ---------- */
.pf-cta {
    padding: 0 0 90px;
}
.pf-cta__inner {
    position: relative;
    overflow: hidden;
    background: var(--gradient-purple);
    border-radius: 24px;
    padding: 64px 56px;
    text-align: center;
    color: #fff;
}
.pf-cta__deco {
    position: absolute;
    width: 460px;
    height: 460px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    top: -220px;
    right: -120px;
    pointer-events: none;
}
.pf-cta__title {
    position: relative;
    font-family: 'Playfair Display', serif;
    font-size: clamp(24px, 3.4vw, 40px);
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 14px;
}
.pf-cta__text {
    position: relative;
    font-size: 16px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    max-width: 560px;
    margin: 0 auto 30px;
}
.pf-cta__actions {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    flex-wrap: wrap;
}
.pf-cta__phone {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

/* ---------- LIGHTBOX ---------- */
.pf-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(8, 14, 24, 0.96);
    backdrop-filter: blur(8px);
    display: grid;
    grid-template-rows: auto 1fr auto;
    padding: 18px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.pf-lightbox.is-open {
    opacity: 1;
    pointer-events: auto;
}
body.pf-lb-open {
    overflow: hidden;
}

.pf-lightbox__head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: #fff;
    padding: 6px 60px;
}
.pf-lightbox__project {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    font-weight: 700;
}
.pf-lightbox__counter {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.55);
}

.pf-lightbox__close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 5;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
}
.pf-lightbox__close:hover { background: rgba(255, 255, 255, 0.22); }

.pf-lightbox__stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 8px;
}
.pf-lightbox__img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
    animation: pf-lb-in 0.35s ease;
}
@keyframes pf-lb-in {
    from { opacity: 0; transform: scale(0.97); }
    to   { opacity: 1; transform: none; }
}

.pf-lightbox__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    z-index: 5;
    transition: background 0.2s;
}
.pf-lightbox__arrow:hover { background: rgba(255, 255, 255, 0.24); }
.pf-lightbox__arrow--prev { left: 18px; }
.pf-lightbox__arrow--next { right: 18px; }

.pf-lightbox__thumbs {
    display: flex;
    gap: 8px;
    justify-content: center;
    padding: 12px 4px 4px;
    overflow-x: auto;
    scrollbar-width: thin;
}
.pf-lightbox__thumbs img {
    width: 74px;
    height: 54px;
    object-fit: cover;
    border-radius: 6px;
    opacity: 0.5;
    cursor: pointer;
    border: 2px solid transparent;
    transition: opacity 0.2s, border-color 0.2s;
    flex-shrink: 0;
}
.pf-lightbox__thumbs img:hover { opacity: 0.85; }
.pf-lightbox__thumbs img.active {
    opacity: 1;
    border-color: var(--clr-purple-400);
}

@media (max-width: 768px) {
    .pf-hero { padding: calc(var(--header-h) + 40px) 0 60px; }
    .pf-hero__stats { gap: 28px; }
    .pf-grid { grid-template-columns: 1fr; gap: 26px; }
    .pf-cta__inner { padding: 44px 26px; }
    .pf-lightbox__arrow--prev { left: 6px; }
    .pf-lightbox__arrow--next { right: 6px; }
    .pf-lightbox__head { padding: 4px 50px; }
}

@media (prefers-reduced-motion: reduce) {
    .pf-hero__bg-img { animation: none; }
    .pf-card { transition: none; opacity: 1; transform: none; }
}
