@font-face {
    font-family: "Outfit Regular";
    src: url("/assets/fonts/Outfit-Regular.ttf") format("truetype");
    font-weight: 400;
}
@font-face {
    font-family: "NCL Blessing Gloomy";
    src: url("/assets/fonts/NCLBlessingGloomy.otf") format("opentype");
    font-weight: 600;
}
@font-face {
    font-family: "Fahim Sans";
    src: url("/assets/fonts/FahimSans-Regular.ttf") format("truetype");
    font-weight: 800;
}
@font-face {
    font-family: "PixelMix Regular";
    src: url("/assets/fonts/pixelmix.ttf");
    font-weight: 500;
}

:root {
    --white: #f0f0f0;

    --black-100: #111111;
    --black-200: #191919;

    --black-bg: #0d100e;
    --grey-bg: #212a26;

    --grey-100: #29332b;
    --grey-200: #2e332f;
    --grey-300: #333333;
    --grey-400: #444444;
    --grey-500: #555555;
    --grez-700: #aaaaaa;

    --green-100: #2e4233;
    --green-200: #375c40;
    --green-300: #3b7549;
    --green-400: #398f4f;
    --green-500: #32a850;

    --gradient-start: #65ba82;
    --gradient-end: #6061b4;

    --font-regular: "Outfit Regular", sans-serif;
    --font-special: "NCL Blessing Gloomy", sans-serif;
    --font-bold: "Fahim Sans", sans-serif;
    --font-pixel: "PixelMix Regular", sans-serif;

    --text-color: var(--white);
    --text-colo-black: var(--grey-100);
}

/* --- RESET & GLOBAL STYLES --- */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
}

body {
    font-family: var(--font-regular);
    margin: 0;
    padding: 0;
    color: var(--text-color);
    background-color: var(--black-bg);
    height: 100dvh;
}

/* --- BUTTONS --- */
button {
    border: none;
    cursor: pointer;
    background-color: transparent;
    color: var(--green-500);
    font-family: var(--font-regular);
    font-weight: 500;
}

button:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* --- HEADER --- */
header {
    padding: 20px 20px;
    position: sticky;
    top: 0;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.5rem;
}

.theme-toggle {
    padding: 0.5rem 0.5rem;
    color: var(--white);
    background: none;
    border: none;
    cursor: pointer;
}
.theme-toggle:disabled {
    opacity: 0.7;
}
.theme-toggle.selected {
    background-color: var(--green-400);
    border-radius: 5px;
}
.theme-toggle.selected svg {
    color: var(--black-bg);
}

.name {
    font-size: 0.7rem;
    text-align: center;
    color: var(--white);
}
.name h1 {
    font-family: var(--font-pixel);
    color: var(--white);
}
.name a {
    text-decoration: none;
}

/* --- LINKS --- */
.btns {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    color: var(--green-500);
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    font-size: clamp(1rem, 5vw, 2rem);
    text-decoration: none;
}
.btn:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.btn-header {
    color: var(--green-500);
    border-radius: 5px;
    font-size: 1.1rem;
    text-decoration: none;
}
.btn-header:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* --- MAIN CONSTACTS ---*/
.main-contacts {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: calc(100dvh - 68px - 80px);
}

.cnt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 3rem;
}

.cnt h2 {
    font-family: var(--font-pixel);
    font-size: clamp(1.5rem, calc(1vw + 1rem), 3rem);
    margin-bottom: 0.5rem;
    color: var(--white);
}

.altro {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 3rem;
}

.altro h3 {
    font-family: var(--font-pixel);
    font-size: clamp(1.5rem, calc(1vw + 1rem), 3rem);
    margin-bottom: 0.5rem;
    color: var(--white);
}

.altro div a svg {
    height: 24px;
    width: 24px;
}

.cnt-btn a {
    color: var(--green-500);
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    font-size: clamp(1rem, 5vw, 2rem);
    text-decoration: none;
}
.cnt-btn a:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* --- MAIN PROJECTS ---*/
.main-projects {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: calc(100dvh - 75.5px - 76px);
}
.cards-proj {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 1rem;
}
.proj-card {
    padding: 1rem;
    border-left: 3px solid var(--green-400);
}
.proj-card h2 {
    display: flex;
    font-family: var(--font-pixel);
    line-height: calc(16px + 1.25rem);
}
.btn-fill {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    aspect-ratio: 1 / 1;
    margin-left: 1rem;
    margin-bottom: 0.3rem;
    border-radius: 10px;
    background-color: var(--green-300);
}
.btn-fill a {
    align-items: center;
    justify-content: center;
    width: 60%;
    height: 60%;
}
.btn-fill a svg {
    width: 100%;
    height: 100%;
    fill: var(--black-bg);
}
.btn-fill:hover {
    background-color: var(--gradient-start);
}
.tags {
    display: flex;
    gap: 1rem;
    margin: 0.7rem;
    margin-left: 0;
}
.tags div {
    padding: 0.6rem;
    color: var(--black-bg);
    background-color: var(--green-300);
    border-radius: 20px;
}
.p-link {
    height: 20px;
    display: flex;
    gap: 0.4rem;
    color: var(--green-400);
}
.proj-card a {
    display: flex;
    gap: 0.3rem;
    text-decoration: none;
    color: var(--green-400);
}
.proj-card a:hover {
    color: var(--gradient-start);
}
.proj-card a svg {
    justify-self: center;
}
#play-here {
    color: var(--black-bg);
}

