@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600;700;800&display=swap');
:root {
    color-scheme: dark;
    --accent: #b99af8;
    --muted: #d5cce8;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
    background: hsl(256 45% 6%);
}

body {
    margin: 0;
    min-height: 100vh;
    color: #faf8ff;
    font: 400 16px/1.75 'Manrope', 'Helvetica Neue', Arial, sans-serif;
    background: transparent;
    isolation: isolate;
}

/* Sfondo continuo */

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 75% 12%, hsl(257 41% 10%) 0%, transparent 65%),
        linear-gradient(180deg, hsl(256 45% 6%) 0%, hsl(257 43% 8%) 52%, hsl(256 45% 6%) 100%);
}

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

a:hover,
a:focus-visible {
    color: var(--accent);
}

main, header, footer {
    max-width: 1600px;
    margin: auto;
    padding-inline: 5.8vw;
}

header, main, footer,
.hero, .visual, .domains, .content {
    background: transparent;
    border: none;
    box-shadow: none;
}

/* Nebulosa continua, con un respiro lentissimo. */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: url('../milky-way.svg') center / cover no-repeat;
    opacity: .9;
    animation: nebula-breath 110s ease-in-out infinite alternate;
    mask-image: linear-gradient(to bottom, #000 0%, #000 56%, rgba(0,0,0,.6) 100%);
}
@keyframes nebula-breath {
    0% { opacity: .82; }
    40% { opacity: .96; }
    75% { opacity: .87; }
    100% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    body::after { animation: none; }
}

/* Intestazione */

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding-block: 25px;
}

nav {
    display: flex;
    gap: clamp(12px, 3vw, 38px);
    flex-wrap: wrap;
}

nav a {
    font-size: 15px;
    font-weight: 500;
}

.logo {
    font-size: 30px;
    font-weight: 750;
    letter-spacing: -.07em;
}

.accent, .num, .arrow {
    color: var(--accent);
}

/* Hero */

.hero {
    display: grid;
    grid-template-columns:
        minmax(0, .85fr) minmax(0, 1.45fr);
    align-items: center;
    min-height: 65vh;
    padding-block: 24px 34px;
}

.hero > div:first-child {
    position: relative;
    z-index: 1;
}

.hero > div:first-child::after {
    content: "";
    display: block;
    width: 50px;
    height: 2px;
    background: var(--accent);
    margin-top: 32px;
}

h1 {
    font-size: clamp(45px, 5.45vw, 88px);
    line-height: 1.12;
    letter-spacing: -.022em;
    margin: 0 0 18px;
    font-weight: 500;
}

h2 {
    font-size: clamp(26px, 3vw, 40px);
    font-weight: 500;
    letter-spacing: -.012em;
}

p {
    color: var(--muted);
    max-width: 57ch;
}

.subtitle {
    font-size: clamp(18px, 2.1vw, 30px);
    margin: 0 0 22px;
}

.hero p:last-child {
    max-width: 36ch;
    font-size: clamp(16px, 1.5vw, 21px);
}

/* Reticolo animato */

.visual {
    position: relative;
    min-width: 0;
    align-self: center;
    overflow: visible;
    padding-bottom: 32px;
}

canvas {
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 1.34;
    display: block;
    background: transparent;
}

.motion {
    position: absolute;
    bottom: 0;
    right: 0;
    background: transparent;
    border: 0;
    color: var(--muted);
    font: inherit;
    font-size: 11px;
    cursor: pointer;
    padding: 8px;
}

/* Ambiti */

.domains {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    position: relative;
    gap: 32px;
    padding-block: 30px 10vh;
}

.domains a {
    display: block;
}

.num {
    font-size: 12px;
}

h3 {
    font-size: 25px;
    font-weight: 500;
    margin: 12px 0 0;
    letter-spacing: .005em;
}

.domains h3 {
    font-size: clamp(22px, 2.4vw, 34px);
}

.domains p {
    margin: 0 0 12px;
    font-size: clamp(14px, 1.5vw, 20px);
}

/* Sezioni successive */

.content {
    padding-block: 65px;
}

.projects {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px 48px;
}

.project {
    padding: 22px 0;
    border: none;
}

.eyebrow {
    font-size: 11px;
    letter-spacing: .22em;
    color: var(--muted);
    text-transform: uppercase;
}

footer {
    padding-block: 32px;
    color: var(--muted);
    font-size: 13px;
}

/* Smartphone */

@media (max-width: 720px) {
    header {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    nav {
        gap: 14px;
    }

    .hero {
        grid-template-columns: 1fr;
        min-height: auto;
        padding-block: 36px 12px;
    }

    .visual {
        padding-bottom: 16px;
    }

    .domains {
        gap: 15px;
        padding-block: 22px 48px;
    }

    .domains h3 {
        font-size: 20px;
    }

    .domains p {
        font-size: 13px;
    }

    .projects {
        grid-template-columns: 1fr;
    }

    .content {
        padding-block: 40px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

body{letter-spacing:.015em}nav a{font-weight:400;letter-spacing:.035em}.subtitle{font-weight:300;letter-spacing:.025em}.hero p:last-child{font-weight:400} .domains p{font-weight:300} @media(max-width:420px){h1{font-size:clamp(36px,10vw,45px)}}
