@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@300..700&display=swap');

/*
HEX COLORS: 
    BODY BKF: #6F4E37 / 111, 78, 55 (coffee brown)
    SEC COLOR #92684A / 146, 104, 74 (light brown)
*/

:root {
    --body-bg-color: #2f2319;
    --sec-color: #92684A;
    --contacts-bg-color: #1c150e;
}

body.light-mode {
    --body-bg-color: #e9d7c5;
    --sec-color: #92684A;
    --contacts-bg-color: #dab89e;
}

body {
    background-color: var(--body-bg-color);
    margin: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* -- Top Heading -- */

.section-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}

.title-welcome {
    color: var(--sec-color);
    text-align: center;
    font-family: 'Fira Code', monospace;
    text-transform: uppercase;
    letter-spacing: 5px;
    font-size: clamp(1rem, 2.5vw, 2rem);
    flex: 1; 
    margin: 0 12px;
    min-width: 0; 
    white-space: nowrap; 
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-icon {
    width: 6vw;
    max-width: 70px;
    min-width: 45px;
    min-height: 45px;
    height: 6vw;
    max-height: 70px;
    border-radius: 40%;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s ease;
    border: none;
    border: 1px solid transparent;
    background-color: transparent;
    outline: none;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.btn-icon:hover {
    transform: scale(1.15);
}

.btn-icon:active {
    transform: scale(0.85);
}

.btn-icon img {
    width: 100%; 
    height: 100%;
    object-fit: cover;
    transform: scale(1.5); 
}

#btn-bright {
    margin-right: 20px;
}

.section-middle {
    margin: 30px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 80vw;
    box-sizing: border-box;
}

.avatar-container img {
    width: clamp(200px, 25vw, 280px);
    height: clamp(200px, 25vw, 280px);
    border-radius: 50%;
    border: 2px solid var(--sec-color);
    margin-bottom: 15px;
    object-fit: cover;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

#name {
    font-family: 'Fira Code', monospace;
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: var(--sec-color);
    margin: 25px 0 10px 0;
}

#name-desc {
    font-family: 'Fira Code', monospace;
    font-size: clamp(1rem, 3vw, 1rem);
    color: var(--sec-color);
    margin: 5px;
}

.main-buttons {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap; 
    width: 100%;
    gap: 18px;
    padding: 28px 0;
    box-sizing: border-box;
}

.main-buttons button {
    flex: 1 1 calc(33.333% - 18px); /* three-per-row on wide screens */
    width: auto;
    height: auto;
    padding: 12px 16px;
    min-height: 48px;
    border-radius: 8px;
    border: 1px solid transparent;
    background-color: var(--sec-color); 
    color: var(--body-bg-color);
    font-family: 'Fira Code', monospace;
    font-size: clamp(1rem, 2vw, 1.3rem);
    cursor: pointer;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, opacity 0.15s ease;
    outline: none;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.main-buttons button:hover {
    transform: scale(1.10);
    opacity: 0.95;
}

.main-buttons button:active {
    transform: scale(0.85); 
}

.section-projects {
    display: flex;
    justify-content: space-between;
    flex-direction: column;
    margin-top: 20px;
    align-items: center;
    width: 100%;
}  

.separator-projects {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--sec-color);
    font-family: 'Fira Code', monospace;
    font-size: clamp(1rem, 2.5vw, 2rem);
    text-transform: uppercase;
    letter-spacing: 5px;
    margin: 20px 0;
}

.projects-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between; 
    row-gap: 25px;
    margin-top: 50px;
    width: 100%;
    max-width: 1500px;
    padding: 10px;
    box-sizing: border-box;
}

.project-card {
    position: relative;
    aspect-ratio: 16 / 9;
    border: 2px solid var(--sec-color);
    max-width: 700px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    background: #222;
    min-height: 140px;
    flex: 0 0 calc(50% - 9px);
}

.project-card:hover {
    transform: translateY(-6px);
}

.project-card:active {
    transform: translateY(0);
    transform: scale(0.85);
}

@media (max-width: 600px) {
    .projects-grid {
        justify-content: center;
    }

    .project-card {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .title-welcome {
        font-size: clamp(0.9rem, 3.2vw, 1.2rem);
        letter-spacing: 3px;
    }

    .btn-icon {
        width: 7.5vw;
        max-width: 60px;
        height: 7.5vw;
        max-height: 60px;
    }

    .section-middle {
        max-width: 94vw;
    }

}

@media (min-width: 601px) and (max-width: 768px) {
    .project-card {
        flex: 0 0 calc(50% - 9px);
    }
}


@media (max-width: 480px) {
    .title-welcome {
        font-size: 0.95rem;
        letter-spacing: 2px;
    }

    .btn-icon {
        width: 9vw;
        max-width: 48px;
        height: 9vw;
        max-height: 48px;
    }

    .main-buttons {
        gap: 12px;
        padding: 16px 0;
    }

    .main-buttons button {
        flex: 0 0 100%;
        width: 100%;
        min-height: 52px; 
        font-size: 1rem;
    }

    .avatar-container img {
        width: clamp(150px, 34vw, 170px);
        height: clamp(150px, 34vw, 170px);
    }

    .projects-grid {
        justify-content: center;
    }
}

.card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    object-fit: cover;
    object-position: center top;
    transition: transform 0.5s ease;
}

.project-card:hover .card-bg {
    transform: scale(1.10);
}

.card-link-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.mini-github-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    z-index: 4;
    background-color: rgba(255, 255, 255, 0.85);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.mini-github-btn img {
    width: 20px;
    height: 20px;
}

.mini-github-btn:hover {
    transform: scale(1.15);
    background-color: #fff;
    cursor: pointer;
}

.card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent 60%);
    color: #ffffffbe;
    padding: 10px 12px;
    z-index: 5;
    pointer-events: none;
}

.card-info h3 {
    margin: 0;
    font-size: 1.2rem;
}

.card-info p {
    margin: 5px 0 0 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

.section-contacts {
    margin-top: 80px;
    width: 100%;
    height: 30vh;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--contacts-bg-color);
}

.section-contacts h3 {
    font-family: 'Fira Code', monospace;
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    color: var(--sec-color);
    margin: 35px 0 35px 0;
}

.contacts-container {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.bmc-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 12px;
}

@media (max-width: 768px) {
    .section-contacts {
        margin-top: 48px;
        padding: 12px 10px;
        height: auto; 
    }

    .section-contacts h3 {
        font-size: clamp(1rem, 3.2vw, 1.2rem);
        margin: 18px 0 8px 0;
    }

    .contacts-container {
        gap: 14px;
    }

    .section-contacts .btn-icon {
        width: 56px;
        height: 56px;
        max-width: 56px;
        max-height: 56px;
    }
}

@media (max-width: 480px) {
    .section-contacts {
        margin-top: 28px;
        padding: 10px 8px;
        height: auto;
    }

    .section-contacts h3 {
        font-size: 0.95rem;
        margin: 12px 0 16px 0;
    }

    .contacts-container {
        margin-top: 10px;
        gap: 10px;
        padding-bottom: 12px;
    }

    .section-contacts .btn-icon {
        width: 44px;
        height: 44px;
        max-width: 44px;
        max-height: 44px;
        border-radius: 12%;
    }

    .section-contacts > .bmc-container,
    .section-contacts > .contacts-container {
        width: 100%;
    }
}