/* =========================================================
   ERMETE SALVATORE.it — Landing page
   LAB | IDEAS | DEVELOPMENT
   ========================================================= */

:root {
  --ink:       #323232;   /* sfondo principale */
  --ink-2:     #383838;   /* sfondo sezioni alternate */
  --panel:     #2a2a2a;   /* pannelli / card */
  --panel-2:   #3a3a3a;   /* bordi soft */
  --lime:      #6AE456;   /* verde brand */
  --lime-dim:  #4fae42;
  --paper:     #f5f6f4;   /* testo chiaro */
  --mist:      #aab0a7;   /* testo secondario */
  --line:      #474747;   /* linee/divider */

  --font-display: "Ubuntu", system-ui, sans-serif;
  --font-body:    "Ubuntu", system-ui, sans-serif;
  --font-mono:    "Ubuntu Mono", ui-monospace, monospace;

  --maxw: 1180px;
  --pad:  clamp(1.25rem, 4vw, 2.5rem);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 88px; }

/* Lenis — smooth scroll JS. Quando è attivo prende il posto di scroll-behavior. */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.075rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.05; margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--lime);
  text-transform: lowercase;
  margin: 0 0 1.25rem;
}

.hl { color: var(--lime); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.6em 1.5em;
  border-radius: 9px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform .15s ease-in-out, box-shadow .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
.btn--solid { background: var(--lime); color: #10110f; }
.btn--solid:hover {
  transform: translateY(-2px) scale(1.035);
  background: #7cf268;
  box-shadow: 0 10px 30px rgba(106,228,86,0.35);
}
.btn--ghost { border-color: var(--line); color: var(--paper); }
.btn--ghost:hover {
  border-color: var(--lime);
  color: var(--lime);
  transform: translateY(-2px) scale(1.035);
  box-shadow: 0 10px 30px rgba(106,228,86,0.18);
}
.btn:active { transform: translateY(0) scale(0.99); }

/* =========================================================
   HEADER / NAV
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(50, 50, 50, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 72px;
}

.brand { display: flex; align-items: center; gap: 0.6rem; }
.brand__mark { flex: none; height: 36px; width: auto; }
.brand__word {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.02rem;
  letter-spacing: 0.01em;
  color: var(--mist);
}
.brand__word b { color: var(--paper); font-weight: 700; }
.brand__word i { color: var(--lime); font-style: normal; }
.brand__lockup { display: flex; flex-direction: column; gap: 2px; line-height: 1.05; }
.brand__tagline {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper);
}

.nav-links { display: flex; align-items: center; gap: 1.75rem; }
.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--mist);
  transition: color .2s ease;
}
.nav-links a:hover { color: var(--paper); }
.nav-cta {
  color: var(--lime) !important;
  border: 1.5px solid var(--line);
  padding: 0.55em 1.1em;
  border-radius: 9px;
  transition: border-color .2s ease, background .2s ease;
}
.nav-cta:hover { border-color: var(--lime); background: rgba(106,228,86,0.08); }

/* mobile burger (CSS-only via checkbox) */
.nav-burger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 8px; }
.nav-burger span { width: 24px; height: 2px; background: var(--paper); transition: .25s ease; }
.nav-toggle:checked ~ .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle:checked ~ .nav-burger span:nth-child(2) { opacity: 0; }
.nav-toggle:checked ~ .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative;
  overflow: hidden;
  min-height: calc(100svh - 72px);
  display: flex;
  align-items: center;
  padding-block: clamp(3rem, 7vw, 6rem);
}
/* nebulosa aurora (come test2) — base immersiva dietro tutto */
.hero__space {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(60% 55% at 22% 30%, rgba(106,228,86,0.28), transparent 60%),
    radial-gradient(55% 50% at 80% 25%, rgba(79,174,66,0.22), transparent 60%),
    radial-gradient(70% 60% at 60% 85%, rgba(106,228,86,0.18), transparent 65%),
    radial-gradient(120% 120% at 50% 50%, #383838 0%, #2a2a2a 55%, #1c1c1c 100%);
  pointer-events: none;
}

/* texture circuito/matrix del biglietto (pattern.svg) */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image: url("../../images/pattern.svg");
  background-repeat: repeat;
  background-size: 420px auto;
  opacity: 0.55;
  mask-image: radial-gradient(150% 120% at 75% 15%, #000 35%, rgba(0,0,0,0.35) 100%);
  -webkit-mask-image: radial-gradient(150% 120% at 75% 15%, #000 35%, rgba(0,0,0,0.35) 100%);
  pointer-events: none;
}

/* vignette per profondità (come test2) */
.hero__vignette {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(75% 75% at 50% 45%, transparent 55%, rgba(20,20,20,0.75) 100%);
}

/* campo stellare animato con parallasse (hero-stars.js) */
.hero__stars {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero__grid {
  position: relative;
  z-index: 4;
  width: 100%;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.hero__title {
  font-size: clamp(1.85rem, 1.2rem + 2.6vw, 3.2rem);
  letter-spacing: -0.02em;
  margin-bottom: 1.4rem;
}
.hero__lead {
  color: var(--mist);
  max-width: 46ch;
  margin: 0 0 1.8rem;
}

.hero__roles {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  margin: 0 0 2rem;
}
.hero__roles li {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35em 0.85em;
}
.hero__roles li::before { content: "› "; color: var(--lime); }

.hero__actions { display: flex; flex-wrap: wrap; gap: 0.9rem; }

/* ---------- Easter egg: chiusura del terminale ----------
   Due fasi guidate da main.js:
   1) .is-term-closing  → il terminale sfuma e rimpicciolisce, layout fermo
   2) .is-term-closed   → il terminale esce dal flusso (già invisibile)
                          e la colonna di testo si allarga                  */
.hero__grid {
  transition: grid-template-columns 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}
/* .is-term-anim la mette main.js al primo click: da lì in poi queste
   transizioni battono quelle di .reveal (0.7s + delay dello stagger),
   senza toccare l'animazione d'ingresso della pagina */
.hero__grid.is-term-anim .hero__terminal {
  transform-origin: 70% 50%;
  transition: opacity 0.28s ease, transform 0.34s cubic-bezier(0.34, 1.2, 0.64, 1);
  transition-delay: 0s;
}

/* fase 1 — sparisce sul posto */
.hero__grid.is-term-closing .hero__terminal {
  opacity: 0;
  transform: scale(0.9);
  pointer-events: none;
}

/* fase 2 — a larghezza 0 il <pre> andrebbe a capo a ogni carattere e
   farebbe crescere l'altezza dell'hero: lo togliamo dal flusso */
.hero__grid.is-term-closed { grid-template-columns: 1fr 0fr; }
.hero__grid.is-term-closed .hero__terminal {
  position: absolute;
  top: 50%;
  right: 0;
  width: 45%;
  transform: translateY(-50%) scale(0.9);
}

/* il testo di sinistra si allarga a tutta larghezza */
.hero__grid.is-term-closed .hero__lead { max-width: 78ch; }
.hero__grid.is-term-closed .hero__title { font-size: clamp(2rem, 1.2rem + 2.9vw, 3.6rem); }
.hero__grid.is-term-anim .hero__title,
.hero__grid.is-term-anim .hero__lead {
  transition: font-size 0.42s cubic-bezier(0.22, 1, 0.36, 1),
              max-width 0.42s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: 0s;
}

.hero__reopen {
  display: none;
  margin-top: 1.4rem;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--mist);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease, color 0.2s ease;
}
.hero__reopen.is-in { opacity: 0.7; }
.hero__reopen:hover, .hero__reopen:focus-visible { opacity: 1; color: var(--paper); }
.hero__reopen:not([hidden]) { display: inline-block; }

@media (prefers-reduced-motion: reduce) {
  .hero__grid,
  .hero__grid.is-term-anim .hero__terminal,
  .hero__grid.is-term-anim .hero__title,
  .hero__grid.is-term-anim .hero__lead { transition: none; }
}

/* ---------- Terminal ---------- */
.terminal {
  background: #15161400;
  background: linear-gradient(180deg, #1b1d1a, #141513);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 30px 60px -25px rgba(0,0,0,0.8),
              0 0 0 1px rgba(106,228,86,0.06) inset;
  overflow: hidden;
}
.terminal__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
}
.terminal__bar .dot { width: 11px; height: 11px; border-radius: 50%; background: #3a3d39; }
.terminal__bar .dot--close { cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.terminal__bar .dot--close:hover { transform: scale(1.25); box-shadow: 0 0 0 4px rgba(224,98,91,0.18); }
.terminal__bar .dot:nth-child(1) { background: #e0625b; }
.terminal__bar .dot:nth-child(2) { background: #e5b94e; }
.terminal__bar .dot:nth-child(3) { background: var(--lime); }
.terminal__title {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--mist);
  margin-left: 0.5rem;
}
.terminal__body {
  font-family: var(--font-mono);
  font-size: clamp(0.78rem, 0.7rem + 0.4vw, 0.92rem);
  line-height: 1.7;
  color: var(--paper);
  margin: 0;
  padding: 1.4rem 1.3rem 1.6rem;
  white-space: pre-wrap;
}
.t-prompt { color: var(--lime); }
.t-out    { color: var(--mist); }
.t-ok     { color: var(--lime); }
.cursor   { color: var(--lime); animation: blink 1.1s steps(2, start) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* =========================================================
   SECTION base (riutilizzabile)
   ========================================================= */
.section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
/* sezioni a sfondo alternato per dare ritmo/profondità */
.section--alt { background: var(--ink-2); border-block: 1px solid var(--line); }
.section__title {
  font-size: clamp(1.6rem, 1.15rem + 1.8vw, 2.45rem);
  letter-spacing: -0.02em;
  margin: 0 0 1.4rem;
  max-width: 18ch;
}

/* heading di sezione con testo watermark dietro + trattino lime */
.section-head {
  text-align: center;
  max-width: none;
}
.section-head__group {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding-block: clamp(1.2rem, 4vw, 2.2rem);
}
.section-head__bg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(3.2rem, 13vw, 7.5rem);
  font-weight: 800;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
  color: var(--paper);
  opacity: 0.05;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}
.section-head__title {
  position: relative;
  z-index: 1;
  font-size: clamp(1.6rem, 1.15rem + 1.8vw, 2.45rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}
.section-head__title::after {
  content: "";
  display: block;
  width: 58px;
  height: 3px;
  margin: 0.7rem auto 0;
  border-radius: 2px;
  background: var(--lime);
}
.section-head__sub {
  position: relative;
  z-index: 1;
  margin: 0.9rem auto 0;
  max-width: 46ch;
  color: var(--mist);
  font-size: clamp(0.95rem, 0.9rem + 0.3vw, 1.1rem);
  line-height: 1.6;
}

/* =========================================================
   CHI SONO  —  bento grid
   ========================================================= */
.about { position: relative; overflow: hidden; }
.about::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: url("../../images/World Map 1.png") center top / cover no-repeat;
  opacity: 0.12;
  mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,0.35) 45%, transparent 75%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,0.35) 45%, transparent 75%);
  pointer-events: none;
}
.about > .container { position: relative; z-index: 1; }
.about__intro { margin-bottom: clamp(1.75rem, 4vw, 2.75rem); }
.about__intro .section__title { margin-bottom: 0; max-width: 20ch; }

.bento {
  display: grid;
  grid-template-columns: 0.9fr 1.2fr 1fr;
  gap: 1rem;
  grid-template-areas:
    "photo lead config"
    "photo ref  config"
    "wp    ai   opt";
}
.bento__photo  { grid-area: photo; }
.bento__lead   { grid-area: lead; }
.bento__config { grid-area: config; }
.feature--ref  { grid-area: ref; }
.feature--wp   { grid-area: wp; }
.feature--ai   { grid-area: ai; }
.feature--opt  { grid-area: opt; }

/* ritratto */
.bento__photo {
  padding: 0;
  overflow: hidden;
  position: relative;
  margin: 0;
  min-height: 340px;
}
.bento__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  filter: grayscale(1) contrast(1.04) brightness(0.95);
  display: block;
  border-radius: 6px;
}
.bento__photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(106,228,86,0.18) 0%, transparent 35%),
    linear-gradient(0deg, var(--panel) 2%, rgba(38,40,37,0) 38%);
  pointer-events: none;
}

