/* -------------------------------------------------------------------------------- */
/* ! Base */
/* -------------------------------------------------------------------------------- */

/* Reset */
* {
    margin: 0;
    padding: 0;
}

a {
    text-decoration: none;
}

li {
    list-style-type: none;
}

html {
    scroll-behavior: smooth;
}

/* Utility */
.clippy {
    clip-path: circle(39% at 50% 50%);
}

.res {
    width: 100%;
    max-width: 290px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Tipografia */
body {
    font-family: 'General Sans', sans-serif;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'General Sans', sans-serif;
    font-weight: 700;
}

p {
    font-size: 1.2em;
    font-weight: 400;
}

/* Tavolozza colori */
:root {
    --primary: #3986ff;
    --secondary: #FF006E;
    --accent: #FFE74C;
    --dark: #000000;
    --light: #FFFFFF;
}

.blu {
    color: var(--primary);
}

.fucsia {
    color: var(--secondary);
}

.giallo {
    -webkit-text-stroke-width: 2px;
    -webkit-text-stroke-color: var(--accent);
    color: var(--dark);
}

.arancione {
    color: #FB5607;
}

.viola {
    color: #8337EC;
}

.verde {
    color: #6CF178;
}

/* Animazioni */
@keyframes openPanel {
    0% {
        transform: scale(0.8);
    }

    100% {
        transform: scale(1);
    }
}

body {
    background-color: var(--dark);
}

/* -------------------------------------------------------------------------------- */
/* ! Grid per Mobile first */
/* -------------------------------------------------------------------------------- */
/* Grid stystem */
.grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 10px;
    padding: 10px 20px;
}

/* Navigazione */

header {
    background-color: var(--primary);
    margin-top: 20px;
    margin-bottom: 20px;
    margin-left: 20px;
    margin-right: 20px;
    border-radius: 50px;
}

.site-nav img {
    grid-column: 1/5;
    /* outline: 1px solid red; */
    z-index: 1;
}

.site-nav__menu {
    position: absolute;
    top: 0;
    left: 0;
    max-height: 0;
    overflow: hidden;
    z-index: 1;
}

.open .site-nav__menu {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    max-height: 30%;
    width: 100%;
    height: 100vh;
    margin-top: 15px;
    margin-bottom: 20px;
    border-radius: 50px;
    background: var(--primary);
    animation: openPanel 0.6s;
    font-size: 1.5em;
    line-height: 1.8em;
}

.open .site-nav a {
    color: var(--light);
    font-weight: 500;
}

.open .site-nav a:hover {
    color: var(--accent);
    font-weight: 500;
}

.open .site-nav a.active {
    border: 10px solid var(--accent);
    border-radius: 50px;
    background-color: var(--accent);
    color: var(--dark);
    font-weight: 500;
}

/* Hamburger */

.site-nav__hamburger {
    cursor: pointer;
    grid-column: 8/9;
    justify-self: end;
    /* outline: 1px solid red; */
    height: 20px;
    width: 40px;
    position: relative;
    transition: 0.6s cubic-bezier(.99, .3, .06, .79);
}

.site-nav__hamburger span {
    background: var(--light);
    height: 2px;
    width: 100%;
    position: absolute;
    left: 0;
    border-radius: 20px;
    transition: 0.6s cubic-bezier(.99, .3, .06, .79);
}

.site-nav__hamburger span:nth-child(1) {
    top: 0;
    width: 90%;
    opacity: 1;

}

.site-nav__hamburger span:nth-child(2),
.site-nav__hamburger span:nth-child(3) {
    top: 10px;
    width: 70%;
}

.site-nav__hamburger span:nth-child(4) {
    top: 20px;
    width: 90%;
    opacity: 1;
}

/* Hamburger in open */
.open .site-nav__hamburger {
    transform: rotate(180deg);
    z-index: 999;
}

.open .site-nav__hamburger span:nth-child(1),
.open .site-nav__hamburger span:nth-child(4) {
    width: 0;
    opacity: 0.4;
}

.open .site-nav__hamburger span:nth-child(2) {
    transform: rotate(45deg);
    width: 80%;
}

.open .site-nav__hamburger span:nth-child(3) {
    transform: rotate(-45deg);
    width: 80%;
}


/* Section Welcome */
.welcome__text {
    grid-column: 1/9;
    color: var(--light);
    font-size: 1.8em;
    line-height: 1.5em;
}

.welcome__img {
    grid-column: 1/9;
    display: flex;
    justify-content: center;
}

.btn {
    margin-top: 50px;
    margin-bottom: 30px;
    background: transparent;
    border: none;
    position: relative;
    width: 280px;
    height: 70px;
    cursor: pointer;
}

.btn-back {
    border-radius: 50px;
    z-index: 1;
    top: 0;
    left: 0;
    position: absolute;
    background-color: grey;
    width: 100%;
    height: 100%;
    transition: all 0.3s;
}

