/* =========================================================================
   KATY · PORTFOLIO — Stylesheet
   Palette: azzurro chiaro (primario) · bianco (secondario) · grigio chiaro
   Font: Fraunces (display) + Manrope (UI/body)
   ========================================================================= */

/* ------------------------------------------------------------- Tokens */
:root {
  --azure-50:  #f2f9fd;
  --azure-100: #e4f2fb;
  --azure-200: #c8e6f7;
  --azure-300: #9fd4f0;
  --azure-400: #6ec0ea;
  --azure-500: #3fa5dd;
  --azure-600: #2b8bc4;
  --azure-700: #22729f;

  --btn-1: #1a76ab;
  --btn-2: #15628d;

  --gold:      #cba25a;   /* decorativo (linee, riempimenti, gradienti) */
  --gold-ink:  #7a5c12;   /* oro scuro per TESTO: contrasto AA su chiaro */
  --gold-soft: #e6cd93;
  --cape:      #d64b4b;

  --ink-900: #122232;
  --ink-700: #2c4152;
  --ink-500: #5b7180;
  --ink-400: #8698a5;

  --line: #e5edf3;
  --mist: #f6fafc;
  --paper: #ffffff;

  --sh-sm: 0 2px 10px rgba(24, 64, 94, .06);
  --sh-md: 0 12px 32px rgba(24, 64, 94, .10);
  --sh-lg: 0 26px 60px rgba(24, 64, 94, .16);
  --sh-azure: 0 22px 48px rgba(43, 139, 196, .28);

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 34px;
  --r-pill: 999px;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --container: 1200px;
  --nav-h: 76px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* --------------------------------------------------------------- Reset */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: var(--font-body);
  color: var(--ink-700);
  background: var(--paper);
  line-height: 1.65;
  font-size: 1rem;
  font-weight: 400;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
/* l'attributo [hidden] deve avere la precedenza su `img{display:block}`
   e simili, altrimenti gli elementi nascosti resterebbero visibili */
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; color: inherit; background: none; border: none; }
input, textarea { font: inherit; }
ul, ol { list-style: none; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 400; line-height: 1.1; color: var(--ink-900); }
strong { font-weight: 700; color: var(--ink-900); }

body.modal-open, body.nav-open { overflow: hidden; }

/* ------------------------------------------------------- A11y helpers */
.skip-link {
  position: fixed; top: -60px; left: 16px; z-index: 2000;
  background: var(--ink-900); color: #fff; padding: 12px 18px;
  border-radius: var(--r-sm); font-weight: 600; transition: top .25s var(--ease);
}
.skip-link:focus { top: 14px; }

:focus-visible {
  outline: 3px solid var(--azure-500);
  outline-offset: 2px;
  border-radius: 4px;
}

/* -------------------------------------------------- Scroll progress bar */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 1200;
  background: transparent; pointer-events: none;
}
.scroll-progress span {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--azure-400), var(--azure-600), var(--gold));
}

/* --------------------------------------------------------- Layout base */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: clamp(20px, 5vw, 48px); }
.section { padding-block: clamp(72px, 11vw, 130px); position: relative; }
/* le sezioni alternate diventano "pannelli" flottanti arrotondati */
.section-alt {
  background: radial-gradient(120% 90% at 85% 0%, var(--azure-50) 0%, var(--mist) 45%);
  margin-inline: clamp(10px, 2vw, 26px);
  border-radius: clamp(26px, 4vw, 56px);
  border: 1px solid var(--line);
}
main section[id] { scroll-margin-top: var(--nav-h); }

/* --------------------------------------------------------- Reveal anim
   Lo stato "nascosto" è attivo solo quando il JS è presente (html.js):
   senza JS o se l'osservatore non parte, i contenuti restano visibili. */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.in-view { opacity: 1; transform: none; }

/* =========================================================================
   HEADER / NAV
   ========================================================================= */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1100;
  height: var(--nav-h);
  display: flex; align-items: center;
  transition: background .35s var(--ease), box-shadow .35s var(--ease), backdrop-filter .35s var(--ease);
}
.site-header.is-scrolled {
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  box-shadow: 0 1px 0 var(--line), var(--sh-sm);
}
.nav-inner {
  width: 100%; max-width: var(--container); margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 48px);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; font-family: var(--font-display); font-size: 1.4rem; color: var(--ink-900); perspective: 420px; }
.brand img { filter: drop-shadow(0 4px 10px rgba(43, 139, 196, .28)); transition: transform .75s var(--ease); }
/* il cubo fluttua dolcemente da fermo… */
.brand-mark { animation: brandFloat 5.5s ease-in-out infinite; }
@keyframes brandFloat {
  0%, 100% { translate: 0 0; rotate: 0deg; }
  50%      { translate: 0 -3px; rotate: -5deg; }
}
/* …e all'hover fa un giro completo su se stesso */
.brand:hover img { transform: rotateY(360deg) scale(1.1); }
.brand-text { letter-spacing: .3px; transition: color .35s var(--ease); }
.brand:hover .brand-text { color: var(--azure-700); }
.brand-dot { display: inline-block; color: var(--azure-500); transition: color .35s var(--ease); }
.brand:hover .brand-dot { color: var(--gold); animation: dotBounce .55s var(--ease); }
@keyframes dotBounce {
  0%   { translate: 0 0; scale: 1; }
  35%  { translate: 0 -8px; scale: 1.35; }
  70%  { translate: 0 2px; scale: .95; }
  100% { translate: 0 0; scale: 1; }
}

.nav-links { display: flex; align-items: center; gap: clamp(4px, 1.4vw, 22px); }
.nav-link {
  position: relative; font-weight: 600; font-size: .96rem; color: var(--ink-700);
  padding: 8px 4px; transition: color .25s var(--ease);
}
.nav-link::after {
  content: ""; position: absolute; left: 4px; right: 4px; bottom: 2px; height: 2px;
  background: linear-gradient(90deg, var(--azure-500), var(--gold));
  transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease); border-radius: 2px;
}
.nav-link:hover { color: var(--azure-700); }
.nav-link:hover::after, .nav-link.is-active::after { transform: scaleX(1); }
.nav-link.is-active { color: var(--azure-700); }

