:root {
    --bg-color: #2C2141;
    --bg-darker: #1e1929;
    --primary: #DB2807;
    --text-main: #f0f0f5;
    --text-muted: #b8b0c5;
    --glass-border: rgba(255, 255, 255, 0.08);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    padding-top: 90px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Header */
.portfolio-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(44, 33, 65, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    padding: 18px 0;
}
.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.back-link {
    font-weight: 600;
    font-size: 1.05rem;
    padding: 10px 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    transition: background 0.3s, border-color 0.3s;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}
.back-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}
.logo-img {
    height: 42px;
    width: auto;
    display: block;
}

/* Main */
.portfolio-main {
    padding: 40px 0 80px;
}
.page-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 2.75rem;
    margin-bottom: 40px;
    color: var(--text-main);
}
.page-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary);
    margin-top: 12px;
    border-radius: 2px;
}
.empty-message {
    color: var(--text-muted);
    font-size: 1.1rem;
}
.empty-message code {
    background: rgba(0,0,0,0.3);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.95rem;
}

/* Grid */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 32px;
}
.portfolio-item {
    cursor: pointer;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s, box-shadow 0.3s;
}
.portfolio-item:hover {
    transform: translateY(-6px);
    border-color: rgba(219, 40, 7, 0.3);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
}
.portfolio-thumb-wrap {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--bg-darker);
}
.portfolio-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.portfolio-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s;
}
.portfolio-arrow:hover {
    background: rgba(0, 0, 0, 0.75);
}
.portfolio-arrow-prev { left: 8px; }
.portfolio-arrow-next { right: 8px; }
.portfolio-item-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.25rem;
    padding: 20px 20px 8px;
}
.portfolio-item-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    padding: 0 20px 20px;
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.lightbox.is-open {
    opacity: 1;
    visibility: visible;
}
.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 2002;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s, color 0.2s;
}
.lightbox-close:hover {
    background: var(--primary);
    color: #fff;
}
.lightbox-content {
    position: relative;
    z-index: 2001;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2003;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s, color 0.2s;
    border-radius: 50%;
}
.lightbox-arrow:hover {
    background: var(--primary);
    color: #fff;
}
.lightbox-arrow-prev { left: -60px; }
.lightbox-arrow-next { right: -60px; }
.lightbox-arrow.hidden { display: none; }
.lightbox-img {
    max-width: 100%;
    max-height: 75vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.lightbox-caption {
    margin-top: 20px;
    text-align: center;
    max-width: 500px;
}
.lightbox-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.35rem;
    margin-bottom: 8px;
    color: var(--text-main);
}
.lightbox-desc {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    body { padding-top: 80px; }
    .page-title { font-size: 2.2rem; margin-bottom: 28px; }
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .lightbox-close {
        top: 12px;
        right: 12px;
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        font-size: 1.75rem;
    }
    .lightbox-content {
        max-height: 90vh;
    }
    .lightbox-img {
        max-height: 70vh;
    }
    .lightbox-arrow-prev { left: 8px; }
    .lightbox-arrow-next { right: 8px; }
}

@media (max-width: 480px) {
    .header-content {
        flex-wrap: wrap;
        justify-content: center;
    }
    .back-link { order: 2; width: 100%; justify-content: center; }
    .logo-wrap { order: 1; }
}
