/* --- GLOBAL VARIABLES & RESET --- */
:root {
    --accent: #E0E0E0;
    --dark: #0a0a0a;
    --text: #ffffff;
    --surface: #151515;
    --carousel-bg: #1a1a1a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--dark);
    color: var(--text);
    overflow-x: hidden;

    &.lightbox-open {
        overflow: hidden;
    }
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

/* --- NAVIGATION --- */
.menu-btn {
    position: fixed;
    top: 30px;
    right: 40px;
    z-index: 2000;
    cursor: pointer;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: 0.3s;
}

.menu-btn:hover {
    background: var(--accent);
}

.menu-btn svg {
    fill: var(--text);
    width: 24px;
}

.menu-btn:hover svg {
    fill: var(--dark);
}

.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 350px;
    height: 100vh;
    /* UPDATED: Solid black from 20% to 100%, fast fade from 0% to 20% */
    background: linear-gradient(to right, transparent 0%, #000000 20%, #000000 100%);
    border: none;
    z-index: 1999;
    transform: translateX(100%);
    transition: transform 0.2s cubic-bezier(0.77, 0, 0.175, 1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px;
    padding-top: 80px;
}

.sidebar.active {
    transform: translateX(0);
}

.sidebar-links a {
    display: block;
    font-family: 'Anton', sans-serif;
    font-size: 2.5rem;
    text-transform: uppercase;
    color: #444;
    margin-bottom: 20px;
    transition: 0.3s;
    text-align: right;
}

.sidebar-links a:hover,
.sidebar-links a.active {
    color: var(--accent);
    transform: translateX(-20px);
}

/* --- HERO --- */
.hero {
    position: relative;
    height: 100vh;
    height: 100svh;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow: hidden;
}

.video-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
    background: linear-gradient(45deg, #222, #444);
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: -1;
}

.hero h1 {
    font-family: 'Anton', sans-serif;
    font-size: clamp(4rem, 10vw, 8rem);
    text-transform: uppercase;
    line-height: 1;
    letter-spacing: 2px;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.hero h2 {
    font-size: clamp(1.2rem, 3vw, 2rem);
    font-weight: 300;
    margin-top: 10px;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: var(--accent);
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    animation: bounce 2s infinite;
}

.scroll-text {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
}

.arrow {
    font-size: 1.5rem;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

/* --- SOCIAL LINKS --- */
.social-links {
    margin-top: 25px;
    display: flex;
    justify-content: center;
    gap: 30px;
    z-index: 10;
}

.social-icon {
    width: 64px;
    height: 64px;
    fill: var(--text);
    object-fit: contain;
    transition: all 0.3s ease;
    cursor: pointer;
}

.social-links a,
.social-links button {
    background: none;
    border: none;
    padding: 0;
}

.social-links a:hover .social-icon,
.social-links button:hover .social-icon {
    fill: var(--accent);
    transform: translateY(-5px);
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.4));
    filter: brightness(0.88) drop-shadow(0 0 10px rgba(255, 255, 255, 0.4));
}

/* --- SECTIONS --- */
section {
    padding: 100px 5vw;
}

.section-header {
    font-family: 'Anton', sans-serif;
    font-size: 3rem;
    margin-bottom: 60px;
    border-left: 5px solid var(--accent);
    padding-left: 20px;
    text-transform: uppercase;
}

/* --- PROJECTS --- */
.projects-container {
    background: var(--dark);
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
}

.card {
    background: var(--surface);
    height: 500px;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    display: block;
    transform: translateZ(0);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(255, 255, 255, 0.1);
}

.card-img {
    width: 100%;
    height: 120%;
    object-fit: cover;
    background-size: cover;
    background-position: center;
    position: absolute;
    top: -10%;
    left: 0;
    will-change: transform;
    transition: transform 0.3s ease-out;
}

.card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px;
    z-index: 2;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
}

.card h3 {
    font-size: 2rem;
    font-family: 'Anton', sans-serif;
    margin-bottom: 10px;
    color: var(--text);
}

.tags {
    font-family: monospace;
    color: #ccc;
    font-size: 0.9rem;
}

/* --- VIEW ALL BUTTON --- */
.view-all-container {
    text-align: center;
    margin-top: 60px;
}

.view-all-btn {
    display: inline-block;
    padding: 15px 40px;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    transition: color 0.3s;
    z-index: 1;
}

.view-all-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: var(--accent);
    z-index: -1;
    transition: width 0.3s ease;
}

.view-all-btn:hover {
    color: var(--dark) !important;
}

.view-all-btn:hover::before {
    width: 100%;
}

/* --- ABOUT SECTION --- */
.about-container {
    background: #0f0f0f;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #ccc;
    margin-bottom: 20px;
}

.about-img-wrapper {
    width: 100%;
    height: 400px;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    background: #222;
}

.about-img {
    width: 100%;
    height: 140%;
    object-fit: cover;
    position: absolute;
    top: -20%;
    left: 0;
    will-change: transform;
    transition: transform 0.3s ease-out;
}