.nav-cta {
  background: linear-gradient(135deg, var(--btn-1), var(--btn-2));
  color: #fff !important; padding: 9px 18px; border-radius: var(--r-pill);
  box-shadow: 0 8px 20px rgba(26, 118, 171, .28);
}
.nav-cta::after { display: none; }
.nav-cta:hover { transform: translateY(-1px); filter: brightness(1.06); }

.nav-toggle { display: none; width: 46px; height: 46px; border-radius: var(--r-sm); position: relative; }
.nav-toggle span {
  position: absolute; left: 11px; right: 11px; height: 2.4px; background: var(--ink-900); border-radius: 2px;
  transition: transform .3s var(--ease), opacity .2s var(--ease);
}
.nav-toggle span:nth-child(1) { top: 16px; }
.nav-toggle span:nth-child(2) { top: 22px; }
.nav-toggle span:nth-child(3) { top: 28px; }
.nav-toggle.is-open span:nth-child(1) { top: 22px; transform: rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { top: 22px; transform: rotate(-45deg); }

/* =========================================================================
   BUTTONS
   ========================================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-weight: 700; font-size: 1rem; padding: 14px 26px; border-radius: var(--r-pill);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), background-position .5s var(--ease), color .3s var(--ease);
  position: relative; overflow: hidden;
}
.btn svg { transition: transform .3s var(--ease); }
.btn-primary {
  color: #fff;
  background: linear-gradient(120deg, var(--btn-1), var(--btn-2), var(--btn-1));
  background-size: 200% 100%;
  box-shadow: var(--sh-azure);
}
.btn-primary:hover { transform: translateY(-3px); background-position: 100% 0; box-shadow: 0 26px 54px rgba(26, 118, 171, .38); }
.btn-primary:hover svg { transform: translateX(4px); }
/* lampo di luce che attraversa il pulsante all'hover */
.btn-primary::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.4) 50%, transparent 60%);
  transform: translateX(-130%); transition: transform .6s ease;
}
.btn-primary:hover::after { transform: translateX(130%); }
.btn-ghost {
  color: var(--azure-700); background: var(--paper);
  border: 1.5px solid var(--azure-200); box-shadow: var(--sh-sm);
}
.btn-ghost:hover { transform: translateY(-3px); border-color: var(--azure-400); box-shadow: var(--sh-md); background: var(--azure-50); }
.btn-block { width: 100%; }

/* =========================================================================
   HERO
   ========================================================================= */
.hero {
  min-height: 100svh; display: flex; align-items: center;
  padding-top: calc(var(--nav-h) + 26px); padding-bottom: 60px;
  background: radial-gradient(120% 120% at 80% 0%, var(--azure-50) 0%, #fff 55%);
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; animation: float 16s var(--ease) infinite; }
.blob-1 { width: 460px; height: 460px; background: radial-gradient(circle, var(--azure-300), transparent 70%); top: -120px; right: -60px; }
.blob-2 { width: 380px; height: 380px; background: radial-gradient(circle, var(--gold-soft), transparent 70%); bottom: -120px; left: -80px; opacity: .4; animation-delay: -5s; }
.blob-3 { width: 320px; height: 320px; background: radial-gradient(circle, var(--azure-200), transparent 70%); top: 40%; left: 45%; animation-delay: -9s; }
.grid-overlay {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 54px 54px; opacity: .4;
  -webkit-mask-image: radial-gradient(circle at 50% 40%, #000, transparent 72%);
  mask-image: radial-gradient(circle at 50% 40%, #000, transparent 72%);
}
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(24px, -30px) scale(1.06); }
  66% { transform: translate(-20px, 18px) scale(.96); }
}

.hero-grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: clamp(24px, 5vw, 70px);
}
.eyebrow {
  display: inline-block; text-transform: uppercase; letter-spacing: 3px; font-size: .78rem; font-weight: 700;
  color: var(--azure-700); background: var(--azure-100); padding: 7px 16px; border-radius: var(--r-pill);
}
.hero-title {
  font-size: clamp(4.4rem, 13vw, 9rem); line-height: .92; margin-top: 20px; letter-spacing: -1px;
  background: linear-gradient(120deg, var(--ink-900) 15%, var(--azure-600) 45%, var(--gold) 65%, var(--ink-900) 85%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: heroShimmer 7s ease-in-out infinite alternate;
}
@keyframes heroShimmer { from { background-position: 0% 0; } to { background-position: 100% 0; } }
.hero-roles {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px;
  font-family: var(--font-display); font-style: italic; font-size: clamp(1.05rem, 2.4vw, 1.5rem); color: var(--ink-700);
}
.hero-roles i { color: var(--gold); font-style: normal; }
.hero-desc { margin-top: 20px; max-width: 40ch; font-size: 1.08rem; color: var(--ink-500); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 32px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: clamp(20px, 4vw, 42px); margin-top: 46px; }
.hero-stats li { display: flex; flex-direction: column; }
.hero-stats strong { font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.6rem); color: var(--azure-700); line-height: 1; }
.hero-stats span { font-size: .82rem; color: var(--ink-500); margin-top: 6px; text-transform: uppercase; letter-spacing: .8px; font-weight: 600; }

/* Skin stage */
.hero-visual { position: relative; display: flex; flex-direction: column; align-items: center; }
.skin-stage {
  position: relative; width: 100%; max-width: 420px; aspect-ratio: 3 / 4;
  display: flex; align-items: center; justify-content: center;
}
.skin-glow {
  position: absolute; width: 78%; height: 78%; border-radius: 50%;
  background: radial-gradient(circle, rgba(63, 165, 221, .38), transparent 68%);
  filter: blur(10px); animation: pulse 6s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: .85; } 50% { transform: scale(1.08); opacity: 1; } }
