/* =====================================================
   PHOTOGRAPHER PORTFOLIO — Dark Edition
   ===================================================== */

:root {
    --bg:            #0c0c0c;
    --surface:       #141414;
    --surface-2:     #1d1d1d;
    --text:          #e4e0d8;
    --muted:         #6e6e6e;
    --muted-2:       #9e9e9e;
    --gold:          #c8a56a;
    --gold-light:    #e0c898;
    --gold-dim:      rgba(200, 165, 106, 0.12);
    --white:         #ffffff;
    --border:        rgba(255, 255, 255, 0.07);
    --border-gold:   rgba(200, 165, 106, 0.28);

    --shadow-card:   0 4px 32px rgba(0, 0, 0, 0.55);
    --shadow-lg:     0 16px 56px rgba(0, 0, 0, 0.7);

    --radius-xl:     18px;
    --radius-lg:     12px;
    --radius-md:     8px;
    --radius-sm:     4px;

    --header-h:      68px;

    --ease-expo:     cubic-bezier(0.16, 1, 0.3, 1);
    --ease-smooth:   cubic-bezier(0.65, 0, 0.35, 1);
}

/* ─── Reset ─────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-padding-top: calc(var(--header-h) + 1rem);
    font-size: 16px;
}

body {
    font-family: 'Manrope', sans-serif;
    line-height: 1.7;
    color: var(--text);
    background-color: var(--bg);
    min-height: 100vh;
    overflow-x: hidden;
}

img {
    display: block;
    max-width: 100%;
}

h1, h2, h3, h4 {
    font-family: 'Playfair Display', serif;
    letter-spacing: 0.01em;
    line-height: 1.2;
}

.container {
    width: min(1240px, 94vw);
    margin: 0 auto;
}

/* ─── Page transition overlay ────────────────────────── */
.page-transition {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 99999;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.55s var(--ease-smooth);
}

.page-transition.is-loaded {
    opacity: 0;
}

.page-transition.is-leaving {
    opacity: 1;
    pointer-events: all;
}

/* ─── Header ─────────────────────────────────────────── */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-h);
    display: flex;
    align-items: center;
    background: rgba(12, 12, 12, 0.88);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border-bottom: 1px solid var(--border);
    transition: background 0.4s ease, border-color 0.4s ease;
}

.header.is-scrolled {
    background: rgba(10, 10, 10, 0.97);
    border-bottom-color: rgba(200, 165, 106, 0.12);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo */
.logo a {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: var(--text);
}

.logo-aperture {
    color: var(--gold);
    flex-shrink: 0;
    transition: transform 0.65s var(--ease-expo), color 0.3s ease;
}

.logo a:hover .logo-aperture {
    transform: rotate(45deg);
    color: var(--gold-light);
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--white);
    line-height: 1;
}

.logo-tagline {
    font-size: 0.66rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold);
    line-height: 1;
    margin-top: 0.28rem;
}

/* Nav */
.nav ul {
    display: flex;
    list-style: none;
    gap: 0.15rem;
}

.nav a {
    position: relative;
    color: var(--muted-2);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius-sm);
    transition: color 0.25s ease;
}

.nav a::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0.25rem;
    width: 0;
    height: 1px;
    background: var(--gold);
    transform: translateX(-50%);
    transition: width 0.35s var(--ease-expo);
}

.nav a:hover {
    color: var(--white);
}

.nav a:hover::after {
    width: calc(100% - 1.8rem);
}

/* ─── Main ───────────────────────────────────────────── */
.main {
    padding: 0 0 5rem;
    min-height: calc(100vh - var(--header-h) - 100px);
}

/* ─── Scroll Reveal ──────────────────────────────────── */
[data-reveal] {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.9s var(--ease-expo), transform 0.9s var(--ease-expo);
}

[data-reveal="scale"] {
    transform: scale(0.97) translateY(10px);
}

[data-reveal="left"] {
    transform: translateX(-22px);
}

[data-reveal].is-visible {
    opacity: 1;
    transform: none;
}

