*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0
}

:root {
  --bg: #ffffff;
  --ink: #0c0c0b;
  --ink2: #4a4a47;
  --ink3: #9a9a94;
  --ac: #3EBAF4;
  --yellow: #EDCD09;
  --accent-red: #E02429;
  --green: #35A877;
  --violet: #533198;
  --line: rgba(12, 12, 11, 0.08);
  --W: 1060px;
}

html {
  scroll-behavior: smooth
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Epilogue', sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
  cursor: none;
}

/* ── CURSOR ──────────────────────── */
#cur {
  position: fixed;
  width: 7px;
  height: 7px;
  background: var(--ac);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width .2s, height .2s, background .2s;
}

#cur.big {
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1.5px solid var(--ac);
}

@media(hover:none) {
  #cur {
    display: none;
  }

  body {
    cursor: auto;
  }

  .proj-screenshot img {
    filter: grayscale(0) !important;
  }
}

/* ── NAV ─────────────────────────── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem 5vw;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}

nav.scrolled {
  border-bottom-color: var(--line);
}

/* barra di avanzamento della lettura, appoggiata al bordo inferiore della nav */
.nav-prog {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1.5px;
  overflow: hidden;
  pointer-events: none;
}

.nav-prog i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ac);
}

.logo {
  font-family: 'DM Mono', monospace;
  font-size: .85rem;
  font-weight: 400;
  letter-spacing: .04em;
  color: var(--ink);
  text-decoration: none;
}

.logo span {
  color: var(--ac);
}

nav ul {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}

nav ul a {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink2);
  text-decoration: none;
  transition: color .2s;
  position: relative;
}

nav ul a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--ac);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .28s cubic-bezier(.25, .46, .45, .94);
}

nav ul a:hover {
  color: var(--ac);
}

nav ul a:hover::after {
  transform: scaleX(1);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--ink);
  transition: transform .28s, opacity .28s;
}

nav.open .nav-toggle span:first-child {
  transform: rotate(45deg) translate(4px, 4px);
}

nav.open .nav-toggle span:last-child {
  transform: rotate(-45deg) translate(4px, -4px);
}

/* ── HERO ─────────────────────────── */
#hero {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: stretch;
}

.hero-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: 100%;
  padding: 7rem 5vw 4rem;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* left text */
.hero-text {
  flex: 1 1 0;
  max-width: 600px;
  text-align: left;
}

.hero-tag {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--ac);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: .9rem;
  justify-content: flex-start;
  opacity: 0;
  animation: up .7s .1s cubic-bezier(.25, .46, .45, .94) both;
}

.hero-tag::before,
.hero-tag::after {
  content: '';
  display: block;
  width: 36px;
  height: 1.5px;
  background: var(--ac);
  flex-shrink: 0;
}

h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(3rem, 7.2vw, 6rem);
  line-height: .92;
  letter-spacing: -.005em;
  margin-bottom: 1.6rem;
}

.name-solid {
  display: block;
  color: var(--ink);
  opacity: 0;
  animation: up .75s .2s cubic-bezier(.25, .46, .45, .94) both;
}

/* Il cognome è in outline. `width: fit-content` fa sì che il riquadro
   coincida con le lettere: l'effetto di riempimento parte solo passando
   davvero sopra la scritta, non nello spazio vuoto a destra. */
.name-outline {
  display: block;
  position: relative;
  width: fit-content;
  color: transparent;
  -webkit-text-stroke: 2px var(--ac);
  opacity: 0;
  animation: up .75s .32s cubic-bezier(.25, .46, .45, .94) both;
}

/* Copia piena sovrapposta, ritagliata da --fill (aggiornata a ogni frame dal JS).
   I due margini verticali negativi sono necessari: con line-height .92 le lettere
   Bebas sporgono dalla propria line box, e un inset a 0 taglierebbe la cima e il
   piede della versione piena mentre l'outline sotto resta intero.
   Nessuna `transition` qui: il movimento è ammorbidito dal lerp in main.js. Una
   transizione CSS verrebbe riavviata a ogni mousemove e produrrebbe scatti. */
.name-outline::before {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  color: var(--ac);
  -webkit-text-stroke: 0;
  clip-path: inset(-1em calc(100% - var(--fill, 0%)) -1em 0);
  pointer-events: none;
}

@keyframes up {
  from {
    opacity: 0;
    transform: translateY(36px)
  }

  to {
    opacity: 1;
    transform: none
  }
}

