/**
 * Foglio di stile di QUESTO sito (Alessandro Canali 2026)
 * Viene caricato dopo css/motore.css e ridà alle classi del motore l'aspetto che il sito
 * aveva prima di SAN CMS (css/style.css della cartella HTML): stessi valori, nomi nuovi.
 * L'aggiornamento del motore non tocca questo file.
 *
 * Le sezioni si riconoscono dalla loro ancora (#home, #portfolio, #skills, #gear, #resume,
 * #contact): cambiando l'ancora di una sezione nel pannello, le sue regole qui non valgono più.
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Syne:wght@600;700;800&display=swap');

:root {
  /* Colors - Apple Editorial Light Theme */
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f7;
  --bg-card: rgba(255, 255, 255, 0.85);

  --text-primary: #1d1d1f;
  --text-secondary: #86868b;
  --border-light: rgba(0, 0, 0, 0.08);

  --accent-blue: #0066cc;
  --accent-blue-hover: #0077ed;

  --pastel-cream-bg: linear-gradient(135deg, #faf8f5 0%, #f2eae1 100%);
  --pastel-cream-border: rgba(217, 191, 163, 0.45);
  --pastel-cream-text: #8c7355;

  /* Custom Skills Pastels derived from #FAA009, #CC3300, #4C894B */
  --skills-orange-bg: #ffe8cc;
  --skills-orange-border: rgba(250, 160, 9, 0.35);
  --skills-orange-text: #b27200;

  --skills-red-bg: #ffd6cc;
  --skills-red-border: rgba(204, 51, 0, 0.35);
  --skills-red-text: #cc3300;

  --skills-green-bg: #dceddc;
  --skills-green-border: rgba(76, 137, 75, 0.35);
  --skills-green-text: #3c6e3b;

  --skills-cyan-bg: #e0f7ff;
  --skills-cyan-border: rgba(0, 153, 204, 0.35);
  --skills-cyan-text: #0099CC;

  /* Sizing tokens */
  --rounded-card: 24px;
  --rounded-icon: 20px;
  --rounded-btn: 30px;

  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-accent: 'Syne', sans-serif;

  /* le variabili del motore prendono i valori del sito */
  --bg: var(--bg-primary);
  --bg2: var(--bg-secondary);
  --ink: var(--text-primary);
  --muted: var(--text-secondary);
  --text: var(--text-secondary);
  --line: var(--border-light);
  --display: var(--font-main);
  --body: var(--font-main);
}

/* ==========================================================================
   BASE
   ========================================================================== */

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
  font-size: 16px;
  background-color: var(--bg-primary);
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-main);
  letter-spacing: normal;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

a {
  transition: var(--transition-smooth);
}

ul {
  padding: 0;
}

section {
  scroll-margin-top: 0;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: #d1d1d6;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a1a1a6;
}

/* contenitore: quello dell'intestazione e del piè di pagina (.container) e quello delle sezioni (.wrap) */
.container,
.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.sec.pad {
  padding: 60px 0;
}

/* righe e colonne: stesso passo che avevano i titoli di sezione (3.5rem sotto) */
.rw {
  gap: 2rem;
}

.rw + .rw {
  margin-top: 3.5rem;
}

/* titolo di sezione: titolo grande + sottotitolo grigio subito sotto */
.title {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text-primary);
  text-wrap: wrap;
}

.t-sub {
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text-secondary);
}

.cl > .title + .t-sub {
  margin-top: calc(5px - 20px);
}

.desc {
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* pulsanti a capsula */
.btn {
  border-radius: var(--br, var(--btn-r, var(--rounded-btn)));
  transition: var(--transition-smooth);
}

.btn:hover {
  opacity: 0.9;
}

.btn.grey {
  border: 1px solid var(--border-light);
  box-shadow: none;
}

.btn.grey:hover {
  opacity: 1;
  background: #e8e8ed;
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: none;
}

.btn.light {
  border: 1px solid var(--border-light);
}

.btn.light:hover {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: var(--top-bg, rgba(255, 255, 255, 0.7));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition-smooth);
}

header.scrolled {
  background: var(--top-bg, rgba(255, 255, 255, 0.85));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 76px;
}

.logo-container {
  display: flex;
  align-items: center;
}

.logo-img {
  height: var(--logo-h, 40px);
  width: auto;
  transition: var(--transition-smooth);
  filter: contrast(1.1);
}

.nav-menu {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 2.2rem;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
  padding: 8px 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background-color: var(--text-primary);
  transition: var(--transition-smooth);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 80%;
}

.nav-socials {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-left: 1.5rem;
}