@media (max-width: 768px) {
    .about-container {
        grid-template-columns: 1fr;
    }
}

/* --- TECH STACK (PURE CSS MARQUEE - CONSTANT HIGHLIGHT) --- */
.tech-container {
    padding: 60px 0;
    background: var(--dark);
    border-top: 1px solid #222;
    border-bottom: 1px solid #222;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    display: flex;
}

.tech-track {
    display: flex;
    width: max-content;
}

.tech-group {
    display: flex;
    flex-shrink: 0;
    animation: scroll-text 30s linear infinite;
}

.tech-item {
    font-family: 'Anton', sans-serif;
    font-size: 2.5rem;
    color: var(--accent);
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
    margin: 0;
    padding: 0;
    cursor: default;
}

.dot {
    color: var(--accent);
    font-size: 1rem;
    opacity: 0.3;
    margin: 0 60px;
    display: flex;
    align-items: center;
}

@keyframes scroll-text {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-100%);
    }
}

/* --- FOOTER --- */
footer {
    padding: 100px 20px;
    text-align: center;
    background: #050505;
}

.footer-note {
    color: #555;
    margin-top: 30px;
    font-family: monospace;
    font-size: 1rem;
    user-select: text;
    -webkit-user-select: text;
}

.footer-note.success {
    color: var(--accent);
}

/* =========================================
   PROJECT PAGE SPECIFIC STYLES
   ========================================= */

.project-nav {
    padding: 20px 5vw;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--dark);
}

.back-btn {
    position: relative;
    font-size: 1rem;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 20px;
    border-radius: 50px;
    overflow: hidden;
    transition: color 0.4s ease;
    z-index: 1;
}

.back-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: var(--accent);
    z-index: -1;
    transition: width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.back-btn:hover {
    color: var(--dark);
    border-color: var(--accent);
}

.back-btn:hover::before {
    width: 100%;
}

.project-carousel {
    width: 100%;
    height: 480px;
    background-color: var(--carousel-bg);
    padding: 0;
    padding-bottom: 60px;
    overflow: hidden;
    position: relative;
    display: flex;
    cursor: grab;
}

.project-carousel:active {
    cursor: grabbing;
}

.project-carousel.single-item {
    cursor: default;
    padding-bottom: 0;
    justify-content: center;
    align-items: center;
}

.project-carousel.single-item:active {
    cursor: default;
}

.project-carousel.single-item .swiper-wrapper {
    justify-content: center;
    align-items: center;
    width: 100%;
}

.project-carousel.single-item .swiper-slide[data-video="true"] {
    cursor: default;
}

.swiper-wrapper {
    align-items: center;
}

/* --- CAROUSEL SLIDES (VISUALS) --- */

/* 1. The Container (Mechanics) */
.swiper-slide {
    background-position: center;
    background-size: cover;
    width: 560px !important;
    height: 315px !important;
    border-radius: 8px;
    overflow: visible;
    background-color: transparent;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    z-index: 5;
}

/* 2. Default Content State (Inactive) */
.swiper-slide img,
.swiper-slide iframe,
.swiper-slide video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    transition: all 0.4s ease;
    opacity: 0.4;
    filter: blur(3px);
    box-shadow: none;
}

/* 3. Active State (Highlighted) */
.swiper-slide-active,
.swiper-slide-duplicate-active {
    z-index: 10 !important;
}

.swiper-slide-active img,
.swiper-slide-duplicate-active img,
.swiper-slide-active iframe,
.swiper-slide-duplicate-active iframe {
    opacity: 1 !important;
    filter: blur(0) !important;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.6);
}

/* Swiper Buttons */
.swiper-button-next,
.swiper-button-prev {
    color: var(--accent) !important;
    transform: scale(1);
    font-weight: 900;
    z-index: 999;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
    pointer-events: auto;
    width: 40px !important;
    height: 40px !important;
    position: absolute;
    top: auto !important;
    bottom: 15px !important;
    margin-top: 0 !important;
    transition: transform 0.1s ease, text-shadow 0.3s ease !important;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
    text-shadow: 0 0 10px var(--accent), 0 0 20px var(--accent) !important;
    cursor: pointer;
}

.swiper-button-next:active,
.swiper-button-prev:active {
    transform: scale(0.85) !important;
    text-shadow: 0 0 5px var(--accent) !important;
}

.swiper-button-prev {
    left: calc(50% - 60px) !important;
    right: auto !important;
}

.swiper-button-next {
    left: calc(50% + 20px) !important;
    right: auto !important;
}

/* Layout */
.project-container {
    width: 90vw;
    margin: 40px auto;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 60px;
}

.project-title h1 {
    font-family: 'Anton', sans-serif;
    font-size: clamp(3rem, 5vw, 6rem);
    line-height: 1;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.project-meta {
    color: var(--accent);
    font-family: monospace;
    font-size: 1.2rem;
    margin-bottom: 40px;
    display: block;
}

.project-description p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #ccc;
    margin-bottom: 20px;
}