.hero-headline {
  font-family: 'Epilogue', sans-serif;
  font-size: clamp(1.15rem, 1.9vw, 1.55rem);
  font-weight: 400;
  line-height: 1.45;
  color: var(--ink);
  margin-bottom: 1.8rem;
  max-width: 520px;
  opacity: 0;
  animation: up .7s .42s cubic-bezier(.25, .46, .45, .94) both;
}

.hero-headline em {
  font-style: normal;
  color: var(--ac);
  font-weight: 500;
}

.hero-foot {
  border-top: 1px solid var(--line);
  padding-top: 1.4rem;
  opacity: 0;
  animation: up .7s .55s cubic-bezier(.25, .46, .45, .94) both;
}

.hero-sub {
  font-size: 15px;
  font-weight: 300;
  color: var(--ink2);
  line-height: 1.7;
  margin-bottom: 1.3rem;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.btn-primary {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .14em;
  text-transform: uppercase;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  padding: .95rem 1.5rem;
  border: 1px solid var(--ink);
  transition: background .2s, color .2s, transform .2s;
}

.btn-primary:hover {
  background: var(--ac);
  border-color: var(--ac);
  transform: translateY(-2px);
}

.btn-ghost {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink2);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 3px;
  transition: color .2s, border-color .2s;
}

.btn-ghost:hover {
  color: var(--ac);
  border-color: var(--ac);
}

/* portrait right */
.hero-portrait {
  position: relative;
  flex: 0 0 auto;
  width: clamp(320px, 38vw, 540px);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: -1rem;
}

.hero-portrait img {
  width: 100%;
  height: auto;
  display: block;
  position: relative;
  z-index: 2;
  animation: portraitIn 1s .4s cubic-bezier(.25, .46, .45, .94) both;
  max-width: 100%;
}

@keyframes portraitIn {
  from {
    opacity: 0;
    transform: translateY(20px)
  }

  to {
    opacity: 1;
    transform: none
  }
}

/* ── SECTIONS ────────────────────── */
section {
  padding: 6.5rem 5vw;
  border-top: 1px solid var(--line);
}

#hero {
  border-top: none;
  padding: 0;
}

.sec-wrap {
  max-width: var(--W);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 5rem;
  align-items: start;
}

.sec-left {
  position: sticky;
  top: 7rem;
}

.sec-num {
  display: block;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 300;
  letter-spacing: .15em;
  color: var(--ac);
  margin-bottom: 1.2rem;
}

.sec-left h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2.4rem, 4.5vw, 4rem);
  line-height: 1;
  color: var(--ink);
}

.ac {
  color: var(--ac);
}

.br-mobile {
  display: none;
}

/* ── CHI SONO ─────────────────────── */
.sec-right p {
  font-size: 16px;
  font-weight: 300;
  color: var(--ink2);
  line-height: 1.8;
  margin-bottom: 1.2rem;
}

/* stack tecnologie (sostituisce .skills) */
.stack {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}

.stack-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  padding: .4rem .3rem;
  transition: transform .3s cubic-bezier(.25, .46, .45, .94);
}

.stack-item:hover {
  transform: translateY(-4px);
}

.stack-item img {
  width: 100%;
  max-width: 96px;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(12, 12, 11, .06));
  transition: filter .3s;
}

.stack-item:hover img {
  filter: drop-shadow(0 8px 14px rgba(62, 186, 244, .18));
}

.stack-item figcaption {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink);
}

/* ── PROGETTI ─── */
.proj-group-real {
  margin-top: 3.5rem;
}

.proj-group-demo {
  margin-top: 5rem;
}

/* intestazione gruppo: label + filetto che corre fino al bordo */
.proj-group-head {
  max-width: var(--W);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.4rem;
}

.proj-group-head::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.proj-group-label {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .24em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.proj-group-real .proj-group-label {
  color: var(--ink);
}

.proj-group-demo .proj-group-label {
  color: var(--ink3);
}

/* pallino "live" */
.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

.proj-group-note {
  max-width: var(--W);
  margin: .9rem auto 0;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 300;
  letter-spacing: .04em;
  color: var(--ink3);
  line-height: 1.7;
}

/* griglia leggermente più stretta delle intestazioni, che restano a --W */
.projects-grid {
  max-width: 960px;
  margin: 2.2rem auto 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 2rem;
}

.col-left {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.col-right {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding-top: 5rem;
}

.proj {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .9rem;
  text-decoration: none;
  color: inherit;
  cursor: none;
}

.proj-screenshot {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--line);
  overflow: hidden;
}

.proj-screenshot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(1);
  transition: filter .5s cubic-bezier(.25, .46, .45, .94), transform .6s cubic-bezier(.25, .46, .45, .94);
}