.bento__cell {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.6rem;
}
.bento__cell.bento__photo { padding: 16px; }

.bento__lead {
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #383838, var(--panel));
}
.bento__lead p {
  margin: 0;
  color: var(--paper);
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.18rem);
  line-height: 1.55;
  max-width: 40ch;
}

/* feature card */
.feature { display: flex; flex-direction: column; transition: border-color .2s ease, transform .2s ease; }
.feature:hover { border-color: rgba(106,228,86,0.4); transform: translateY(-3px); }
.feature__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  color: var(--lime);
  background: rgba(106,228,86,0.10);
  border: 1px solid rgba(106,228,86,0.22);
  margin-bottom: 1.1rem;
}
.feature__icon svg { width: 22px; height: 22px; }
.feature__title { display: block; font-size: 1.05rem; font-weight: 700; margin: 0 0 0.45rem; }
.feature__text { font-size: 0.88rem; line-height: 1.55; color: var(--mist); margin: 0; }
/* accordion: su desktop la card resta invariata (head trasparente al layout, chevron nascosto) */
.feature__head { display: contents; color: inherit; }
.feature__chev { display: none; }

/* config card: riempie la colonna alta del bento */
.bento__config { display: flex; flex-direction: column; }
.bento__config .specs { flex: 1; display: flex; flex-direction: column; padding: 0; }
.bento__config .specs__row { flex: 1; align-items: center; }