[data-delay="1"] { transition-delay: 0.07s; }
[data-delay="2"] { transition-delay: 0.14s; }
[data-delay="3"] { transition-delay: 0.21s; }
[data-delay="4"] { transition-delay: 0.28s; }
[data-delay="5"] { transition-delay: 0.35s; }
[data-delay="6"] { transition-delay: 0.42s; }

/* ─── About / Hero Section ───────────────────────────── */
.about-section {
    padding: clamp(4rem, 8vw, 7rem) 0 clamp(3rem, 5vw, 5rem);
    border-bottom: 1px solid var(--border);
}

.about-eyebrow {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 1.2rem;
}

.about-eyebrow::before {
    content: '';
    display: block;
    width: 26px;
    height: 1px;
    background: var(--gold);
    flex-shrink: 0;
}

.about-section h2 {
    font-size: clamp(2.6rem, 3.5vw + 1rem, 5.5rem);
    font-weight: 600;
    color: var(--white);
    margin-bottom: 1.5rem;
    line-height: 1.08;
}

.about-section h2 em {
    font-style: italic;
    color: var(--gold);
}

.lead {
    font-size: clamp(1rem, 0.9rem + 0.35vw, 1.18rem);
    color: var(--muted-2);
    margin-bottom: 1.3rem;
    max-width: 560px;
}

.about-text {
    color: var(--muted);
    display: grid;
    gap: 0.75rem;
    max-width: 560px;
    font-size: 0.95rem;
}

/* Stats */
.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border);
    width: min(100%, 900px);
    margin: 3rem auto 0;
}

.stat-item {
    text-align: left;
    margin: 0 auto;
}


.stat-number {
    display: block;
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 3vw, 3.4rem);
    font-weight: 600;
    color: var(--gold);
    line-height: 1;
    margin-bottom: 0.45rem;
}

.stat-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ─── Section Headings ───────────────────────────────── */
.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    padding-top: clamp(3.5rem, 6vw, 5.5rem);
    margin-bottom: 2.5rem;
}

.section-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 0.65rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.section-label::before {
    content: '';
    display: block;
    width: 20px;
    height: 1px;
    background: var(--gold);
    flex-shrink: 0;
}

.section-header h2 {
    font-size: clamp(1.7rem, 2vw + 0.7rem, 2.9rem);
    color: var(--white);
    font-weight: 600;
}

.section-subtitle {
    color: var(--muted);
    font-size: 0.88rem;
    text-align: right;
    max-width: 240px;
    line-height: 1.65;
}

/* ─── Category Cards ─────────────────────────────────── */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.category-card {
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    background: var(--surface);
}

.category-card a {
    display: block;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}

.category-cover {
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    display: block;
    transform: scale(1.03);
    transition: transform 0.7s var(--ease-expo), filter 0.4s ease;
    filter: brightness(0.8);
}

.category-card:hover .category-cover {
    transform: scale(1.08);
    filter: brightness(0.55);
}

.category-placeholder {
    width: 100%;
    aspect-ratio: 3 / 2;
    background: var(--surface);
    display: grid;
    place-items: center;
    font-size: 3rem;
    color: var(--muted);
}

/* Overlay info — всегда снизу */
.category-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem 1.25rem 1.25rem;
    background: linear-gradient(to top, rgba(0,0,0,0.82) 0%, transparent 100%);
    transition: padding 0.35s var(--ease-expo);
}

.category-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 0;
    transition: margin-bottom 0.35s var(--ease-expo);
}

.category-card:hover .category-info h3 {
    margin-bottom: 0.4rem;
}

.category-info p {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.5;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s var(--ease-expo), opacity 0.35s ease;
}

.category-card:hover .category-info p {
    max-height: 80px;
    opacity: 1;
}




.category-card a.disabled {
    pointer-events: none;
    opacity: 0.45;
}

.empty-message {
    text-align: center;
    color: var(--muted);
    padding: 3rem;
    background: var(--surface);
    border-radius: var(--radius-lg);
    font-size: 0.93rem;
    border: 1px solid var(--border);
    letter-spacing: 0.03em;
}

