/* projects.css — Matches backstory layout with a side-by-side grid for media */

body {
    background-color: #e2e8f0;
    background-image: 
        radial-gradient(circle at 50% 30%, rgba(148, 163, 184, 0.15) 0%, transparent 70%),
        linear-gradient(rgba(15, 23, 42, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, 0.03) 1px, transparent 1px);
    background-size: 100% 100%, 40px 40px, 40px 40px;
    color: #1e293b;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 0;
    overflow: auto;
}

/* FIXED WRAPPER FOR NAVBAR CENTERING */
.top-nav-wrapper {
    position: fixed;
    top: 20px;
    left: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    justify-content: center;
    pointer-events: none;
}

/* WIDE FLOATING TOP CONTAINER NAVBAR */
.top-nav-container {
    pointer-events: auto; /* Re-enables interaction for the navbar itself */
    width: 92%;
    max-width: 900px;
    background: rgba(241, 245, 249, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 40px;
    padding: 12px 30px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

nav {
    width: 100%;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 35px;
    align-items: center;
    width: 100%;
    margin: 0;
    padding: 0;
}

nav ul li {
    position: relative;
}

nav a {
    text-decoration: none;
    color: #475569;
    font-size: 0.8rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: color 0.2s ease;
    display: inline-block;
    padding-bottom: 4px;
    position: relative;
}

/* Glowing underline effect scoped strictly to individual links */
nav a::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #0891b2;
    box-shadow: 0 0 8px rgba(8, 145, 178, 0.5);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

nav a:hover::after, nav a.active::after {
    width: 100%;
}

nav a:hover, nav a.active {
    color: #0f172a;
}

/* MAIN CONTAINER */
.main-container {
    max-width: 1000px;
    margin: 120px auto 80px auto;
    padding: 0 20px;
}

/* DOSSIER CARD */

.dossier-card {
    background: rgba(255, 255, 255, 0.45); /* Lowered opacity from 0.75 to 0.45 for a softer, less bright container */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.04);
    margin-bottom: 2.5rem;
    overflow: hidden;
    animation: terminalFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.card-header {
    background-color: rgba(248, 250, 252, 0.5); /* Softened header background opacity */
    padding: 20px 30px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.card-header h2 {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #0f172a;
    text-transform: uppercase;
    margin: 0;
}

/* PROJECT CONTENT GRID (Text on left, Media on right) */
.project-content-grid {
    padding: 30px;
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 30px;
    align-items: center;
}

.project-text p {
    font-size: 0.88rem;
    line-height: 1.8;
    color: #334155;
    margin-bottom: 1.2rem;
}

.project-text p:last-child {
    margin-bottom: 0;
}

/* MEDIA CONTAINER */
.project-media {
    width: 100%;
    height: 280px; /* Essential: gives the flex container a visible height */
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(15, 23, 42, 0.05); /* Temporary backdrop to see the box */
    overflow: hidden;
}

.project-media img {
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: contain; /* Keeps the full image visible without cropping */
}

/* Ensure the looping video feed scales properly inside the flex container */
.project-media video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* or 'contain' depending on how you want it to scale */
    display: block;
}
.media-placeholder {
    width: 100%;
    height: 220px;
    background: rgba(226, 232, 240, 0.6);
    border: 1px dashed rgba(100, 116, 139, 0.4);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #64748b;
    font-size: 0.75rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-align: center;
    padding: 10px;
}

/* Responsive layout adjustments for smaller screens */
@media (max-width: 768px) {
    .project-content-grid {
        grid-template-columns: 1fr;
    }
}

/* FOOTER */
footer {
    border-top: 1px solid rgba(15, 23, 42, 0.1);
    color: #64748b;
    text-align: center;
    padding: 30px 0;
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
    padding-left: 5%;
    padding-right: 5%;
}

/* TERMINAL LOAD-IN ANIMATION */
@keyframes terminalFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.inspo-card {
    animation: terminalFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.inspo-card:nth-child(2) {
    animation-delay: 0.15s;
}

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #0f172a; /* Dark home page theme */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeToLight 1s ease-in-out 0.8s forwards;
}

.animation-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.pets-playing {
    position: relative;
    width: 90px;
    height: 40px;
}

/* White circle mimicking the Maltese dog */
.maltese-circle {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 32px;
    height: 32px;
    background-color: #ffffff;
    border-radius: 50%;
    animation: circlePlayLeft 1s ease-in-out infinite alternate;
}

/* Black circle mimicking the cat */
.cat-circle {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 28px;
    height: 28px;
    background-color: #0f172a;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(248, 250, 252, 0.2); /* subtle border to stand out on dark background */
    animation: circlePlayRight 1s ease-in-out infinite alternate-reverse;
}

.loading-text {
    font-family: sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: #94a3b8;
    letter-spacing: 1px;
    animation: pulseText 1s ease-in-out infinite alternate;
}

@keyframes circlePlayLeft {
    0% { transform: translateX(0) translateY(0) scale(1); }
    100% { transform: translateX(25px) translateY(-12px) scale(1.05); }
}

@keyframes circlePlayRight {
    0% { transform: translateX(0) translateY(0) scale(1); }
    100% { transform: translateX(-25px) translateY(-16px) scale(0.95); }
}

@keyframes pulseText {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

@keyframes fadeToLight {
    0% {
        background-color: #0f172a;
        opacity: 1;
    }
    50% {
        background-color: #78869b;
        opacity: 1;
    }
    100% {
        background-color: rgba(248, 250, 252, 0.5);
        opacity: 0;
        visibility: hidden;
    }
}

/* Prevent horizontal overflow on mobile */
html, body {
    max-width: 100vw;
    overflow-x: hidden;
}

/* Make images and containers fluid */
img, video {
    max-width: 100%;
    height: auto;
}

/* --- WIDE DESKTOP VIEW (Screens wider than 1024px) --- */
.hamburger-btn {
    display: none;
}

/* --- THIN SCREEN & MOBILE VIEW (1024px and down) --- */
@media screen and (max-width: 1024px) {
    .top-nav-wrapper {
        top: 10px;
        left: 0;
        width: 100%;
        padding: 0 15px;
        box-sizing: border-box;
    }

    .top-nav-container {
        width: 100%;
        max-width: 100%;
        padding: 12px 20px;
        border-radius: 20px;
        display: flex;
        flex-direction: row-reverse; /* Places hamburger button on the right */
        justify-content: space-between;
        align-items: center;
        box-sizing: border-box;
        position: relative;
    }

    /* Show hamburger button when window is thin or smaller */
    .hamburger-btn {
        display: flex;
        background: none;
        border: none;
        cursor: pointer;
        padding: 5px;
        flex-direction: column;
        justify-content: space-between;
        width: 24px;
        height: 18px;
        z-index: 10001;
        color: #1e293b;
    }

    .hamburger-btn span {
        display: block;
        width: 100%;
        height: 2px;
        background-color: currentColor;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }

    /* Hide the full navigation bar until toggled */
    .nav-links-container {
        display: none;
        position: absolute;
        top: calc(100% + 8px);
        left: 0;
        width: 100%;
        background: rgba(241, 245, 249, 0.95);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border: 1px solid rgba(15, 23, 42, 0.1);
        border-radius: 16px;
        padding: 20px;
        box-sizing: border-box;
        box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    }

    .nav-links-container.active {
        display: block;
    }

    nav {
        width: 100%;
    }

    nav ul {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
        padding: 0;
        margin: 0;
    }

    nav a {
        font-size: 0.85rem;
        width: 100%;
        text-align: left;
    }

    /* Hamburger to 'X' transformation */
    .hamburger-btn.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .hamburger-btn.active span:nth-child(2) {
        opacity: 0;
    }
    .hamburger-btn.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
}