.speccard {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 50px -28px rgba(0,0,0,0.7);
}
.speccard__head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
}
.speccard__head .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.speccard__head .dot:nth-child(3) { background: var(--lime); }
.speccard__title {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--mist);
  margin-left: 0.4rem;
}
.specs { margin: 0; padding: 0.5rem 0; }
.specs__row {
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: 0.5rem 1rem;
  align-items: baseline;
  padding: 0.7rem 1.4rem;
  border-bottom: 1px solid var(--line);
}
.specs__row:last-child { border-bottom: 0; }
.specs dt {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--lime);
}
.specs dt::before { content: "› "; }
.specs dd {
  margin: 0;
  font-size: 0.95rem;
  color: var(--paper);
}

/* blocco personale / bio */
.about__aiclaim {
  margin-top: 1rem;
  background: linear-gradient(135deg, #383838, var(--panel));
  border: 1px solid var(--line);
  border-left: 3px solid var(--lime);
  border-radius: 16px;
  padding: clamp(1.5rem, 3vw, 2.2rem);
}
.about__aiclaim-text {
  margin: 0;
  font-size: clamp(1.1rem, 0.85rem + 1.2vw, 1.55rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--paper);
  text-wrap: balance;
}
.about__aiclaim-text + .about__aiclaim-text {
  margin-top: 0.75em;
}

.about__personal {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 1rem 2.2rem;
  align-items: center;
  background: linear-gradient(135deg, #383838, var(--panel));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: clamp(1.5rem, 3vw, 2.2rem);
}
.about__quote {
  margin: 0;
  border-left: 3px solid var(--lime);
  padding-left: 1.15rem;
}
.about__quote p {
  margin: 0 0 0.65rem;
  font-size: clamp(1.25rem, 1rem + 1.2vw, 1.75rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--paper);
}
.about__quote cite {
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 0.8rem;
  color: var(--lime);
}
.about__bio {
  color: var(--mist);
  font-size: clamp(0.95rem, 0.9rem + 0.3vw, 1.08rem);
  line-height: 1.65;
}
.about__bio p { margin: 0 0 0.85rem; }
.about__bio p:last-child { margin-bottom: 0; }

/* =========================================================
   SERVIZI  —  cosa faccio
   ========================================================= */
.services__intro,
.skills__intro,
.projects__intro { margin-bottom: clamp(1.75rem, 4vw, 2.75rem); max-width: 52ch; }
.services__intro .section__title,
.skills__intro .section__title,
.projects__intro .section__title { margin-bottom: 0.8rem; max-width: 24ch; }
.services__lead,
.skills__lead,
.projects__lead {
  margin: 0;
  color: var(--mist);
  font-size: clamp(0.95rem, 0.9rem + 0.3vw, 1.1rem);
  line-height: 1.6;
}
.services__callout {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: clamp(1.25rem, 3vw, 1.75rem);
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--lime);
  border-radius: 0 8px 8px 0;
  background: rgba(106,228,86,0.06);
}
.services__callout-icon {
  flex: none;
  width: 24px;
  height: 24px;
  color: var(--lime);
}
.services__callout-icon svg { width: 100%; height: 100%; }
.services__callout p {
  margin: 0;
  font-size: clamp(0.98rem, 0.92rem + 0.3vw, 1.12rem);
  line-height: 1.55;
}
.services__callout strong { color: var(--paper); font-weight: 700; }
.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
/* SEO e Grafica: una riga dedicata, 50% ciascuna */
.services-grid .service--wide { grid-column: span 2; }

/* su schermi medi: 2 colonne (tutte le card al 50%) */
@media (max-width: 1080px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .services-grid .service--wide { grid-column: auto; }
}

/* =========================================================
   COMPETENZE  —  gruppi di skill
   ========================================================= */
.skills { position: relative; overflow: hidden; }
.skills::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url("../../images/pattern.svg");
  background-repeat: repeat;
  background-size: 420px auto;
  opacity: 0.45;
  mask-image: radial-gradient(140% 130% at 85% 0%, #000 20%, rgba(0,0,0,0.25) 65%, transparent 100%);
  -webkit-mask-image: radial-gradient(140% 130% at 85% 0%, #000 20%, rgba(0,0,0,0.25) 65%, transparent 100%);
  pointer-events: none;
}
.skills > .container { position: relative; z-index: 1; }

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  grid-template-areas:
    "dev dev    seo"
    "ai  design pm";
}
.skillgroup--dev    { grid-area: dev; }
.skillgroup--seo    { grid-area: seo; }
.skillgroup--ai     { grid-area: ai; }
.skillgroup--design { grid-area: design; }
.skillgroup--pm     { grid-area: pm; }

.skillgroup {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.6rem;
  transition: border-color .2s ease, transform .2s ease;
}
.skillgroup:hover { border-color: rgba(106,228,86,0.4); transform: translateY(-3px); }
/* card principale: gradiente + titolo piu' grande */
.skillgroup--dev {
  background: linear-gradient(135deg, #383838, var(--panel));
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.skillgroup--dev .skillgroup__title { font-size: 1.2rem; }
.skillgroup__title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 1.1rem;
}
.skillgroup__title::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--lime);
  flex: none;
}
.taglist {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  margin: 0;
}
.taglist li {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35em 0.85em;
  transition: border-color .2s ease, color .2s ease;
}
.taglist li:hover { border-color: rgba(106,228,86,0.5); color: var(--lime); }