.proj:hover .proj-screenshot img {
  filter: grayscale(0);
  transform: scale(1.04);
}

/* i siti online restano sempre a colori */
.proj-real .proj-screenshot img {
  filter: grayscale(0);
}

.proj-meta {
  display: flex;
  align-items: baseline;
  gap: 1rem;
}

.proj-meta .proj-num {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  font-weight: 300;
  letter-spacing: .12em;
  flex-shrink: 0;
}

.proj-a .proj-num {
  color: var(--ac);
}

.proj-b .proj-num {
  color: var(--yellow);
}

.proj-c .proj-num {
  color: var(--violet);
}

.proj-d .proj-num {
  color: var(--accent-red);
}

/* i siti online non hanno numero: al suo posto il pallino verde "live" */
.proj-live {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  align-self: center;
}

.proj-meta h3 {
  font-family: 'Epilogue', sans-serif;
  font-weight: 500;
  font-size: 1rem;
  color: var(--ink);
  margin-bottom: .15rem;
  transition: color .25s;
}

.proj:hover .proj-meta h3 {
  color: var(--ac);
}

.proj-type {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink3);
  display: block;
  margin-top: .15rem;
}

/* stesso corpo e stesso peso dei concept: la distinzione la fanno
   pallino verde, colore dello screenshot e dominio in accento */
.proj-real .proj-meta h3 {
  margin-bottom: 0;
}

/* nome a sinistra, dominio a destra: essendo agli estremi opposti si allineano
   al centro, non alla baseline (che farebbe sedere più in basso il font piccolo) */
.proj-real .proj-meta>div {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .4rem 1.5rem;
  flex-wrap: wrap;
}

.proj-real .proj-type {
  color: var(--ac);
  margin-top: 0;
}

/* freccia centrata sulla riga, altrimenti la baseline la fa sedere più in basso */
.proj-real .proj-arrow {
  align-self: center;
}

.proj-arrow {
  margin-left: auto;
  font-size: .9rem;
  color: var(--ink3);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity .25s, transform .25s;
  flex-shrink: 0;
}

.proj:hover .proj-arrow {
  opacity: 1;
  transform: none;
}

/* ── COSA OFFRO ───────────────────── */
.offro-list {
  display: flex;
  flex-direction: column;
}

.offro-item {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 1.5rem;
  padding: 2rem 0;
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  transition: padding-left .25s;
}

.offro-item:first-child {
  border-top: 1px solid var(--line);
}

.offro-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  transition: width .15s cubic-bezier(.25, .46, .45, .94);
}

.offro-item:nth-child(1)::before {
  background: var(--ac);
}

.offro-item:nth-child(2)::before {
  background: var(--yellow);
}

.offro-item:nth-child(3)::before {
  background: var(--accent-red);
}

.offro-item:hover::before {
  width: 3px;
}

.offro-item:hover {
  padding-left: .8rem;
}

.offro-num {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 300;
  letter-spacing: .1em;
  color: var(--ac);
  padding-top: .2rem;
}

.offro-item h4 {
  font-family: 'Epilogue', sans-serif;
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--ink);
  margin-bottom: .5rem;
}

.offro-item p {
  font-size: 14px;
  font-weight: 300;
  color: var(--ink2);
  line-height: 1.7;
}

/* ── COME LAVORO ──────────────────── */
.process-wrap {
  max-width: var(--W);
  margin: 5rem auto 0;
  padding-top: 3rem;
  border-top: 1px solid var(--line);
}

.process-label {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 300;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ac);
  margin-bottom: 2.5rem;
}

.process {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr auto 1fr;
  align-items: start;
  gap: 0;
}

.step {
  min-width: 0;
}

.step-arrow {
  color: var(--ink3);
  font-size: 1.1rem;
  padding: 0 1rem;
  align-self: start;
  margin-top: 2.8rem;
}

.step-n {
  display: block;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 3rem;
  color: rgba(12, 12, 11, .07);
  line-height: 1;
  margin-bottom: .6rem;
}

.step h5 {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: .4rem;
}

.step p {
  font-size: 13px;
  font-weight: 300;
  color: var(--ink3);
  line-height: 1.6;
}