/* ─── Featured Section ───────────────────────────────── */
/* Contacts section */
.contacts-section {
    padding-top: clamp(2.8rem, 4.5vw, 4.2rem);
}

.contacts-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: clamp(1.2rem, 2.3vw, 2rem);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0));
}

.contacts-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.contact-link {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-decoration: none;
    background: var(--surface);
    transition: border-color 0.25s ease, transform 0.25s ease;
}

.contact-link:hover {
    border-color: rgba(200, 165, 106, 0.45);
    transform: translateY(-2px);
}

.contact-link-label {
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
}

.contact-link-value {
    color: var(--white);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
    word-break: break-word;
}

.contacts-write {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.contacts-write-title {
    color: var(--white);
    font-size: 1.02rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5px;
    background: var(--border);
    border: 1px solid var(--border);
    overflow: hidden;
    border-radius: var(--radius-lg);
}

.featured-item {
    background: var(--bg);
    overflow: hidden;
    position: relative;
}

.featured-item > img {
    width: 100%;
    height: clamp(220px, 38vh, 480px);
    object-fit: cover;
    object-position: top center;
    display: block;
    transform: scale(1.03);
    transition: transform 0.7s var(--ease-expo), filter 0.5s ease;
    filter: brightness(0.78);
}

.featured-item:hover > img {
    transform: scale(1.09);
    filter: brightness(1);
}

.photo-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem 1.2rem 1.1rem;
    background: linear-gradient(to top, rgba(0,0,0,0.84) 0%, transparent 100%);
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 0.35s ease, transform 0.35s var(--ease-expo);
}

.featured-item:hover .photo-caption {
    opacity: 1;
    transform: translateY(0);
}

.photo-caption h4 {
    font-size: 0.92rem;
    color: var(--white);
    margin-bottom: 0.2rem;
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
}

.photo-caption p {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.6);
}

/* ─── Category Detail ────────────────────────────────── */
.category-detail-section {
    padding-top: clamp(2.5rem, 5vw, 4.5rem);
}

.category-back {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 2.5rem;
    transition: color 0.25s ease;
}

.category-back::before {
    content: '←';
    transition: transform 0.28s ease;
}

.category-back:hover {
    color: var(--gold);
}

.category-back:hover::before {
    transform: translateX(-5px);
}

.category-detail-section h1 {
    font-size: clamp(2.2rem, 3.5vw + 0.5rem, 4.5rem);
    color: var(--white);
    margin-bottom: 0.8rem;
}

.category-description {
    color: var(--muted-2);
    margin-bottom: 3rem;
    max-width: 600px;
    font-size: 0.97rem;
}

/* Photo gallery — grid left-to-right, tight packing */
.photo-gallery-grid {
    column-count: 3;
    column-gap: 6px;
}

.photo-card {
    width: 100%;
    margin: 0 0 6px;
    background: var(--bg);
    overflow: hidden;
    position: relative;
    cursor: zoom-in;
    border: none;
    padding: 0;
    text-align: left;
    display: block;
    border-radius: 8px;
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
}

.photo-card img {
    width: 100%;
    height: auto;
    display: block;
    transition: filter 0.5s ease;
    filter: brightness(0.9);
}

.photo-card:hover img {
    filter: brightness(1);
}

.photo-card .photo-caption {
    opacity: 0;
    transform: translateY(5px);
}

.photo-card:hover .photo-caption {
    opacity: 1;
    transform: translateY(0);
}