#skinCanvas { position: relative; z-index: 2; cursor: grab; touch-action: none; max-width: 100%; }
#skinCanvas:active { cursor: grabbing; }
#skinFallback { position: relative; z-index: 2; filter: drop-shadow(0 30px 40px rgba(24, 64, 94, .25)); animation: bob 5s ease-in-out infinite; }
.skin-stage.is-static #skinFallback { animation: bob 5s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
.skin-pedestal {
  position: absolute; bottom: 4%; left: 50%; transform: translateX(-50%);
  width: 62%; height: 26px; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(43, 139, 196, .30), transparent 70%);
  z-index: 1; filter: blur(3px);
}
/* Nametag con il nick, ben visibile sopra la skin — nello stile del sito */
.skin-nametag {
  position: absolute; top: 0; left: 50%; translate: -50% 0; z-index: 3;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--paper); border: 1.5px solid var(--azure-300);
  color: var(--azure-700); font-weight: 800; font-size: 1.02rem;
  letter-spacing: .4px; white-space: nowrap;
  padding: 9px 19px; border-radius: var(--r-pill);
  box-shadow: var(--sh-md);
  animation: bob 6s ease-in-out infinite;
}
.skin-nametag svg { width: 14px; height: 14px; color: var(--gold); flex-shrink: 0; }
.skin-nametag::after { /* codina verso la testa, come il fumetto della mascotte */
  content: ""; position: absolute; bottom: -5.5px; left: 50%; translate: -50% 0;
  width: 10px; height: 10px; background: var(--paper); rotate: 45deg;
  border-right: 1.5px solid var(--azure-300); border-bottom: 1.5px solid var(--azure-300);
}
.skin-hint { margin-top: 10px; font-size: .82rem; color: var(--ink-500); }

/* Scroll cue */
.scroll-cue {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--ink-500);
  font-size: .74rem; text-transform: uppercase; letter-spacing: 2px; font-weight: 600;
}
.mouse { width: 24px; height: 38px; border: 2px solid var(--azure-400); border-radius: 14px; position: relative; }
.mouse span { position: absolute; top: 7px; left: 50%; width: 4px; height: 7px; margin-left: -2px; background: var(--azure-500); border-radius: 2px; animation: wheel 1.6s infinite; }
@keyframes wheel { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }

/* =========================================================================
   SECTION HEADINGS
   ========================================================================= */
.section-head { max-width: 720px; margin-bottom: clamp(40px, 6vw, 68px); }
.server-logo {
  height: 74px; width: auto; max-width: 240px; object-fit: contain; margin-bottom: 20px;
  filter: drop-shadow(0 8px 18px rgba(24, 64, 94, .18));
  /* pop elastico in stile videogioco quando ci passi sopra */
  transition: transform .5s cubic-bezier(.34, 1.56, .64, 1), filter .5s var(--ease);
}
.server-logo:hover {
  transform: scale(1.12) rotate(-4deg) translateY(-6px);
  filter: drop-shadow(0 18px 30px rgba(43, 139, 196, .4));
}
.section-eyebrow { text-transform: uppercase; letter-spacing: 3px; font-size: .78rem; font-weight: 700; color: var(--gold-ink); margin-bottom: 14px; }
.section-title { font-size: clamp(2.3rem, 5.2vw, 3.8rem); letter-spacing: -.5px; }
/* sottolineatura che si "disegna" quando la sezione entra in vista */
.section-title::after {
  content: ""; display: block; width: 92px; height: 4px; margin-top: 18px; border-radius: 4px;
  background: linear-gradient(90deg, var(--azure-500), var(--gold));
  transform: scaleX(0); transform-origin: left;
  transition: transform .9s var(--ease) .3s;
}
.section-head.in-view .section-title::after { transform: scaleX(1); }
.no-js .section-title::after, html:not(.js) .section-title::after { transform: scaleX(1); }
.section-sub { margin-top: 16px; font-size: 1.1rem; color: var(--ink-500); }

/* Prose */
.prose h3 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 14px; position: relative; padding-left: 18px; }
.prose h3::before { content: ""; position: absolute; left: 0; top: .18em; bottom: .18em; width: 4px; border-radius: 3px; background: linear-gradient(var(--azure-400), var(--gold)); }
.prose p { color: var(--ink-500); margin-bottom: 15px; font-size: 1.03rem; }
.prose p:last-child { margin-bottom: 0; }
.prose em { color: var(--azure-700); font-style: italic; }
.mini-title { font-size: clamp(1.3rem, 2.6vw, 1.7rem); margin-bottom: 22px; }

/* =========================================================================
   CHI SONO
   ========================================================================= */
.about-grid { display: grid; grid-template-columns: 340px 1fr; gap: clamp(30px, 5vw, 64px); align-items: start; }
.about-portrait { position: sticky; top: calc(var(--nav-h) + 20px); }
.portrait-frame {
  position: relative; border-radius: var(--r-lg); padding: 26px 26px 0;
  background: linear-gradient(160deg, var(--azure-100), var(--paper));
  border: 1px solid var(--line); box-shadow: var(--sh-md); overflow: hidden;
}
.portrait-frame::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 20%, rgba(63,165,221,.18), transparent 60%); }
.portrait-frame img { position: relative; margin-inline: auto; filter: drop-shadow(0 24px 30px rgba(24,64,94,.22)); }
.portrait-badge {
  position: relative; margin: 18px -26px 0; padding: 16px 26px; background: var(--ink-900);
  display: flex; flex-direction: column;
}
.portrait-badge strong { font-family: var(--font-display); font-size: 1.3rem; color: #fff; }
.portrait-badge span { font-size: .85rem; color: var(--azure-300); letter-spacing: .5px; }

.feature-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; margin-top: clamp(48px, 7vw, 76px); }
.feature-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 26px 20px; box-shadow: var(--sh-sm); transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
}
.feature-card:hover { transform: translateY(-8px); box-shadow: var(--sh-lg); border-color: var(--azure-200); }
/* icona card: ogni card imposta il proprio colore con --c (fallback azzurro) */
.fc-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 54px; height: 54px; border-radius: 14px; margin-bottom: 16px;
  color: var(--azure-600);
  background: linear-gradient(150deg, var(--azure-100), var(--azure-50));
  box-shadow: inset 0 0 0 1px var(--azure-100);
  /* versione colorata per browser moderni (color-mix) */
  color: var(--c, var(--azure-600));
  background: linear-gradient(150deg, color-mix(in srgb, var(--c, var(--azure-600)) 15%, #fff), color-mix(in srgb, var(--c, var(--azure-600)) 6%, #fff));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c, var(--azure-600)) 20%, #fff);
}
.fc-icon svg { width: 30px; height: 30px; }
.feature-card:hover .fc-icon { filter: brightness(.88) saturate(1.15); }
.feature-card h4 { font-size: 1.2rem; margin-bottom: 8px; }
.feature-card p { font-size: .92rem; color: var(--ink-500); line-height: 1.55; }

.about-journey { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 56px); margin-top: clamp(48px, 7vw, 80px); }