.step:nth-child(1) .step-n {
  color: rgba(83, 49, 152, .15);
}

.step:nth-child(3) .step-n {
  color: rgba(53, 168, 119, .18);
}

.step:nth-child(5) .step-n {
  color: rgba(62, 186, 244, .2);
}

.step:nth-child(7) .step-n {
  color: rgba(237, 205, 9, .18);
}

.step:nth-child(9) .step-n {
  color: rgba(224, 36, 41, .15);
}

/* ── CONTATTI ─────────────────────── */
#contatti {
  text-align: center;
  position: relative;
  overflow: hidden;
}

#contatti::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 80% at 50% 50%, rgba(62, 186, 244, .05) 0%, transparent 70%);
  pointer-events: none;
}

.contact-wrap {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .8rem;
  position: relative;
  z-index: 1;
}

/* raggruppa links + social in un blocco compatto */
.contact-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
}

.contact-title-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.contact-icon {
  width: 96px;
  height: auto;
  filter: drop-shadow(0 6px 12px rgba(62, 186, 244, .12));
  animation: floatY 5s ease-in-out infinite;
}

@keyframes floatY {

  0%,
  100% {
    transform: translateY(0)
  }

  50% {
    transform: translateY(-6px)
  }
}

.contact-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(3.5rem, 8vw, 7rem);
  line-height: 1;
  color: var(--ink);
  letter-spacing: -.01em;
}

.contact-sub {
  font-size: 16px;
  font-weight: 300;
  color: var(--ink2);
  line-height: 1.7;
}

.email-link {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  font-weight: 300;
  letter-spacing: .03em;
  color: var(--ac);
  text-decoration: none;
  border-bottom: 1px solid var(--ac);
  padding-bottom: 3px;
  transition: color .2s, border-color .2s;
}

.email-link:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.whatsapp-link {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  font-weight: 300;
  letter-spacing: .03em;
  color: var(--green);
  text-decoration: none;
  border-bottom: 1px solid rgba(53,168,119,.4);
  padding-bottom: 3px;
  transition: color .2s, border-color .2s;
}

.whatsapp-link:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.whatsapp-note {
  color: var(--green);
  font-size: 12px;
  transition: color .2s;
}

.whatsapp-link:hover .whatsapp-note {
  color: var(--ink);
}

/* email + whatsapp affiancati */
.contact-links-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: nowrap;
}

.contact-links-sep {
  display: block;
  width: 1px;
  height: 16px;
  background: var(--line);
  flex-shrink: 0;
}

/* google + instagram affiancati */
.social-links {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 1.5rem;
  align-items: center;
  justify-content: center;
}

.social-divider {
  width: 1px;
  background: var(--line);
  flex-shrink: 0;
  margin: 0 .8rem;
  align-self: stretch;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  font-weight: 300;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink3);
  text-decoration: none;
  transition: color .2s;
}

.social-link:hover {
  color: var(--ac);
}

