:root {
    --folder-color: #000000;
    --folder-back-color: #1a1a1a;
    --paper-1: #e6e6e6;
    --paper-2: #f2f2f2;
    --paper-3: #ffffff;
}

.projects-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding-top: 2rem;
    scroll-margin-top: 80px;
}

#projects .section-header {
    margin-bottom: 2rem;
}

.folders-wrapper {
    display: flex;
    justify-content: center;
    gap: 350px;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    flex-wrap: wrap;
    padding-top: 220px;
    padding-bottom: 60px;
}

.folder-container {
    height: 300px;
    /* Compacted height */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
}

.folder-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    /* Labels closer to folders */
    position: relative;
    z-index: 1;
    transition: z-index 0.3s;
}

.folder-wrapper.active {
    z-index: 100;
}

.folder-label {
    font-family: 'Glacial Indifference', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #000;
    /* Changed to black */
    text-transform: uppercase;
    letter-spacing: 2px;
}

.folder {
    position: relative;
    transition: all 0.2s ease-in;
    cursor: pointer;
    transform: scale(2.5);
}

@media (max-width: 1100px) {
    .folders-wrapper {
        gap: 40px;
    }
}

@media (max-width: 768px) {
    .folders-wrapper {
        flex-direction: column;
        align-items: center;
        gap: 40px;
        padding-top: 30px;
        padding-bottom: 20px;
    }

    .folder {
        transform: scale(1.2) !important;
    }

    .folder:not(.open):hover {
        transform: scale(1.3) translateY(-5px) !important;
    }

    .folder.open {
        transform: scale(1.2) translateY(-5px) !important;
    }

    .folder-label {
        color: #000 !important;
        font-size: 0.9rem;
    }

    .folder-container {
        height: 180px;
    }

    .folder.open .paper {
        width: 55px !important;
        height: 45px !important;
    }

    /* Mobile open state: papers centered above folder in arc */
    .folder.open .paper:nth-child(1) {
        transform: translate(-130%, -140%) !important;
    }

    .folder.open .paper:nth-child(2) {
        transform: translate(-45%, -170%) !important;
    }

    .folder.open .paper:nth-child(3) {
        transform: translate(45%, -170%) !important;
    }

    .folder.open .paper:nth-child(4) {
        transform: translate(130%, -140%) !important;
    }

    /* Mobile peek state: papers inside folder */
    .folder:not(.open):hover .paper:nth-child(1) {
        transform: translate(-120%, -30%) rotate(-6deg) !important;
    }

    .folder:not(.open):hover .paper:nth-child(2) {
        transform: translate(-60%, -45%) rotate(-2deg) !important;
    }

    .folder:not(.open):hover .paper:nth-child(3) {
        transform: translate(0%, -45%) rotate(2deg) !important;
    }

    .folder:not(.open):hover .paper:nth-child(4) {
        transform: translate(60%, -30%) rotate(6deg) !important;
    }

    .paper h4 {
        font-size: 0.35rem !important;
    }

    .paper-icon {
        width: 16px !important;
        height: 16px !important;
    }

    .projects-section {
        min-height: auto;
        padding-top: 1rem;
    }
}

.folder:not(.open):hover {
    transform: scale(2.7) translateY(-8px);
}

.folder:not(.open):hover .paper {
    transform: translate(-50%, 0%);
}

.folder:not(.open):hover .folder__front {
    transform: skew(15deg) scaleY(0.6);
}

.folder:not(.open):hover .folder__front.right {
    transform: skew(-15deg) scaleY(0.6);
}

.folder.open {
    transform: scale(2.5) translateY(-8px);
}

/* Peeking state on HOVER: Papers clustered inside the folder */
.folder:not(.open):hover .paper:nth-child(1) {
    transform: translate(-150%, -40%) rotate(-8deg);
    opacity: 1;
    pointer-events: auto;
    /* Clickable in peek mode */
    z-index: 4;
}

