.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Manrope', system-ui, sans-serif;
    background: #121212;
    color: #e0e0e0;
}

header {
    background: #1f1f1f;
    color: #e0e0e0;
    padding: 40px 20px;
}

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

.name-section {
    text-align: left;
}

.socials {
    display: flex;
    gap: 20px;
}

.socials a img {
    width: 28px;
    height: 28px;
    filter: brightness(0) invert(1);
    transition: transform 0.2s, filter 0.3s;
}

.socials a:hover img {
    transform: scale(1.1);
    filter: brightness(1.2);
}

.section-title {
    font-family: 'Heading Now', sans-serif;
    font-size: 2rem;
    margin: 30px 0 20px 0;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    padding: 0 20px 60px;
    max-width: 1200px;
    margin: auto;
}

.tile {
    position: relative;
    text-align: left;
}

.project {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    border-radius: 10px;
    background: #2a2a2a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.gallery {
    position: relative;
    width: 100%;
    height: 100%;
}

.gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.gallery video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.gallery video.active {
    display: block;
}

.gallery img.active {
    display: block;
}

/* Only arrows centered vertically */
.gallery button.prev,
.gallery button.next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: none;
    padding: 10px;
    cursor: pointer;
    font-size: 1.5rem;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.3s;
}

/* Arrows appear on hover */
.gallery:hover button.prev,
.gallery:hover button.next {
    opacity: 1;
}

.prev {
    left: 10px;
}

.next {
    right: 10px;
}

/* Expand button (top right) */
.gallery .expand {
    position: absolute;
    top: 10px;
    right: 10px;
    transform: none;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
    transition: background 0.3s;
}

.gallery .expand:hover {
    background: rgba(255, 255, 255, 0.4);
}

.tile h3 {
    margin-top: 10px;
    font-size: 1.2rem;
    color: #ffffff;
}

/* Description floating, no displacement */
.description {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #1f1f1f;
    border: 1px solid #333;
    padding: 10px;
    font-size: 0.95rem;
    color: #cccccc;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    transform: translateY(10px);
    z-index: 5;
}

.tile:hover .description {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* Fullscreen Gallery */
.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 999;
}

.fullscreen img,
.fullscreen video {
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain;
    object-position: center;
    display: block;
}

.fullscreen .close,
.fullscreen .prev-fullscreen,
.fullscreen .next-fullscreen {
    position: absolute;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
}

.fullscreen .close {
    top: 20px;
    right: 20px;
}

.fullscreen .prev-fullscreen {
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
}

.fullscreen .next-fullscreen {
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
}

.hidden {
    display: none;
}

footer {
    text-align: center;
    padding: 30px;
    background: #1a1a1a;
    font-size: 0.9rem;
    color: #777;
}

.project-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.tags {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tags span {
    background: #2f2f2f;
    color: #ccc;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 16px;
    font-family: 'Manrope', sans-serif;
    white-space: nowrap;
    transition: background 0.3s;
}

.tags span:hover {
    background: #444;
}

.socials {
    align-items: center;
}

.projects-link {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 12px;
    border: 1px solid #4a4a4a;
    border-radius: 8px;
    transition: background 0.2s, border-color 0.2s;
}

.projects-link:hover {
    background: #2f2f2f;
    border-color: #777;
}

@media (max-width: 720px) {
    .header-content {
        align-items: flex-start;
        gap: 24px;
        flex-direction: column;
    }

    .socials {
        flex-wrap: wrap;
    }
}