/* =========================================================
   PROGETTI
   ========================================================= */
.projects-tabs {
  display: inline-flex;
  gap: 0.35rem;
  padding: 0.3rem;
  margin-bottom: clamp(1.2rem, 3vw, 1.8rem);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.projects-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--mist);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: .02em;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: color .2s ease, background .2s ease;
}
.projects-tab:hover { color: var(--lime); }
.projects-tab.is-active {
  background: rgba(106,228,86,0.14);
  color: var(--lime);
  box-shadow: inset 0 0 0 1px rgba(106,228,86,0.35);
}
.projects-grid[hidden] { display: none; }
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}
/* pannello con poche card: evita che le card occupino tutta la riga */
.projects-grid--few {
  grid-template-columns: repeat(auto-fit, minmax(260px, 340px));
  justify-content: start;
}
.project { display: flex; }
.project__link {
  display: flex;
  flex-direction: column;
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color .2s ease, transform .2s ease;
}
.project__link:hover { border-color: rgba(106,228,86,0.4); transform: translateY(-3px); }
.project__thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #383838, #242424);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.project__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform .35s ease;
}
.project__link:hover .project__img { transform: scale(1.04); }
.project__body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.4rem;
}
.project__tag {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--lime);
}
.project__title { font-size: 1.15rem; font-weight: 700; }
.project__text { font-size: 0.88rem; line-height: 1.55; color: var(--mist); }
.project__cta {
  margin-top: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--paper);
  transition: color .2s ease;
}
.project__link:hover .project__cta { color: var(--lime); }