.folder:not(.open):hover .paper:nth-child(2) {
    transform: translate(-90%, -60%) rotate(-2deg);
    opacity: 1;
    pointer-events: auto;
    z-index: 4;
}

.folder:not(.open):hover .paper:nth-child(3) {
    transform: translate(-10%, -60%) rotate(2deg);
    opacity: 1;
    pointer-events: auto;
    z-index: 4;
}

.folder:not(.open):hover .paper:nth-child(4) {
    transform: translate(50%, -40%) rotate(8deg);
    opacity: 1;
    pointer-events: auto;
    z-index: 4;
}

/* Open state on CLICK: Papers fly out fully */
.folder.open .paper:nth-child(1) {
    transform: translate(-250%, -160%);
    z-index: 4;
    opacity: 1;
    pointer-events: auto;
}

.folder.open .paper:nth-child(2) {
    transform: translate(-116%, -195%);
    z-index: 4;
    opacity: 1;
    pointer-events: auto;
}

.folder.open .paper:nth-child(3) {
    transform: translate(16%, -195%);
    z-index: 4;
    opacity: 1;
    pointer-events: auto;
}

.folder.open .paper:nth-child(4) {
    transform: translate(150%, -160%);
    z-index: 4;
    opacity: 1;
    pointer-events: auto;
}

.folder.open .folder__front.right {
    transform: skew(-15deg) scaleY(0.6);
}


.folder__back {
    position: relative;
    width: 160px;
    height: 80px;
    background: var(--folder-back-color);
    border-radius: 0px 10px 10px 10px;
}

.folder__back::after {
    position: absolute;
    z-index: 0;
    bottom: 98%;
    left: 0;
    content: '';
    width: 45px;
    height: 12px;
    background: var(--folder-back-color);
    border-radius: 5px 5px 0 0;
}

/* Detail icon on tab circle */
.folder__back::before {
    position: absolute;
    top: -15px;
    left: 20px;
    width: 14px;
    height: 14px;
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    z-index: 10;
    content: '⇪';
    /* Upwards arrow icon */
    color: #fff;
    font-size: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    line-height: 1;
}


.paper {
    position: absolute;
    z-index: 2;
    bottom: 15%;
    left: 50%;
    transform: translate(-50%, 10%);
    width: 35px;
    height: 35px;
    background: #fff;
    border-radius: 4px;
    transition: all 0.5s cubic-bezier(0.2, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3px 3px 3px 12px;
    /* Extra left padding for holes */
    box-sizing: border-box;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
}

/* Notebook Holes Effect */
.paper::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 5px;
    bottom: 5px;
    width: 4px;
    /* Series of holes using radial gradient */
    background-image: radial-gradient(circle, #ddd 1.5px, transparent 1.5px);
    background-size: 100% 8px;
    background-position: center;
    z-index: 2;
}

/* Vertical Spine Line */
.paper::after {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.folder.open .paper {
    width: 65px;
    /* Slightly wider to accommodate holes */
    height: 55px;
    opacity: 1;
    pointer-events: auto;
}

.paper:hover {
    z-index: 10 !important;
}

.paper-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
}

.paper h4 {
    font-size: 0.5rem;
    /* Tiny but readable uppercase */
    font-weight: 800;
    margin: 0;
    color: #000;
    text-transform: uppercase;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.2px;
    line-height: 1;
}

.paper p {
    display: none;
    /* Hide subtitle as per reference */
}

.paper img {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 38px;
    /* High ratio logo-to-card */
    object-fit: contain;
    margin-bottom: 1px;
}

.folder__front {
    position: absolute;
    z-index: 3;
    width: 100%;
    height: 100%;
    background: var(--folder-color);
    border-radius: 10px;
    transform-origin: bottom;
    transition: all 0.3s ease-out;
}

.folder__front::before {
    position: absolute;
    z-index: 1;
    top: 10%;
    left: 10%;
    content: '';
    width: 80%;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.folder__front.right {
    z-index: 5;
    background: var(--folder-color);
}