body.no-scroll {
    overflow: hidden;
}

main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6rem;
  
  /* MAGIA APPLE: Container centrato a larghezza massima */
  margin: 0 auto; 
  width: 100%;
  max-width: 1140px; 
  padding: 12rem 1rem 8rem 1rem;
}

/* MEDIA QUERIES PER IL MAIN */
@media (min-width: 750px) {
  main {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}
/* La media query dei 1080px non serve più: ci pensa il max-width! */


main h3 {
  font-weight: 500;
}

.cv-title {
  display: flex;
  flex-direction: column;
  align-items: center; 
  gap: 2rem;
  align-self: stretch;
}

.cv-title img {
  border-radius: 999px;
}

.cv-title .name {
  text-align: center;
  font-size: 3rem;
  line-height: 3.5rem;
  font-weight: 500;
}

.cv-title .role {
  text-align: center;
  font-size: 1.5rem;
  background: linear-gradient(90deg, #DB00AC 23.56%, #0900FF 90.38%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* NAVIGAZIONE INTERNA (INDEX-LIST) */
.index-list {
  z-index: 90;
  width: 100%;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.85); 
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.index-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #B7B7B7; 
  white-space: nowrap;
}

.index-list ul {
  display: flex;
  list-style: none;
  padding: 0.75rem 1rem;
  gap: 0.5rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.index-list ul::-webkit-scrollbar {
  display: none;
}

.index-list ul a {
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  color: #666;
  white-space: nowrap; 
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
  display: block;
}

.index-list ul a:hover, .index-list ul a:active {
  background: #212121;
  color: #fff;
}

/* LOGICA RESPONSIVE PER L'INDICE */
@media (max-width: 749px) {
  .index-list {
    position: static; 
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
}

@media (min-width: 750px) {
  .index-list {
    position: static;
    width: fit-content;
    padding: 1rem 2.5rem;
    border-radius: 1.5rem;
    margin: 0 auto;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  }

  .index-list ul {
    overflow-x: visible;
    padding: 0;
    gap: 1.5rem;
    flex-direction: row; 
  }

  .index-list ul a {
    background: transparent;
    padding: 0.5rem 0;
    border-radius: 0;
    font-size: 1rem;
  }

  .index-list ul a:hover {
    background: transparent;
    color: #212121;
    box-shadow: 0 2px 0 #212121; 
  }
}

.title {
  align-self: stretch;
  padding-right: 3rem;
}

/* SEZIONE OBIETTIVI E LEGGIBILITÀ */
.goal-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem; 
  align-self: stretch;
}

.goal-section .intro-text {
  display: flex;
  flex-direction: column;
  gap: 1.25rem; 
  max-width: 65ch; 
}

.goal-section .intro-text p {
  font: var(--body-m-font); 
  line-height: 1.6; 
  color: #333333; 
}

.goal-section .intro-text strong {
  font: var(--body-m-strong-font);
  color: #111111; 
}

/* --- SEZIONE COMPETENZE CSS GRID --- */
.skills-section {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2.5rem;
  align-self: stretch;
}

.skills-section .skills-grid {
  display: grid;
  grid-template-columns: 1fr; 
  gap: 3rem; 
  width: 100%;
}

@media (min-width: 768px) {
  .skills-section .skills-grid {
    grid-template-columns: 1fr 1fr; 
    column-gap: 4rem; 
    row-gap: 4rem;    
    align-items: start; 
  }
}

.skills-section .skill-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  align-self: stretch;
  gap: 1.25rem;
}

.skills-section .skill-group h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #212121;
}

.skills-section .skill-group .chips-group {
  display: flex;
  align-items: flex-start;
  align-content: flex-start;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.education-section, .jobs-section {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5rem;
  align-self: stretch;
}

.education-section h3, .jobs-section h3 {
  font-size: 1rem;
  font-weight: 600;
}

.language-section {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5rem;
  align-self: stretch;
}

.language-section .language-group {
  display: flex;
  align-items: flex-start;
  align-content: flex-start;
  gap: 0.75rem;
  align-self: stretch;
  flex-wrap: wrap;
}

.final-section {
  display: flex;
  padding-top: 2rem;
  flex-direction: column;
  align-items: center;
  gap: 5.5rem;
  align-self: stretch;
}

.final-section .cv-download {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4rem;
}

.final-section .cv-download p {
  font-size: 1.25rem;
}

.final-section .contact-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4rem;
  align-self: stretch;
}

.final-section .contact-group .row {
  display: flex;
  max-width: 34rem;
  padding: 0.25rem 3rem;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
}

.final-section .contact-group .row img {
  width: 48px;
  height: 48px;
}

.final-section .contact-group .row a {
  transition: all 0.3s ease;
}

.final-section .contact-group .row a:hover {
  transform: translateY(-4px) scale(1.1);
  opacity: 0.9;
}

/* Applichiamo l'offset a tutte le sezioni principali del CV */
#obiettivi, 
#competenze, 
#formazione, 
#esperienze, 
#lingue, 
#contatti {
  scroll-margin-top: 9.5rem; 
}

section[id] {
  scroll-margin-top: 9.5rem;
}

/* --- TIMELINE FORMAZIONE --- */
.timeline-container {
  position: relative;
  padding-left: 2.5rem; /* Spazio per la linea e i cerchi */
  display: flex;
  flex-direction: column;
  gap: 1.5rem; /* Mantiene lo spazio tra le card */
  width: 100%;
}

/* La linea verticale della timeline */
.timeline-container::before {
  content: '';
  position: absolute;
  top: 1.5rem; /* Fai partire la linea un po' più in basso per allinearla al primo cerchio */
  bottom: 1rem; /* Fai terminare la linea prima dell'ultima card */
  left: 7px; /* Centra la linea rispetto al cerchio (16px / 2 = 8px, meno metà spessore linea) */
  width: 2px;
  background-color: #DADADA;
}

.timeline-item {
  position: relative;
  width: 100%;
}

/* Il contenitore del cerchio principale (esterno scuro) */
.timeline-dot {
  position: absolute;
  left: -2.5rem; /* Riporta il cerchio sulla linea verticale */
  top: 1.25rem; /* Allineato visivamente alla testata della card */
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: #212121;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2; /* Rimane sopra la linea grigia */
}

/* Il cerchio interno più chiaro */
.timeline-dot .inner-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #A0A0A0; /* Grigio più chiaro a contrasto */
  position: relative;
  z-index: 3;
}

/* L'animazione radar che pulsa dal cerchio esterno */
.timeline-dot::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: #212121; /* Stesso colore del cerchio esterno per l'onda */
  z-index: 1;
  animation: radar-pulse 2s infinite ease-out;
}

@keyframes radar-pulse {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}