/* style.css di base */
body { margin:0; font-family: 'Orbitron', 'Open Sans', sans-serif; color:#333; }
.hero { position: relative; height: 100vh; overflow: hidden; }
.hero-video { position: absolute; width: 100%; height: 100%; object-fit: cover; top:0; left:0; z-index: -1; }
.hero-text {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 80px; /* distanza dalla fine del div; regola se vuoi più/meno spazio */
  width: 100%;
  text-align: center;
  color: #fff;
  z-index: 2; /* sopra la sfumatura (::after ha z-index:1) */
}
.hero::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px; /* prima era 200px: prova 60–100px per una sfumatura più sottile */
  background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, #f9f9f9 100%);
  z-index: 1;
}

.btn {
  background: linear-gradient(180deg,#11249e 0%, #06186b 100%);
  color: #fff;
  padding: 14px 28px;
  text-decoration: none;
  border-radius: 8px;
  display: inline-block;
  position: relative;
  z-index: 3;

  /* tipografia */
  font-family: 'Orbitron', sans-serif;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  font-size: 0.95rem;

  /* effetto 3D / shadow */
  box-shadow: 0 10px 20px rgba(6,24,107,0.25), 0 2px 0 rgba(0,0,0,0.25) inset;
  text-shadow: 0 1px 0 rgba(0,0,0,0.25);

  /* transizioni e animazione leggera */
  transition: transform 200ms cubic-bezier(.2,.9,.3,1), box-shadow 200ms ease, filter 200ms ease;
  animation: float 4s ease-in-out infinite;
  will-change: transform, box-shadow, filter;
}

/* pseudo-elemento per creare un bordo inferiore 'strato' che rafforza l'effetto 3D */
.btn::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: -8px;
  height: 8px;
  background: rgba(0,0,0,0.18);
  border-radius: 6px;
  z-index: -1;
  filter: blur(2px);
  transition: bottom 200ms ease, opacity 200ms ease;
}

/* hover / focus: solleva il bottone e aumenta l'ombra, rendendolo più evidente */
.btn:hover,
.btn:focus {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 20px 30px rgba(6,24,107,0.30), 0 4px 0 rgba(0,0,0,0.28) inset;
  outline: none;
  filter: saturate(1.05) brightness(1.03);
}
.btn:hover::after,
.btn:focus::after {
  bottom: -12px;
  opacity: 0.95;
}

/* animazione floating leggerissima */
@keyframes float {
  0% { transform: translateY(0) }
  50% { transform: translateY(-4px) }
  100% { transform: translateY(0) }
}

/* preferenze di riduzione movimento — disattiva animazioni se utente le preferisce ridotte */
@media (prefers-reduced-motion: reduce) {
  .btn { animation: none; transition: none; }
}

/* tweak responsive: evitare animazione eccessiva su schermi piccoli e ridurre dimensioni */
@media (max-width: 480px) {
  .btn { animation: none; padding: 12px 20px; font-size: 0.9rem; }
  .btn::after { display: none; }
}

/* sezioni con padding uniforme */
section { 
  padding: 35px 20px; /* ridotto da 60px a 35px */
  max-width: 1200px; 
  margin: auto;
}

/* Hero video mobile-friendly */
@media (max-width: 768px) {
  .hero {
    height: 60vh; /* riduce l'altezza su tablet e smartphone */
  }
  .hero-video {
    height: 100%;
    object-fit: cover; /* mantiene proporzioni senza deformare */
  }
  .hero-text {
    bottom: 40px; /* avvicina il testo al centro su mobile */
    padding: 0 10px; /* margine laterale */
  }
}

h1, h2{
  color: #06186b;
  text-align: center;
}

p {
  text-align: center;
}

/* riduzione spazio specifico tra about e skills */
#about {
  padding-bottom: 10px; /* ridotto padding bottom */
  text-align: center;
}

#about {
  text-align: center;
}

.about-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap; /* così su mobile si adatta */
  margin-top: 20px;
}

.about-photo {
  width: 220px;
  height: auto;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

#about p {
  max-width: 600px;
  text-align: left;
  line-height: 1.6;
}


.astronaut-wrapper {
  position: relative;
  width: 100%;
  height: 150px; /* ridotta rispetto a prima */
  overflow: hidden; /* nasconde fuori dallo schermo */
}