.skills-block {
  margin-top: clamp(40px, 6vw, 64px); padding: clamp(30px, 4.5vw, 54px);
  border-radius: var(--r-lg); background: linear-gradient(140deg, var(--ink-900), #1c3346);
  color: #fff; box-shadow: var(--sh-lg); position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(260px, .9fr) 1.1fr;
  gap: clamp(28px, 4vw, 56px); align-items: center;
}
/* orb luminoso + bagliore periodico che attraversa il pannello */
.skills-block::after { content: ""; position: absolute; top: -40%; right: -10%; width: 420px; height: 420px; background: radial-gradient(circle, rgba(63,165,221,.4), transparent 70%); pointer-events: none; }
.skills-block::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: linear-gradient(115deg, transparent 42%, rgba(255,255,255,.09) 50%, transparent 58%);
  transform: translateX(-130%); animation: panelSweep 6.5s ease-in-out infinite;
}
@keyframes panelSweep { 0%, 55% { transform: translateX(-130%); } 78%, 100% { transform: translateX(130%); } }
.skills-head { position: relative; }
.skills-kicker { text-transform: uppercase; letter-spacing: 3px; font-size: .76rem; font-weight: 700; color: var(--gold-soft); margin-bottom: 12px; }
.skills-title { color: #fff; font-size: clamp(1.7rem, 3.2vw, 2.4rem); }
.skills-lead { color: var(--azure-200); margin-top: 14px; max-width: 42ch; }
.skills-count { margin-top: 22px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.14); color: #9fc6de; font-size: .95rem; }
.skills-count strong { color: var(--gold-soft); font-family: var(--font-display); font-size: 1.35rem; }
.skill-tags { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; position: relative; }
.skill-tags li {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-radius: var(--r-md); font-weight: 600; font-size: .96rem;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.15); color: #eaf5fc;
  transition: background .3s var(--ease), transform .3s var(--ease), border-color .3s var(--ease);
}
.skill-tags li svg { width: 15px; height: 15px; color: var(--gold-soft); flex-shrink: 0; }
.skill-tags li:hover { background: rgba(63,165,221,.24); border-color: var(--azure-400); transform: translateX(6px); }

/* =========================================================================
   SERVER SECTIONS (Atlantis / Zero)
   ========================================================================= */
.server-intro { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(28px, 5vw, 56px); align-items: start; }
.stat-strip { display: grid; gap: 14px; }
.stat-strip li {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 20px 24px; box-shadow: var(--sh-sm); display: flex; align-items: baseline; gap: 14px;
}
.stat-strip strong { font-family: var(--font-display); font-size: 2rem; color: var(--azure-700); line-height: 1; }
.stat-strip span { color: var(--ink-500); font-weight: 600; font-size: .95rem; }

/* Timeline */
.timeline { margin-top: clamp(48px, 7vw, 76px); }
.timeline-title { font-size: clamp(1.4rem, 3vw, 1.9rem); margin-bottom: 30px; }
.tl-list { position: relative; padding-left: 34px; }
.tl-list::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--azure-300), var(--gold-soft)); }
.tl-item { position: relative; padding-bottom: 34px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot { position: absolute; left: -34px; top: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--paper); border: 3px solid var(--azure-500); box-shadow: 0 0 0 5px var(--azure-100); animation: dotPulse 3.2s ease-in-out infinite; }
.tl-item:nth-child(2) .tl-dot { animation-delay: .8s; }
.tl-item:nth-child(3) .tl-dot { animation-delay: 1.6s; }
.tl-item:nth-child(4) .tl-dot { animation-delay: 2.4s; }
@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 0 5px var(--azure-100); }
  50%      { box-shadow: 0 0 0 11px rgba(63, 165, 221, .18); }
}
.tl-body { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); padding: 22px 26px; box-shadow: var(--sh-sm); transition: transform .3s var(--ease), box-shadow .3s var(--ease); display: flex; gap: 20px; align-items: flex-start; }
.tl-body:hover { transform: translateX(5px); box-shadow: var(--sh-md); }
/* medaglione illustrato della tappa (colore per-tappa con --c) */
.tl-fig {
  flex-shrink: 0; width: 62px; height: 62px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  color: var(--azure-600);
  background: linear-gradient(150deg, var(--azure-100), var(--azure-50));
  box-shadow: inset 0 0 0 1px var(--azure-100);
  color: var(--c, var(--azure-600));
  background: linear-gradient(150deg, color-mix(in srgb, var(--c, var(--azure-600)) 15%, #fff), color-mix(in srgb, var(--c, var(--azure-600)) 6%, #fff));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c, var(--azure-600)) 20%, #fff);
  transition: rotate .35s var(--ease), scale .35s var(--ease);
}
.tl-fig svg { width: 36px; height: 36px; }
.tl-body:hover .tl-fig { rotate: -5deg; scale: 1.08; }
.tl-content { flex: 1; min-width: 0; }
.tl-date { display: inline-block; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--gold-ink); margin-bottom: 8px; }
.tl-body h4 { font-size: 1.3rem; margin-bottom: 8px; }
.tl-body p { color: var(--ink-500); font-size: 1rem; }
.role-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.role-badges span { padding: 7px 14px; border-radius: var(--r-pill); background: var(--azure-50); border: 1px solid var(--azure-200); color: var(--azure-700); font-weight: 600; font-size: .85rem; }

/* CTA verso il portfolio (sezioni server), con linee decorative laterali */
.server-cta { margin-top: clamp(40px, 6vw, 64px); display: flex; justify-content: center; align-items: center; gap: 22px; }
.server-cta::before, .server-cta::after { content: ""; height: 1.5px; flex: 1; max-width: 190px; }
.server-cta::before { background: linear-gradient(90deg, transparent, var(--azure-300)); }
.server-cta::after { background: linear-gradient(90deg, var(--azure-300), transparent); }

/* Character card */
.character-card {
  margin-top: clamp(48px, 7vw, 76px); display: grid; grid-template-columns: auto 1fr; gap: 26px;
  padding: clamp(28px, 4vw, 44px); border-radius: var(--r-lg);
  background: linear-gradient(140deg, var(--azure-50), var(--paper)); border: 1px solid var(--azure-100); box-shadow: var(--sh-md); position: relative; overflow: hidden;
}
.character-mark { color: var(--gold); line-height: 0; }
.character-mark svg { width: 34px; height: 34px; }
.character-kicker { text-transform: uppercase; letter-spacing: 2px; font-size: .76rem; font-weight: 700; color: var(--azure-700); margin-bottom: 6px; }
.character-card h3 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-bottom: 14px; }
.character-card p { color: var(--ink-500); margin-bottom: 12px; }
.character-card p:last-child { margin-bottom: 0; }