@media (max-width: 600px) {
  .projects-grid { grid-template-columns: repeat(2, 1fr); gap: 0.7rem; }
  .project__link { border-radius: 12px; }
  .project__body { padding: 0.6rem; gap: 0.25rem; }
  .project__tag { font-size: 0.56rem; }
  .project__title { font-size: 0.85rem; }
  .project__text { font-size: 0.7rem; line-height: 1.3; }
  .project__cta { font-size: 0.68rem; margin-top: 0.2rem; }
}

/* =========================================================
   CONTATTI
   ========================================================= */
.contact { text-align: center; }
.contact__intro { margin: 0 auto clamp(1.6rem, 4vw, 2.4rem); max-width: 60ch; }
.contact__intro .eyebrow { justify-content: center; }
.contact__intro .section__title { max-width: none; margin: 0 0 1rem; }
.contact__lead {
  margin: 0 auto;
  max-width: 54ch;
  color: var(--mist);
  font-size: clamp(0.95rem, 0.9rem + 0.3vw, 1.1rem);
  line-height: 1.6;
}
.contact__actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.9rem;
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(0,0,0,0.18);
}
.site-footer__grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr 1.2fr;
  gap: 2rem;
  padding-block: clamp(2.4rem, 5vw, 3.4rem);
}
.site-footer__tagline {
  margin: 0.85rem 0 0;
  max-width: 38ch;
  color: var(--mist);
  font-size: 0.9rem;
  line-height: 1.6;
}
.site-footer__heading {
  margin: 0 0 1rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lime);
}
.site-footer__col { display: flex; flex-direction: column; gap: 0.65rem; }
.site-footer__col a {
  width: fit-content;
  color: var(--mist);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color .2s ease;
}
.site-footer__col a:hover { color: var(--paper); }
.site-footer__col--mono a { font-family: var(--font-mono); font-size: 0.85rem; }