.astronauta {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: -300px; /* parte fuori schermo a destra */
  width: 120px; /* ridotta, regolabile */
  /* rimosso opacity: l'immagine resta piena */
}






#skills {
  padding-top: 10px; /* ridotto padding top */
  text-align: center;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* aumentata larghezza minima */
    gap: 20px;
}

/* skill card with logo + label */
.skill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem;
  min-height: 200px;
  border-radius: 12px;
  background: #06186b;
  box-shadow: 0 4px 10px rgba(6, 24, 107, 0.18);
  color: #ffffff;
  font-weight: 700;
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  text-align: center;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  min-width: 0;
  cursor: pointer;
  animation: skillPulse 2s ease-in-out infinite;
  transform-origin: center;
}

/* contenuto interno e dettagli */
.skill-content,
.skill-details {
  border-radius: inherit;
  overflow: hidden;
}

.skill-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
}

/* immagine del logo */
.skill-logo {
  width: 80px;
  height: 80px;
  max-width: 100%;
  object-fit: contain;
  border-radius: 10px;
  display: block;
  margin: 0 auto;
  transition: transform 0.3s ease;
}

.skill:hover .skill-logo {
  transform: scale(1.05);
}

/* testo all’interno del riquadro */
.skill > span {
  display: block;
  text-align: center;
  line-height: 1.3;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 6px;
}

.skill-details {
  position: absolute;
  inset: 0;
  background: rgba(6, 24, 107, 0.95);
  color: #fff;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease-in-out;
  display: flex;
  justify-content: flex-start;   /* inizia dall'alto */
  align-items: center;           /* centrato orizzontalmente */
  padding: 1rem;
  box-sizing: border-box;
}

.skill-details-inner {
  overflow-y: auto;  /* scroll solo sull'interno */
  max-height: 100%;
  text-align: center;
  line-height: 1.3;
  word-break: break-word;
}





.skill.active .skill-details {
  opacity: 1;
  visibility: visible;
}

/* responsive */
@media (max-width: 768px) {
  .skill {
    flex-direction: column;
    gap: 0.6rem;
    padding: 1rem;
    min-height: 160px;
  }

  .skill-logo {
    width: 60px;
    height: 60px;
  }

  .skill-details {
    font-size: 0.85rem;
    padding: 0.8rem;
  }
}

@media (max-width: 480px) {
  .skills-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .skill {
    padding: 0.8rem;
    min-height: 140px;
  }

  .skill-logo {
    width: 50px;
    height: 50px;
  }

  .skill-details {
    font-size: 0.8rem;
  }
}

/* animazione bagliore */
@keyframes skillPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 12px 30px rgba(6, 24, 107, 0.25);
  }
  50% {
    transform: scale(1.03);
    box-shadow: 0 20px 40px rgba(17, 36, 158, 0.45), 0 0 15px rgba(255, 255, 255, 0.1);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 12px 30px rgba(6, 24, 107, 0.25);
  }
}

.skill:hover {
  animation-play-state: paused;
  transform: scale(1.05);
  box-shadow: 0 25px 50px rgba(17, 36, 158, 0.5), 0 0 20px rgba(255, 255, 255, 0.15);
}

/* riduzione movimento */
@media (prefers-reduced-motion: reduce) {
  .skill {
    animation: none;
  }
}




.portfolio-grid { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); 
  gap: 24px; 
  align-items: start; 
}
#certifications { padding: 60px 20px; text-align: center; background: #f9f9f9; }
.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  align-items: start;
  justify-items: center;
}
.cert-item {
  background: #06186b;       /* changed: dark blue background */
  color: #ffffff;            /* changed: ensure text in card is white */
  padding: 30px;             /* increased padding */
  border-radius: 12px;       /* a bit more rounded */
  box-shadow: 0 8px 20px rgba(0,0,0,0.08); /* stronger shadow */
  transition: transform 220ms ease, box-shadow 220ms ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 160px;         /* larger card height */
  width: 100%;
  box-sizing: border-box;
}

.cert-item img {
  width: auto;
  height: 120px;             /* enlarged image height */
  max-width: 100%;
  object-fit: contain;
  margin-bottom: 14px;
  display: block;
}
.cert-item p { 
  color: #ffffff;  /* changed: white text */
  font-size: 0.9rem; 
}

