:root {
  color-scheme: dark;
  --bg: #0a0c10;
  --surface: #11141b;
  --surface-raised: #171b24;
  --ink: #f1f2f6;
  --muted: #9aa1b2;
  --line: #262b37;
  --accent: #b6f36b;
  --accent-strong: #91d646;
  --accent-ink: #11170b;
  --lavender: #b8a5ff;
  --cyan: #75e1d1;
  --rose: #ff9fbd;
  --glow: rgba(182, 243, 107, .16);
  --shadow: 0 20px 60px rgba(0, 0, 0, .35);
  --radius: 22px;
  --page: 1200px;
  --gutter: 16px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: "Bricolage Grotesque", var(--font);
  font-family: var(--font);
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f6f1;
  --surface: #ffffff;
  --surface-raised: #eef0e8;
  --ink: #15191b;
  --muted: #5d6769;
  --line: #dde1d6;
  --accent: #4f7a1d;
  --accent-strong: #3f6316;
  --accent-ink: #ffffff;
  --lavender: #654fbb;
  --cyan: #127368;
  --rose: #b63d62;
  --glow: rgba(79, 122, 29, .12);
  --shadow: 0 18px 48px rgba(32, 45, 28, .1);
}
@media (min-width: 720px) { :root { --gutter: 32px; } }

* { box-sizing: border-box; }
html { overflow-x: clip; scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body { margin: 0; min-width: 320px; overflow-x: hidden; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { max-width: 100%; }
button, input { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 99; transform: translateY(-160%); padding: 10px 15px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-weight: 800; }
.skip-link:focus { transform: none; }

/* ---------- Sfondo animato e barra di avanzamento ---------- */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blob { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(90px); opacity: .22; animation: drift 26s ease-in-out infinite alternate; }
.blob-1 { top: -30vmax; left: -20vmax; background: var(--accent); }
.blob-2 { top: 10vmax; right: -30vmax; background: var(--lavender); animation-duration: 32s; animation-delay: -8s; }
.blob-3 { bottom: -35vmax; left: 20vmax; background: var(--cyan); opacity: .14; animation-duration: 38s; animation-delay: -14s; }
:root[data-theme="light"] .blob { opacity: .13; }
@keyframes drift { 0% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(6vmax, 4vmax, 0) scale(1.08); } 100% { transform: translate3d(-4vmax, 7vmax, 0) scale(.95); } }
.scroll-progress { position: fixed; top: 0; left: 0; z-index: 30; width: 100%; height: 3px; transform: scaleX(var(--progress, 0)); transform-origin: left; background: linear-gradient(90deg, var(--accent), var(--cyan), var(--lavender)); }

/* ---------- Barra superiore ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: var(--page); margin: 0 auto; padding: 12px var(--gutter); transition: background .25s ease, border-color .25s ease; border-bottom: 1px solid transparent; }
.is-scrolled .topbar { border-bottom-color: color-mix(in srgb, var(--line) 80%, transparent); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 15px; font-weight: 700; letter-spacing: -.02em; text-decoration: none; white-space: nowrap; }
.brand-mark { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-size: 14px; font-weight: 900; letter-spacing: -.06em; transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.08); }
.brand-mark-small { width: 26px; height: 26px; border-radius: 8px; font-size: 12px; }
.brand-dot { margin: 0 2px; color: var(--accent); }
.topnav { display: flex; align-items: center; gap: 4px; }
.topnav a { padding: 8px 10px; border-radius: 99px; color: var(--muted); font-size: 13px; font-weight: 600; text-decoration: none; transition: color .2s ease, background .2s ease; }
.topnav a:hover { color: var(--ink); background: var(--surface-raised); }
.topnav a span[aria-hidden] { color: var(--accent); }
.theme-toggle { display: grid; width: 38px; height: 38px; margin-left: 4px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--accent); font-size: 16px; cursor: pointer; transition: transform .4s ease; }
.theme-toggle:hover { transform: rotate(180deg); }
.lang-toggle { display: grid; min-width: 38px; height: 38px; margin-left: 4px; padding: 0 9px; place-items: center; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .06em; cursor: pointer; transition: border-color .2s ease, background .2s ease; }
.lang-toggle:hover { border-color: var(--accent); background: var(--surface-raised); }
/* In inglese la pagina resta nascosta finché site.js non ha tradotto i testi (al massimo 1,2 s, poi compare comunque). */
html[lang="en"]:not(.i18n-ready) body { visibility: hidden; animation: i18n-fallback 0s 1.2s forwards; }
@keyframes i18n-fallback { to { visibility: visible; } }
.nav-hide-sm { display: none; }
@media (min-width: 560px) { .nav-hide-sm { display: inline; } }
@media (max-width: 380px) { .brand > span:last-child { display: none; } }

main { max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter) 80px; }

