/* ============================================================
   Tokens — CRT dark / phosphor light
   ============================================================ */
[data-theme="dark"] {
  --bg:            #0a0a12;
  --bg-elevated:   #10101c;
  --surface:       #161624;
  --surface-2:     #1e1e30;
  --line:          #2c2c46;
  --line-strong:   #45456b;
  --text:          #eaeaf7;
  --text-dim:      #b4b4d4;   /* AA su tutte le superfici scure */
  --text-faint:    #9a9ac2;
  --acc:           #7ee787;
  --acc-2:         #4ec9f5;
  --acc-3:         #f5c451;
  --acc-err:       #ff8a99;
  --shadow:        #05050b;
  --btn-fg:        #0a0a12;
  --btn-bg:        #7ee787;
  --scan:          rgba(0,0,0,.55);
  --scan-op:       .34;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg:            #dcdce8;
  --bg-elevated:   #eaeaf3;
  --surface:       #f7f7fc;
  --surface-2:     #ffffff;
  --line:          #a9a9c4;
  --line-strong:   #6d6d92;
  --text:          #14141f;
  --text-dim:      #3d3d55;
  --text-faint:    #54546f;   /* AA su tutte le superfici chiare */
  /* verificati a 8px sul fondo peggiore (--bg #dcdce8): tutti sopra 4.5:1 */
  --acc:           #126536;
  --acc-2:         #15619e;
  --acc-3:         #84590c;
  --acc-err:       #a8112a;
  --shadow:        #9c9cb8;
  --btn-fg:        #f7f7fc;
  --btn-bg:        #14141f;
  --scan:          rgba(20,20,40,.5);
  --scan-op:       .14;
  color-scheme: light;
}

*,*::before,*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .3s steps(4), color .3s steps(4);
}
::selection { background: var(--acc); color: var(--bg); }
:focus-visible { outline: 3px solid var(--acc); outline-offset: 3px; }

h1,h2,h3,p,figure,ul,ol { margin: 0; }
ul,ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

/* the pixel typeface only reads crisply at multiples of its em grid */
.px { font-family: "Press Start 2P", "Courier New", monospace; font-weight: 400; line-height: 1.5; }

.wrap { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: clamp(16px, 4.5vw, 48px); }

/* CRT overlay ------------------------------------------------- */
.crt {
  position: fixed; inset: 0; z-index: 300; pointer-events: none;
  background: repeating-linear-gradient(to bottom, var(--scan) 0 1px, transparent 1px 3px);
  opacity: var(--scan-op);
}
.crt::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 100% at 50% 50%, transparent 58%, var(--shadow) 100%);
  opacity: .5;
}

/* Chunky pixel frame ------------------------------------------ */
.frame {
  background: var(--surface);
  border: 3px solid var(--line-strong);
  box-shadow: 0 0 0 3px var(--bg), 6px 6px 0 0 var(--shadow);
  position: relative;
}

/* ============================================================
   Nav
   ============================================================ */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 200; height: 62px;
  display: flex; align-items: center;
  border-bottom: 3px solid transparent;
  transition: background-color .2s steps(3), border-color .2s steps(3);
}
.nav.is-stuck { background: var(--bg-elevated); border-bottom-color: var(--line); }
.nav__inner { display: flex; align-items: center; gap: 10px; width: 100%; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 11px; letter-spacing: .02em; }
.brand__mark {
  width: 32px; height: 32px; flex: none;
  background: var(--surface); border: 2px solid var(--line-strong);
  display: grid; place-items: center;
}
.nav__links { display: flex; align-items: center; gap: 2px; margin-left: 20px; }
.nav__links a {
  font-size: 8px; color: var(--text-dim); padding: 8px 9px;
  border: 2px solid transparent;
  transition: color .15s steps(2), border-color .15s steps(2);
}
.nav__links a:hover { color: var(--acc); border-color: var(--line); }
.nav__end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.lang {
  font-size: 9px; color: var(--text-dim); padding: 11px 10px;
  border: 2px solid var(--line); flex: none;
  transition: color .15s steps(2), border-color .15s steps(2);
}
.lang:hover { color: var(--acc); border-color: var(--line-strong); }
/* .nav__end lo qualifica: .icon-btn è dichiarata più sotto con display:grid
   e a parità di specificità vincerebbe lei, mostrando il burger anche su desktop */
.nav__end .nav__burger { display: none; }

