/* Setup generale */
html {
    scroll-behavior: smooth;
    font-family: "Baskervville", serif;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Link: nessuna decorazione e colore personalizzato */
a, a:visited, a:hover, a:focus, a:active {
    text-decoration: none;
    color: black;
    outline: none;
}

/* Header */
.header {
    display: grid;
    font-family: "Inter", sans-serif;
    font-weight: 100;
    font-size: 12px;
    margin: 5vh 12.5vw 0;
    grid-template-columns: 3vw 42vw 10vw 10vw 10vw;
    height: 3vw;
    text-align: right;
}

.header div {
    line-height: 3vw;
}

.logo {
    height: 3vw;
    width: 3vw;
    opacity: 60%;
}

.name {
    margin-left: 2vw;
    text-align: left;
}

/* Top navigation */
.topnav {
    text-align: center;
    margin: 7vw 30vw 6vw;
    background-size: auto;
    background-position: center;
    background-repeat: no-repeat;
    height: 10vw;
}

/* Project Grid */
.projects {
    display: grid;
    margin: 0 12.5vw;
    grid-template-columns: repeat(4, 15vw);
    gap: 5vw;
}

.box {
    background-color: #F2F2F2;
    height: 15vw;
    width: 100%;
    background-size: 100%;
    background-position: center;
    background-repeat: no-repeat;
    transition: background-size 0.5s ease-in-out, background-position 0.5s ease-in-out;
}

.box:hover {
    background-size: 110%; /* Slight zoom */
    /* background-position: 70% 50%;  /*  Adjust focus (X% Y%) */
}

.line {
    height: 0.2px;
    background-color: grey;
    width: 100%;
    margin-top: 5px;
    opacity: 50%;
}

.title {
    margin-top: 3px;
    font-size: 1.2vw;
    opacity: 60%;
}

.subtitle {
    font-size: 0.8vw;
    opacity: 40%;
    font-family: "Inter", sans-serif;
    font-weight: 200;
    font-style: italic;
}

.project1:hover .title, .project1:hover .subtitle, .project1 .box:hover .title, .project1 .line:hover .title, .project1 .box:hover .subtitle, .project1 .line:hover .subtitle {opacity: 1;} /* Full opacity on hover */
.project2:hover .title, .project2:hover .subtitle, .project2 .box:hover .title, .project2 .line:hover .title, .project2 .box:hover .subtitle, .project2 .line:hover .subtitle {opacity: 1;} /* Full opacity on hover */
.project3:hover .title, .project3:hover .subtitle, .project3 .box:hover .title, .project3 .line:hover .title, .project3 .box:hover .subtitle, .project3 .line:hover .subtitle {opacity: 1;} /* Full opacity on hover */
.project4:hover .title, .project4:hover .subtitle, .project4 .box:hover .title, .project4 .line:hover .title, .project4 .box:hover .subtitle, .project4 .line:hover .subtitle {opacity: 1;} /* Full opacity on hover */
.project5:hover .title, .project5:hover .subtitle, .project5 .box:hover .title, .project1 .line:hover .title, .project5 .box:hover .subtitle, .project5 .line:hover .subtitle {opacity: 1;} /* Full opacity on hover */
.project6:hover .title, .project6:hover .subtitle, .project6 .box:hover .title, .project6 .line:hover .title, .project6 .box:hover .subtitle, .project6 .line:hover .subtitle {opacity: 1;} /* Full opacity on hover */
.project7:hover .title, .project7:hover .subtitle, .project7 .box:hover .title, .project7 .line:hover .title, .project1 .box:hover .subtitle, .project7 .line:hover .subtitle {opacity: 1;} /* Full opacity on hover */
.project8:hover .title, .project8:hover .subtitle, .project8 .box:hover .title, .project8 .line:hover .title, .project8 .box:hover .subtitle, .project8 .line:hover .subtitle {opacity: 1;} /* Full opacity on hover */

/* Footer */
.footer {
    padding-top: 100px;
    text-align: right;
    margin: 0 12.5vw 3vw;
    display: grid;
    grid-template-columns: 30vw 15vw 15vw 15vw;
    font-family: "Inter", sans-serif;
    font-weight: 100;
    font-size: 0.8vw;
}

.mail {
    text-align: left;
}

.mail .get {font-weight: 600; opacity: 40%;}

/* Hover Effects */
.header div:hover, .projects .title:hover {
    cursor: pointer;
}

/* Responsive Design */

/* Tablet Portrait (max-width: 1024px) */
@media (max-width: 1024px) {
    .projects {
        margin: 0 5vw;
        grid-template-columns: repeat(2, 42vw); /* 2 colonne per schermi medi */
        gap: 6vw;
    }

    .box {
        height: 42vw;
    }

  
    .header {
    margin: 20px 5vw;
    grid-template-columns: 5vw 55vw 10vw 10vw 10vw;
    }    

   
    .topnav {
        font-size: 30px;
        margin-top: 200px;
    }

    .title {
        font-size: 3vw;
    }

    .subtitle {
        font-size: 1.5vw;
    }

    .footer {
        margin: 0 5vw;
        text-align: right;
        grid-template-columns: 30vw 20vw 20vw 20vw;
        font-size: 1vw;
    }
}

/* Mobile (max-width: 768px) */
@media (max-width: 768px) {
    .projects {
        margin-left: 5vw;
        margin-right: 5vw;
        grid-template-columns: 42vw 42vw;
        grid-gap: 6vw;
        font-size: 10pt;
    }

    .box {
        height: 42vw;
    }

    .header {
        display: block;
        text-align: left;
        margin: 20px 5vw;
    }

    .logo {
        width: 30px;
        height: 30px;
        padding-bottom: 5px;
    }

    .name {
        margin-left: 4px;
        font-size: 12px;
        padding-top: 2px;
        padding-bottom: 10px;
    }

    .project {
        margin-left: 4px;
        padding-top: 2px;
        padding-bottom: 10px;
    }

    .about {
        margin-left: 4px;
        padding-top: 2px;
        padding-bottom: 10px;
    }

    .contacts {
        margin-left: 4px;
        padding-top: 2px;
        padding-bottom: 10px;
    }

    .topnav {
        font-size: 30px;
        margin-top: 200px;
    }

    .title {
        font-size: 3vw;
    }

    .subtitle {
        font-size: 1.5vw;
    }

    .footer {
        margin-left: 5vw;
        margin-right: 5vw;
        text-align: right;
        grid-template-columns: 30vw 20vw 20vw 20vw;
        font-size: 1vw;
    }
}

/* Mobile (max-width: 480px) */
@media (max-width: 480px) {


.header {
    margin-top: 10vw;
    height: 30vw;
    margin-left: 10vw;
}

.header div {
    line-height: 3vw;
}
   
    .projects {
        margin-left: 10vw;
        margin-right: 10vw;
        display: block;
    }


    .topnav {
        font-size: 22px;
        margin-top: 0px;
        margin-left: 10vw;
        margin-right: 10vw;
        width: 80vw;
        height: 10vw;
        margin-bottom: 10vw;
        margin-top: 15vw;
    }

    .box {
        height: 80vw;
    }
    
    
    .title {
        font-size: 12px;
    }
    
    .subtitle {
    font-size: 10px;
    margin-bottom: 50px;
    }

    .footer {
        display: block;
        font-size: 9px;
        text-align: left;
        margin-bottom: 35px;
    }

    .get {
        font-size: 8px;
        font-weight: 300;
    }
    .cv {margin-top: 10px;}
    .pdf {margin-top: 5px;}
    .copyright {margin-top:5px;}
    
    
    
    
    
}