/* ---------- Elementi comuni ---------- */
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 10px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.live-dot, .status-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.live-dot::after { position: absolute; inset: 0; border-radius: 50%; background: var(--accent); content: ""; animation: ping 2s ease-out infinite; }
.status-dot.is-muted { background: var(--muted); }
@keyframes ping { to { transform: scale(3); opacity: 0; } }
.accent-dot, .heading-mark { color: var(--accent); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border: 1px solid transparent; border-radius: 14px; font-weight: 700; text-decoration: none; transition: transform .2s ease, box-shadow .2s ease, background .2s ease; }
.button:hover { transform: translateY(-2px); }
.button:active { transform: translateY(0) scale(.98); }
.button-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 30px var(--glow); }
.button-primary:hover { box-shadow: 0 14px 40px color-mix(in srgb, var(--accent) 35%, transparent); }
.button-ghost, .button-secondary { border-color: var(--line); background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--ink); }
.text-link { display: inline-flex; gap: 6px; color: var(--ink); font-weight: 700; text-decoration: none; background: linear-gradient(var(--accent), var(--accent)) left bottom / 0 2px no-repeat; transition: background-size .3s ease; }
.text-link:hover { background-size: 100% 2px; }
.text-link span { color: var(--accent); }

/* Comparsa allo scroll */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--d, 0) * 80ms); }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; align-items: center; padding: 28px 0 24px; }
.hero-title { margin: 0 0 16px; font-family: var(--display); font-size: clamp(38px, 10.5vw, 80px); font-weight: 800; line-height: .98; letter-spacing: -.045em; }
.hero-title .line { display: block; }
.hero-title .line-word { display: grid; }
.hero-rotator { position: relative; display: grid; overflow: hidden; padding-bottom: .1em; }
.hero-word { grid-area: 1 / 1; background: linear-gradient(100deg, var(--accent), var(--cyan) 55%, var(--lavender)); -webkit-background-clip: text; background-clip: text; color: transparent; white-space: nowrap; transition: transform .6s cubic-bezier(.2, .8, .2, 1), opacity .6s ease; }
.hero-word.is-entering { transform: translateY(70%); opacity: 0; }
.hero-word.is-leaving { transform: translateY(-70%); opacity: 0; }
.hero-lede { max-width: 560px; margin: 0 0 24px; color: var(--muted); font-size: 16px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-actions .button { flex: 1 1 auto; }
@media (min-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 32px; min-height: min(calc(100svh - 70px), 760px); padding: 24px 0 40px; }
  .hero-actions .button { flex: 0 0 auto; }
  .hero-lede { font-size: 17px; }
}

