@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700;800;900&display=swap');
@import "animations.css";


/* VARIABLES */
:root {
    --clr-bg: #0D1117;
    --clr-bg-secondary: #111827;
    --clr-surface: #F8FAFC;
    --clr-primary: #6366F1;
    --clr-secondary: #8B5CF6;
    --clr-text: #F8FAFC;
    --clr-text-light: #CBD5E1;
    --clr-text-dark: #111827;
    --radius: 16px;
    --shadow:
        0 10px 25px rgba(99, 102, 241, .25);
    --transition: .3s ease;
}


/* GLOBAL */

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Poppins", sans-serif;
    background: var(--clr-surface);
    color: var(--clr-text-dark);
    line-height: 1.6;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
    cursor: pointer;
}

.container {
    width: min(90%, 1200px);
    margin-inline: auto;
}

.logo span,
.footer-logo span {
    color: var(--clr-primary);
}

/* COMMON SECTIONS */

.section {
    padding: 5rem 0;
}

.section-title {
    color: var(--clr-primary);
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: clamp(2rem, 5vw, 2.6rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--clr-text-dark);
}


/* BUTTONS */

.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: .5rem;
    padding: 1rem 1.8rem;
    border: none;
    border-radius: 14px;
    background:
        linear-gradient(135deg,
            var(--clr-primary),
            var(--clr-secondary));
    color: white;
    font-weight: 600;
    box-shadow: var(--shadow);
    transition:
        transform var(--transition),
        box-shadow var(--transition);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow:
        0 18px 35px rgba(99, 102, 241, .35);
    background: var(--clr-primary)
}

.btn--secondary {
    background: transparent;
    border: 2px solid var(--clr-primary);
    color: white;
}

.btn--secondary:hover {
    background: var(--clr-primary);
}

.btn--outline {
    background: transparent;
    color: var(--clr-primary);
    border: 2px solid var(--clr-primary);
}

.btn--outline:hover {
    background: var(--clr-primary);
    color: white;
}


/* SOCIALS */

.socials {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.socials a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 48px;
    aspect-ratio: 1;
    border-radius: 50%;
    color: var(--clr-text-light);
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .08);
    transition: all var(--transition);
}

.socials a:hover {
    background: var(--clr-primary);
    color: white;
    transform: translateY(-4px);
    box-shadow:
        0 10px 25px rgba(99, 102, 241, .35);
}

.socials svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}


/* REVEAL ANIMATION */

.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition:
        opacity .7s ease,
        transform .7s ease;
}

.reveal.show {
    opacity: 1;
    transform: none;
}


/* HEADER */

.header {
    position: fixed;
    inset: 0 0 auto;
    width: 100%;
    z-index: 1000;
    background: transparent;
    transition:
        background-color .35s ease,
        backdrop-filter .35s ease,
        box-shadow .35s ease;
}

.header.scrolled {
    background: rgba(13, 17, 23, .75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, .25);
}

.nav {
    min-height: 72px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -1px;
    transition: var(--transition);
}


/* MOBILE MENU */

.nav__toggle {
    position: relative;
    z-index: 1200;
    width: 44px;
    height: 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 12px;
    background: rgba(255, 255, 255, .04);
    transition: var(--transition);
}

.nav__toggle span {
    width: 26px;
    height: 3px;
    border-radius: 999px;
    background: var(--clr-text);
    transition:
        transform .3s ease,
        opacity .3s ease;
}

.nav__toggle.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.nav__toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav__toggle.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

.nav__menu {
    position: fixed;
    top: 88px;
    left: 5%;
    right: 5%;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: .35rem;
    padding: 1.25rem;
    border: 1px solid var(--clr-primary);
    border-radius: 22px;
    background: rgba(13, 17, 23, .92);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow:
        0 0 25px rgba(99, 102, 241, .35),
        inset 0 0 18px rgba(99, 102, 241, .08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-16px) scale(.98);
    pointer-events: none;
    transition:
        opacity .35s ease,
        visibility .35s ease,
        transform .35s ease;
}

.nav__menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.nav__menu a {
    display: block;
    padding: 1rem;
    border-radius: 14px;
    color: var(--clr-text-light);
    font-weight: 500;
    transition: var(--transition);
}

.nav__menu a:hover,
.nav__menu a:focus {
    color: var(--clr-text);
    background: rgba(99, 102, 241, .14);
    transform: translateX(4px);
}

.nav__cta {
    display: none;
}

.nav__menu-cta {
    display: flex;
    justify-content: center;
    margin-top: .75rem;
    padding-top: .75rem;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.nav__menu .nav__menu-button {
    width: min(100%, 220px);
    justify-content: center;
    margin-top: .5rem;
    color: var(--clr-text);
    text-align: center;
}

.nav__menu .nav__menu-button:hover {
    color: var(--clr-text);
    background: linear-gradient(135deg,
            var(--clr-primary),
            var(--clr-secondary));
    transform: translateY(-2px);
}

/* MENU OVERLAY / PAGE BLUR */

html.menu-open,
body.menu-open {
    overflow: hidden;
}

body.menu-open main,
body.menu-open footer {
    filter: blur(5px);
}

main,
footer {
    transition: filter .35s ease;
}

body.menu-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 900;
    background: rgba(13, 17, 23, .45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    pointer-events: auto;
}

/* HERO */

.hero {
    position: relative;
    overflow: hidden;
    padding-top: 60px;
    color: var(--clr-text);
    background:
        radial-gradient(circle at top right,
            rgba(99, 102, 241, .25),
            transparent 30%),
        linear-gradient(180deg,
            var(--clr-bg),
            var(--clr-bg-secondary));
}

.hero__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 0 10rem;
}


