/* --- Work Page Styles --- */
#work-main {
    justify-content: flex-start;
    padding-top: 5rem;
    align-items: flex-start;
}

#work-main h1 {
    font-size: clamp(2.5rem, 8vw, 6rem);
    font-family: 'Nunito Sans', sans-serif;
    font-weight: bold;
    margin-bottom: 2rem;
    text-align: left;
    color: #333;
    padding-left: 10%;
}

#work-main h1 .fancy-letter {
    font-family: 'Carattere', cursive;
    font-style: normal;
    font-size: 1.1em;
    font-weight: normal;
}

#work-main h1 .fancy-o {
    margin-right: 0.1em;
}

.menu-layout-container {
    position: relative;
    width: 80%;
    max-width: 1400px; /* Prevents layout from getting too large on ultrawide monitors */
    margin: 0 auto;
    
    /* This forces the container to always have a ~16:8 aspect ratio */
    aspect-ratio: 16 / 8;
}

/* A wrapper for each menu item group */
.menu-item {
    position: absolute;
    /* border: 1px solid blue; */
}

/* General styles for all visual elements */
.menu-image, .menu-scribble, .menu-label {
    position: absolute;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}

.menu-scribble { z-index: 1; }
.menu-image    { z-index: 2; }
.menu-label    { z-index: 3; }

.menu-label {
    font-size: clamp(1.5rem, 2.2vw, 2.5rem); /* Corrected clamp */
    font-weight: 300;
    line-height: 1.1;
    text-transform: uppercase;
    text-align: left;
}

.menu-hitbox {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 4;
    cursor: pointer;
    /* UNCOMMENT THE LINE BELOW TO SEE THE HITBOXES */
    /* background-color: rgba(255, 0, 0, 0.2); */
}

/* --- Hover Animations (Updated for new structure) --- */
.menu-item:hover .menu-image {
    transform: scale(1.05);
}
#menu-item-motion:hover .menu-image { transform: rotate(-8deg) scale(1.05); }
#menu-item-3d:hover .menu-image { transform: rotate(8deg) scale(1.05); }
#menu-item-uxui:hover .menu-image { transform: rotate(-5deg) scale(1.05) translateY(-5px); }
#menu-item-graphic:hover .menu-image { transform: rotate(5deg) scale(1.05) translateY(-5px); }

.menu-item:hover .menu-scribble {
    transform: scale(1.02);
}

/* --- 1. Motion Design (Cookie) --- */
/* This positions the entire group where your hitbox was */
#menu-item-motion { top: 0%;  left: 25%; width: 38%;  height: 50%; }
/* These values now position the elements INSIDE the group wrapper */
#menu-item-motion .menu-image    { top: 0%; left: 0%; width: 52%; }
#menu-item-motion .menu-scribble { top: 10%;  left: 5%; width: 71%; }
#menu-item-motion .menu-label    { top: 50%; left: 58%; }

/* --- 2. 3D Design (Croissant) --- */
#menu-item-3d { top: 35%; left: 0%;  width: 25%;  height: 60%; }
#menu-item-3d .menu-image    { top: 33%; left: 12%; width: 80%; }
#menu-item-3d .menu-scribble { top: 16%; left: 0%;  width: 100%; }
#menu-item-3d .menu-label    { top: 0%; left: 4%; }

/* --- 3. UX/UI Design (Muffin) --- */
#menu-item-uxui { top: -10%; left: 75%;  width: 26%; height: 65%; }
#menu-item-uxui .menu-image    { top: 37%; left: 4%; width: 77%; }
#menu-item-uxui .menu-scribble { top: 18%; left: 0%;  width: 86%; }
#menu-item-uxui .menu-label    { top: 0%; left: 10%; }

/* --- 4. Graphic Design (Toast) --- */
#menu-item-graphic { top: 55%; left: 46%; width: 39%; height: 46%; }
#menu-item-graphic .menu-image    { top: 7%; left: 5%; width: 46%; }
#menu-item-graphic .menu-scribble { top: 5%; left: 0%; width: 73%; }
#menu-item-graphic .menu-label    { top: 30%; left: 65%; }

/* --- Project Selection Styles (from 3d.css) --- */
.project-selection-container {
    display: flex;
    gap: 4rem;
    width: 100%; /* Make container full-width */
    padding: 0 10%; /* Apply same horizontal padding as the title */
    box-sizing: border-box; /* Ensure padding is included in the width */
    margin-top: 2rem;
    flex-wrap: wrap;
}

.project-placeholder {
    flex: 1; /* Allow the item to grow and fill available space */
    aspect-ratio: 1 / 1; /* Maintain a 1:1 square ratio */
    min-width: 350px; /* Set a minimum width before wrapping */
    background-color: #f0f0f0;
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    color: #333;
    font-size: 1.5rem;
    font-weight: bold;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden; /* This is crucial for cropping */
}

.project-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* This crops the image to fit, centered by default */
    transition: transform 0.3s ease, filter 0.3s ease;
}

.project-placeholder:hover img {
    transform: scale(1.05);
    filter: blur(4px);
}

#project-sewing-box img {
    object-position: 20% 50%; /* Shifts the center point left (X-axis) */
}

.project-placeholder .project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-size: 1.8rem;
    font-weight: bold;
    letter-spacing: 1px;
}

.project-placeholder:hover .project-overlay {
    opacity: 1;
}

.project-placeholder:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.project-placeholder.placeholder-only {
    cursor: default;
    background-color: #e9e9e9;
    color: #aaa;
}

.project-placeholder.placeholder-only:hover {
    transform: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}