.site-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem 1.5rem;
  padding-block: 1.3rem;
  border-top: 1px solid var(--line);
}
.site-footer__copy { margin: 0; color: var(--mist); font-size: 0.85rem; }
.site-footer__visits {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--mist);
}
.site-footer__visits-num { color: var(--lime); font-weight: 700; }
.site-footer__top {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--mist);
  text-decoration: none;
  transition: color .2s ease;
}
.site-footer__top:hover { color: var(--lime); }

/* =========================================================
   CTA STICKY (solo mobile)
   ========================================================= */
.cta-sticky { display: none; }

@media (max-width: 880px) {
  .cta-sticky {
    display: block;
    position: fixed;
    z-index: 60;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0.7rem 1rem calc(0.7rem + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(20,21,19,0), rgba(20,21,19,0.92) 45%);
    /* nascosta finché l'hero è a schermo: la sua CTA basta */
    opacity: 0;
    transform: translateY(120%);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .cta-sticky.is-in {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
  .cta-sticky__btn {
    width: 100%;
    justify-content: center;
    box-shadow: 0 8px 28px rgba(0,0,0,0.45);
  }
  /* il footer non deve finire sotto la barra (sul footer e non su
     __bottom: a 600px un'altra regola gli riscrive il padding) */
  .site-footer { padding-bottom: calc(4.2rem + env(safe-area-inset-bottom)); }

  /* col modal aperto la barra sparisce */
  body.modal-open .cta-sticky {
    opacity: 0;
    transform: translateY(120%);
    pointer-events: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cta-sticky { transition: none; }
}

@media (max-width: 880px) {
  .site-footer__grid { grid-template-columns: 1fr; gap: 1.8rem; }
}

@media (max-width: 600px) {
  .site-footer__bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.4rem;
    padding-block: 1.6rem;
  }
  .site-footer__bottom .langswitch { gap: 0.9rem; }
  .site-footer__bottom .langswitch__btn {
    min-width: 44px;
    min-height: 44px;
    padding: 0.6rem 0.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .site-footer__top {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0.6rem 1rem;
  }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 880px) {
  .hero { padding-block: 1.75rem clamp(2.5rem, 8vw, 4rem); }
  .hero__grid, .hero__grid.is-term-closed { grid-template-columns: 1fr; }
  .hero__grid.is-term-closed .hero__terminal { width: 100%; }
  .eyebrow { margin-bottom: 0.9rem; }

  .section__title { max-width: none; }
  .about__intro .section__title { max-width: none; }
  .bento {
    grid-template-columns: 1fr;
    grid-template-areas:
      "photo"
      "lead"
      "ref"
      "wp"
      "ai"
      "opt"
      "config";
  }
  .bento__photo { min-height: 0; height: 300px; }
  .bento__photo img { object-position: center 25%; }

  .about__personal { grid-template-columns: 1fr; gap: 1.3rem; }

  .services-grid { grid-template-columns: 1fr; }
  .services-grid .service--wide { grid-column: auto; }

  .skills-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "dev"
      "seo"
      "ai"
      "design"
      "pm";
  }

  /* card del bento "Chi sono" -> accordion su mobile (le card servizi restano invariate) */
  .bento .feature { padding: 1.05rem 1.25rem; }
  .bento .feature:hover { transform: none; }
  .bento .feature__head {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .bento .feature__icon { margin-bottom: 0; flex: none; }
  .bento .feature__title { margin: 0; flex: 1; }
  .bento .feature__chev {
    display: block;
    width: 18px; height: 18px;
    color: var(--mist);
    flex: none;
    transition: transform .25s ease;
  }
  .bento .feature__body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .28s ease;
  }
  .bento .feature__body > .feature__text {
    overflow: hidden;
    min-height: 0;
    padding-top: 0.85rem;
  }
  .bento .acc-toggle:checked ~ .feature__body { grid-template-rows: 1fr; }
  .bento .acc-toggle:checked ~ .feature__head .feature__chev { transform: rotate(180deg); }

  .nav-burger { display: flex; }
  .nav-links {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--ink);
    padding-inline: var(--pad);
    max-height: 0;
    padding-block: 0;
    border-bottom: 0 solid var(--line);
    visibility: hidden;
    overflow: hidden;
    transition: max-height .3s ease, padding .3s ease, visibility .3s;
  }
  .nav-toggle:checked ~ .nav-links {
    max-height: 520px;
    padding-block: 0.5rem 1.2rem;
    border-bottom-width: 1px;
    visibility: visible;
  }
  .nav-links a { padding: 0.85rem 0; border-bottom: 1px solid var(--line); }
  .nav-cta { text-align: center; margin-top: 0.8rem; border-radius: 9px; }
  .nav-links .langswitch {
    justify-content: center;
    gap: 1rem;
    margin-top: 0.9rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--line);
  }
  .nav-links .langswitch__btn {
    min-width: 44px;
    min-height: 44px;
    padding: 0.5rem 0.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* =========================================================
   ANIMAZIONI — reveal on scroll + effetti
   ========================================================= */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1);
  transition-delay: calc(var(--d, 0) * 90ms);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }

/* bagliore sulle parole verdi dell'hero */
.hero__title .hl { text-shadow: 0 0 34px rgba(106,228,86,0.28); }

/* (glow ambientale rimosso: la nebulosa aurora di .hero__space lo sostituisce) */
@keyframes floatGlow {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(-26px, 30px); }
}

/* spotlight che segue il cursore sulle card */
.bento__cell, .bento__config, .skillgroup { position: relative; }
.bento__cell::before, .bento__config::before, .skillgroup::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(200px circle at var(--mx, 50%) var(--my, 50%), rgba(106,228,86,0.12), transparent 60%);
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}
.bento__cell:hover::before, .bento__config:hover::before, .skillgroup:hover::before { opacity: 1; }

/* =========================================================
   QUOTE / PREVENTIVO FORM
   ========================================================= */
.quote { position: relative; overflow: hidden; }
.quote::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url("../../images/pattern.svg");
  background-repeat: repeat;
  background-size: 420px auto;
  opacity: 0.45;
  mask-image: radial-gradient(140% 130% at 15% 0%, #000 20%, rgba(0,0,0,0.25) 65%, transparent 100%);
  -webkit-mask-image: radial-gradient(140% 130% at 15% 0%, #000 20%, rgba(0,0,0,0.25) 65%, transparent 100%);
  pointer-events: none;
}
.quote > .container { position: relative; z-index: 1; }

.quote__form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  max-width: 760px;
  margin-inline: auto;
  margin-top: clamp(1.5rem, 4vw, 2.5rem);
}