.btn-text {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    background: rgb(251, 86, 7);
    color: var(--light);
    border: 2px solid var(--dark);
    top: 0;
    left: 0;
    position: absolute;
    border-radius: 50px;
    font-family: 'General Sans', sans-serif;
    font-size: 2em;
    font-weight: 500;
    transition: all 0.3s;
}

.btn img {
    opacity: 0;
    position: absolute;
    top: -30px;
    left: -30px;
    width: 50px;
    height: 50px;
    z-index: 3;
    transform: all 0.3s;
}

.btn:hover .btn-text {
    transform: translate(-15px, -10px) rotate(-2deg);
}

.btn:hover .btn-back {
    transform: rotate(-2deg);
}

.btn:hover img {
    opacity: 1;
}

.blob {
    width: 300px;
    height: 300px;
    border-radius: 60% 40% 40% 60% / 60% 40% 60% 40%;
    overflow: hidden;
    animation: flow 4s infinite ease-in-out;
}

.blob img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@keyframes flow {
    0% {
        border-radius: 60% 40% 40% 60% / 60% 40% 60% 40%;
    }

    35% {
        border-radius: 80% 70% 60% 60% / 80% 70% 60% 60%;
    }

    70% {
        border-radius: 70% 90% 60% 70% / 80% 90% 50% 90%;
    }

    100% {
        border-radius: 60% 40% 40% 60% / 60% 40% 60% 40%;
    }
}

/* Section Topics */
#main_container {
    grid-column: 1/9;
    margin-top: 30px;
}

#container {
    max-width: 450px;
    overflow: hidden;
    background-color: var(--dark);
}

.stage_animation {
    overflow: hidden;
    white-space: nowrap;
    display: inline-block;
    animation: stage_animation 5s linear infinite;
}

.stage_animation p {
    display: inline-block;
    font-family: 'General Sans', sans-serif;
    font-size: 30px;
}

@keyframes stage_animation {
    0% {
        transform: translate3d(0, 0, 0);
    }

    100% {
        transform: translate3d(-50%, 0, 0);
    }
}

/* Section Skills */
#skills {
    grid-column: 1/3;
}

#skills h3 {
    color: var(--light);
    font-weight: 300;
    text-align: center;
    margin-top: 30px;
}

#skills h1 {
    color: var(--light);
    font-size: 40px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 30px;
}

#skills img {
    width: 80px;
}

#skills li {
    grid-column: span 4;
    text-align: center;
    padding: 12px;
}

/* Section Highlights */
#highlights {
    grid-column: 1/3;

}

#highlights h3 {
    color: var(--light);
    font-weight: 300;
    text-align: center;
    margin-top: 30px;
}

#highlights h1 {
    color: var(--light);
    font-size: 40px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 30px;
}

#highlights .container {
    display: grid;
    place-items: center;
    margin-inline: 1.5rem;
    padding-block: 2rem;
}

.card__container {
    display: grid;
    row-gap: 3.5rem;
}

.card__article {
    position: relative;
    overflow: hidden;
}

.card__img {
    width: 328px;
    border-radius: 1.5rem;
}

.card__data {
    width: 250px;
    background-color: var(--light);
    /* padding: 1.5rem 2rem; */
    padding: 1rem;
    box-shadow: 0 8px 24px hsla(0, 0%, 0%, .15);
    border-radius: 1rem;
    position: absolute;
    bottom: -9rem;
    left: 0;
    right: 0;
    margin-inline: auto;
    opacity: 0;
    transition: opacity 1s 1s;
}

.card__description {
    display: block;
    font-size: small;
    margin-bottom: .25rem;
}

.card__title {
    font-size: 25px;
    color: var(--dark);
    margin-bottom: .75rem;
}

.card__button {
    text-decoration: none;
    font-size: small;
    font-weight: 500;
    color: var(--primary);
}

.card__button:hover {
    text-decoration: underline;
}

.card__article:hover .card__data {
    animation: show-data 1s forwards;
    opacity: 1;
    transition: opacity .3s;
}

.card__article:hover {
    animation: remove-overflow 2s forwards;
}

.card__article:not(:hover) {
    animation: show-overflow 2s forwards;
}

.card__article:not(:hover) .card__data {
    animation: remove-data 1s forwards;
}

@keyframes show-data {
    50% {
        transform: translateY(-10rem);
    }

    100% {
        transform: translateY(-7rem);
    }
}

@keyframes remove-overflow {
    to {
        overflow: initial;
    }
}

@keyframes remove-data {
    0% {
        transform: translateY(-7rem);
    }

    50% {
        transform: translateY(-10rem);
    }

    100% {
        transform: translateY(.5rem);
    }
}

@keyframes show-overflow {
    0% {
        overflow: initial;
        pointer-events: none;
    }

    50% {
        overflow: hidden;
    }
}

.button__projects {
    display: grid;
}

.button__projects a {
    grid-column: 2/8;
    justify-self: center;
}

