@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/lato-400.woff2") format("woff2");
}
@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/lato-700.woff2") format("woff2");
}

:root {
  --bg: #fff;
  --text: #334;
  --muted: #6c6c7e;
  --rule: #e4e7eb;
  --blue: #3498db;       /* accento: bordi, pulsanti, nome */
  --link: #2a7ab8;       /* link nel testo, più scuro per il contrasto */
  --blue-soft: #eef6fc;
  --sans: Lato, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

:target { scroll-margin-top: 1.5rem; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--sans);
}

main {
  max-width: 44rem;
  margin: 0 auto;
  padding: 3.5rem 1.25rem 4rem;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

/* impaginazione a due colonne: foto e contatti a sinistra, contenuto a destra */

.page {
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: grid;
  grid-template-columns: 17rem minmax(0, 1fr);
  gap: 0 4.5rem;
}
.page main { max-width: 44rem; margin: 0; padding: 3.5rem 0 4rem; }

.profile {
  position: sticky;
  top: 0;
  align-self: start;
  padding: 3.5rem 0 2rem;
  text-align: center;
}
.profile .photo {
  display: block;
  width: 100%;
  max-width: 13.5rem;
  height: auto;
  margin: 0 auto 1.4rem;
  border-radius: 50%;
}
.profile h1 {
  margin: 0;
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--blue);
}
.profile .role { margin: .35rem 0 0; color: var(--muted); }