/* Focus cards (Zero) */
.focus-cards { display: grid; gap: 16px; }
.focus-cards li { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); padding: 22px 24px; box-shadow: var(--sh-sm); transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.focus-cards li:hover { transform: translateY(-5px); box-shadow: var(--sh-md); }
.focus-cards h4 { font-size: 1.2rem; margin: 6px 0 6px; }
.focus-cards p { color: var(--ink-500); font-size: .95rem; }

/* =========================================================================
   PORTFOLIO
   ========================================================================= */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 40px; }
.filter-btn {
  padding: 10px 20px; border-radius: var(--r-pill); font-weight: 600; font-size: .92rem;
  background: var(--paper); border: 1.5px solid var(--line); color: var(--ink-500);
  transition: all .28s var(--ease);
}
.filter-btn:hover { border-color: var(--azure-300); color: var(--azure-700); transform: translateY(-2px); }
.filter-btn.is-active { background: linear-gradient(135deg, var(--btn-1), var(--btn-2)); color: #fff; border-color: transparent; box-shadow: 0 10px 22px rgba(26,118,171,.3); }

.portfolio-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.p-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--sh-sm); cursor: pointer; transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .4s var(--ease);
}
.p-card.is-hidden { display: none; }
.p-card:hover { transform: translateY(-10px); box-shadow: var(--sh-lg); border-color: var(--azure-200); }
.p-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
.p-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.p-card:hover .p-media img { transform: scale(1.08); }
.p-badge { position: absolute; top: 14px; left: 14px; z-index: 2; background: rgba(255,255,255,.92); backdrop-filter: blur(4px); color: var(--azure-700); font-weight: 700; font-size: .76rem; text-transform: uppercase; letter-spacing: .6px; padding: 6px 13px; border-radius: var(--r-pill); box-shadow: var(--sh-sm); }
.p-open {
  position: absolute; right: 14px; bottom: 14px; z-index: 2; display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, var(--btn-1), var(--btn-2)); color: #fff; font-weight: 700; font-size: .82rem;
  padding: 9px 15px; border-radius: var(--r-pill); opacity: 0; transform: translateY(10px); transition: opacity .35s var(--ease), transform .35s var(--ease); box-shadow: var(--sh-md);
}
.p-card:hover .p-open, .p-open:focus-visible { opacity: 1; transform: none; }
.p-info { padding: 20px 22px 24px; }
.p-info h3 { font-size: 1.32rem; margin-bottom: 4px; }
.p-info p { color: var(--ink-500); font-size: .92rem; font-weight: 600; }

/* bottone "Mostra tutti / Mostra meno" sotto la griglia */
.grid-more { margin-top: clamp(30px, 4vw, 44px); display: flex; justify-content: center; align-items: center; gap: 22px; }
.grid-more::before, .grid-more::after { content: ""; height: 1.5px; flex: 1; max-width: 190px; }
.grid-more::before { background: linear-gradient(90deg, transparent, var(--azure-300)); }
.grid-more::after { background: linear-gradient(90deg, var(--azure-300), transparent); }
.grid-more .btn svg { transition: rotate .35s var(--ease); }
.grid-more .btn[aria-expanded="true"] svg { rotate: 180deg; }

.empty-state { text-align: center; padding: 56px 20px; color: var(--ink-500); font-size: 1.05rem; background: var(--paper); border: 1.5px dashed var(--azure-200); border-radius: var(--r-lg); }

/* =========================================================================
   SKIN — galleria compatta di personaggi
   ========================================================================= */
.skins-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 16px; }
.skin-card {
  position: relative; aspect-ratio: 3 / 4; overflow: hidden;
  border-radius: var(--r-md); border: 1px solid var(--line);
  background: linear-gradient(165deg, var(--azure-50) 0%, #fff 60%);
  box-shadow: var(--sh-sm); cursor: zoom-in; padding: 0;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
}
.skin-card.is-hidden { display: none; }
/* piedistallo luminoso sotto il personaggio */
.skin-card::after {
  content: ""; position: absolute; left: 50%; bottom: 8%; translate: -50% 0; z-index: 0;
  width: 62%; height: 16px; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(43, 139, 196, .28), transparent 70%);
  filter: blur(2px); opacity: 0; transition: opacity .35s var(--ease);
}
.skin-card img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; padding: 14px 10px 10px; transition: transform .4s var(--ease); }
.skin-card:hover, .skin-card:focus-visible { transform: translateY(-7px); box-shadow: var(--sh-lg); border-color: var(--azure-200); }
.skin-card:hover img, .skin-card:focus-visible img { transform: scale(1.07); }
.skin-card:hover::after, .skin-card:focus-visible::after { opacity: 1; }
.empty-state code { background: var(--azure-50); padding: 2px 8px; border-radius: 6px; color: var(--azure-700); font-weight: 600; }
.empty-state .es-spark { width: 15px; height: 15px; vertical-align: -2px; color: var(--gold); }

/* =========================================================================
   CONTATTI
   ========================================================================= */