/* ---------- Sistema "mx" in orbita ---------- */
.orbit-stage { position: relative; width: min(100%, 520px); aspect-ratio: 1; margin: 0 auto; perspective: 900px; touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab; }
.orbit-stage.is-dragging { cursor: grabbing; }
.orbit-scene { position: absolute; inset: 0; transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transform-style: preserve-3d; }
.orbit-rings { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ring { fill: none; stroke-width: 1.2; stroke-dasharray: 1200; stroke-dashoffset: 1200; }
.ring-1 { stroke: color-mix(in srgb, var(--accent) 55%, transparent); }
.ring-2 { stroke: color-mix(in srgb, var(--cyan) 45%, transparent); }
.ring-3 { stroke: color-mix(in srgb, var(--lavender) 45%, transparent); }
.is-ready .ring { animation: draw 1.8s cubic-bezier(.4, 0, .2, 1) forwards; }
.is-ready .ring-2 { animation-delay: .15s; }
.is-ready .ring-3 { animation-delay: .3s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.orbit-core { position: absolute; top: 50%; left: 50%; z-index: 2; display: grid; width: 30%; aspect-ratio: 1; place-items: center; align-content: center; border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--line)); border-radius: 28%; background: color-mix(in srgb, var(--surface) 88%, transparent); box-shadow: var(--shadow), inset 0 0 40px var(--glow); transform: translate(-50%, -50%) translate3d(var(--cx, 0), var(--cy, 0), 40px); scale: 0; cursor: pointer; transition: transform .25s ease-out; }
.is-ready .orbit-core { scale: 1; animation: core-in 1s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes core-in { from { scale: 0; rotate: -30deg; } to { scale: 1; rotate: 0deg; } }
.no-js .orbit-core { scale: 1; }
.core-glow { position: absolute; inset: -30%; z-index: -1; border-radius: 50%; background: radial-gradient(circle, var(--glow), transparent 65%); animation: breathe 4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.18); opacity: .6; } }
.core-label { font-family: var(--display); font-size: clamp(30px, 9vw, 52px); font-weight: 800; line-height: 1; letter-spacing: -.07em; color: var(--accent); }
.core-count { margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.core-count:not(:empty)::after { content: " repo"; }
.is-ready .orbit-core.is-pulsing { animation: pulse .6s ease; }
@keyframes pulse { 40% { scale: 1.08;  box-shadow: var(--shadow), 0 0 0 14px var(--glow), inset 0 0 40px var(--glow); } }
.orbit-nodes { position: absolute; top: 50%; left: 50%; width: 0; height: 0; }
.orbit-node { position: absolute; top: 0; left: 0; display: flex; align-items: center; gap: 6px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 99px; background: color-mix(in srgb, var(--surface) 92%, transparent); box-shadow: 0 8px 24px rgba(0, 0, 0, .18); font-size: 12px; font-weight: 700; white-space: nowrap; cursor: pointer; opacity: 0; will-change: transform; transition: border-color .2s ease, background .2s ease, color .2s ease; }
.orbit-node:hover, .orbit-node:focus-visible { border-color: var(--accent); }
.node-count { display: grid; min-width: 20px; height: 20px; padding: 0 5px; place-items: center; border-radius: 99px; background: var(--surface-raised); color: var(--accent); font-size: 11px; }
.orbit-node.is-active { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.orbit-node.is-active .node-count { background: color-mix(in srgb, var(--accent-ink) 18%, transparent); color: inherit; }
.has-active .orbit-node:not(.is-active) { filter: saturate(.4); }
.orbit-hint { position: absolute; bottom: 0; left: 50%; margin: 0; transform: translateX(-50%); color: var(--muted); font-size: 12px; white-space: nowrap; transition: opacity .5s ease; animation: hint 2.6s ease-in-out 2s infinite; }
.orbit-hint.is-hidden { opacity: 0; }
@keyframes hint { 50% { transform: translate(-50%, -4px); } }
.motion-button { position: absolute; top: 0; right: 0; z-index: 4; padding: 7px 14px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); font-size: 12px; font-weight: 700; cursor: pointer; }
@media (max-width: 480px) { .orbit-node { padding: 6px 9px; font-size: 11px; } }

/* ---------- Numeri ---------- */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px 0 8px; }
.stat { padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: color-mix(in srgb, var(--surface) 75%, transparent); }
.stat strong { display: block; font-family: var(--display); font-size: clamp(32px, 8vw, 46px); font-weight: 800; line-height: 1; letter-spacing: -.04em; }
.stat:first-child strong { color: var(--accent); }
.stat span { color: var(--muted); font-size: 13px; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; } .stat { padding: 22px; } }

/* ---------- Sezioni ---------- */
.section { padding: 64px 0 0; }
.section-heading { margin-bottom: 22px; }
.section-heading h2 { margin: 0 0 8px; font-family: var(--display); font-size: clamp(32px, 7vw, 54px); font-weight: 800; line-height: 1; letter-spacing: -.04em; }
.section-heading p:last-child { max-width: 560px; margin: 0; color: var(--muted); }

