:root {
  --bg: #f7f8ff;
  --surface: #ffffff;
  --line: #dde1f7;
  --text: #141538;
  --muted: #4d5075;
  /* colori accesi: abbastanza pieni da leggersi anche come testo */
  --blue: #2457ff;
  --violet: #8228f0;
  --pink: #e01e74;
  --orange: #d15a00;
  --teal: #00857a;
  --accent: var(--blue);
  --rainbow: linear-gradient(90deg, #2f6bff, #8b3dff, #ff3d8b, #ff9f1c, #00c2b2, #2f6bff);
  --sans: "Space Grotesk", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; color-scheme: light; background: var(--bg); }
body { color: var(--text); font: 16px/1.65 var(--sans); }
/* macchie di colore dietro a tutta la pagina */
body::before { content: ""; position: fixed; inset: 0; z-index: -3; pointer-events: none; background: radial-gradient(circle at 8% 22%, #2f6bff26, transparent 34%), radial-gradient(circle at 92% 30%, #ff3d8b22, transparent 32%), radial-gradient(circle at 20% 88%, #00c2b226, transparent 34%), radial-gradient(circle at 82% 82%, #ff9f1c26, transparent 32%); }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--violet); color: #fff; }

.wrap { width: min(1080px, 100% - 40px); margin-inline: auto; }
.mono { font-family: var(--mono); font-size: 13px; }
.muted { color: var(--muted); }

/* un colore diverso per ogni blocco */
.traits li:nth-child(2), .grid > .card:nth-child(5n+1), .contacts > :nth-child(1), .nav nav a:nth-child(2), #progetti h2 { --accent: var(--violet); }
.traits li:nth-child(3), .grid > .card:nth-child(5n+4), .contacts > :nth-child(3), .nav nav a:nth-child(3), #stack h2 { --accent: var(--pink); }
.traits li:nth-child(4), .grid > .card:nth-child(5n+2), .nav nav a:nth-child(4), #lavoro h2 { --accent: var(--orange); }
.grid > .card:nth-child(5n), .contacts > :nth-child(2), .nav nav a:nth-child(5), #contatti h2 { --accent: var(--teal); }
.grid > .card:nth-child(5n+3) { --accent: var(--blue); }

/* menu */
.nav { position: sticky; top: 0; z-index: 10; background: var(--surface); border-bottom: 1px solid var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 64px; }
.logo { font: 700 17px var(--mono); }
.logo span { color: var(--pink); }
.nav nav { display: flex; gap: 24px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; font: 13px var(--mono); color: var(--muted); }
.nav nav a { padding-block: 8px; border-bottom: 2px solid transparent; }
.nav nav a span { color: var(--accent); font-weight: 700; }
.nav nav a:hover, .nav nav a.active { color: var(--text); }
.nav nav a.active { border-bottom-color: var(--accent); }
.nav nav { min-width: 0; }
em { font-style: normal; }

/* pulsante delle lingue */
.lang { display: flex; flex-shrink: 0; gap: 2px; padding: 3px; background: #eef0ff; border: 1px solid var(--line); border-radius: 99px; }
.lang button { padding: 4px 11px; background: none; border: 0; border-radius: 99px; font: 700 12px var(--mono); color: var(--muted); cursor: pointer; transition: color .2s, background-color .2s; }
.lang button:hover { color: var(--violet); }
.lang button[aria-pressed="true"] { background: linear-gradient(90deg, #2457ff, #8228f0, #e01e74); color: #fff; }

/* apertura */
.hero { position: relative; display: grid; align-items: center; min-height: calc(100svh - 124px); overflow: hidden; isolation: isolate; }
.hero-inner { display: grid; grid-template-columns: 1.15fr 1fr; gap: 48px; align-items: center; padding-block: 56px; }
.hero-inner > * { min-width: 0; }
.badge { display: inline-flex; align-items: center; gap: 10px; padding: 5px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; font: 12px var(--mono); color: var(--muted); }
.badge i { width: 8px; height: 8px; border-radius: 50%; background: #12b76a; }
h1 { width: fit-content; font-size: clamp(56px, 11vw, 108px); line-height: 1.1; letter-spacing: -.04em; margin-block: 20px 6px; background: var(--rainbow) 0 0 / 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; }
.dot { color: var(--pink); }
.role { font: 700 18px var(--mono); color: var(--violet); min-height: 1.65em; }
.role a[href]:hover { text-decoration: underline; }
.role a::after { content: "▍"; animation: blink 1s steps(1) infinite; }
.lead { max-width: 44ch; margin-top: 16px; color: var(--muted); font-size: 18px; }
.lead strong, .prose strong { color: var(--text); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.btn { padding: 12px 20px; background: var(--surface); border: 2px solid var(--line); border-radius: 10px; font: 700 13px var(--mono); transition: border-color .2s, translate .2s; }
.btn:hover { border-color: var(--accent); translate: 0 -2px; }
.btn-main { border-color: transparent; background: linear-gradient(90deg, #2457ff, #8228f0, #e01e74) border-box; color: #fff; }
.btn-main:hover { border-color: transparent; }

.terminal { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.terminal-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: #eef0ff; }
.terminal-bar i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.terminal-bar i:nth-child(2) { background: #febc2e; }
.terminal-bar i:nth-child(3) { background: #28c840; }
.terminal-bar span { margin-left: 8px; font: 12px var(--mono); color: var(--muted); }
.terminal-body { padding: 20px; min-height: 230px; font: 13px/2 var(--mono); }
.terminal-body b { color: var(--pink); margin-right: 6px; }
.terminal-body .out { color: var(--muted); white-space: pre-wrap; }
.terminal-body a { color: var(--violet); font-weight: 700; text-decoration: underline; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.stats div { display: flex; flex-direction: column-reverse; justify-content: flex-end; padding: 18px 10px; text-align: center; }
.stats div + div { border-left: 1px solid var(--line); }
.stats dd { font-size: 30px; font-weight: 700; color: var(--blue); }
.stats div:nth-child(2) dd { color: var(--violet); }
.stats div:nth-child(3) dd { color: var(--pink); }
.stats dt { font: 11px/1.5 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

.marquee { overflow: hidden; background: var(--surface); border-block: 1px solid var(--line); padding-block: 18px; }
.track { display: flex; width: max-content; animation: scroll 40s linear infinite; font: 700 14px var(--mono); color: var(--text); }
.track span { white-space: nowrap; }
.track span::after { content: "✦"; color: var(--blue); margin-inline: 36px; }
.track span:nth-child(4n+2)::after { color: var(--violet); }
.track span:nth-child(4n+3)::after { color: var(--pink); }
.track span:nth-child(4n)::after { color: var(--orange); }

/* sezioni */
.section { padding-top: 112px; }
h2 { display: flex; align-items: baseline; gap: 14px; font-size: clamp(28px, 5vw, 40px); letter-spacing: -.02em; margin-bottom: 28px; }
h2 span { font: 700 14px var(--mono); color: var(--accent); }
h2::after { content: ""; flex: 1; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--accent), transparent); align-self: center; }
h3 { font-size: 22px; margin-bottom: 10px; }
.intro { color: var(--muted); margin-bottom: 28px; }
.card { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: 14px; padding: 28px; box-shadow: 0 10px 30px -18px #2b2f7a55; }

.about { display: grid; grid-template-columns: 1.6fr 1fr; gap: 48px; align-items: start; }
.prose { display: grid; gap: 18px; color: var(--muted); font-size: 17px; }
.paradox { color: var(--violet); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.paradox:hover { color: var(--pink); }
.profile { --accent: var(--violet); }
.avatar { display: grid; place-items: center; width: 72px; height: 72px; margin-bottom: 18px; border-radius: 16px; background: linear-gradient(135deg, #2457ff, #8228f0, #e01e74); color: #fff; font: 700 30px var(--mono); }
.profile h3 { margin-bottom: 0; }
.profile ul { margin-top: 20px; border-top: 1px solid var(--line); }
.profile li { display: flex; justify-content: space-between; gap: 16px; padding-top: 12px; font: 12px var(--mono); }
.profile li span { color: var(--muted); }
.profile li b { text-align: right; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid p { color: var(--muted); }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.grid .featured { grid-column: 1 / -1; position: relative; cursor: pointer; background: linear-gradient(120deg, #ffffff 40%, #f1e6ff); }
/* il link copre tutta la scheda: cliccando ovunque si va su ParadoxMC */
.cover::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.grid.three .tags { margin-top: 18px; }
.traits { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 40px; }
.traits li { display: flex; flex-direction: column; gap: 6px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: 14px; }
.traits b { color: var(--accent); font: 700 15px var(--mono); }
.traits span { font-size: 14px; color: var(--muted); }
.project { display: flex; flex-direction: column; align-items: flex-start; transition: border-color .2s; }
.grid .path { color: var(--accent); font: 700 12px var(--mono); margin-bottom: 20px; }
.project ul { margin-block: 18px; padding-top: 14px; border-top: 1px solid var(--line); align-self: stretch; font-size: 15px; }
.project li { position: relative; padding-left: 18px; }
.project li::before { content: "›"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.tags span { padding: 3px 10px; background: color-mix(in srgb, var(--accent) 10%, #fff); border: 1px solid color-mix(in srgb, var(--accent) 35%, #fff); border-radius: 6px; font: 11px var(--mono); color: var(--text); }
.link { margin-top: 18px; font: 700 13px var(--mono); color: var(--accent); }
.link:hover { text-decoration: underline; }
.grid .note { margin-top: 10px; font-size: 12px; }

/* stack: riquadri con logo, ognuno nel colore della sua tecnologia */
.stack-title { display: flex; align-items: center; gap: 10px; margin: 32px 0 14px; font: 700 13px var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.intro + .stack-title { margin-top: 0; }
.stack-title::before { content: ""; width: 22px; height: 4px; border-radius: 4px; background: var(--rainbow); }
.stack { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stack li { position: relative; display: flex; flex-direction: column; align-items: flex-start; overflow: hidden; padding: 22px; background: linear-gradient(160deg, var(--surface) 55%, color-mix(in srgb, var(--accent) 11%, var(--surface))); border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line)); border-radius: 18px; box-shadow: 0 10px 28px -20px #2b2f7a66; }
.stack i { display: grid; place-items: center; width: 60px; height: 60px; margin-bottom: 18px; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--surface)); border-radius: 16px; font-style: normal; transition: translate .3s, rotate .3s, scale .3s, box-shadow .3s; }
.stack img { width: 34px; height: 34px; object-fit: contain; }
.stack li:hover i { translate: 0 -4px; rotate: -7deg; scale: 1.1; box-shadow: 0 12px 22px -10px var(--accent); }
.stack b { font-size: 19px; }
.stack span { font: 12px var(--mono); color: var(--muted); }
/* filo colorato in basso, che si allunga al passaggio del mouse */
.stack li::after { content: ""; position: absolute; left: 22px; bottom: 0; width: 28px; height: 4px; border-radius: 4px 4px 0 0; background: var(--accent); transition: width .35s; }
.stack li:hover::after { width: calc(100% - 44px); }

.contact .big { width: fit-content; font-size: clamp(36px, 7vw, 64px); font-weight: 700; line-height: 1.15; letter-spacing: -.03em; margin-bottom: 14px; background: var(--rainbow) 0 0 / 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; }
.contacts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* messaggio di benvenuto */
.welcome { width: min(440px, 100% - 32px); margin: auto; padding: 32px 28px; text-align: center; color: var(--text); border: 3px solid transparent; border-radius: 20px; background: linear-gradient(#fff, #fff) padding-box, var(--rainbow) border-box; box-shadow: 0 40px 90px -30px #3b2fb099; }
.welcome::backdrop { background: #e7e9ffb3; backdrop-filter: blur(8px); }
.welcome .avatar { margin-inline: auto; }
.welcome p { color: var(--muted); }
.welcome .welcome-title { font-size: 30px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.welcome .mono { margin-top: 20px; font-weight: 700; }
.welcome-lang { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-block: 10px 20px; }
.welcome-lang button { padding: 10px 4px; background: var(--surface); border: 2px solid var(--line); border-radius: 10px; font: 700 13px var(--mono); color: var(--text); cursor: pointer; transition: border-color .2s, background-color .2s; }
.welcome-lang button:hover { border-color: var(--violet); }
.welcome-lang button[aria-pressed="true"] { background: #f1e6ff; border-color: var(--violet); color: var(--violet); }
.welcome .btn { width: 100%; cursor: pointer; }
html:has(.welcome[open]) { overflow: hidden; }
.value { margin-top: 6px; font-size: 20px; font-weight: 500; overflow-wrap: anywhere; }

footer { display: flex; justify-content: space-between; gap: 16px; margin-top: 112px; padding-block: 28px; border-top: 1px solid var(--line); font: 12px var(--mono); color: var(--muted); }
footer a:hover { color: var(--text); }

@keyframes blink { 50% { opacity: 0; } }
@keyframes scroll { to { transform: translateX(-50%); } }

@media (max-width: 960px) {
  /* menu su due righe: nome e lingue sopra, sezioni sotto */
  .nav-inner { flex-wrap: wrap; row-gap: 4px; height: auto; padding-top: 12px; }
  .nav nav { order: 3; width: 100%; gap: 18px; }
  html { scroll-padding-top: 110px; }
}

@media (max-width: 820px) {
  .hero-inner, .about, .grid, .grid.three, .contacts { grid-template-columns: 1fr; }
  .traits, .stack { grid-template-columns: 1fr 1fr; }
  .stack li { padding: 18px; }
  .hero { min-height: 0; }
  .section { padding-top: 80px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .track, .role a::after { animation: none; }
}