.contact-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(28px, 5vw, 56px); align-items: start; }
.contact-channels { display: grid; gap: 14px; }
.channel-card {
  display: flex; align-items: center; gap: 16px; padding: 18px 22px; border-radius: var(--r-md);
  background: var(--paper); border: 1px solid var(--line); box-shadow: var(--sh-sm);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.channel-card:hover { transform: translateY(-4px); box-shadow: var(--sh-md); border-color: var(--azure-200); }
.channel-ic { width: 48px; height: 48px; border-radius: 13px; display: flex; align-items: center; justify-content: center; color: var(--c); background: color-mix(in srgb, var(--c) 14%, #fff); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 24%, #fff); }
.channel-ic svg { width: 24px; height: 24px; }
.channel-meta { display: flex; flex-direction: column; flex: 1; }
.channel-meta strong { font-family: var(--font-body); font-size: 1.02rem; }
.channel-meta span { color: var(--ink-500); font-size: .9rem; }
.channel-copy { font-size: .82rem; font-weight: 700; color: var(--azure-700); background: var(--azure-50); padding: 6px 12px; border-radius: var(--r-pill); }
.channel-card.copied .channel-copy { background: #e2f6ea; color: #2e8b57; }
.channel-card.copy-fail .channel-copy { background: #fdeaea; color: #b03a3a; }

/* campo honeypot anti-spam: fuori dallo schermo e fuori dal tab order */
.hp-field { position: absolute; left: -9999px; top: 0; width: 1px; height: 1px; overflow: hidden; }
/* bordo "vivo": gradiente conico che ruota lentamente attorno al form */
@property --ang { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.contact-form {
  border: 3px solid transparent; border-radius: var(--r-lg);
  background:
    linear-gradient(var(--paper), var(--paper)) padding-box,
    conic-gradient(from var(--ang, 0deg), var(--azure-300), var(--gold), var(--azure-500), var(--azure-200), var(--azure-300)) border-box;
  padding: clamp(26px, 4vw, 40px); box-shadow: var(--sh-md);
  animation: borderSpin 7s linear infinite;
}
@keyframes borderSpin { to { --ang: 360deg; } }
.field { margin-bottom: 20px; }
.field label { display: block; font-weight: 600; font-size: .92rem; color: var(--ink-700); margin-bottom: 8px; }
.field input, .field textarea {
  width: 100%; padding: 14px 16px; border-radius: var(--r-sm); border: 1.5px solid var(--line);
  background: var(--mist); color: var(--ink-900); transition: border-color .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease); resize: vertical;
}
.field input::placeholder, .field textarea::placeholder { color: var(--ink-500); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--azure-600); background: #fff; box-shadow: 0 0 0 4px var(--azure-100); }
/* indicatore di focus visibile e con contrasto sufficiente da tastiera */
.field input:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--azure-700); outline-offset: 2px; }
.field input.has-error, .field textarea.has-error { border-color: var(--cape); background: #fdf3f3; }
.field-error { display: block; color: var(--cape); font-size: .82rem; font-weight: 600; margin-top: 6px; min-height: 1em; }
.form-note { margin-top: 4px; font-weight: 600; font-size: .95rem; min-height: 1.2em; }
.form-note.is-error { color: var(--cape); }
.form-note.is-ok { color: #2e8b57; }

/* =========================================================================
   FOOTER
   ========================================================================= */
.site-footer { background: var(--ink-900); color: #cddbe6; margin-top: 0; }
.footer-inner { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; padding-block: clamp(52px, 7vw, 76px); }
.footer-brand .brand { color: #fff; margin-bottom: 16px; }
.footer-brand p { color: #9fb4c4; max-width: 42ch; font-size: .98rem; }
.footer-links h3, .footer-social h3 { color: #fff; font-family: var(--font-body); font-weight: 700; font-size: .82rem; text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 18px; }
.footer-links { display: flex; flex-direction: column; gap: 11px; }
.footer-links a { color: #9fb4c4; font-weight: 500; width: fit-content; transition: color .25s var(--ease), transform .25s var(--ease); }
.footer-links a:hover { color: var(--azure-300); transform: translateX(4px); }
.social-row { display: flex; gap: 12px; }
.social-btn { width: 46px; height: 46px; border-radius: 13px; display: flex; align-items: center; justify-content: center; color: #c3d4e0; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); transition: transform .3s var(--ease), background .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease); }
.social-btn svg { width: 20px; height: 20px; }
.social-btn:hover { transform: translateY(-4px); background: rgba(63,165,221,.24); border-color: var(--azure-400); color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); }
.footer-bottom-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding-block: 22px; font-size: .88rem; color: #8ba1b2; }

/* To-top */
.to-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 900; width: 50px; height: 50px; border-radius: 50%;
  background: linear-gradient(135deg, var(--btn-1), var(--btn-2)); color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--sh-azure); opacity: 0; transform: translateY(20px) scale(.85); pointer-events: none;
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { transform: translateY(-4px); }

/* =========================================================================
   MODAL (progetto)
   ========================================================================= */
.modal, .lightbox { position: fixed; inset: 0; z-index: 1500; display: flex; align-items: center; justify-content: center; }
.modal[hidden], .lightbox[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(12,26,38,.62); backdrop-filter: blur(4px); opacity: 0; transition: opacity .3s var(--ease); }
.modal.is-open .modal-backdrop { opacity: 1; }
.modal-panel {
  position: relative; z-index: 2; width: min(940px, 94vw); max-height: 92vh; overflow: auto;
  background: var(--paper); border-radius: var(--r-xl); box-shadow: var(--sh-lg);
  display: grid; grid-template-columns: 1.05fr 1fr; transform: translateY(24px) scale(.97); opacity: 0; transition: transform .4s var(--ease), opacity .4s var(--ease);
}
.modal.is-open .modal-panel { transform: none; opacity: 1; }
.modal-close { position: absolute; top: 14px; right: 14px; z-index: 5; width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.9); color: var(--ink-900); display: flex; align-items: center; justify-content: center; box-shadow: var(--sh-sm); transition: transform .25s var(--ease), background .25s var(--ease); }
.modal-close:hover { transform: rotate(90deg); background: #fff; }
.modal-media { position: relative; min-height: 300px; }
.modal-media img { width: 100%; height: 100%; object-fit: cover; }
.modal-cat { position: absolute; left: 18px; bottom: 18px; background: rgba(255,255,255,.92); color: var(--azure-700); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .6px; padding: 7px 14px; border-radius: var(--r-pill); }
.modal-info { padding: clamp(26px, 3vw, 40px); }
.modal-info h3 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-bottom: 12px; }
.modal-desc { color: var(--ink-500); margin-bottom: 22px; }
.modal-specs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; margin-bottom: 22px; }
.modal-specs .spec { border-left: 3px solid var(--azure-200); padding-left: 12px; }
.modal-specs dt { font-size: .72rem; text-transform: uppercase; letter-spacing: 1px; color: var(--ink-500); font-weight: 700; margin-bottom: 3px; }
.modal-specs dd { font-weight: 600; color: var(--ink-900); font-size: .95rem; }
/* pulsante per ingrandire la foto del progetto a schermo intero */
.modal-expand {
  position: absolute; right: 16px; bottom: 16px; z-index: 3;
  width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .92); color: var(--azure-700);
  box-shadow: var(--sh-sm); transition: transform .25s var(--ease), background .25s var(--ease);
}
.modal-expand svg { width: 18px; height: 18px; }
.modal-expand:hover { transform: scale(1.1); background: #fff; }

/* =========================================================================
   LIGHTBOX
   ========================================================================= */
.lightbox { background: rgba(10,22,32,.9); opacity: 0; transition: opacity .3s var(--ease); backdrop-filter: blur(6px); }
.lightbox.is-open { opacity: 1; }
.lb-figure { max-width: 88vw; max-height: 84vh; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.lb-figure img { max-width: 88vw; max-height: 76vh; border-radius: var(--r-md); box-shadow: 0 30px 70px rgba(0,0,0,.5); object-fit: contain; }
.lb-figure figcaption { color: #dce9f2; font-size: .98rem; text-align: center; max-width: 60ch; }
.lb-anim { animation: lbIn .4s var(--ease); }
@keyframes lbIn { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
.lb-close { position: absolute; top: 20px; right: 22px; width: 48px; height: 48px; border-radius: 50%; color: #fff; background: rgba(255,255,255,.12); display: flex; align-items: center; justify-content: center; transition: background .25s var(--ease), transform .25s var(--ease); }
.lb-close:hover { background: rgba(255,255,255,.24); transform: rotate(90deg); }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 56px; height: 56px; border-radius: 50%; color: #fff; background: rgba(255,255,255,.12); display: flex; align-items: center; justify-content: center; transition: background .25s var(--ease); }
.lb-nav:hover { background: rgba(63,165,221,.4); }
.lb-prev { left: 20px; }
.lb-next { right: 20px; }

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 1080px) {
  .feature-cards { grid-template-columns: repeat(3, 1fr); }
  .portfolio-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  :root { --nav-h: 68px; }
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed; inset: var(--nav-h) 0 auto 0; flex-direction: column; align-items: stretch; gap: 4px;
    background: rgba(255,255,255,.97); backdrop-filter: blur(14px); padding: 18px clamp(20px,5vw,48px) 28px;
    box-shadow: var(--sh-md); transform: translateY(-140%); visibility: hidden;
    transition: transform .4s var(--ease), visibility .4s var(--ease); border-bottom: 1px solid var(--line);
    max-height: calc(100vh - var(--nav-h)); overflow-y: auto;
  }
  .nav-links.is-open { transform: none; visibility: visible; }
  .nav-link { padding: 14px 8px; font-size: 1.05rem; border-bottom: 1px solid var(--line); }
  .nav-link::after { display: none; }
  .nav-cta { text-align: center; margin-top: 10px; border-bottom: none; }

  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-copy { order: 2; }
  .hero-visual { order: 1; margin-bottom: 10px; }
  .eyebrow, .hero-roles, .hero-actions, .hero-stats { justify-content: center; }
  .hero-roles { justify-content: center; }
  .hero-desc { margin-inline: auto; }
  .hero-stats { justify-content: center; }
  .skin-stage { max-width: 320px; }

  .about-grid { grid-template-columns: 1fr; }
  .about-portrait { position: static; max-width: 340px; margin-inline: auto; }
  .about-journey { grid-template-columns: 1fr; }
  .skills-block { grid-template-columns: 1fr; }
  .server-intro { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: repeat(3, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
  .modal-panel { grid-template-columns: 1fr; }
  .modal-media { min-height: 220px; max-height: 300px; }
}
@media (max-width: 680px) {
  .feature-cards { grid-template-columns: 1fr 1fr; }
  .portfolio-grid { grid-template-columns: 1fr; }
  .skill-tags { grid-template-columns: 1fr; }
  .tl-body { gap: 14px; }
  .tl-fig { width: 50px; height: 50px; border-radius: 13px; }
  .tl-fig svg { width: 28px; height: 28px; }
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
  .stat-strip { grid-template-columns: 1fr; }
  .modal-specs { grid-template-columns: 1fr; }
  .hero-stats { gap: 22px; }
  .lb-nav { width: 44px; height: 44px; }
  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }
}
@media (max-width: 440px) {
  .feature-cards { grid-template-columns: 1fr; }
  .hero-title { font-size: clamp(3.6rem, 20vw, 5rem); }
  .skin-nametag { font-size: .95rem; padding: 8px 16px; }
}

/* --------------------------------------------------- Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .blob, .skin-glow, #skinFallback, .mouse span { animation: none !important; }
}

/* =========================================================================
   V2 — MASCOTTE 3D, MARQUEE, PARTICELLE & MICRO-EFFETTI
   ========================================================================= */

/* ---- Dock della skin (mascotte fissa in basso a sinistra) ---- */
.skin-dock {
  position: fixed; left: 16px; bottom: 12px; z-index: 940; width: 156px;
  padding-top: 34px; /* spazio per il fumetto sopra la testa */
  pointer-events: none; opacity: 0; transform: translateY(30px) scale(.85);
  transition: opacity .45s var(--ease), transform .45s var(--ease);
}
.skin-dock.is-on { opacity: 1; transform: none; }
.dock-slot { position: relative; pointer-events: auto; cursor: grab; }
.dock-slot:active { cursor: grabbing; }
.dock-slot canvas { display: block; margin-inline: auto; position: relative; z-index: 1; filter: drop-shadow(0 12px 14px rgba(24, 64, 94, .28)); }
/* disco luminoso sotto i piedi */
.dock-slot::after {
  content: ""; position: absolute; bottom: 2px; left: 50%; translate: -50% 0;
  width: 104px; height: 22px; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(63, 165, 221, .4), transparent 68%);
  filter: blur(3px);
}
.dock-bubble {
  position: absolute; left: 50%; top: 0; translate: -50% 0; z-index: 2; white-space: nowrap;
  background: var(--paper); border: 1.5px solid var(--azure-300); color: var(--azure-700);
  font-weight: 700; font-size: .8rem; padding: 6px 13px; border-radius: var(--r-pill);
  box-shadow: var(--sh-md);
}
.dock-bubble::after { /* codina del fumetto */
  content: ""; position: absolute; bottom: -5px; left: 50%; translate: -50% 0;
  width: 9px; height: 9px; background: var(--paper); rotate: 45deg;
  border-right: 1.5px solid var(--azure-300); border-bottom: 1.5px solid var(--azure-300);
}
.dock-bubble.pop { animation: bubblePop .5s var(--ease); }
@keyframes bubblePop {
  0% { transform: scale(.6) translateY(8px); opacity: 0; }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}
/* saltello felice quando accarezzi la mascotte */
.dock-slot.hop canvas { animation: dockHop .9s var(--ease); }
@keyframes dockHop {
  0%, 100% { translate: 0 0; }
  22%      { translate: 0 -16px; }
  42%      { translate: 0 0; }
  60%      { translate: 0 -9px; }
  78%      { translate: 0 0; }
}
/* cuoricini e scintille che salgono dalla testa */
.dock-pop {
  position: absolute; left: 50%; top: 30px; z-index: 4; pointer-events: none;
  opacity: 0; animation: popFloat 1.15s ease-out forwards;
}
.dock-pop svg { width: 15px; height: 15px; filter: drop-shadow(0 2px 5px rgba(24, 64, 94, .25)); }
@keyframes popFloat {
  0%   { opacity: 0; translate: var(--dx, 0) 6px; scale: .35; rotate: -12deg; }
  22%  { opacity: 1; }
  100% { opacity: 0; translate: var(--dx, 0) -52px; scale: 1.15; rotate: 10deg; }
}
.skin-stage.is-empty .skin-glow, .skin-stage.is-empty .skin-pedestal, .skin-stage.is-empty .skin-nametag { opacity: 0; transition: opacity .4s var(--ease); }
@media (max-width: 679px) { .skin-dock { display: none; } }

/* ---- Marquee (striscia scorrevole sotto l'hero) ---- */
.marquee { overflow: hidden; background: var(--paper); border-block: 1px solid var(--line); padding: 16px 0; }
.marquee-track { display: flex; width: max-content; animation: marqueeSlide 30s linear infinite; }
.mq-item {
  display: inline-flex; align-items: center; gap: 14px; padding-inline: 26px;
  font-family: var(--font-display); font-style: italic; font-size: 1.15rem; color: var(--ink-500); white-space: nowrap;
}
.mq-item svg { width: 13px; height: 13px; color: var(--gold); flex-shrink: 0; }
@keyframes marqueeSlide { to { transform: translateX(-50%); } }
.marquee:hover .marquee-track { animation-play-state: paused; }

/* ---- Particelle (decorative, spente con prefers-reduced-motion) ---- */
.fx { position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; border-radius: inherit; }
.fx-host .container { position: relative; z-index: 1; }
.voxel {
  position: absolute; bottom: -20px; border-radius: 3px;
  background: linear-gradient(150deg, var(--azure-300), var(--azure-500));
  box-shadow: 0 0 14px rgba(63, 165, 221, .5);
  opacity: 0; animation: floatUp linear infinite;
}
.bubble {
  position: absolute; bottom: -60px; border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, rgba(255,255,255,1) 8%, rgba(159,212,240,.55) 45%, rgba(63,165,221,.35));
  border: 2px solid rgba(43,139,196,.55);
  box-shadow: inset -4px -5px 10px rgba(43,139,196,.3), 0 0 16px rgba(63,165,221,.35);
  opacity: 0; animation: floatUp linear infinite;
}
.pixel { position: absolute; bottom: -30px; border-radius: 2.5px; opacity: 0; animation: pixelUp linear infinite; box-shadow: 0 0 12px currentColor; }
@keyframes floatUp {
  0%   { opacity: 0; transform: translate(0, 0); }
  10%  { opacity: .95; }
  90%  { opacity: .5; }
  100% { opacity: 0; transform: translate(var(--sway, 14px), var(--rise, -106vh)); }
}
@keyframes pixelUp {
  0%   { opacity: 0; transform: translateY(0) rotate(0deg); }
  12%  { opacity: 1; }
  88%  { opacity: .55; }
  100% { opacity: 0; transform: translateY(var(--rise, -104vh)) rotate(260deg); }
}

/* scintille (stelle a 4 punte che brillano sul posto) */
.sparkle {
  position: absolute; opacity: 0;
  clip-path: polygon(50% 0%, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0% 50%, 38% 38%);
  animation: twinkle ease-in-out infinite;
}
.sparkle.gold { background: linear-gradient(160deg, #f4e3b5, var(--gold)); filter: drop-shadow(0 0 6px rgba(203, 162, 90, .8)); }
.sparkle.azure { background: linear-gradient(160deg, #cfeafd, var(--azure-500)); filter: drop-shadow(0 0 6px rgba(63, 165, 221, .8)); }
@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(.35) rotate(0deg); }
  50%      { opacity: 1;  transform: scale(1.15) rotate(24deg); }
}

/* orbs morbidi in movimento (Portfolio) */
.orb { position: absolute; border-radius: 50%; filter: blur(46px); animation: orbFloat ease-in-out infinite alternate; }
@keyframes orbFloat { from { transform: translate(0, 0) scale(1); } to { transform: translate(50px, -60px) scale(1.12); } }

/* ---- Spotlight sul portfolio (alone che segue il cursore) ---- */
.portfolio-grid { position: relative; }
.portfolio-grid::after {
  content: ""; position: absolute; inset: -24px; z-index: 2; pointer-events: none;
  background: radial-gradient(360px circle at var(--mx, -500px) var(--my, -500px), rgba(63, 165, 221, .13), transparent 62%);
  opacity: 0; transition: opacity .35s var(--ease); border-radius: var(--r-lg);
}
.portfolio-grid:hover::after { opacity: 1; }

/* ---- Ritocchi hero ---- */
.scroll-cue { transition: opacity .2s linear; }

/* Print niceties */
@media print {
  .site-header, .to-top, .scroll-cue, .nav-toggle, .filter-bar, .skin-dock, .marquee { display: none !important; }
}