.social-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: rgba(0, 0, 0, 0.02);
  transition: var(--transition-smooth);
}

.social-icon img {
  width: 14px;
  height: 14px;
  opacity: 0.7;
  transition: var(--transition-smooth);
}

.social-icon:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: var(--text-primary);
  transform: translateY(-2px);
}

.social-icon:hover img {
  opacity: 1;
}

/* Mobile Toggle */
.menu-btn {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 16px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 1100;
}

.menu-btn span {
  width: 100%;
  height: 2px;
  background-color: var(--text-primary);
  transition: var(--transition-smooth);
}

/* ==========================================================================
   HERO (#home)
   ========================================================================== */

#home.sec.pad {
  position: relative;
  padding-top: 110px;
  padding-bottom: 50px;
  background-color: var(--bg-primary);
}

#home .rw {
  grid-template-columns: 1fr 1.1fr;
  gap: 5rem;
  align-items: center;
}

#home .cl {
  grid-column: auto;
  align-self: center;
  min-width: auto;
}

/* affiancato a quello col bordo, il pulsante scuro è alto uguale */
#home .btn-row,
#contact .btn-row {
  display: flex;
}

/* il ritratto in movimento */
#home .cl:first-child {
  align-items: center;
}

#home .vid {
  position: relative;
  width: 380px;
  height: 380px;
  max-width: 100%;
  margin-bottom: 0;
  z-index: 2;
  overflow: hidden;
  transition: var(--transition-smooth);
}

#home .vid video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
}

/* i testi: una riga per blocco, i due pulsanti affiancati */
#home .cl:last-child {
  flex-flow: row wrap;
  gap: 1.8rem 1.2rem;
}

#home .cl:last-child > * {
  flex: 0 0 100%;
}

#home .cl:last-child > .btn-row {
  flex: 0 0 auto;
  margin-top: 0.8rem;
}

#home .title {
  font-size: 4.5rem;
  letter-spacing: -0.04em;
  white-space: nowrap;
}

#home .t-sub {
  font-size: 2rem;
  line-height: 1.5;
  margin-top: 2px;
  white-space: nowrap;
}

#home .desc + .desc {
  margin-top: 1rem;
  font-size: 1.1rem;
  opacity: 0.85;
}

/* ==========================================================================
   PORTFOLIO (schede con video)
   ========================================================================== */

.vcards {
  --vg: 2.2rem;
  --vr: var(--rounded-card);
}

.vcard {
  background: var(--bg-primary);
  transition: var(--transition-smooth);
}

.vc-pic {
  background: transparent;
}

.vc-pic img {
  transition: var(--transition-smooth);
}

/* velo leggerissimo sopra la copertina, sotto il tondo del play */
.vc-pic::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.02);
  transition: var(--transition-smooth);
}

.vcard:hover .vc-pic::before {
  background: rgba(255, 255, 255, 0.1);
}

.vc-play {
  z-index: 3;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  transition: var(--transition-smooth);
}

.vcard:hover .vc-play {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
  border-color: #ffffff;
}

.vc-info {
  padding: 1.5rem;
}

.vc-info h3 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.5;
  color: var(--text-primary);
}

.vc-tags {
  margin-top: 0.5rem;
}

/* il video aperto */
.vbox {
  z-index: 9999;
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  animation: vboxIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.vbox-in {
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.85);
  animation: vboxGrow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.vbox-x {
  z-index: 10010;
  transition: var(--transition-smooth);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.vbox-x:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: rotate(90deg);
  border-color: #ffffff;
}

@keyframes vboxIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes vboxGrow {
  from { transform: scale(0.92); }
  to { transform: scale(1); }
}

/* ==========================================================================
   SKILLS (#skills)
   ========================================================================== */

#skills .rw {
  grid-template-columns: 0.9fr 1.1fr;
  gap: 5rem;
  align-items: center;
}

#skills .cl {
  grid-column: auto;
  align-self: center;
  min-width: auto;
}

#skills .cl:first-child {
  gap: 2rem;
}

#skills .cl:first-child > .title + .t-sub {
  margin-top: calc(5px - 2rem);
  margin-bottom: 3.5rem;
}

#skills .cl:last-child {
  gap: 1.8rem;
}

/* illustrazione nel suo riquadro bianco */
.pic-box {
  border-radius: var(--rounded-card);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.pic-box .pic {
  max-height: 250px;
  filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.06));
}

/* riquadri con le etichette */
.tagbox {
  position: relative;
  overflow: hidden;
  padding: 2rem;
  border-radius: var(--rounded-card);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  transition: var(--transition-smooth);
}