/* ensure portfolio videos stay inside their card */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  align-items: start;
}

/* video container with fixed aspect ratio (16:9) */
.portfolio-thumb {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 aspect ratio */
  background: #000;
  overflow: hidden;    /* prevent video overflow */
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

/* make the video fill the container and use object-fit to crop if needed */
.portfolio-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* keeps video contained and visually neat */
  display: block;
  border: 0;
}

/* subtitle under the card */
.portfolio-title {
  margin: 12px;
  color: #06186b;
  font-weight: 700;
  text-align: left;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.95rem;
}

/* description line under the title */
.portfolio-desc {
  margin: 0 12px 16px;
  color: #555;
  font-size: 0.9rem;
  line-height: 1.4;
  text-align: left;
  font-family: 'Open Sans', sans-serif;
}

/* responsive: center text on small screens */
@media (max-width: 480px) {
  .portfolio-title { text-align: center; }
  .portfolio-desc { text-align: center; margin-left: 12px; margin-right: 12px; }
}

/* hover / focus states to indicate clickability (kept subtle) */
.portfolio-title .portfolio-link:hover,
.portfolio-title .portfolio-link:focus {
  text-decoration: underline;
  outline: none;
}

/* visible focus outline for keyboard users */
.portfolio-title .portfolio-link:focus {
  box-shadow: 0 0 0 3px rgba(6,24,107,0.12);
  border-radius: 6px;
}

/* ensure portfolio card wrapper has unified radius and clips children */
.portfolio-item {
  border-radius: 12px;
  overflow: hidden;
  background: #fff; /* keep card background */
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

/* make the thumbnail align with the card radius at the top */
.portfolio-thumb {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 aspect ratio */
  background: #000;
  overflow: hidden;
  border-radius: 12px 12px 0 0; /* top corners same as card */
}

/* responsive tweak */
@media (max-width: 480px) {
  .portfolio-grid { grid-template-columns: 1fr; }
  .portfolio-title { text-align: center; }
}

/* responsive tweak: su schermi piccoli alza leggermente il bottone per evitare sovrapposizione */
@media (max-width: 480px) {
  .hero-text { bottom: 60px; }
}

/* reduce vertical gap between intro and about */
.intro { padding-bottom: 20px; }
#about { padding-top: 30px; }




/* headings color */
h1, h2 {
  color: #06186b;
}

/* Transizione e stato alternativo per le skill */
.skill-content, .skill-details {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  transition: transform 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.skill-details {
    transform: translateX(100%);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.95rem;        /* ridotto il font size */
    background: #06186b;
    padding: 30px;             /* padding aumentato */
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.skill-details span {
    display: block;
    max-width: 100%;
    padding: 10px;
    line-height: 1.4;
    overflow-wrap: break-word;
    word-wrap: break-word;
    text-align: center;
}

.skill.active .skill-content {
  transform: translateX(-100%);
}

.skill.active .skill-details {
  transform: translateX(0);
}

/* Skills responsive */
@media (max-width: 768px) {
  .skills-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); /* colonne più strette su tablet e smartphone */
    gap: 15px;
  }
  .skill {
    padding: 12px; /* aumenta area cliccabile */
  }
  .skill-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .skill-logo {
    width: 80px; /* scala le immagini, regolabile */
    height: auto;
    margin-bottom: 8px;
  }
}

/* contact form centered layout and styling */
#contact {
  text-align: center;
}

#contact form {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

#contact {
  position: relative; /* crea un contesto di posizionamento */
  overflow: hidden; /* evita scroll o elementi che “escono” */
}

.robot {
  position: fixed; /* cambia da absolute a fixed */
  bottom: 20%;
  left: -200px;
  opacity: 0;
  width: 120px;
  transition: left 2s ease-out, opacity 1s ease-out;
  z-index: 50;
}






footer {
  background-color: #06186b;
  color: #ffffff;
  text-align: center;
  padding: 30px 0;
  font-size: 1rem;
  letter-spacing: 0.5px;
}

footer a {
  color: #ffffff;          /* colore bianco */
  text-decoration: underline;
  font-weight: 500;
  transition: opacity 0.3s ease;
}

footer a:hover {
  opacity: 0.8;            /* leggero effetto al passaggio */
}