.social { display: flex; justify-content: center; gap: .4rem; margin: 1.1rem 0 0; }
a.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  color: var(--blue);
  border: 1px solid var(--blue);
  border-radius: .25rem;
  transition: background .15s, color .15s;
}
a.icon:hover { background: var(--blue); color: #fff; text-decoration: none; }

.contacts { list-style: none; margin: 1.4rem 0 0; padding: 0; font-size: .92rem; }
.contacts li { display: flex; align-items: center; justify-content: center; gap: .5rem; padding: .12rem 0; }
.contacts svg { color: var(--blue); flex: none; }
.profile .where { margin: .8rem 0 0; font-size: .92rem; color: var(--muted); }
.profile .call { margin: .5rem 0 0; font-size: .92rem; }
.profile .call a::after { content: " →"; }

/* barra delle schede */

header.bar nav { margin-top: 0; }

header nav {
  margin-top: .9rem;
  font-size: .95rem;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1.1rem;
}

.lead { margin: 2rem 0 0; }

.back { font-size: .92rem; margin: 0 0 1.4rem; }
.back .sep { color: #c3c8cf; padding: 0 .4rem; }

header h1 {
  font-size: 2rem;
  line-height: 1.2;
  margin: 0;
  color: var(--blue);
}
header .role { margin: .35rem 0 0; color: var(--muted); }

nav.tabs { margin-left: -.55rem; align-items: center; gap: .3rem .2rem; }
nav.tabs a { color: var(--text); padding: .28rem .55rem; border: 1px solid transparent; border-radius: .25rem; }
nav.tabs a:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; }
nav.tabs a.on { background: var(--blue); border-color: var(--blue); color: #fff; }
nav.tabs .sep { color: #c3c8cf; padding: 0 .25rem; }

.js section.tab { display: none; margin-top: 2.2rem; }
.js section.tab.on { display: block; }
.js .tab-title { display: none; }
.js .tab .lead { margin: 0 0 2.4rem; }
h2.sub { margin-top: 2.4rem; }
.lead p { margin: 0 0 .8rem; }
.lead strong { font-weight: 700; }

section p { margin: 0 0 .8rem; }

.ctas { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.3rem; }

/* pulsanti a contorno blu, pieni al passaggio del mouse; il primario è pieno */
.btn {
  display: inline-block;
  font: 700 .9rem/1.2 var(--sans);
  color: var(--blue);
  background: transparent;
  border: 1px solid var(--blue);
  border-radius: .25rem;
  padding: .5rem .9rem;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.btn:hover { background: var(--blue); color: #fff; text-decoration: none; }
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:hover { background: #2a80b9; border-color: #2a80b9; }

section { margin-top: 2.6rem; }

h2 {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--blue);
  margin: 0 0 .9rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--rule);
}

ul.list { list-style: none; margin: 0; padding: 0; }

ul.list li {
  display: grid;
  grid-template-columns: 7.4rem 1fr;
  gap: 0 1rem;
  padding: .5rem 0;
}

.when {
  font-size: .88rem;
  color: var(--muted);
  padding-top: .15rem;
  white-space: nowrap;
}

.what b { font-weight: 700; }

/* etichette dei servizi: piccole targhette blu */
ul.services li { padding: .75rem 0; }
ul.services .when {
  justify-self: start;
  align-self: start;
  margin-top: .15rem;
  padding: .1rem .5rem;
  border: 1px solid var(--blue);
  border-radius: .25rem;
  color: var(--blue);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  line-height: 1.5;
}
.what .desc { display: block; }

.stack {
  display: block;
  font-size: .85rem;
  color: var(--muted);
  margin-top: .1rem;
}

dl.skills { margin: 0; display: grid; grid-template-columns: 7.4rem 1fr; gap: .35rem 1rem; }
dl.skills dt { font-size: .88rem; color: var(--muted); padding-top: .1rem; }
dl.skills dd { margin: 0; }

ol.steps { list-style: none; margin: 0; padding: 0; counter-reset: passo; }
ol.steps li {
  counter-increment: passo;
  display: grid;
  grid-template-columns: 7.4rem 1fr;
  gap: 0 1rem;
  padding: .35rem 0;
}
ol.steps li::before {
  content: "0" counter(passo);
  font-size: .95rem;
  font-weight: 700;
  color: var(--blue);
}
.note { color: var(--muted); margin-top: .8rem; }

/* contatti: campi del modulo nativi del browser */

.form { display: grid; gap: 1rem; margin-top: 1.2rem; max-width: 36rem; }

fieldset.tipi { margin: 0; padding: .5rem .9rem .7rem; min-width: 0; }
fieldset.tipi legend { padding: 0 .3rem; }
.tipi label { display: flex; align-items: center; gap: .45rem; padding: .12rem 0; cursor: pointer; }
.tipi input { margin: 0; accent-color: var(--blue); }

.field { display: grid; gap: .3rem; }
.field textarea, .field select, .field input { width: 100%; box-sizing: border-box; }
.field textarea { min-height: 6.5rem; resize: vertical; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form .ctas { margin-top: .2rem; }

.direct { margin-top: 1.4rem; color: var(--muted); }

footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: .85rem;
  color: var(--muted);
  line-height: 1.7;
}

@media (max-width: 56rem) {
  .page { display: block; max-width: 44rem; }
  .profile { position: static; padding: 2.5rem 0 0; }
  .profile .photo { max-width: 10rem; margin-bottom: 1rem; }
  .contacts { display: flex; flex-wrap: wrap; justify-content: center; gap: .1rem 1.1rem; margin-top: 1rem; }
  .page main { padding-top: 2rem; }
  header.bar { border-top: 1px solid var(--rule); padding-top: 1.2rem; }
}

@media (max-width: 34rem) {
  main { padding-top: 2.2rem; }
  ul.list li, dl.skills { grid-template-columns: 1fr; }
  ol.steps li { grid-template-columns: 2rem 1fr; gap: 0 .6rem; }
  ul.services .when { margin-bottom: .35rem; }
  .row { grid-template-columns: 1fr; }
  .when { padding-top: 0; }
  dl.skills { gap: 0; }
  dl.skills dt { margin-top: .7rem; }
  dl.skills dt:first-child { margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  a.icon, .btn { transition: none; }
}

@media print {
  .js section.tab { display: block; }
  .js .tab-title { display: block; }
  .ctas, .form, header nav, .social, .profile .call { display: none; }
  body { background: #fff; font-size: 11pt; }
  .page { display: block; }
  .profile { position: static; padding: 0; text-align: left; }
  .profile .photo { max-width: 6rem; margin: 0 0 .6rem; }
  .contacts li { justify-content: flex-start; }
  main, .page main { padding: 0; max-width: none; }
  a { color: inherit; }
}

.more { display: inline-block; margin-top: .25rem; font-size: .9rem; font-weight: 700; }

figure { margin: 1.6rem 0 0; }
figure img, figure video { display: block; width: 100%; height: auto; border: 1px solid var(--rule); border-radius: .25rem; background: #fff; }
figcaption { margin-top: .45rem; font-size: .85rem; color: var(--muted); }
figure.video { margin: 2rem 0 0; }