.tagbox:hover {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.tb-head {
  margin-bottom: 1.2rem;
}

.tb-ico {
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}

.tagbox .h {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.5;
  color: inherit;
}

.tb-tags span {
  color: var(--text-primary);
  border: 1px solid rgba(0, 0, 0, 0.04);
  transition: var(--transition-smooth);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.tb-tags span:hover {
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* ==========================================================================
   GEAR (riquadro con immagine + categorie e schede)
   ========================================================================== */

.picbox {
  gap: 3rem;
  padding: 3rem;
  background: var(--bg-primary);
  border: 1px solid rgba(217, 191, 163, 0.25);
  border-radius: var(--rounded-card);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.02);
  transition: var(--transition-smooth);
}

.pb-pic {
  max-width: 100%;
  flex-shrink: 1;
  border-radius: 16px;
  border: 1px solid var(--border-light);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.picbox .h {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.5;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.pb-text p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1.6;
}

.pb-text .pb-note {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(217, 191, 163, 0.15);
  font-size: 0.88em;
  color: #a09080;
}

.tab-bar {
  gap: 3.5rem;
  max-width: none;
  margin-bottom: 60px;
}

/* le linguette hanno il carattere dei pulsanti del browser, com'era nel sito di prima */
.tab-btn {
  flex: 0 1 auto;
  font-family: revert;
  transition: var(--transition-smooth);
}

.tab-btn.on {
  background: var(--bg-primary);
}

.tab-pane.on {
  animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.lgs {
  gap: 2.5rem 2rem;
}

.lg {
  gap: 0.8rem;
  cursor: pointer;
  border-radius: var(--rounded-card);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.03);
  transition: var(--transition-smooth);
}

.lg-pic {
  position: relative;
  background: var(--bg-primary);
  transition: var(--transition-smooth);
}

.lg-pic img {
  filter: contrast(1.02);
  transition: var(--transition-smooth);
}

.lg-t {
  letter-spacing: -0.02em;
  color: var(--text-primary);
  transition: var(--transition-smooth);
}

.lg:hover .lg-pic {
  transform: translateY(-6px) scale(1.04);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

.lg:hover .lg-pic img {
  transform: scale(1.02);
}

/* il colore al passaggio del mouse cambia con la categoria: prima, seconda, terza, quarta */
.tab-pane:nth-child(2) .lg:hover .lg-pic {
  background: var(--skills-orange-bg);
  border-color: var(--skills-orange-border);
}

.tab-pane:nth-child(2) .lg:hover .lg-t {
  color: var(--skills-orange-text);
}

.tab-pane:nth-child(3) .lg:hover .lg-pic {
  background: var(--skills-red-bg);
  border-color: var(--skills-red-border);
}

.tab-pane:nth-child(3) .lg:hover .lg-t {
  color: var(--skills-red-text);
}

.tab-pane:nth-child(4) .lg:hover .lg-pic {
  background: var(--skills-green-bg);
  border-color: var(--skills-green-border);
}

.tab-pane:nth-child(4) .lg:hover .lg-t {
  color: var(--skills-green-text);
}

.tab-pane:nth-child(5) .lg:hover .lg-pic {
  background: var(--skills-cyan-bg);
  border-color: var(--skills-cyan-border);
}

.tab-pane:nth-child(5) .lg:hover .lg-t {
  color: var(--skills-cyan-text);
}

/* ==========================================================================
   RESUME (#resume): il testo è un blocco Codice HTML con queste classi
   ========================================================================== */

#resume .wrap {
  max-width: 1040px;
}

.resume-text-wrapper {
  background: var(--bg-primary);
  border-radius: var(--rounded-card);
  padding: 3.5rem 4rem;
  border: 1px solid var(--border-light);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.resume-paragraph {
  font-size: 1.02rem;
  line-height: 1.8;
  color: var(--text-secondary);
  text-align: justify;
}

.resume-paragraph.lead-text {
  font-size: 1.28rem;
  font-weight: 600;
  line-height: 1.6;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 2rem;
  margin-bottom: 0.5rem;
  text-align: left;
}

.resume-paragraph strong {
  color: var(--text-primary);
  font-weight: 700;
}

.resume-paragraph em {
  font-style: normal;
  color: var(--text-primary);
  font-weight: 600;
}

.resume-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--border-light);
  text-underline-offset: 4px;
  transition: var(--transition-smooth);
}

.resume-link:hover {
  color: var(--accent-blue);
  text-decoration-color: var(--accent-blue);
}

/* ==========================================================================
   CONTATTI (#contact) E PIÈ DI PAGINA
   ========================================================================== */

#contact.sec.pad {
  border-top: 1px solid var(--border-light);
  padding: 100px 0 5rem;
}

#contact .rw {
  grid-template-columns: 1.1fr 0.9fr;
  gap: 5rem;
  align-items: stretch;
}