.quote__row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}

.quote__field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.quote__label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--mist);
}

.quote__control {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--paper);
  background: var(--panel);
  border: 1.5px solid var(--line);
  border-radius: 9px;
  padding: 0.7em 0.9em;
  transition: border-color .2s ease, background .2s ease;
}

.quote__control::placeholder { color: var(--mist); opacity: 0.7; }

.quote__control:hover { border-color: var(--lime-dim); }

.quote__control:focus {
  outline: none;
  border-color: var(--lime);
  background: var(--ink);
}

textarea.quote__control { resize: vertical; min-height: 7rem; }

select.quote__control { cursor: pointer; }

.quote__actions {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-top: 0.4rem;
}

.quote__actions .btn { flex: none; }

.quote__note {
  margin: 0;
  flex: 1;
  font-size: 0.85rem;
  color: var(--mist);
}

@media (max-width: 700px) {
  .quote__actions { flex-direction: column; align-items: flex-start; gap: 0.9rem; }
}

@media (max-width: 700px) {
  .quote__row { grid-template-columns: 1fr; }
}

/* =========================================================
   MODAL — popup contatto col form del preventivo
   ========================================================= */
.modal-open { overflow: hidden; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--pad);
  opacity: 0;
  transition: opacity .28s ease;
}

.modal[hidden] { display: none; }

.modal.is-open { opacity: 1; }

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 20, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal__dialog {
  position: relative;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--ink-2);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  transform: translateY(16px) scale(0.98);
  transition: transform .28s ease;
}

.modal.is-open .modal__dialog { transform: translateY(0) scale(1); }

.modal__close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  /* la × è disegnata con due barre: il glifo &times; non è centrato
     nel suo em box e restava in alto a sinistra */
  font-size: 0;
  color: var(--mist);
  background: var(--panel);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease;
}
.modal__close::before,
.modal__close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0.95rem;
  height: 1.5px;
  border-radius: 2px;
  background: currentColor;
}
.modal__close::before { transform: translate(-50%, -50%) rotate(45deg); }
.modal__close::after  { transform: translate(-50%, -50%) rotate(-45deg); }

.modal__close:hover { color: var(--paper); border-color: var(--lime); }

.modal__title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin: 0 2.4rem 0 0;
}

.modal__title .hl { color: var(--lime); }

.modal__sub {
  margin: 0.6rem 0 0;
  color: var(--mist);
  font-size: 0.95rem;
  line-height: 1.2;
}

.modal .quote__form { margin-top: 1.6rem; max-width: none; }

/* =========================================================
   ACCESSIBILITY
   ========================================================= */
:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .cursor { animation: none; }
}

/* ---------- Language switch ---------- */
.langswitch {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-family: "Ubuntu Mono", monospace;
  font-size: .85rem;
  line-height: 1;
}
.langswitch__btn {
  background: none;
  border: 0;
  padding: .15rem .1rem;
  color: inherit;
  opacity: .55;
  cursor: pointer;
  font: inherit;
  letter-spacing: .04em;
  transition: opacity .15s ease, color .15s ease;
}
.langswitch__btn:hover { opacity: .85; }
.langswitch__btn.is-active {
  opacity: 1;
  color: var(--lime, currentColor);
  font-weight: 700;
}
.langswitch__sep { opacity: .35; }