.no-photos {
    color: var(--muted);
    font-size: 0.95rem;
    padding: 3rem;
    text-align: center;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

/* ─── Lightbox ───────────────────────────────────────── */
.lock-scroll {
    overflow: hidden !important;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(5, 5, 5, 0.97);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.lightbox.is-open {
    display: flex;
}

.lightbox.is-animating {
    opacity: 1;
}

.lightbox-figure {
    position: relative;
    /* Начальный размер до загрузки фото — JS переопределит */
    width: 90vw;
    height: 88vh;
    max-width: 90vw;
    max-height: 88vh;
    margin: 0;
    transform: scale(0.93) translateY(12px);
    transition: transform 0.45s var(--ease-expo);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.lightbox.is-animating .lightbox-figure {
    transform: none;
}

.lightbox-figure img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.18s ease;
}

.lightbox-figure img.is-switching {
    opacity: 0;
}

.lightbox-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2.5rem 1.5rem 1.2rem;
    background: linear-gradient(to top, rgba(0,0,0,0.88) 0%, transparent 100%);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.lightbox-caption h3 {
    font-size: 0.98rem;
    color: var(--white);
    margin-bottom: 0.2rem;
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
}

.lightbox-caption p {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.7);
}

.lightbox-close {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    color: var(--white);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    z-index: 100000;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.25s ease;
}

.lightbox-close:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.32);
    transform: rotate(90deg);
}

.lightbox-original {
    position: fixed;
    top: 1.25rem;
    right: 4.5rem;
    z-index: 1002;
    color: rgba(255,255,255,0.7);
    font-size: 0.75rem;
    text-decoration: none;
    background: rgba(0,0,0,0.45);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 6px;
    padding: 0.4rem 0.75rem;
    letter-spacing: 0.04em;
    transition: background 0.2s, color 0.2s;
}
.lightbox-original:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

.lightbox-nav {
    position: fixed;
    top: 50%;
    width: 48px;
    height: 48px;
    margin-top: -24px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    color: var(--white);
    font-size: 1.3rem;
    cursor: pointer;
    z-index: 100000;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.lightbox-nav:hover {
    background: var(--gold-dim);
    border-color: var(--border-gold);
    transform: scale(1.1);
}

.lightbox-nav-prev { left: 1.25rem; }
.lightbox-nav-next { right: 1.25rem; }

.lightbox-counter {
    position: fixed;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    color: var(--muted);
    text-transform: uppercase;
    pointer-events: none;
}

/* ─── Footer ─────────────────────────────────────────── */
.footer {
    border-top: 1px solid var(--border);
    background: var(--bg);
    padding: 2.2rem 0;
    margin-top: 3rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.footer-name {
    font-family: 'Playfair Display', serif;
    font-size: 0.98rem;
    color: var(--muted-2);
    margin-bottom: 0.3rem;
}

.footer-copy {
    font-size: 0.77rem;
    color: var(--muted);
    letter-spacing: 0.04em;
}

.social-links {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.social-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    padding: 0.42rem 0.85rem;
    border-radius: 999px;
    text-decoration: none;
    border: 1px solid var(--border);
    color: var(--muted-2);
    background: var(--surface);
    transition: color 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.social-btn:hover {
    color: var(--gold);
    border-color: var(--border-gold);
    background: var(--gold-dim);
}

.social-icon {
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-weight: 800;
    font-size: 0.62rem;
    background: rgba(255,255,255,0.07);
}

.social-text {
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 860px) {
    .header {
        height: auto;
    }

    .header-content {
        flex-direction: column;
        justify-content: center;
        gap: 0.65rem;
        padding: 0.85rem 0;
    }

    .nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.1rem;
    }

    .stats {
        gap: 1.5rem;
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }

    .section-subtitle {
        text-align: left;
        max-width: 100%;
    }

    .contacts-grid {
        grid-template-columns: 1fr;
    }

    .photo-gallery-grid {
        column-count: 2;
    }

    .contacts-write {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 1.2rem;
    }

    .social-links {
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .categories-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .featured-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .photo-gallery-grid {
        column-count: 2;
    }

    .contact-link-value {
        font-size: 0.92rem;
    }

    .lightbox-nav-prev { left: 0.5rem; }
    .lightbox-nav-next { right: 0.5rem; }
}

@media (max-width: 400px) {
    .featured-grid {
        grid-template-columns: 1fr;
    }

    .photo-gallery-grid {
        column-count: 1;
    }
}

/* ─── Reduced motion ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }

    [data-reveal] {
        opacity: 1;
        transform: none;
    }
}