/* --- FOOTER --- */
footer {
    color: var(--green-200);
    text-align: center;
    width: 100%;
    padding: 1rem 0;
    height: auto;
    position: relative;
    bottom: 0;
    justify-self: flex-end;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.links {
    display: flex;
    gap: 1rem;
    padding: 0.5rem;
    justify-content: center;
    color: var(--green-200);
}
.links svg {
    width: 24px;
    height: 24px;
    fill: var(--grey-400);
}
.links a:hover svg {
    fill: var(--white);
    transition: fill 0.3s ease;
    scale: 110%;
}

/* --- LIGHT THEME --- */
body.light-theme {
    background-color: var(--white);
    color: var(--text-color-black);
}
body.light-theme .btn {
    color: var(--green-500);
}
body.light-theme .links svg {
    fill: var(--green-500);
}
body.light-theme .theme-toggle.selected {
    background-color: var(--green-400);
}
body.light-theme .theme-toggle.selected svg {
    color: var(--white);
}
body.light-theme .theme-toggle svg {
    color: var(--grey-500);
}
body.light-theme .name h1 {
    color: var(--black-bg);
}
body.light-theme h1 {
    color: var(--text-color-black);
}
body.light-theme .btn-fill {
    color: var(--white);
}
body.light-theme .cnt h2 {
    color: var(--text-color-black);
}
body.light-theme .altro h3 {
    color: var(--text-color-black);
}
body.light-theme .tags div {
    color: var(--white);
}
body.light-theme #play-here {
    color: var(--text-color-black);
}
body.light-theme .btn-fill a svg {
    fill: var(--white);
}

/* --- SMOOTH THEME TRANSITION --- */
body,
button,
a,
header,
footer,
.container,
.name,
.btns,
.links {
    transition: background-color 0.5s ease, color 0.5s ease, fill 0.5s ease;
}

/* --- MEDIA QUERY ---*/
@media (max-width: 575px) {
    * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }
    .header {
        position: relative;
    }
    .main-projects {
        height: auto;
    }
    .btn {
        font-size: clamp(1rem, 5vw, 2rem);
        align-self: center;
    }
    .proj-card {
        margin-left: 0;
    }
    footer {
        position: relative;
        bottom: 0;
    }
}
@media (min-width: 576px) and (max-width: 2560px) {
    header {
        padding: 1.5rem;
        gap: 1rem;
    }
    .name h1 {
        font-size: 1.2rem;
    }
    .btn-header {
        font-size: 1rem;
    }
    .btns {
        gap: 1rem;
        flex-wrap: wrap;
    }
    .btn {
        font-size: clamp(1rem, 3vw, 1.6rem);
        padding: 0.75rem 1.25rem;
    }
    .main-projects {
        padding: 1.5rem;
        height: calc(100dvh - 220px);
        justify-content: center;
    }
    .cards-proj {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-start;
    }
    .proj-card {
        width: 45%;
        padding: 1rem;
        transform: translateX(10dvw);
    }
    .main-contacts {
        padding: 2rem 1rem;
    }
    .cnt h2,
    .altro h3 {
        font-size: clamp(1.5rem, 3vw, 2.5rem);
    }
    footer {
        position: relative;
        padding: 1.5rem 0;
        flex-direction: column;
        gap: 0.75rem;
    }
    .links svg {
        width: 28px;
        height: 28px;
    }
    header {
        position: relative;
    }
}

/* --- VIEW TRANSITIONS ---*/
@view-transition {
    navigation: auto;
    animation-duration: 0.6s;
}
#name {
    view-transition-name: title;
}
#rights {
    view-timeline-name: rights;
}
#github-ft {
    view-timeline-name: github-svg;
}
#linkedin-ft {
    view-timeline-name: linkedin-svg;
}
#linktree-ft {
    view-timeline-name: linktree-svg;
}