/* Menu mobile --------------------------------------------------- */
.nav__menu {
  position: fixed; z-index: 199; top: 62px; left: 0; right: 0;
  background: var(--bg-elevated); border-bottom: 3px solid var(--line-strong);
  padding: 14px clamp(16px, 4.5vw, 48px) 20px;
  display: flex; flex-direction: column; gap: 4px;
}
.nav__menu[hidden] { display: none; }
/* :not(.btn) è necessario: senza, questa regola vince per specificità
   su .btn--primary e ne sovrascrive colore e padding */
.nav__menu a:not(.btn) {
  font-family: "Press Start 2P", monospace; font-size: 10px; color: var(--text-dim);
  padding: 14px 10px; border: 2px solid transparent;
}
.nav__menu a:not(.btn):hover,
.nav__menu a:not(.btn):focus-visible { color: var(--acc); border-color: var(--line); }
.nav__menu .btn { justify-content: center; margin-top: 10px; }

/* Skip link ----------------------------------------------------- */
.skip {
  position: fixed; z-index: 400; top: 8px; left: 8px;
  transform: translateY(-200%);
  font-family: "Press Start 2P", monospace; font-size: 9px;
  background: var(--acc); color: var(--bg); padding: 12px 14px;
  border: 3px solid var(--bg);
}
.skip:focus { transform: translateY(0); }

.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center; flex: none;
  border: 2px solid var(--line-strong); background: var(--surface);
  cursor: pointer; color: var(--text);
  box-shadow: 3px 3px 0 0 var(--shadow);
  transition: transform .1s steps(2), box-shadow .1s steps(2), color .15s steps(2);
}
.icon-btn:hover { color: var(--acc); }
.icon-btn:active { transform: translate(3px,3px); box-shadow: 0 0 0 0 var(--shadow); }
.icon-btn svg { width: 16px; height: 16px; display: block; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }

/* Pixel button ------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: "Press Start 2P", monospace; font-size: 9px; line-height: 1;
  padding: 12px 15px; cursor: pointer; white-space: nowrap;
  border: 2px solid var(--line-strong);
  background: var(--surface); color: var(--text);
  box-shadow: 4px 4px 0 0 var(--shadow);
  transition: transform .1s steps(2), box-shadow .1s steps(2), color .15s steps(2), background-color .15s steps(2);
}
.btn:hover { color: var(--acc); }
.btn:active { transform: translate(4px,4px); box-shadow: 0 0 0 0 var(--shadow); }
.btn--primary { background: var(--btn-bg); color: var(--btn-fg); border-color: var(--btn-bg); }
.btn--primary:hover { color: var(--btn-fg); filter: brightness(1.12); }
.btn--lg { font-size: 10px; padding: 15px 19px; }

/* Blinking caret ----------------------------------------------- */
.blink { animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 0%,49% { opacity: 1 } 50%,100% { opacity: 0 } }

/* ============================================================
   Item slots (marquee pills)
   ============================================================ */
.slot {
  display: inline-flex; align-items: center; flex: none; width: max-content;
  background: var(--surface); border: 3px solid var(--line);
  box-shadow: 5px 5px 0 0 var(--shadow);
  font-family: "Press Start 2P", monospace; line-height: 1; white-space: nowrap;
  transition: border-color .2s steps(2);
}
.slot pixel-icon { flex: none; }
.slot > span { flex: none; white-space: nowrap; color: var(--text-dim); }
.slot--lg { gap: clamp(12px, 1.5vw, 22px); padding: clamp(11px,1.3vw,17px) clamp(22px,3.4vw,52px) clamp(11px,1.3vw,17px) clamp(11px,1.3vw,17px); font-size: clamp(11px, 1.5vw, 21px); }
.slot--lg pixel-icon { --px-size: clamp(40px, 5vw, 76px); }
.slot--sm { gap: clamp(8px, .9vw, 13px); padding: clamp(7px,.75vw,10px) clamp(14px,1.7vw,26px) clamp(7px,.75vw,10px) clamp(7px,.75vw,10px); font-size: clamp(7px, .92vw, 12px); }
.slot--sm pixel-icon { --px-size: clamp(20px, 2.4vw, 34px); }
.slot--lg > span { color: var(--text); }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative; min-height: 100svh; display: flex; align-items: center;
  padding: 100px clamp(16px, 4.5vw, 48px) 52px;
  isolation: isolate;
}
.hero__intro { position: relative; z-index: 2; max-width: min(460px, 46vw); }
.hero__kicker {
  font-size: 8px; color: var(--acc); margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.hero__kicker i { width: 8px; height: 8px; background: var(--acc); display: block; }
.hero h1 {
  font-family: "Press Start 2P", monospace; font-weight: 400;
  font-size: clamp(19px, 2.6vw, 34px); line-height: 1.34;
  margin-bottom: clamp(14px, 1.6vw, 20px);
}
.hero__class {
  font-family: "JetBrains Mono", monospace; font-size: clamp(12px, 1.1vw, 14px);
  color: var(--acc-2); line-height: 1.6; letter-spacing: .01em;
}
.hero__body {
  margin-top: clamp(16px, 2vw, 24px); color: var(--text-dim);
  font-size: clamp(13.5px, 1.05vw, 15px); line-height: 1.65; max-width: 40ch;
}
.hero__cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: clamp(22px, 2.6vw, 32px); }