/* HERO IMAGE */

.hero__image {
    position: relative;
    margin-bottom: 2rem;
    animation:
        fadeUp .8s ease-out,
        float 6s ease-in-out .8s infinite;
}

.hero__image::before {
    content: "";
    position: absolute;
    inset: -30px;
    width: min(78vw, 330px);
    aspect-ratio: 1;
    background:
        radial-gradient(circle,
            rgba(99, 102, 241, .45),
            transparent 70%);
    filter: blur(45px);
    opacity: .8;
    z-index: -1;
}

.hero__image img {
    width: min(66vw, 290px);
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 50%;
    border: 5px solid rgba(255, 255, 255, .08);
    box-shadow:
        0 20px 50px rgba(0, 0, 0, .45),
        0 0 60px rgba(99, 102, 241, .2);
    animation: float 6s ease-in-out infinite;
    transition: transform var(--transition);
}

.hero__image:hover img {
    transform: scale(1.02);
}


/* HERO TEXT */

.hero__text {
    width: 100%;
    text-align: left;
}

.hero__intro {
    margin-bottom: .8rem;
    font-size: .95rem;
    color: var(--clr-text-light);
    animation: fadeUp .8s ease-out .15s both;
}

.hero__title {
    margin-bottom: 1rem;
    font-size: clamp(3rem, 8vw, 4rem);
    font-weight: 700;
    line-height: 1;
    animation: fadeUp .8s ease-out .25s both;
}

.hero__title span {
    display: block;
    color: var(--clr-primary);
}

.hero__subtitle {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    color: var(--clr-secondary);
    animation: fadeUp .8s ease-out .35s both;
}

.hero__description {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--clr-text-light);
    animation: fadeUp .8s ease-out .45s both;
}


/* HERO BUTTONS */

.hero__buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
    text-align: center;
    animation: fadeUp .8s ease-out .55s both;
}

.hero__socials {
    margin-top: 1.5rem;
}


/* HERO DIVIDER */

.hero__divider {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
}

.hero__divider svg {
    display: block;
    width: 100%;
    height: 100%;
}


/* ABOUT */

.about {
    padding: 5rem 0;
}

.about-content {
    max-width: 650px;
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}


/* SKILLS */

.skills {
    background: rgba(211, 211, 211, .32);
}

.skills-marquee {
    position: relative;
    overflow: hidden;
    margin-top: 3rem;
}

/* sfumatura laterale */
.skills-marquee::before,
.skills-marquee::after {
    content: "";
    position: absolute;
    top: 0;
    width: 80px;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.skills-marquee::before {
    left: 0;
    background: linear-gradient(90deg,
            rgba(239, 239, 239, 1),
            transparent);
}

.skills-marquee::after {
    right: 0;
    background: linear-gradient(270deg,
            rgba(239, 239, 239, 1),
            transparent);
}

.skills-track {
    display: flex;
    align-items: center;
    gap: 2rem;
    width: max-content;
    animation: skillsScroll 28s linear infinite;
}

.skills-marquee:hover .skills-track {
    animation-play-state: paused;
}

.skill-item {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 0 0 auto;
    width: 90px;
    height: 90px;
    padding: 1rem;
    border-radius: 18px;
    background: white;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, .06);
    transition:
        transform var(--transition),
        box-shadow var(--transition);
}

.skill-item:hover {
    transform: translateY(-8px);
    box-shadow:
        0 20px 40px rgba(99, 102, 241, .18);
}

.skill-item img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}


/* PROJECTS */

.projects {
    padding: 5rem 0;
}

.projects-list {
    display: grid;
    gap: 2rem;
    margin: 3rem 0;
}

/* Card dei progetti (pronta per quando le aggiungerai) */

.project-card {
    overflow: hidden;
    border-radius: 20px;
    background: #fff;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, .08);
    transition:
        transform var(--transition),
        box-shadow var(--transition);
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow:
        0 20px 40px rgba(99, 102, 241, .18);
}

.project-card img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.project-card-content {
    padding: 1.5rem;
}

.project-card-title {
    margin-bottom: .75rem;
    font-size: 1.3rem;
    font-weight: 600;
}

.project-card-text {
    color: #555;
    line-height: 1.7;
}


/* ENGAGED */

.engaged {
    padding: 4rem 0;
    background: var(--clr-bg-secondary);
    color: var(--clr-text-light);
}

.engaged-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.engaged-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.engaged-content img {
    width: 90px;
    animation: float 5s ease-in-out infinite;
}

.engaged-title {
    margin-bottom: .4rem;
    font-size: 1.6rem;
    font-weight: 700;
    color: white;
}

.engaged-content p:last-child {
    opacity: .85;
}



/* FOOTER */

.footer {
    padding: 2.5rem 0;
    background: var(--clr-bg);
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

.footer-job {
    color: var(--clr-text-light);
    font-size: .95rem;
    margin-bottom: 1rem;
}

.footer-logo {
    font-size: 2rem;
    font-weight: 700;
    color: var(--clr-text);
}

.footer-logo span {
    color: var(--clr-primary);
}

.footer-copy {
    color: var(--clr-text-light);
    font-size: .95rem;
}

.footer-copy span {
    color: var(--clr-primary);
    font-weight: 600;
}