/* Base */
/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

a {
    text-decoration: none;
}

li {
    list-style-type: none;
}

/* Utlity */
.res {
    width: 100%;
    max-width: 290px;
}

.container {
    max-width: 1200px;
}

body {
    background-color: var(--background);
}

/* Tipografia */
h1,
h2,
h3,
h4,
h5 {
    font-family: Etna, bold;
    font-size: 2em;
}

p {
    font-family: Urbanist;
}

/* Tavolozza colore */
:root {
    --background: #F4ECE1;
    --secondary: #FF6D3A;
    --accent: #4185F4;
    --primary: #006d38;
    --warm: #F8BC5C;
    --text: #70BFA0;
}


/* Grid system */
.grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 10px;
    padding: 10px 20px;
}

/* Navigazione */

.menu {
    --s: 30px;
    --c: #006d38;
    height: var(--s);
    aspect-ratio: 1;
    border: none;
    padding: 0;
    border-inline: calc(var(--s)/2) solid #0000;
    box-sizing: content-box;
    --_g1: linear-gradient(var(--c) 20%, #0000 0 80%, var(--c) 0) no-repeat content-box border-box;
    --_g2: radial-gradient(circle closest-side at 50% 12.5%, var(--c) 95%, #0000) repeat-y content-box border-box;
    background:
        var(--_g2) left var(--_p, 0px) top,
        var(--_g1) left calc(var(--s)/10 + var(--_p, 0px)) top,
        var(--_g2) right var(--_p, 0px) top,
        var(--_g1) right calc(var(--s)/10 + var(--_p, 0px)) top;
    background-size:
        20% 80%,
        40% 100%;
    position: relative;
    clip-path: inset(0 25%);
    -webkit-mask: linear-gradient(90deg, #0000, #000 25% 75%, #0000);
    cursor: pointer;
    transition:
        background-position .3s var(--_s, .3s),
        clip-path 0s var(--_s, .6s);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.menu:before,
.menu:after {
    content: "";
    position: absolute;
    border-radius: var(--s);
    inset: 40% 0;
    background: var(--c);
    transition: transform .3s calc(.3s - var(--_s, .3s));
}

.menu:checked {
    clip-path: inset(0);
    --_p: calc(-1*var(--s));
    --_s: 0s;
}

.menu:checked:before {
    transform: rotate(45deg);
}

.menu:checked:after {
    transform: rotate(-45deg);
}

.menu:focus-visible {
    clip-path: none;
    -webkit-mask: none;
    border: none;
    outline: 2px solid var(--c);
    outline-offset: 5px;
}

header {
    color: var(--secondary);
    background: var(--warm);
    font-size: 0.8em;
    padding: 25px;
}

header.cover {
    background: var(--warm);
    color: var(--primary);
    padding: 15px 20px;
    height: 90px;
    overflow: hidden;
    font-family: Etna, bold;
}

header .container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.cover.active {
    height: 150px;
}

div.cover_logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cover_menu {
    order: 3;
    width: 100%;
    visibility: hidden;
}

.cover.active .cover_menu {
    visibility: visible;
}

header h2 {
    font-size: 1.8em;
    color: var(--primary);
}

.cover_menu a {
    font-family: Etna, bold;
    color: var(--primary);
    font-size: 1.8em;
}

.cover_menu li {
    text-align: right;
}

.cover_hb {
    color: var(--light);
    font-size: 2em;
}

/* Benvenuto */
.welcome__text {
    grid-column: 1/9;
    color: black;
}

.welcome__text h1 {
    grid-column: 1/9;
    color: var(--secondary);
    font-size: 3em;
}

.welcome__img {
    grid-column: 1/9;
    display: flex;
    justify-content: center;
}

/* cta */
.cta_group {
    font-size: 1.5em;
    display: flex;
    gap: 100px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.cta__primary {
    border: 2px solid var(--secondary);
    padding: 10px 50px;
    border-radius: 50px;
    font-weight: 600;
}

.cta__primary {
    background: var(--secondary);
    color: var(--background);
}

.cta__primary:hover {
    background: var(--background);
    color: var(--secondary);

}

.cta__secondary {
    border: 2px solid var(--accent);
    padding: 10px 50px;
    border-radius: 50px;
    font-weight: 600;
}

.cta__secondary {
    background: var(--accent);
    color: var(--background);
}

.cta__secondary:hover {
    background: var(--background);
    color: var(--accent);

}

.cta__third {
    border: 2px solid var(--primary);
    padding: 10px 50px;
    border-radius: 50px;
    font-weight: 600;
}

.cta__third {
    background: var(--primary);
    color: var(--background);
}

.cta__third:hover {
    background: var(--background);
    color: var(--primary);

}

.linea {
    grid-column: 2 / 7;
    border-bottom: 8px solid var(--text);
    margin: 20px;
    border-radius: 30%;
}

/* Stile per le card */
.card {
    position: relative;
    height: 400px;
    width: 100%;
    perspective: 150rem;
    display: flex;
    width: 350px;
    justify-self: center;
    align-items: center;
}

.card__side {
    height: 100%;
    transition: all 0.8s ease;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    backface-visibility: hidden;
    border-radius: 3px;
    overflow: hidden;

    justify-content: center;
    align-items: center;
    margin-bottom: 60px;
}


/* Stile per le immagini */
.cards {
    display: flex;
    justify-content: center;
    /* Centra le card orizzontalmente */
    flex-wrap: wrap;
    /* Permette il wrapping delle card quando lo spazio è insufficiente */
    gap: 20px;
    /* Spazio tra le card */
    max-width: 114rem;
    /* Larghezza massima per mantenere le card allineate */
    margin: 0 auto;
    /* Centra il contenitore delle card sulla pagina */
}

.card__side img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.card__side--front-1,
.card__side--front-2,
.card__side--back {
    width: 100%;
    height: 100%;
    margin-bottom: 20px;
}

.card__side--front-1 img,
.card__side--front-2 img,
.card__side--back img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    padding: 20px;
}

.card__side--back {
    transform: rotateY(180deg);
}

.card:hover .card__side--front-1,
.card:hover .card__side--front-2 {
    transform: rotateY(-180deg);
}

.card:hover .card__side--back {
    transform: rotateY(0);
}

.row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    max-width: 114rem;
    margin: 0 auto;
}



/* Tesi */
.tesi__text {
    grid-column: 1/9;
}

.tesi__text h2 {
    font-size: 2.5em;
    color: var(--accent);
    margin-top: 20px;
}

.tesi__text h3 {
    font-size: 1.5em;
    color: var(--accent);
}

.tesi__img img {
    grid-column: 1/9;
    justify-self: center;
    width: 600px;
    object-fit: cover;

}

/* Scarica cv */
.scaricapt {
    background: url(../img/portfolio_mb.png) no-repeat center center;
    height: 150vh;
    background-size: cover;
    display: grid;

    align-items: center;
    text-align: center;

}



.scaricapt__content h1 {
    font-size: 2.5em;
    margin-bottom: 30px;
    color: var(--primary);
    text-align: center;
}

.scaricapt__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    /* Allinea il testo al centro */
}

.scaricapt__content h1 {
    font-size: 2.5em;
    margin-bottom: 30px;
    color: var(--primary);
    text-align: center;
    position: absolute;
    left: 50%;
    transform: translate(-50%, -50%);
}



.cta_group {
    display: flex;
    justify-content: left;
    gap: 20px;
    margin-top: 15px;

}

.cta_porfolio {
    display: flex;
    justify-content: center;
    /* Centra gli elementi orizzontalmente */
    gap: 20px;
    margin-top: 60px;
    position: absolute;
    /* Posiziona in modo assoluto rispetto al contenitore relativo */
    bottom: auto;
    /* Distanza dal fondo */
    left: 50%;
    /* Allinea al centro orizzontalmente */
    transform: translateX(-50%);
}




/* Footer */
footer {
    color: var(--secondary);
    background: var(--warm);
    font-size: 0.8em;
    padding: 25px;
    font-family: Urbanist;
    margin-top: 30px;
}

footer .container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    align-items: center;
    gap: 20px;
}

/* Marchio */
.marchio {
    grid-column: 1 / 2;
}

.marchio img {
    width: 100px;
    height: auto;
}

/* Social */
.social {
    grid-column: 7 / 9;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.social h3 {
    margin-bottom: 10px;
    font-size: 1.5em;
    color: var(--secondary);
}

.social a {
    font-size: 1.5em;
    color: var(--secondary);
    margin-right: 10px;
}

/* Contatti */
.contatti {
    grid-column: 3 / 7;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.contatti h3 {
    font-size: 1.5em;
    color: var(--secondary);
    margin-right: 10px;
}

.contatti a {
    font-size: 1.5em;
    color: var(--secondary);
    margin-right: 10px;
}

/* Media Query per dispositivi mobili */
@media (max-width: 768px) {
    footer .container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .marchio,
    .contatti,
    .social {
        grid-column: auto;
        margin-bottom: 20px;
    }

    .social a {
        margin-right: 0;
    }

    .cards {
        display: grid;
        justify-content: center;

    }

}

/* Medium Devices */
@media (min-width: 768px) {
    .cover_menu {
        all: unset;
    }

    .cover_menu li {
        display: inline-block;
        margin-left: 10px;
    }

    .cover_hb {
        display: none;
    }

    /* Welcome */
    .welcome__text {
        grid-column: 1/5;
    }

    .welcome__img {
        grid-column: 6/9;
    }

    /* Fix per img */
    .welcome__img img {
        object-fit: contain;
    }

    /* Tesi */
    .tesi__text {
        grid-column: 4 / 9;
    }

    .tesi__img {
        grid-column: 1 /4;
    }

    /* Fix per img */
    .tesi__img img {
        object-fit: contain;
    }

    .cards {
        display: flex;
        justify-content: center;
        align-items: center;
        flex-wrap: wrap;
        gap: 20px;
        max-width: 1200px;
        /* Limita la larghezza massima per centrare meglio */
        margin: 0 auto;
        flex-direction: row;
    }

    .card {
        justify-content: center;
        align-items: center;
    }

    .scaricapt__content {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        /* Allinea il testo al centro */
    }

    .scaricapt__content h1,
    .scaricapt__content .cta_group {
        margin-top: 20px;
        /* Aggiungi margine sopra e sotto */
    }


    footer .container {
        flex-direction: row;
    }

    footer .container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .marchio,
    .contatti,
    .social {
        grid-column: auto;
        margin-bottom: 20px;
    }

    .social a {
        margin-right: 0;
    }

    footer .container {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
    }

    .marchio,
    .contatti {
        flex-basis: auto;
    }
}

/* Large Devices */
@media (min-width: 992px) {
    .grid {
        max-width: 1060px;
        margin: 0 auto;
    }

    .cards {
        flex-direction: row;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        justify-content: center;
        /* Centra la griglia delle card */
        align-items: center;
        justify-items: center;
    }

    .card {
        justify-self: center;
        /* Centra la card */
        justify-content: center;
        align-items: center;
    }

    footer .container {
        display: flex;
        flex-direction: row;
        /* Posiziona gli elementi in riga */
        justify-content: space-between;
        /* Spazia uniformemente gli elementi */
    }

    .marchio,
    .contatti {
        flex-basis: auto;
        /* Ripristina la larghezza automatica */
    }

}



/* CSS PORTFOLIO */
/* CSS PORTFOLIO */
.cover_freccia {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 40px;
}

.cover p {
    font-size: 1em;
    font-family: Etna, bold;
    color: var(--primary);
}

.hero {
    background: url(../img/background_pt.png) no-repeat center center;
    height: 70vh;
    background-size: cover;
    display: flex;
    align-items: center;
}

div.menu__portfolio {
    position: absolute;
    width: 100%;
    height: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

a {
    text-decoration: none;
    color: var(--primary);
}

li.menu__list {
    text-transform: capitalize;
    font-size: 2em;
    font-family: Etna, bold;
    line-height: 50px;
    margin: 0px 30px 0px 30px;
    transition: .1s;
    transition-timing-function: cubic-bezier(.51, .23, .74, 1.52);
}

li.menu__list:hover a {
    border-bottom: 5px solid var(--secondary);
    color: var(--secondary);
    transition: .1s;
    transition-timing-function: cubic-bezier(.51, .23, .74, 1.52);
}


.gray {
    display: flex;
    flex-direction: column;
}

.gray h2 {
    display: grid;
    grid-column: 1/5;
    color: var(--secondary);
}

.skill-card {
    position: relative;
    padding: 20px;
    width: auto;
    background-color: var(--background);
    box-shadow: 0 1px 3px var(--primary), 0 1px 2px rgba(0, 0, 0, 0.24);
    cursor: pointer;
    transition: all 0.3s;
}

.skill-card:hover {
    box-shadow: 0 14px 28px var(--text), 0 10px 10px rgba(0, 0, 0, 0.22);
}

.skill-card__project {
    position: relative;
    background-color: var(--background);
    height: 170px;
    margin: -20px -20px 20px -20px;
    overflow: hidden;
    transition: all 0.5s;
}

.skill-card__project .skill-card__icon {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;

    height: 100%;

    object-fit: cover;

    transition: transform 0.5s;
}

.skill-card__body {
    max-height: 100px;
    /* Aumenta l'altezza massima per visualizzare più testo */
    overflow: auto;
    transition: max-height 0.5s;
}

.skill-card__body p {
    max-height: none;
    /* Aumenta l'altezza massima del paragrafo */
    overflow: auto;
}

.skill-card:hover .skill-card__body {
    max-height: 300px;
}

.skill-card:hover .skill-card__project {
    height: 0;
}

.skill-card:hover .skill-card__project .skill-card__icon {
    transform: translateX(-50%) translateY(-50%) scale(3);
}

.skill-card .skill-card__title {
    font-size: 1.4em;
    font-weight: 600;

}

.skill-card .skill-card__duration {
    color: var(--secondary);
    font-style: italic;
}

.skill-card .skill-card__knowledge {
    margin-top: 10px;
    color: black
}

.skill-card .skill-card__knowledge li {
    margin-top: 5px;
    transition-duration: 0;
    transition-delay: 0.5s;
    transform: translateX(-100%);
}

/* Medium Devices */
@media (min-width: 768px) {
    li.menu__list {
        display: inline;
    }

    .hero {
        height: 50vh;

    }

    .gray {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .gray h2 {
        grid-column: 1/-1;
    }
}