.project-sidebar {
    background: var(--surface);
    padding: 30px;
    border-radius: 15px;
    height: fit-content;
    position: sticky;
    top: 40px;
}

.sidebar-item {
    margin-bottom: 25px;
}

.sidebar-label {
    font-family: monospace;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 5px;
    display: block;
}

.sidebar-value {
    font-size: 1.2rem;
    font-weight: 600;
}

.play-btn {
    display: block;
    width: 100%;
    padding: 20px;
    background: transparent;
    color: var(--accent);
    border: 2px solid var(--accent);
    text-align: center;
    font-weight: 800;
    text-transform: uppercase;
    margin-top: 30px;
    border-radius: 5px;
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: color 0.4s ease;
}

.play-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: var(--accent);
    z-index: -1;
    transition: width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.play-btn:hover {
    color: var(--dark);
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.play-btn:hover::before {
    width: 100%;
}

.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 50px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-overlay.active {
    display: flex;
    opacity: 1;
}

.lightbox-image {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.lightbox-overlay.active .lightbox-image {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 40px;
    font-size: 3rem;
    color: var(--text);
    cursor: pointer;
    transition: 0.3s;
}

.lightbox-close:hover {
    color: var(--accent);
}

@media (max-width: 768px) {
    .hero h1 {
        padding: 0 5vw;
    }

    .about-container {
        grid-template-columns: 1fr;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .project-container {
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    .project-title {
        display: contents;
    }

    .project-title h1 {
        order: 1;
    }

    .project-meta {
        order: 2;
    }

    .project-description {
        order: 3;
    }

    .project-sidebar {
        order: 4;
        position: relative;
        margin: 40px 0;
    }

    .post-mortem-section {
        order: 5;
        margin-top: 0;
    }

    .project-carousel {
        height: 400px;
    }

    .swiper-slide {
        width: 85vw !important;
        height: 220px !important;
    }

    .sidebar {
        width: 100vw;
        /* Take up the entire screen */
        background: #181818;
        /* Solid dark grey */
        align-items: center;
        /* Centers the content */
        padding: 40px 20px;
    }

    .sidebar-links a {
        text-align: center;
        /* Center the text */
        transform: none !important;
        /* Stops it from shifting left on hover on mobile */
    }

    /* Target the social links inside the sidebar to center them */
    .sidebar .social-links {
        justify-content: center !important;
        margin-top: 60px !important;
    }
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 15px;
    background: var(--surface);
    border: 1px solid #222;
    border-radius: 8px;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--accent);
}

.contact-form textarea {
    resize: vertical;
}

.submit-btn {
    display: inline-block;
    width: 100%;
    padding: 20px;
    background: transparent;
    color: var(--accent);
    border: 2px solid var(--accent);
    text-align: center;
    font-weight: 800;
    text-transform: uppercase;
    border-radius: 5px;
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: color 0.4s ease, transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: var(--accent);
    z-index: -1;
    transition: width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.submit-btn:hover {
    color: var(--dark);
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.submit-btn:hover::before {
    width: 100%;
}

/* --- POST MORTEM SECTION --- */
.post-mortem-section {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #222;
}

.post-mortem-title {
    font-family: 'Anton', sans-serif;
    font-size: 2.5rem;
    margin-bottom: 25px;
    text-transform: uppercase;
    color: var(--text);
    letter-spacing: 1px;
}

.post-mortem-video {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}

.post-mortem-video + .post-mortem-video {
    margin-top: 25px;
}

.post-mortem-video iframe {
    width: 100%;
    height: 100%;
    border: none;
}


.swiper-slide-active:hover .play-overlay {
    background: var(--accent);
    color: var(--dark);
    transform: translate(-50%, -50%) scale(1.1);
}

.play-overlay::after {
    content: '▶';
    margin-left: 5px;
}

.lightbox-overlay.active .lightbox-video {
    transform: scale(1);
}

/* --- GALLERY (MASONRY LAYOUT) --- */
.gallery-container {
    background: var(--dark);
}

.masonry-grid {
    column-count: 3;
    column-gap: 24px;
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 24px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface);
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.masonry-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(255, 255, 255, 0.1);
}

.masonry-item img {
    width: 100%;
    height: auto;
    display: block;
}

@media (max-width: 1024px) {
    .masonry-grid {
        column-count: 2;
    }
}

@media (max-width: 768px) {
    .masonry-grid {
        column-count: 1;
    }
}

/* --- IRIS PAGE TRANSITIONS --- */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: #050505;
    z-index: 99998;
    pointer-events: none;
    opacity: 1;
}

body.iris-ready::before {
    opacity: 0;
    display: none;
}

.iris-solid {
    position: fixed;
    inset: 0;
    background: var(--dark);
    z-index: 10000;
    pointer-events: none;
    will-change: clip-path;
}

.iris-aperture {
    position: fixed;
    border-radius: 50%;
    box-shadow: 0 0 0 250vmax var(--dark);
    transform: translate(-50%, -50%);
    z-index: 10000;
    pointer-events: none;
    will-change: width, height;
}