/* ── FOOTER ───────────────────────── */
footer {
  border-top: 1px solid var(--line);
  padding: 2rem 5vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

footer span {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 300;
  letter-spacing: .08em;
  color: var(--ink3);
}

/* ── REVEAL ───────────────────────── */
.r {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .65s cubic-bezier(.25, .46, .45, .94), transform .65s cubic-bezier(.25, .46, .45, .94);
}

.r.on {
  opacity: 1;
  transform: none;
}

.d1 {
  transition-delay: .1s
}

.d2 {
  transition-delay: .2s
}

.d3 {
  transition-delay: .3s
}

.d4 {
  transition-delay: .4s
}

/* ── CONTACT ILLUSTRATION ──────────────── */
.contact-illustration {
  width: 100%;
  margin-top: 3.5rem;
  overflow: hidden;
  line-height: 0;
}

.contact-illustration img {
  display: block;
  height: 500px;
  width: auto;
  margin: 0 auto;
}

/* ────────────────────────────────────── */
/* RESPONSIVE                              */
/* ────────────────────────────────────── */

/* ── LARGE DESKTOP ── */
@media(max-width:1180px) {
  .hero-inner {
    padding: 7rem 4vw 3.5rem;
    gap: 1rem;
  }

  .hero-portrait {
    width: clamp(300px, 36vw, 460px);
  }
}

/* ── TABLET ───────────────────────── */
@media(max-width:1024px) {
  .hero-inner {
    gap: 1rem;
    padding: 6rem 4vw 3rem;
  }

  .hero-portrait {
    width: clamp(280px, 34vw, 400px);
    margin-left: 0;
  }

  .hero-text {
    max-width: 520px;
  }

  h1 {
    font-size: clamp(2.8rem, 7vw, 4.5rem);
  }

  .sec-wrap {
    gap: 3rem;
  }

  .process {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2rem 1.5rem;
  }

  .step-arrow {
    display: none;
  }
}

@media(max-width:860px) {
  .hero-inner {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 6rem 5vw 3rem;
  }

  .hero-portrait {
    width: min(360px, 75vw);
    margin: 0 auto;
    order: -1;
  }

  .hero-text {
    text-align: center;
    max-width: 580px;
  }

  .hero-tag {
    justify-content: center;
  }

  /* con width:fit-content il blocco va ricentrato a mano */
  .name-outline {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-headline {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-headline br {
    display: none;
  }

  .hero-cta {
    justify-content: center;
  }

  .hero-foot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
  }

  .sec-wrap {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .sec-left {
    position: static;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    display: flex;
    flex-direction: column;
    gap: 2rem;
  }

  .col-left,
  .col-right {
    display: contents;
  }

  /* Con display:contents le colonne non generano box e le card diventano
     figlie dirette della griglia, quindi seguono l'ordine del DOM:
     01, 03, 02, 04. L'ordine numerico va ripristinato a mano. */
  .proj-a { order: 1 }
  .proj-b { order: 2 }
  .proj-c { order: 3 }
  .proj-d { order: 4 }

  .proj-group-real {
    margin-top: 3rem;
  }

  .proj-group-demo {
    margin-top: 5rem;
  }

  .process {
    grid-template-columns: 1fr 1fr;
    gap: 2rem 1.5rem;
  }

  .stack {
    gap: 1rem;
  }

  .stack-item img {
    max-width: 100px;
  }

  /* contatti 860 */
  .contact-links-row {
    flex-direction: column;
    gap: .5rem;
    align-items: center;
  }

  .contact-links-sep {
    display: none;
  }

  .social-links {
    flex-wrap: nowrap;
  }
}

/* ── MOBILE ───────────────────────── */
@media(max-width:600px) {
  nav {
    padding: 1rem 1.2rem;
  }

  nav ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
  }

  nav.open ul {
    display: flex;
  }

  nav ul li a {
    display: block;
    padding: .7rem 1.2rem;
    font-size: 12px;
  }

  .nav-toggle {
    display: flex;
  }

  .logo {
    font-size: .75rem;
  }

  #hero {
    min-height: auto;
  }

  .hero-inner {
    padding: 5.5rem 1.2rem 3rem;
    gap: 1.5rem;
  }

  .hero-tag {
    font-size: 10px;
    margin-bottom: 1.4rem;
    gap: .6rem;
    letter-spacing: .18em;
  }

  .hero-tag::before {
    width: 22px;
    height: 1px;
  }

  .hero-portrait {
    width: min(230px, 60vw);
  }

  .hero-text {
    max-width: 100%;
  }

  h1 {
    font-size: clamp(2.6rem, 12vw, 3.6rem);
    margin-bottom: 1.1rem;
  }

  .name-outline {
    -webkit-text-stroke: 1.5px var(--ac);
  }

  .hero-headline {
    font-size: 1.05rem;
    margin-bottom: 1.3rem;
  }

  .hero-sub {
    font-size: 13.5px;
    line-height: 1.65;
    margin-bottom: 1rem;
  }

  .hero-foot {
    padding-top: 1rem;
  }

  .hero-cta {
    gap: .7rem;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
  }

  .btn-primary {
    text-align: center;
    padding: .85rem 1.2rem;
    font-size: 11px;
  }

  .btn-ghost {
    text-align: center;
    padding: .4rem 0;
    font-size: 11px;
  }

  section {
    padding: 3.5rem 1.2rem;
  }

  .sec-wrap {
    gap: 1rem;
  }

  .sec-left h2 {
    font-size: 1.4rem;
  }

  .br-desktop { display: none; }
  .br-mobile { display: inline; }

  #chi-sono .sec-right p {
    font-size: 13px;
    line-height: 1.6;
  }

  .sec-num {
    font-size: 10px;
    margin-bottom: .8rem;
  }

  /* progetti */
  .proj-group-real {
    margin-top: 2.2rem;
  }

  .proj-group-demo {
    margin-top: 3.5rem;
  }

  .proj-group-head {
    gap: 1rem;
  }

  .proj-group-label {
    font-size: 10px;
    letter-spacing: .18em;
  }

  .proj-group-note {
    font-size: 10px;
    letter-spacing: .02em;
    line-height: 1.6;
  }

  .projects-grid {
    margin-top: 1.6rem;
  }

  /* La freccia su mobile non compare mai: nascondendola il dominio arriva
     a filo del bordo destro, senza lo spazio vuoto che le restava accanto.
     L'allineamento a destra resta quello del desktop. */
  .proj-real .proj-arrow {
    display: none;
  }

  /* stack */
  .stack {
    grid-template-columns: repeat(3, 1fr);
    gap: .6rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
  }

  .stack-item {
    padding: .5rem .2rem;
    gap: .5rem;
  }

  .stack-item img {
    max-width: 80px;
  }

  .stack-item figcaption {
    font-size: 10px;
    letter-spacing: .14em;
  }

  /* offro */
  .offro-item {
    grid-template-columns: 32px 1fr;
    gap: .8rem;
    padding: 1.2rem 0;
  }

  .offro-num {
    font-size: 10px;
  }

  .offro-item h4 {
    font-size: .9rem;
    margin-bottom: .4rem;
  }

  .offro-item p {
    font-size: 12.5px;
  }

  /* ── COME LAVORO (mobile) — OPZIONE 3 ──────────
     Timeline: un binario verticale continuo attraversa la sezione e i
     numeri ci si appoggiano sopra, ritagliandolo con il proprio sfondo.
     Niente separatori orizzontali, così non somiglia alla lista sopra. */
  .process-wrap {
    margin: 3rem 0 0;
    padding-top: 2rem;
  }

  .process-label {
    margin-bottom: 1.5rem;
  }

  .process {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .step {
    position: relative;
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 0 1.1rem;
    padding-bottom: 1.7rem;
  }

  /* il binario di ogni passaggio arriva fino al numero del successivo;
     sull'ultimo non serve e sparisce */
  .step::before {
    content: '';
    position: absolute;
    left: 17px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--line);
  }

  .step:last-child::before {
    display: none;
  }

  .step:last-child {
    padding-bottom: 0;
  }

  .step-n {
    grid-column: 1;
    grid-row: 1 / span 2;
    justify-self: center;
    align-self: start;
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    font-weight: 300;
    letter-spacing: .1em;
    line-height: 1;
    margin: 0;
    /* sfondo pieno: è così che il numero "buca" il binario */
    background: var(--bg);
    padding: .3rem 0;
    position: relative;
    z-index: 1;
  }

  .step:nth-child(1) .step-n { color: var(--violet); }
  .step:nth-child(3) .step-n { color: var(--green); }
  .step:nth-child(5) .step-n { color: var(--ac); }
  .step:nth-child(7) .step-n { color: var(--yellow); }
  .step:nth-child(9) .step-n { color: var(--accent-red); }

  .step h5 {
    grid-column: 2;
    font-size: .95rem;
    font-weight: 600;
    margin: 0 0 .2rem;
  }

  .step p {
    grid-column: 2;
    font-size: 13px;
    line-height: 1.55;
    margin: 0;
  }

  .step-arrow {
    display: none;
  }

  /* contatti */
  .contact-icon {
    width: 100px;
  }

  .contact-title {
    font-size: clamp(2.6rem, 11vw, 4rem);
  }

  .contact-sub {
    font-size: 13px;
  }

  .contact-links-row {
    flex-direction: column;
    gap: .5rem;
    align-items: center;
  }

  .contact-links-sep {
    display: none;
  }

  .email-link {
    font-size: 12px;
    word-break: break-all;
  }

  .whatsapp-link {
    font-size: 12px;
    gap: .4rem;
  }

  .whatsapp-note {
    font-size: 11px;
  }

  .social-links {
    flex-wrap: nowrap;
  }

  .social-link {
    font-size: 10px;
    letter-spacing: .07em;
  }

  .contact-illustration img {
    max-height: 180px;
  }

  footer {
    flex-direction: column;
    gap: .4rem;
    text-align: center;
    padding: 1.5rem 1.2rem;
  }

  footer span {
    font-size: 10px;
  }
}

@media(max-width:380px) {
  h1 {
    font-size: 2.4rem;
  }

  .stack-item img {
    max-width: 68px;
  }
}
