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

:root {
    --color-bg: #f5f0e8;
    --color-bg-dark: #e8e0d0;
    --color-text: #3a3530;
    --color-text-light: #7a7570;
    --color-accent: #c4a574;
    --color-accent-dark: #a08060;
    --color-border: #d5cec0;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
    overflow-x: hidden;
}

header {
    padding: 3rem 2rem;
    text-align: center;
    background: linear-gradient(180deg, #ffffff 0%, var(--color-bg) 100%);
    border-bottom: 1px solid var(--color-border);
}

header h1 {
    font-size: 2.2rem;
    font-weight: 300;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
    color: var(--color-accent-dark);
}

header p {
    font-size: 0.95rem;
    color: var(--color-text-light);
    font-weight: 300;
}

.gallery-container {
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 1rem;
}

.hex-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 2rem 0;
    --hex-width: 220px;
    --hex-height: calc(var(--hex-width) * 1.1547);
    --hex-margin: 4px;
    --hex-row-shift: calc(var(--hex-width) / 2 + var(--hex-margin));
}

.hex-row {
    display: flex;
    justify-content: center;
    margin-top: calc(var(--hex-margin) - var(--hex-height) / 4);
}

.hex-row:first-child {
    margin-top: 0;
}

.hex-row:nth-child(even) {
    margin-left: var(--hex-row-shift);
}

.hex-item {
    width: var(--hex-width);
    height: var(--hex-height);
    margin: var(--hex-margin);
    position: relative;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    overflow: hidden;
}

.hex-item:hover {
    transform: scale(1.08);
    z-index: 10;
}

.hex-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, filter 0.3s ease;
}

.hex-item:hover img {
    transform: scale(1.15);
    filter: brightness(1.1);
}

.hex-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(196, 165, 116, 0.85) 0%, rgba(160, 128, 96, 0.9) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    padding: 1.5rem;
    gap: 0.5rem;
}

.hex-item:hover .hex-overlay {
    opacity: 1;
}

.hex-number {
    font-size: 2rem;
    font-weight: 200;
    opacity: 0.9;
}

.hex-title {
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.hex-view-btn {
    margin-top: 0.5rem;
    padding: 0.4rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    color: white;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hex-view-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Лайтбокс */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(58, 53, 48, 0.97);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.lightbox-info {
    margin-top: 1.5rem;
    text-align: center;
    color: var(--color-bg);
}

.lightbox-counter {
    font-size: 0.85rem;
    color: var(--color-accent);
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
}

.lightbox-title {
    font-size: 1.3rem;
    font-weight: 300;
    margin-bottom: 0.3rem;
}

.lightbox-filename {
    font-size: 0.8rem;
    color: var(--color-text-light);
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    color: var(--color-bg);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(245, 240, 232, 0.1);
    border: 1px solid var(--color-border);
    border-radius: 50%;
    color: var(--color-bg);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-nav:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
}

.lightbox-prev {
    left: -80px;
}

.lightbox-next {
    right: -80px;
}

.lightbox-thumbnails {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
    overflow-x: auto;
    padding: 0.5rem;
    max-width: 90vw;
}

.lightbox-thumb {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    flex-shrink: 0;
}

.lightbox-thumb.active {
    opacity: 1;
    border-color: var(--color-accent);
}

.lightbox-thumb:hover {
    opacity: 0.8;
}

.lightbox-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

footer {
    background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-bg-dark) 100%);
    border-top: 1px solid var(--color-border);
    padding: 2.5rem 2rem;
    text-align: center;
    color: var(--color-text-light);
    font-size: 0.9rem;
}

footer p {
    margin: 0.4rem 0;
}

/* Адаптивный дизайн */
@media (max-width: 1024px) {
    .hex-grid {
        --hex-width: 180px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .lightbox-prev {
        left: -60px;
    }

    .lightbox-next {
        right: -60px;
    }
}

@media (max-width: 768px) {
    header {
        padding: 2rem 1rem;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .hex-grid {
        --hex-width: 140px;
        --hex-margin: 3px;
    }

    .hex-number {
        font-size: 1.5rem;
    }

    .hex-title {
        font-size: 0.8rem;
    }

    .hex-view-btn {
        display: none;
    }

    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-title {
        font-size: 1.1rem;
    }

    .lightbox-thumbnails {
        display: none;
    }
}

@media (max-width: 480px) {
    header {
        padding: 1.5rem 1rem;
    }

    header h1 {
        font-size: 1.2rem;
        letter-spacing: 1px;
    }

    header p {
        font-size: 0.85rem;
    }

    .gallery-container {
        margin: 1.5rem auto;
    }

    .hex-grid {
        --hex-width: 110px;
        --hex-margin: 2px;
    }

    .hex-row:nth-child(even) {
        margin-left: calc(var(--hex-width) / 2 + var(--hex-margin));
    }

    .hex-overlay {
        padding: 1rem;
    }

    .hex-number {
        font-size: 1.2rem;
    }

    .hex-title {
        font-size: 0.7rem;
    }

    .lightbox-close {
        top: -40px;
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }

    .lightbox-counter {
        font-size: 0.75rem;
    }

    .lightbox-title {
        font-size: 1rem;
    }

    .lightbox-filename {
        font-size: 0.7rem;
    }

    footer {
        padding: 1.5rem 1rem;
    }

    footer p {
        font-size: 0.8rem;
    }
}