.project-hero {
    position: relative;
    width: 100%;
    height: 60vh;                     
    min-height: 350px;
    max-height: 600px;
    overflow: hidden;
    background: var(--bg-secondary);  
}

.project-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;                
    object-position: center center;   
}

.project-hero-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(8, 8, 8, 0.25) 0%,
        rgba(8, 8, 8, 0.05) 30%,
        rgba(8, 8, 8, 0.45) 65%,
        rgba(8, 8, 8, 0.85) 88%,
        #080808 100%
    );
    pointer-events: none;              
}

.project-hero-title {
    position: absolute;
    bottom: 2rem;
    left: 0;
    width: 100%;
    padding: 0 var(--gutter);
    z-index: 2;
}

.project-hero-title h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    max-width: var(--container-max);
    margin: 0 auto;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

@media (max-width: 768px) {
    .project-hero {
        height: 40vh;
        min-height: 250px;
    }
}

.project-content {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 3rem var(--gutter);
}

.project-date {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.project-description {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 70ch;                  
}

.project-description h2,
.project-description h3 {
    color: var(--text-primary);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.project-description p {
    margin-bottom: 1rem;
}

.project-description a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.project-description ul,
.project-description ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
    list-style: disc;
}

blockquote.quote-callout {
    border-left: 3px solid var(--text-primary);
    padding: 1.25rem 1.5rem;
    margin: 2rem 0;
    background: rgba(255, 255, 255, 0.03);
}

blockquote.quote-callout p {
    font-size: 1.25rem;
    font-style: italic;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

blockquote.quote-callout cite {
    display: block;
    text-align: right;
    font-size: 0.9rem;
    font-style: normal;
    font-weight: 500;
    color: var(--text-muted);
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 3rem;
}

.project-tags .tag-display {
    border-radius: 0 !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    background: rgba(255, 255, 255, 0.14);
    color: #c4c4c4;
    border: 1px solid rgba(255, 255, 255, 0.26);
    text-decoration: none;
    transition: all 0.2s ease;
}

.project-tags .tag-display:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.4);
}

.gallery-section {
    max-width: var(--container-wide);
    margin: 0 auto;
    padding: 0 var(--gutter) 4rem;
}

.gallery-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.gallery-toggle-container {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    user-select: none;
}

.gallery-toggle-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.25s ease;
}

.gallery-toggle-label.active {
    color: var(--text-primary);
    font-weight: 600;
}

.gallery-toggle-pill {
    position: relative;
    width: 48px;
    height: 26px;
    padding: 0;
    border-radius: 9999px;
    background: #38383a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
    outline: none;
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.gallery-toggle-pill:hover {
    border-color: rgba(255, 255, 255, 0.25);
}

.gallery-toggle-pill:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.gallery-toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #1c1c1e;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    transform: translateX(0);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
}

.gallery-toggle-pill.is-masonry .gallery-toggle-thumb {
    transform: translateX(22px);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.5rem;
    transition: opacity 0.2s ease;
}

.gallery-grid.gallery-masonry {
    display: block;
    column-count: 3;
    column-gap: 0.75rem;
}

@media (max-width: 900px) {
    .gallery-grid.gallery-masonry {
        column-count: 2;
        column-gap: 0.6rem;
    }
}

@media (max-width: 540px) {
    .gallery-grid.gallery-masonry {
        column-count: 1;
    }
}

.gallery-grid.gallery-masonry .gallery-item {
    display: inline-block;
    width: 100%;
    margin-bottom: 0.75rem;
    aspect-ratio: auto;
    height: auto;
    break-inside: avoid;
}

.gallery-grid.gallery-masonry .gallery-item img,
.gallery-grid.gallery-masonry .gallery-item video {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

.gallery-item {
    aspect-ratio: 1;                  
    overflow: hidden;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    background: var(--bg-secondary);
}

.gallery-item img,
.gallery-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s var(--ease-smooth);
}

.gallery-item:hover img,
.gallery-item:hover video {
    transform: scale(1.05);
}

.gallery-item--video::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 24px;
    pointer-events: none;
    transition: transform 0.2s ease;
}

.gallery-item--video:hover::after {
    transform: translate(-50%, -50%) scale(1.1);
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 4px;
    }
}

.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-bg);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

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

.lightbox-content img,
.lightbox-content video {
    max-width: 90vw;
    max-height: 78vh;
    object-fit: contain;
    border-radius: 4px;
    display: block;
}

.lightbox-media-link {
    display: inline-block;
    cursor: pointer;
    line-height: 0;
}

.lightbox-meta {
    margin-top: 0.85rem;
    text-align: center;
    color: #f5f5f7;
    max-width: 90vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.lightbox-caption {
    font-size: 0.95rem;
    line-height: 1.4;
    color: #f5f5f7;
    background: rgba(0, 0, 0, 0.6);
    padding: 0.45rem 1.25rem;
    border-radius: 6px;
    max-width: 720px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.lightbox-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: #2997ff;
    text-decoration: underline;
    background: rgba(0, 0, 0, 0.4);
    padding: 0.3rem 0.75rem;
    border-radius: 4px;
    transition: opacity 0.2s ease, background 0.2s ease;
}

.lightbox-link:hover {
    opacity: 0.9;
    background: rgba(0, 113, 227, 0.3);
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    font-size: 2rem;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
}

.lightbox-prev,
.lightbox-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.5rem;
    color: white;
    background: rgba(0, 0, 0, 0.4);
    border: none;
    cursor: pointer;
    padding: 1rem;
    border-radius: 4px;
    transition: background 0.2s ease;
    z-index: 2001;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(0, 0, 0, 0.7);
}

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

.attachments-section {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--gutter) 4rem;
}

.attachments-section h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.attachment-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.attachment-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: border-color 0.2s ease;
}

.attachment-card:hover {
    border-color: var(--text-muted);
}

.attachment-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 6px;
    color: var(--text-muted);
}

.attachment-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.attachment-info {
    flex: 1;
    min-width: 0;                     
}

.attachment-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachment-size {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.attachment-download {
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.attachment-download:hover {
    background: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
    opacity: 1;
}

.site-header .nav-link {
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.site-header .header-logo img,
.site-header .header-logo svg,
.site-header .header-logo-img {
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
}

.site-header .burger-line {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