.button__projects .btn {
    width: 280px;
    height: 70px;
    margin-top: 50px;
    margin-bottom: 30px;
    background: transparent;
    border: none;
    position: relative;
    cursor: pointer;
}

/* Section Contacts */
#contacts {
    grid-column: 1/3;
    margin-top: 50px;
    max-width: 1200px;
    margin: 0 auto;
}

#contacts h3 {
    color: var(--light);
    font-weight: 300;
    text-align: center;
    margin-top: 100px;
}

#contacts h1 {
    color: var(--light);
    font-size: 40px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 30px;
}

.sections__contacts {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 10px;
    padding: 10px 20px;
}

.sections__contacts .wrapper-1 {
    grid-column: 1/9;
}

.sections__contacts .wrapper-2 {
    grid-column: -1/-9;
}

.wrapper-1-title,
.wrapper-2-title {
    margin-bottom: 50px;
}

.wrapper-2-title h1 {
    margin-top: 50px;
}

.wrapper-1-icon {
    display: flex;
    justify-content: space-around;
}

.wrapper-2-icon {
    display: flex;
    justify-content: space-around;
}

.icon {
    text-decoration: none;
    width: 5.625rem;
    height: 5.625rem;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.icon>i {
    color: var(--light);
    font-size: 1.5rem;
    transition: all 0.2s;
}

.icon:hover>i {
    scale: 2.2;
    background: var(--primary);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.icon::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 100%;
    background: var(--primary);
    scale: 1;
    z-index: -1;
    transition: all 300ms ease-out;
}

.icon:hover::before {
    scale: 0;
}

/* Footer */
footer {
    background-color: var(--secondary);
    margin-top: 100px;
    color: var(--light);
    text-align: center;
    height: 230px;
}

.footer .info {
    grid-column: 1/9;
}

.info h5 {
    font-weight: 300;
    margin-top: 40px;
    margin-bottom: 10px;
}

.footer .navigation {
    grid-column: -1/-9;
}

.navigation a {
    color: var(--light);
    margin-left: 10px;
    margin-right: 10px;
}

.navigation a:hover {
    color: var(--dark);
}

.footer .copyright {
    grid-column: 1/9;
    margin-top: 25px;
}

.copyright h6 {
    font-weight: 500;
    color: var(--dark);
}







/* -------------------------------------------------------------------------------- */
/* ! Dispositivi medium */
/* -------------------------------------------------------------------------------- */
@media (min-width: 768px) {

    /* Section Welcome */
    .welcome__text {
        grid-column: 1/6;
        font-size: 2.5em;
        line-height: 1.5em;
        margin-top: 50px;
    }

    .welcome__img {
        grid-column: 6/9;
        margin-top: 50px;
    }

    /* Section Topics */
    #container {
        max-width: 1200px;
    }

    /* Section Highlights */
    #highlights .container {
        margin: 0 auto;
    }

    .card__container {
        grid-template-columns: repeat(2, 1fr);
        column-gap: 1.5rem;
    }

    /* Section Contacts */
    .sections__contacts .wrapper-1 {
        grid-column: 3/7;
        margin-bottom: 50px;
    }

    .sections__contacts .wrapper-2 {
        grid-column: -2/-8;
    }

    /* Footer */
    footer {
        height: 200px;
    }


}

/* -------------------------------------------------------------------------------- */
/* ! Dispositivi large */
/* -------------------------------------------------------------------------------- */
@media (min-width: 992px) {
    .grid {
        max-width: 1060px;
        margin: 0 auto;
    }

    /* Header */

    .site-nav {
        display: grid;
        grid-column: 1/9;
    }

    .site-nav img {
        width: 75px;
        align-self: center;
    }

    .site-nav .site-nav__menu {
        all: inherit;
        grid-column: 5/8;
    }

    .site-nav__menu a {
        font-size: 22px;
        color: var(--light);
        font-weight: 500;
        margin-right: 10px;
    }

    .site-nav__menu a:hover {
        color: var(--accent);
        font-weight: 500;
    }

    .site-nav__menu a.active {
        border: 10px solid var(--accent);
        border-radius: 50px;
        background-color: var(--accent);
        color: var(--dark);
        font-weight: 500;
    }

    .site-nav__hamburger {
        display: none;
    }

    /* Section Topics */
    #container {
        max-width: 1200px;
    }

    /* Section Skills */
    #skills li {
        grid-column: span 2;
    }

    /* Section Highlights */
    #highlights .container {
        margin: 0 auto;
    }

    .card__container {
        grid-column: span 2;
        column-gap: 5rem;
    }

    .card__img {
        width: 348px;
        /* padding-inline: 2.5rem; */
    }

    /* Section Contacts */
    .sections__contacts .wrapper-1 {
        grid-column: 1/4;
        margin-bottom: 50px;
    }

    .sections__contacts .wrapper-2 {
        grid-column: 5/9;
    }

    .wrapper-2-title h1 {
        margin-top: 0px;
    }


}