#contact .cl {
  grid-column: auto;
  align-self: stretch;
  min-width: auto;
}

/* testi a sinistra: una riga per blocco, i due pulsanti affiancati, tutto centrato in altezza */
#contact .cl:first-child {
  flex-flow: row wrap;
  align-content: center;
  gap: 1.2rem;
}

/* fra un testo e l'altro 2.2rem; fra i due pulsanti, quando vanno a capo, 1.2rem */
#contact .cl:first-child > * {
  flex: 0 0 100%;
  margin-bottom: 1rem;
}

#contact .cl:first-child > .btn-row {
  margin-bottom: 0;
}

#contact .cl:first-child > .btn-row {
  flex: 0 0 auto;
}

#contact .title {
  font-size: 4rem;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

#contact .cl:first-child > .title + .t-sub {
  line-height: 1.05;
  margin-top: calc(8px - 2.2rem);
}

#contact .desc {
  font-size: 1.25rem;
}

#contact .btn {
  gap: 10px;
  padding: 0.9rem 2.5rem;
  font-size: 1.1rem;
}

/* l'icona davanti alla scritta: la busta per la posta, il marchio per LinkedIn */
#contact .btn[href="#email"]::before,
#contact .btn[href*="linkedin.com"]::before {
  content: '';
  flex: none;
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: var(--btn-icon) center / contain no-repeat;
  mask: var(--btn-icon) center / contain no-repeat;
}

#contact .btn[href="#email"] {
  --btn-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z'/%3E%3C/svg%3E");
}

#contact .btn[href*="linkedin.com"] {
  --btn-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 0h-14c-2.761 0-5 2.239-5 5v14c0 2.761 2.239 5 5 5h14c2.762 0 5-2.239 5-5v-14c0-2.761-2.238-5-5-5zm-11 19h-3v-11h3v11zm-1.5-12.268c-.966 0-1.75-.79-1.75-1.764s.784-1.764 1.75-1.764 1.75.79 1.75 1.764-.783 1.764-1.75 1.764zm13.500 12.268h-3v-5.604c0-3.368-4-3.113-4 0v5.604h-3v-11h3v1.765c1.396-2.586 7-2.777 7 2.476v6.759z'/%3E%3C/svg%3E");
}

/* illustrazione a destra: il riquadro bianco è la colonna (fondo, spazio e angoli si scelgono nel pannello) */
#contact .cl:last-child {
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  transition: var(--transition-smooth);
}

#contact .cl:last-child .pic {
  width: auto;
  max-height: 250px;
  object-fit: contain;
  filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.06));
  transition: var(--transition-smooth);
}

footer {
  background: var(--foot-bg, var(--bg-secondary));
  padding: 0 0 50px 0;
}

.footer-bottom {
  text-align: center;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border-light);
}