/* ---------- Progetti in evidenza ---------- */
.feature-grid { display: grid; grid-auto-flow: column; grid-auto-columns: 86%; gap: 14px; margin: 0 calc(var(--gutter) * -1); padding: 6px var(--gutter) 18px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 var(--gutter); scrollbar-width: none; }
.feature-grid::-webkit-scrollbar { display: none; }
@media (min-width: 720px) { .feature-grid { grid-auto-flow: row; grid-template-columns: repeat(2, 1fr); grid-auto-columns: auto; margin: 0; padding: 0; overflow: visible; } }
@media (min-width: 1040px) { .feature-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; } }
.feature-card { position: relative; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; scroll-snap-align: start; transform: perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)); transition: transform .35s ease, border-color .3s ease, box-shadow .3s ease, opacity .7s ease; }
.js .feature-card.reveal.is-visible { transform: perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)); }
.feature-card::after, .repo-card::after { position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%); content: ""; opacity: 0; pointer-events: none; transition: opacity .3s ease; }
.feature-card:hover::after, .repo-card:hover::after { opacity: 1; }
.feature-card:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); box-shadow: var(--shadow); }
.feature-media { display: block; aspect-ratio: 944 / 600; overflow: hidden; border-bottom: 1px solid var(--line); background: var(--surface-raised); }
.feature-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2, .7, .2, 1); }
.feature-card:hover .feature-media img { transform: scale(1.05); }
.feature-placeholder { display: grid; height: 100%; place-items: center; font-family: var(--display); font-size: 48px; font-weight: 800; color: var(--accent); }
.feature-body { display: flex; flex: 1; flex-direction: column; gap: 6px; padding: 18px; }
.feature-kicker { color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.feature-title { font-family: var(--display); font-size: 22px; font-weight: 800; line-height: 1.15; letter-spacing: -.02em; }
.feature-copy { flex: 1; color: var(--muted); font-size: 14px; }
.feature-cta { margin-top: 6px; font-size: 13px; font-weight: 700; }
.feature-cta span { display: inline-block; color: var(--accent); transition: transform .25s ease; }
.feature-card:hover .feature-cta span { transform: translateX(5px); }
.skeleton-card { min-height: 320px; border-radius: var(--radius); background: linear-gradient(100deg, var(--surface) 30%, var(--surface-raised) 50%, var(--surface) 70%) 0 0 / 300% 100%; animation: shimmer 1.4s linear infinite; scroll-snap-align: start; }
@keyframes shimmer { to { background-position: -150% 0; } }

/* ---------- Elenco progetti ---------- */
.directory-tools { display: grid; gap: 10px; margin-bottom: 12px; }
.search-field { display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); transition: border-color .2s ease, box-shadow .2s ease; }
.search-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--glow); }
.search-field > span:first-child { color: var(--muted); font-size: 18px; }
.search-field input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; }
.chip-scroller { display: flex; gap: 8px; margin: 0 calc(var(--gutter) * -1); padding: 2px var(--gutter); overflow-x: auto; scrollbar-width: none; }
.chip-scroller::-webkit-scrollbar { display: none; }
@media (min-width: 720px) { .chip-scroller { flex-wrap: wrap; margin: 0; padding: 0; overflow: visible; } }
.filter-chip { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 700; cursor: pointer; transition: all .2s ease; }
.filter-chip span { color: var(--accent); font-size: 12px; }
.recent-icon { display: inline-block; font-size: 14px !important; }
.filter-chip.is-selected .recent-icon { animation: spin-once .6s ease; }
@keyframes spin-once { from { transform: rotate(-360deg); } }
.filter-chip:hover { color: var(--ink); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.filter-chip.is-selected { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.filter-chip.is-selected span { color: inherit; opacity: .7; }
.area-chip.is-selected { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.results-status { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.repo-grid { display: grid; gap: 12px; view-transition-name: repo-grid; }
@media (min-width: 640px) { .repo-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .repo-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
.repo-card { position: relative; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 18px; background: color-mix(in srgb, var(--surface) 88%, transparent); transition: border-color .25s ease, transform .25s ease, box-shadow .25s ease, opacity .7s ease; }
.repo-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: var(--shadow); }
.js .repo-card.reveal.is-visible:hover { transform: translateY(-4px); }
.repo-card-link { display: flex; flex: 1; flex-direction: column; gap: 8px; padding: 18px; text-decoration: none; }
.repo-card-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.status-pill { padding: 3px 9px; border-radius: 99px; background: var(--surface-raised); color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.status-pill.is-active { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.status-pill.is-fork { background: color-mix(in srgb, var(--lavender) 16%, transparent); color: var(--lavender); }
.status-pill.is-new { background: var(--rose); color: #fff; animation: breathe 2s ease-in-out infinite; }
.repo-stars { margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 700; }
.repo-card h3 { margin: 4px 0 0; font-family: var(--display); font-size: 19px; font-weight: 800; line-height: 1.2; letter-spacing: -.02em; overflow-wrap: anywhere; }
.repo-description { display: -webkit-box; flex: 1; margin: 0; overflow: hidden; color: var(--muted); font-size: 14px; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.repo-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; }
.lang { display: inline-flex; align-items: center; gap: 5px; color: var(--ink); font-weight: 600; }
.lang i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.area-tag { color: var(--accent); font-weight: 700; }
.repo-card-link { padding-bottom: 12px; }
.repo-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 18px; padding: 10px 0 16px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 12px; }
.repo-open { text-decoration: none; }
.repo-open { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; background: var(--surface-raised); color: var(--accent); transition: transform .3s ease, background .3s ease; }
.repo-card:hover .repo-open { transform: rotate(45deg); background: var(--accent); color: var(--accent-ink); }
/* ---------- Demo su GitHub Pages ---------- */
.play-icon { display: inline-grid; width: 1.5em; height: 1.5em; place-items: center; border-radius: 50%; background: currentColor; font-size: .62em; line-height: 1; }
.play-icon { background: color-mix(in srgb, currentColor 18%, transparent); }
.demo-pill { display: inline-flex; align-items: center; gap: 10px; margin-top: 16px; padding: 8px 14px 8px 8px; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: 99px; background: color-mix(in srgb, var(--accent) 10%, var(--surface)); color: var(--ink); font-size: 14px; font-weight: 700; text-decoration: none; transition: transform .2s ease, box-shadow .2s ease; }
.demo-pill:hover { transform: translateY(-2px); box-shadow: 0 10px 30px var(--glow); }
.demo-pill .play-icon { width: 28px; height: 28px; background: var(--accent); color: var(--accent-ink); font-size: 11px; animation: play-pulse 2.4s ease-in-out infinite; }
.demo-pill > span:last-child { color: var(--accent); transition: transform .2s ease; }
.demo-pill:hover > span:last-child { transform: translateX(4px); }
@keyframes play-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); } 60% { box-shadow: 0 0 0 10px transparent; } }
.demo-grid { display: grid; grid-auto-flow: column; grid-auto-columns: 86%; gap: 14px; margin: 0 calc(var(--gutter) * -1); padding: 6px var(--gutter) 18px; overflow-x: auto; contain: paint; scroll-snap-type: x mandatory; scroll-padding: 0 var(--gutter); scrollbar-width: thin; }
@media (min-width: 720px) { .demo-grid { grid-auto-columns: calc((100% - 14px) / 2); } }
@media (min-width: 1040px) { .demo-grid { grid-auto-columns: calc((100% - 36px) / 3); gap: 18px; } }
.demo-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); border-radius: var(--radius); background: var(--surface); scroll-snap-align: start; transition: border-color .3s ease, box-shadow .3s ease, opacity .7s ease, transform .7s ease; }
.demo-card:hover { border-color: var(--accent); box-shadow: 0 18px 50px var(--glow); }
.demo-preview { display: block; text-decoration: none; }
.browser-bar { display: flex; align-items: center; gap: 5px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--surface-raised); color: var(--muted); font-size: 11px; }
.browser-bar i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.browser-bar i:nth-child(1) { background: #ff5f57; } .browser-bar i:nth-child(2) { background: #febc2e; } .browser-bar i:nth-child(3) { background: #28c840; }
.browser-bar span { overflow: hidden; margin-left: 8px; text-overflow: ellipsis; white-space: nowrap; }
.preview-frame { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg); }
.preview-frame iframe { position: absolute; top: 0; left: 0; width: 400%; height: 400%; border: 0; transform: scale(.25); transform-origin: 0 0; pointer-events: none; opacity: 0; transition: opacity .6s ease; }
.preview-frame.is-loaded iframe { opacity: 1; }
.preview-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 12px; background: linear-gradient(100deg, var(--surface) 30%, var(--surface-raised) 50%, var(--surface) 70%) 0 0 / 300% 100%; animation: shimmer 1.4s linear infinite; }
.is-loaded .preview-loading { display: none; }
.demo-preview::after { position: absolute; }
.demo-body { display: flex; flex: 1; flex-direction: column; gap: 6px; padding: 16px 18px 18px; }
.demo-body h3 { margin: 0; font-family: var(--display); font-size: 20px; font-weight: 800; letter-spacing: -.02em; overflow-wrap: anywhere; }
.demo-body p { display: -webkit-box; flex: 1; margin: 0 0 6px; overflow: hidden; color: var(--muted); font-size: 14px; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.demo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.demo-actions .button { min-height: 42px; padding: 0 16px; }
.demo-button { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 6px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 800; text-decoration: none; transition: transform .2s ease, box-shadow .2s ease; }
.demo-button:hover { transform: translateY(-1px); box-shadow: 0 8px 22px var(--glow); }
.demo-button .play-icon { width: 20px; height: 20px; font-size: 9px; }
.repo-card.has-demo { border-color: color-mix(in srgb, var(--accent) 28%, var(--line)); }
.demo-chip .play-icon { width: 18px; height: 18px; font-size: 8px; color: var(--accent); }
.demo-chip.is-selected { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.demo-chip.is-selected .play-icon { color: inherit; }
.feature-badge { position: absolute; top: 12px; left: 12px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px 5px 5px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 800; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }
.feature-badge .play-icon { width: 20px; height: 20px; font-size: 9px; }
.button-demo .play-icon { width: 24px; height: 24px; font-size: 10px; }
.demo-note { display: flex; align-items: center; gap: 10px; margin: 14px 0 0; color: var(--muted); font-size: 14px; }
.empty-state { padding: 40px 16px; border: 1px dashed var(--line); border-radius: 18px; color: var(--muted); text-align: center; }
::view-transition-old(repo-grid), ::view-transition-new(repo-grid) { animation-duration: .35s; }

/* ---------- Riquadro finale e footer ---------- */
.about { display: grid; gap: 18px; margin-top: 72px; padding: 26px; border: 1px solid var(--line); border-radius: 26px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, var(--surface)), var(--surface) 60%); }
.about h2 { margin: 0 0 10px; font-family: var(--display); font-size: clamp(26px, 6vw, 40px); font-weight: 800; line-height: 1.05; letter-spacing: -.03em; }
.about p:not(.eyebrow) { margin: 0 0 16px; color: var(--muted); }
.about-symbol { font-family: var(--display); font-size: 56px; font-weight: 800; line-height: 1; color: var(--accent); animation: float 5s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-8px) rotate(-4deg); } }
@media (min-width: 720px) { .about { grid-template-columns: auto 1fr; align-items: center; gap: 36px; padding: 40px; } .about-symbol { font-size: 96px; } }
.site-footer { display: grid; gap: 10px; max-width: var(--page); margin: 0 auto; padding: 28px var(--gutter) 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.site-footer > div { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; }
.site-footer p { margin: 0; }
.site-footer a { color: var(--ink); font-weight: 700; text-decoration: none; }
@media (min-width: 900px) { .site-footer { grid-template-columns: auto 1fr auto; align-items: center; gap: 28px; } }

/* ---------- Profili esterni ---------- */
.social-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.social-link { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 40px; height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--surface) 80%, transparent); color: var(--muted); font-size: 13px; font-weight: 700; text-decoration: none; transition: color .2s ease, border-color .2s ease, transform .25s cubic-bezier(.3, 1.6, .5, 1), background .2s ease; }
.social-link svg { width: 18px; height: 18px; fill: currentColor; }
.social-link:hover { transform: translateY(-3px) rotate(-4deg); border-color: var(--accent); color: var(--ink); }
.social-linkedin:hover { background: #0a66c2; border-color: #0a66c2; color: #fff; }
.social-github:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.hero-links { margin-top: 14px; }
.about-links { margin-top: 4px; }
.about-links .social-link { padding: 0 14px; color: var(--ink); }
.site-footer .social-links { justify-content: flex-start; }

/* ---------- Pagina progetto ---------- */
.project-hero { padding: 28px 0 8px; }
.back-link { display: inline-flex; gap: 8px; margin-bottom: 22px; color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: none; }
.back-link:hover { color: var(--ink); }
.back-link span { transition: transform .25s ease; }
.back-link:hover span { transform: translateX(-4px); }
.project-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.project-hero h1 { margin: 0; font-family: var(--display); font-size: clamp(36px, 9vw, 72px); font-weight: 800; line-height: 1; letter-spacing: -.045em; overflow-wrap: anywhere; }
.project-glyph { display: none; font-family: var(--display); font-size: 64px; font-weight: 800; color: var(--accent); animation: float 5s ease-in-out infinite; }
@media (min-width: 720px) { .project-glyph { display: block; } }
.project-lede { max-width: 720px; margin: 16px 0 22px; color: var(--muted); font-size: 17px; }
.project-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.fork-notice { display: flex; gap: 14px; margin-top: 22px; padding: 16px; border: 1px solid color-mix(in srgb, var(--lavender) 40%, var(--line)); border-radius: 16px; background: color-mix(in srgb, var(--lavender) 8%, var(--surface)); }
.fork-notice p { margin: 4px 0 0; color: var(--muted); }
.fork-notice a { color: var(--lavender); font-weight: 700; }
.notice-symbol { color: var(--lavender); font-size: 24px; }
.project-figure { max-width: 820px; margin: 26px 0 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-raised); }
.project-figure img { display: block; width: 100%; height: auto; }
.project-layout { display: grid; gap: 14px; margin-top: 28px; }
@media (min-width: 900px) { .project-layout { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; gap: 20px; } .project-aside { position: sticky; top: 84px; } }
.project-main { display: grid; gap: 14px; }
.content-panel, .project-aside { padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: color-mix(in srgb, var(--surface) 88%, transparent); }
.content-panel h2 { margin: 0 0 10px; font-family: var(--display); font-size: 24px; letter-spacing: -.02em; }
.content-panel p { color: var(--muted); }
.content-source { font-size: 13px; }
.readme { color: var(--muted); }
.readme p { margin: 0 0 12px; }
.readme h3 { margin: 20px 0 8px; color: var(--ink); font-family: var(--display); font-size: 18px; letter-spacing: -.01em; }
.readme ul, .readme ol { margin: 0 0 12px; padding-left: 20px; }
.readme li { margin: 4px 0; }
.readme li::marker { color: var(--accent); }
.readme strong { color: var(--ink); }
.readme a { color: var(--accent); overflow-wrap: anywhere; }
.readme code { padding: 1px 6px; border-radius: 6px; background: var(--surface-raised); color: var(--ink); font-size: .9em; }
.topic-list, .language-list { display: flex; flex-wrap: wrap; gap: 8px; }
.topic-chip { padding: 5px 11px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-size: 13px; font-weight: 700; }
.language-item { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 99px; font-size: 13px; font-weight: 600; }
.language-item i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.language-item small { color: var(--muted); }
.aside-heading { display: flex; justify-content: space-between; margin-bottom: 12px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .14em; }
.project-facts { display: grid; gap: 0; margin: 0; }
.project-facts div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.project-facts div:last-child { border-bottom: 0; }
.project-facts dt { color: var(--muted); font-size: 13px; }
.project-facts dd { margin: 0; font-size: 14px; font-weight: 700; text-align: right; }
.next-projects { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line); }
.next-projects .eyebrow { margin: 0; }

/* ---------- Movimento ridotto ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .blob { animation: none; }
  .orbit-node { opacity: 1; }
}