.hero__stage {
  position: absolute; z-index: 1; top: 0; bottom: 0; right: 0; left: 42%;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 20%, #000 85%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 20%, #000 85%, transparent 100%);
}
/* three.js background — rendered at a fraction of the real resolution and
   blown back up, so the polygons carry the same hard pixel edges as the sprites */
.hero__gl {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: .55;
  /* fades out under the text column so the copy keeps its contrast */
  -webkit-mask-image: linear-gradient(to right, transparent 0, rgba(0,0,0,.3) 20%, #000 46%);
  mask-image: linear-gradient(to right, transparent 0, rgba(0,0,0,.3) 20%, #000 46%);
}
.hero__gl canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; }

.marquee { position: absolute; inset: 0; }
.marquee__track {
  position: absolute; top: 0; left: 0; width: 100%;
  display: flex; flex-direction: column; align-items: flex-start;
  gap: clamp(14px, 2vw, 32px);
  will-change: transform;
  animation: rollUp var(--dur, 26s) linear infinite;
}
.marquee__track > .slot { margin-left: var(--x, 0); }
.marquee__track > .slot--lg { min-width: 74%; }
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes rollUp { from { transform: translate3d(0,0,0); } to { transform: translate3d(0, calc(-1 * var(--shift, 50%)), 0); } }

.scroll-hint {
  position: absolute; z-index: 3; left: clamp(16px, 4.5vw, 48px); bottom: 24px;
  font-family: "Press Start 2P", monospace; font-size: 8px; color: var(--text-faint);
  display: flex; align-items: center; gap: 8px;
}
/* Press Start 2P has no ▼ glyph, so the arrow is drawn with borders */
.scroll-hint i {
  width: 0; height: 0; display: block;
  border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-top: 6px solid var(--acc);
  animation: nudge 1.4s steps(2) infinite;
}
@keyframes nudge { 0%,50% { transform: translateY(0) } 51%,100% { transform: translateY(3px) } }

/* ============================================================
   Sections
   ============================================================ */
.section { padding: clamp(64px, 8vw, 118px) 0; position: relative; scroll-margin-top: 62px; }
.section--alt { background: var(--bg-elevated); border-block: 3px solid var(--line); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: "Press Start 2P", monospace; font-size: 8px; color: var(--acc);
  margin-bottom: 18px;
}
.eyebrow i { width: 8px; height: 8px; background: var(--acc); display: block; }
.section h2 {
  font-family: "Press Start 2P", monospace; font-weight: 400;
  font-size: clamp(15px, 1.9vw, 25px); line-height: 1.5; max-width: 22ch;
}
.section__lede {
  margin-top: 16px; color: var(--text-dim); font-size: clamp(13.5px, 1.1vw, 15.5px);
  line-height: 1.68; max-width: 58ch;
}
.section__head { margin-bottom: clamp(34px, 4vw, 56px); }

/* Competenze (inventario) -------------------------------------- */
.skills { display: grid; gap: clamp(14px, 1.5vw, 22px); grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.skill {
  background: var(--surface); border: 3px solid var(--line);
  box-shadow: 5px 5px 0 0 var(--shadow);
  padding: clamp(18px, 1.9vw, 24px);
  display: flex; flex-direction: column; gap: 13px;
  transition: border-color .15s steps(2), transform .1s steps(2), box-shadow .1s steps(2);
}
.skill:hover { border-color: var(--acc); transform: translate(-2px,-2px); box-shadow: 7px 7px 0 0 var(--shadow); }
.skill__top { display: flex; align-items: center; gap: 13px; }
.skill__top pixel-icon { --px-size: 48px; flex: none; }
.skill h3 { font-family: "Press Start 2P", monospace; font-weight: 400; font-size: 11px; line-height: 1.5; }
.skill p { font-size: 13.5px; line-height: 1.68; color: var(--text-dim); flex: 1; }

/* XP bar — VALORI DA TARARE (data-level, 0-10) */
.xp { display: flex; align-items: center; gap: 8px; }
.xp__label { font-family: "Press Start 2P", monospace; font-size: 7px; color: var(--text-faint); }
.xp__bar { display: flex; gap: 2px; }
.xp__bar i { width: 8px; height: 12px; background: var(--line); display: block; }
.xp__bar i.on { background: var(--acc); }

.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tags li {
  font-family: "JetBrains Mono", monospace; font-size: 11px; color: var(--text-faint);
  border: 2px solid var(--line); padding: 3px 7px; background: var(--bg-elevated);
}

/* Stack -------------------------------------------------------- */
.stack { display: grid; gap: clamp(18px, 2.2vw, 30px); grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.stack__title {
  font-family: "Press Start 2P", monospace; font-size: 9px; color: var(--acc-2);
  display: flex; align-items: center; gap: 10px; margin-bottom: 13px;
}
.stack__title pixel-icon { --px-size: 26px; }
.stack__list { display: flex; flex-wrap: wrap; gap: 6px; }
.stack__list li {
  font-family: "JetBrains Mono", monospace; font-size: 12.5px; color: var(--text-dim);
  border: 2px solid var(--line); padding: 5px 10px; background: var(--surface);
  transition: color .15s steps(2), border-color .15s steps(2);
}
.stack__list li:hover { color: var(--acc); border-color: var(--line-strong); }

/* Processo (quest log) ----------------------------------------- */
/* four steps read as one sequence, so they stay on one row as long as they fit */
.steps { display: grid; gap: clamp(14px, 1.5vw, 20px); grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.step {
  background: var(--surface); border: 3px solid var(--line);
  box-shadow: 5px 5px 0 0 var(--shadow);
  padding: clamp(18px, 1.9vw, 24px); display: flex; flex-direction: column; gap: 11px;
}
.step__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.step__n { font-family: "Press Start 2P", monospace; font-size: 8px; color: var(--acc-3); }
.step__top pixel-icon { --px-size: 34px; }
.step h3 { font-family: "Press Start 2P", monospace; font-weight: 400; font-size: 10px; line-height: 1.5; }
.step p { font-size: 13px; line-height: 1.65; color: var(--text-dim); }

/* Portfolio ---------------------------------------------------- */
.soon {
  background: var(--surface); border: 3px dashed var(--line-strong);
  padding: clamp(28px, 4vw, 52px) clamp(20px, 3.4vw, 44px);
  display: flex; align-items: center; gap: clamp(18px, 2.6vw, 36px); flex-wrap: wrap;
}
.soon pixel-icon { --px-size: clamp(56px, 6.5vw, 86px); flex: none; }
.soon__text { flex: 1; min-width: 230px; display: flex; flex-direction: column; gap: 11px; }
.soon__text h3 { font-family: "Press Start 2P", monospace; font-weight: 400; font-size: clamp(11px, 1.3vw, 15px); line-height: 1.5; }
.soon__text p { font-size: 14px; line-height: 1.68; color: var(--text-dim); max-width: 54ch; }

/* Numeri (striscia di prova) ----------------------------------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: clamp(12px,1.4vw,18px); }
.stat {
  background: var(--surface); border: 3px solid var(--line);
  box-shadow: 5px 5px 0 0 var(--shadow); padding: 20px 18px;
  display: flex; flex-direction: column; gap: 8px;
}
.stat__n { font-family: "Press Start 2P", monospace; font-size: clamp(18px,2.2vw,26px); color: var(--acc); }
.stat__l { font-size: 12.5px; line-height: 1.5; color: var(--text-faint); }

/* Case study --------------------------------------------------- */
.cases { display: flex; flex-direction: column; gap: clamp(16px,2vw,26px); }
.case {
  background: var(--surface); border: 3px solid var(--line);
  box-shadow: 6px 6px 0 0 var(--shadow);
}
.case__bar {
  background: var(--surface-2); border-bottom: 3px solid var(--line-strong);
  padding: 11px 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-family: "Press Start 2P", monospace; font-size: 8px;
}
.case__bar pixel-icon { --px-size: 22px; flex: none; }
.case__id { color: var(--acc-3); }
.case__who { color: var(--text-faint); margin-left: auto; }
.case__body { padding: clamp(20px,2.4vw,30px); display: grid; gap: clamp(18px,2vw,26px); grid-template-columns: minmax(0,2fr) minmax(0,1fr); }
.case h3 { font-family: "Press Start 2P", monospace; font-weight: 400; font-size: clamp(11px,1.3vw,14px); line-height: 1.5; margin-bottom: 16px; }
.case__blocks { display: flex; flex-direction: column; gap: 14px; }
.case__block { display: flex; flex-direction: column; gap: 6px; }
.case__k { font-family: "Press Start 2P", monospace; font-size: 8px; color: var(--acc-2); }
.case__block p { font-size: 13.5px; line-height: 1.68; color: var(--text-dim); }
.case__side { display: flex; flex-direction: column; gap: 14px; }
.case__metrics { display: flex; flex-direction: column; gap: 8px; }
.metric {
  border: 2px solid var(--line); background: var(--bg-elevated); padding: 10px 12px;
  display: flex; flex-direction: column; gap: 5px;
}
.metric b { font-family: "Press Start 2P", monospace; font-size: 13px; font-weight: 400; color: var(--acc); }
.metric span { font-size: 11.5px; line-height: 1.45; color: var(--text-faint); }

/* Chi sono ----------------------------------------------------- */
.about { display: grid; grid-template-columns: minmax(0,260px) minmax(0,1fr); gap: clamp(16px,2.2vw,30px); align-items: start; }
.about__card {
  background: var(--surface); border: 3px solid var(--line);
  box-shadow: 5px 5px 0 0 var(--shadow); padding: clamp(20px,2.2vw,26px);
  display: flex; flex-direction: column; gap: 12px; align-items: flex-start;
}
.about__card h3 { font-family: "Press Start 2P", monospace; font-weight: 400; font-size: 11px; line-height: 1.5; }
.about__text { display: flex; flex-direction: column; gap: 14px; }
.about__text p { font-size: 14.5px; line-height: 1.72; color: var(--text-dim); }
.about__text p:last-child { color: var(--text); border-left: 3px solid var(--acc); padding-left: 16px; }
@media (max-width: 720px) { .about { grid-template-columns: 1fr; } }

.member {
  background: var(--surface); border: 3px solid var(--line);
  box-shadow: 5px 5px 0 0 var(--shadow); padding: clamp(20px,2.2vw,26px);
  display: flex; flex-direction: column; gap: 12px; align-items: flex-start;
}
.member__face {
  background: var(--bg-elevated); border: 3px solid var(--line-strong);
  padding: 8px; display: grid; place-items: center;
}
.member__face pixel-icon { --px-size: 56px; }
.member h3 { font-family: "Press Start 2P", monospace; font-weight: 400; font-size: 11px; line-height: 1.5; }
.member__role { font-family: "JetBrains Mono", monospace; font-size: 12px; color: var(--acc-2); }
.member p { font-size: 13px; line-height: 1.62; color: var(--text-dim); }

/* FAQ ---------------------------------------------------------- */
.faq { display: flex; flex-direction: column; gap: 10px; }
.faq details {
  background: var(--surface); border: 3px solid var(--line);
  transition: border-color .15s steps(2);
}
.faq details[open] { border-color: var(--line-strong); }
.faq summary {
  cursor: pointer; list-style: none; padding: 16px 18px;
  display: flex; align-items: center; gap: 13px;
  font-family: "Press Start 2P", monospace; font-size: 10px; line-height: 1.6;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary pixel-icon { --px-size: 22px; flex: none; }
.faq summary::after {
  content: "+"; margin-left: auto; color: var(--acc); font-size: 14px; flex: none;
}
.faq details[open] summary::after { content: "\2212"; }
.faq summary:hover { color: var(--acc); }
.faq__a { padding: 0 18px 18px 53px; font-size: 13.5px; line-height: 1.7; color: var(--text-dim); }
.faq__a p + p { margin-top: 10px; }
/* segnaposto ancora da scrivere: visibilmente tali, impossibili da pubblicare per sbaglio */
.hint { color: var(--acc-3); font-style: italic; }

/* Form --------------------------------------------------------- */
.form { display: grid; gap: 14px; text-align: left; width: 100%; max-width: 560px; margin-top: 6px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-family: "Press Start 2P", monospace; font-size: 8px; color: var(--text-faint); }
.field input, .field textarea {
  font-family: "JetBrains Mono", monospace; font-size: 14px;
  background: var(--bg-elevated); color: var(--text);
  border: 3px solid var(--line); padding: 11px 12px; width: 100%;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--acc); }
.field textarea { resize: vertical; min-height: 120px; }
.field[data-err] input, .field[data-err] textarea { border-color: var(--acc-err); }
.field__err { font-size: 12px; color: var(--acc-err); min-height: 0; }
.field__err:empty { display: none; }
.consent { display: flex; gap: 11px; align-items: flex-start; }
.consent input { width: 20px; height: 20px; flex: none; accent-color: var(--acc); margin-top: 2px; }
.consent label { font-family: inherit; font-size: 12.5px; line-height: 1.55; color: var(--text-dim); text-transform: none; }
.consent a { color: var(--acc); border-bottom: 2px solid var(--line-strong); }
.form__note { font-size: 12px; line-height: 1.6; color: var(--text-faint); }
.form__ok {
  border: 3px solid var(--acc); background: var(--bg-elevated); padding: 14px 16px;
  font-family: "Press Start 2P", monospace; font-size: 9px; line-height: 1.7; color: var(--acc);
}

/* Boot screen -------------------------------------------------- */
.boot {
  position: fixed; inset: 0; z-index: 500; background: var(--bg);
  display: grid; place-items: center; gap: 22px; align-content: center;
  text-align: center; padding: 24px;
}
.boot[hidden] { display: none; }
.boot pixel-icon { --px-size: 88px; }
.boot__name { font-family: "Press Start 2P", monospace; font-size: clamp(16px,3vw,26px); }
.boot__line { font-family: "JetBrains Mono", monospace; font-size: 13px; color: var(--acc); min-height: 1.6em; }
.boot__press { font-family: "Press Start 2P", monospace; font-size: 10px; color: var(--text-faint); }

/* Arcade: nucleo 3D + trofei ----------------------------------- */
.arcade { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(0,1fr); gap: clamp(14px, 1.8vw, 24px); align-items: start; }
.screen {
  background: var(--bg); border: 3px solid var(--line-strong);
  box-shadow: 0 0 0 3px var(--bg-elevated), 7px 7px 0 0 var(--shadow);
}
.screen__bar {
  background: var(--surface-2); border-bottom: 3px solid var(--line-strong);
  padding: 9px 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-family: "Press Start 2P", monospace; font-size: 8px; color: var(--text);
}
.screen__hint { margin-left: auto; color: var(--text-faint); }
.screen__gl { position: relative; aspect-ratio: 4 / 3; touch-action: none; cursor: grab; }
.screen__gl:active { cursor: grabbing; }
.screen__gl canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; }
/* visible by default: if three.js never loads (offline, CDN blocked, no WebGL)
   the box explains itself instead of sitting there empty */
.screen__fallback {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  padding: 24px; font-family: "JetBrains Mono", monospace; font-size: 12.5px; line-height: 1.6;
  color: var(--text-faint);
  background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 8px 8px;
}
.screen.gl-ok .screen__fallback { display: none; }

.trophies__head {
  display: flex; align-items: center; gap: 10px;
  font-family: "Press Start 2P", monospace; font-size: 9px; color: var(--acc-3); margin-bottom: 14px;
}
.trophies__count { margin-left: auto; color: var(--text-faint); }
.trophies { display: flex; flex-direction: column; gap: 8px; }
.trophy {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 3px solid var(--line); padding: 10px 12px;
  transition: border-color .15s steps(2), background-color .15s steps(2);
}
.trophy pixel-icon { --px-size: 28px; flex: none; }
.trophy__txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.trophy__name { font-family: "Press Start 2P", monospace; font-size: 8px; color: var(--text-faint); }
.trophy__desc { font-size: 12.5px; line-height: 1.5; color: var(--text-faint); }
.trophy.is-open { border-color: var(--acc); background: var(--surface-2); }
.trophy.is-open .trophy__name { color: var(--acc); }
.trophy.is-open .trophy__desc { color: var(--text-dim); }
.trophies__foot { margin-top: 14px; font-size: 12.5px; line-height: 1.6; color: var(--text-faint); }

/* Toast di sblocco --------------------------------------------- */
.toast {
  position: fixed; z-index: 250; left: 50%; bottom: 26px; transform: translate(-50%, 130%);
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 3px solid var(--acc);
  box-shadow: 6px 6px 0 0 var(--shadow);
  padding: 12px 16px; max-width: calc(100vw - 32px);
  transition: transform .25s steps(4);
}
.toast.is-on { transform: translate(-50%, 0); }
.toast pixel-icon { --px-size: 30px; flex: none; }
.toast__txt { display: flex; flex-direction: column; gap: 4px; }
.toast__k { font-family: "Press Start 2P", monospace; font-size: 7px; color: var(--acc); }
.toast__n { font-family: "Press Start 2P", monospace; font-size: 9px; color: var(--text); }

/* Contatti (finestra di dialogo) ------------------------------- */
.dialog {
  background: var(--surface); border: 3px solid var(--line-strong);
  box-shadow: 0 0 0 3px var(--bg), 8px 8px 0 0 var(--shadow);
  padding: 0;
}
.dialog__bar {
  background: var(--surface-2); border-bottom: 3px solid var(--line-strong);
  padding: 9px 13px; display: flex; align-items: center; gap: 9px;
  font-family: "Press Start 2P", monospace; font-size: 8px; color: var(--text);
}
.dialog__dots { display: flex; gap: 5px; margin-left: auto; }
.dialog__dots i { width: 8px; height: 8px; display: block; background: var(--text-faint); }
.dialog__body {
  padding: clamp(28px, 4vw, 56px) clamp(20px, 3.4vw, 48px);
  text-align: center; display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.dialog__body pixel-icon { --px-size: clamp(64px, 7.5vw, 96px); }
.dialog__body h2 {
  font-family: "Press Start 2P", monospace; font-weight: 400;
  font-size: clamp(14px, 1.9vw, 24px); line-height: 1.5; max-width: 20ch;
}
.dialog__body p { color: var(--text-dim); font-size: clamp(13.5px, 1.15vw, 15.5px); line-height: 1.68; max-width: 50ch; }
.dialog__row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 6px; }
.wip { font-family: "JetBrains Mono", monospace; font-size: 12.5px; color: var(--text-faint); margin-top: 2px; }

/* Footer ------------------------------------------------------- */
.footer { border-top: 3px solid var(--line); padding: 34px 0 48px; }
.footer__inner { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer__note { font-family: "JetBrains Mono", monospace; font-size: 12px; color: var(--text-faint); line-height: 1.7; }
.footer__links { margin-left: auto; display: flex; gap: 14px; flex-wrap: wrap; }
.footer__links a { font-family: "Press Start 2P", monospace; font-size: 8px; color: var(--text-dim); }
.footer__links a:hover { color: var(--acc); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .nav__links { display: none; }
  .nav__end .nav__burger { display: grid; }
  .nav__end .btn { display: none; }   /* la CTA vive nel menu */
  .hero { flex-direction: column; align-items: stretch; min-height: auto; padding-top: 92px; padding-bottom: 0; }
  .hero__intro { max-width: none; }
  .hero__stage {
    position: relative; left: auto; right: auto; top: auto; bottom: auto;
    height: 58svh; min-height: 360px; margin: 34px calc(-1 * clamp(16px, 4.5vw, 48px)) 0;
  }
  /* the longest label ("Intelligenza artificiale") has to clear 375px */
  .slot--lg { font-size: clamp(9px, 2.9vw, 19px); }
  .slot--lg pixel-icon { --px-size: clamp(36px, 10vw, 70px); }
  .slot--sm { font-size: clamp(7px, 2.1vw, 11px); }
  .slot--sm pixel-icon { --px-size: clamp(20px, 5.5vw, 32px); }
  .scroll-hint { display: none; }
}
@media (max-width: 860px) {
  .arcade { grid-template-columns: 1fr; }
  .case__body { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .skills, .stack { grid-template-columns: 1fr; }
  .footer__links { margin-left: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee__track { animation: none; }
  .blink { animation: none; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