.copyright {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.copyright span.accent-name {
  color: var(--text-primary);
  font-weight: 600;
}

.iubenda-links {
  margin-top: 0.8rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

/* ==========================================================================
   ANIMATIONS & MOBILE BREAKPOINTS
   ========================================================================== */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* il motore mette le colonne una sotto l'altra da 900px, il sito lo faceva da 1024px */
@media (min-width: 901px) and (max-width: 1024px) {
  .cl {
    grid-column: auto / span 12;
    align-self: stretch;
  }
}

/* e le sue regole per le linguette e il riquadro con immagine partivano da soglie diverse */
@media (min-width: 769px) {
  .tab-bar {
    align-self: center;
    overflow: visible;
    border-radius: 40px;
  }
}

@media (max-width: 1024px) {
  html {
    font-size: 15px;
  }

  .title {
    font-size: 3rem;
  }

  #home .rw {
    grid-template-columns: 1fr;
    gap: 4rem;
    text-align: center;
  }

  #home .vid {
    width: 320px;
    height: 320px;
  }

  #home .cl:last-child {
    justify-content: center;
  }

  #home .title {
    font-size: 3.5rem;
    white-space: normal;
  }

  #home .t-sub {
    font-size: 1.6rem;
    white-space: normal;
    margin-top: 2px;
  }

  #skills .rw {
    grid-template-columns: 1fr;
    gap: 4rem;
  }

  .picbox,
  .picbox.rev {
    flex-direction: column;
    text-align: center;
    padding: 2rem;
  }

  .pb-pic {
    width: 100%;
  }

  #contact .rw {
    grid-template-columns: 1fr;
    gap: 4rem;
    text-align: center;
  }

  #contact .cl:first-child {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .container,
  .wrap {
    padding: 0 1rem;
  }

  .menu-btn {
    display: flex;
    margin-left: auto;
  }

  .nav-menu {
    position: fixed;
    top: 76px;
    left: 0;
    width: 100%;
    height: calc(100vh - 76px);
    background: var(--bg-primary);
    border-top: 1px solid var(--border-light);
    flex-direction: column;
    padding: 3rem 0;
    gap: 2.2rem;
    transform: translateX(-100%);
    transition: var(--transition-smooth);
    z-index: 999;
  }

  .nav-menu.active {
    transform: translateX(0);
  }

  .nav-socials {
    margin-left: 0;
    margin-top: 2rem;
  }

  .menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .menu-btn.active span:nth-child(2) {
    opacity: 0;
  }

  .menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  #home .title {
    font-size: clamp(2rem, 9vw, 2.8rem);
  }

  #home .t-sub {
    font-size: clamp(1.1rem, 5vw, 1.4rem);
  }

  #home .vid {
    width: min(290px, 75vw);
    height: min(290px, 75vw);
  }

  .title {
    font-size: clamp(1.8rem, 7vw, 2.4rem);
  }

  .t-sub {
    font-size: clamp(1rem, 4.5vw, 1.2rem);
  }

  .rw + .rw {
    margin-top: 2rem;
  }

  #skills .cl:first-child > .title + .t-sub {
    margin-bottom: 2rem;
  }

  /* linguette che si scorrono col dito, sfumate dal lato in cui continuano (lo dice sito.js) */
  .tab-bar {
    width: 100%;
    align-self: stretch;
    justify-content: center;
    overflow-x: auto;
    white-space: nowrap;
    flex-wrap: nowrap;
    border-radius: 20px;
    padding: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, #000 82%, transparent 97%);
    mask-image: linear-gradient(to right, #000 82%, transparent 97%);
    transition: mask-image 0.25s ease, -webkit-mask-image 0.25s ease;
  }

  .tab-bar.fits {
    -webkit-mask-image: none;
    mask-image: none;
  }

  .tab-bar.fade-right {
    -webkit-mask-image: linear-gradient(to right, #000 82%, transparent 97%);
    mask-image: linear-gradient(to right, #000 82%, transparent 97%);
  }

  .tab-bar.fade-left {
    -webkit-mask-image: linear-gradient(to right, transparent 3%, #000 18%);
    mask-image: linear-gradient(to right, transparent 3%, #000 18%);
  }

  .tab-bar.fade-both {
    -webkit-mask-image: linear-gradient(to right, transparent 3%, #000 18%, #000 82%, transparent 97%);
    mask-image: linear-gradient(to right, transparent 3%, #000 18%, #000 82%, transparent 97%);
  }

  .tab-bar::-webkit-scrollbar {
    display: none;
  }

  .tab-btn {
    padding: 0.6rem 1.4rem;
    flex-shrink: 0;
  }

  @media (max-width: 480px) {
    .tab-bar {
      justify-content: flex-start !important;
    }
  }

  /* gli stessi spazi che la sezione aveva sul telefono: titolo, riquadro, linguette, loghi */
  #gear .rw:nth-child(2) {
    margin-top: 5.3rem;
  }

  #gear .rw:nth-child(3) {
    margin-top: 3.8rem;
  }

  #gear .tab-bar {
    margin-bottom: calc(60px + 1.8rem);
  }

  /* due loghi per riga */
  .lgs {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.8rem 1rem !important;
  }

  .lg {
    width: 100% !important;
    max-width: 140px !important;
  }

  .lg-pic {
    width: 72px !important;
    height: 72px !important;
    border-radius: 16px !important;
    padding: 10px !important;
  }

  .resume-text-wrapper {
    padding: 2.5rem 2rem;
    gap: 1.5rem;
  }

  .resume-paragraph {
    font-size: 0.95rem;
    text-align: left;
  }

  .resume-paragraph.lead-text {
    font-size: 1.15rem;
    padding-bottom: 1.5rem;
  }

  #contact .title {
    font-size: clamp(2.2rem, 9vw, 2.8rem);
  }

  #contact .t-sub {
    font-size: clamp(1.1rem, 5vw, 1.3rem);
  }

  #contact .desc {
    font-size: 1.05rem;
    line-height: 1.5;
  }

  #contact .cl:last-child {
    padding: 1.5rem !important;
    margin-top: 1rem;
  }

  #contact .cl:last-child .pic {
    max-height: 200px;
    max-width: 100%;
    height: auto;
  }
}
