/* ===== SECTIONS STYLING ===== */

/* Base sections */
section {
  animation: fadeInUp 0.8s ease-out;
}

section:not(.hero) {
  border-top: 1px solid transparent;
  background: linear-gradient(180deg, transparent 0%, rgba(91,99,255,0.02) 50%, transparent 100%);
  position: relative;
}

section:not(.hero)::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(91,99,255,0.3), transparent);
}

.quick-overview {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: -1.5rem;
  margin-bottom: 4rem;
}

/* Info box base */
.info-box {
  padding: 1.5rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(91,99,255,0.15);
  border-radius: 12px;
  cursor: default;
  overflow: hidden;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  z-index: 1;
}

.info-box:hover {
  transform: translateY(-8px) scale(1.05);
  background: rgba(91,99,255,0.12);
  border-color: rgba(91,99,255,0.4);
  box-shadow: 0 12px 32px rgba(91,99,255,0.15), 0 0 20px rgba(91,99,255,0.08);
}

.info-box h3 {
  transition: color 0.3s ease;
}

.info-box:hover h3 {
  color: rgba(91,99,255,1);
}

.info-box p,
.info-box ul li {
  transition: color 0.3s ease;
}

.info-box:hover p,
.info-box:hover ul li {
  color: #f8fbff;
}

/* Category box animations */
.quick-overview article {
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.quick-overview article:hover {
  transform: translateY(-8px) scale(1.05);
  background: rgba(91,99,255,0.12) !important;
  border-color: rgba(91,99,255,0.4) !important;
  box-shadow: 0 12px 32px rgba(91,99,255,0.15), 0 0 20px rgba(91,99,255,0.08);
}

.quick-overview article h3 {
  transition: color 0.3s ease;
  position: relative;
}

.quick-overview article:hover h3 {
  color: rgba(91,99,255,1) !important;
}

.quick-overview article p,
.quick-overview article ul li {
  transition: color 0.25s ease;
}

.quick-overview article:hover p,
.quick-overview article:hover ul li {
  color: #f8fbff !important;
}

.card-glass {
  transition: all 0.35s ease;
}

.card-glass:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 14px 36px rgba(91,99,255,0.20), 0 0 24px rgba(91,99,255,0.10);
}

/* ===== SEZIONE INFORMAZIONI ===== */
#home ~ section:nth-of-type(2) {
  background: linear-gradient(180deg, rgba(255,255,255,0.4) 0%, rgba(243,244,255,0.3) 100%);
  padding: 3rem 0 2rem !important;
}

#home ~ section:nth-of-type(2) h2 {
  color: var(--primary);
  font-size: 2rem;
  margin-bottom: 1rem;
}

#home ~ section:nth-of-type(2) p {
  font-size: var(--font-size-lg);
  line-height: 1.8;
  color: var(--text-muted);
}

/* ===== SEZIONE COMPETENZE ===== */
#home ~ section:nth-of-type(3) {
  background: linear-gradient(180deg, rgba(107,114,255,0.05) 0%, rgba(91,99,255,0.02) 50%, transparent 100%);
  padding-bottom: 4rem !important;
}

#home ~ section:nth-of-type(3) h2 {
  font-size: 2rem;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.5rem;
}

#home ~ section:nth-of-type(3) .quick-overview {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

#home ~ section:nth-of-type(3) .card-glass {
  background: rgba(91,99,255,0.08);
  border: 1px solid rgba(91,99,255,0.25);
}

#home ~ section:nth-of-type(3) .card-glass h3 {
  color: var(--primary);
  font-size: 1.3rem;
}

/* ===== SEZIONE ABOUT ===== */
#about {
  background: linear-gradient(180deg, rgba(245,245,255,0.6) 0%, rgba(255,250,245,0.4) 100%);
  padding: 3rem 0 !important;
}

#about h2 {
  font-size: 2rem;
  color: #1e293b;
  margin-bottom: 1rem;
  position: relative;
  padding-bottom: 1rem;
}

#about h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  border-radius: 2px;
}

#about > p {
  font-size: var(--font-size-lg);
  line-height: 1.8;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

#about .quick-overview {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

#about .card-glass {
  background: linear-gradient(135deg, rgba(255,255,255,0.8), rgba(255,250,245,0.6));
  border: 1px solid rgba(91,99,255,0.15);
  box-shadow: 0 8px 24px rgba(26,32,44,0.08);
}

#about .card-glass h3 {
  color: #1e293b;
  font-size: 1.2rem;
}

/* ===== SEZIONE SKILLS – Polaroid Scroll Effect ===== */
#skills {
  background: transparent;
  padding: 3rem 0 4rem !important;
  overflow: hidden;
}

#projects {
  background: transparent;
  padding: 3rem 0 !important;
}

#contact {
  background: transparent;
  padding: 3rem 0;
}

#skills h2 {
  font-size: 2rem;
  color: var(--text);
  margin-bottom: 0.4rem;
  text-align: center;
}

#skills > .container > p {
  text-align: center;
  margin-bottom: 0;
}

/* ---- Track wrapper ---- */
.skills-tracks {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  overflow: hidden;
}

.skills-track-outer {
  overflow: hidden;
  width: 100%;
  padding: 0.75rem 0;
}

.skills-track {
  display: flex;
  gap: 24px;
  width: max-content;
  will-change: transform;
}

/* ---- Polaroid card ---- */
.skill-card {
  width: 150px;
  background: rgba(20,31,48,0.9);
  border-radius: 4px;
  padding: 10px 10px 36px;
  box-shadow: 3px 4px 16px rgba(0,0,0,0.35);
  flex-shrink: 0;
  cursor: default;
  user-select: none;
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.25s;
}

.skill-card.skill-rotate-0 { transform: rotate(-4deg); }
.skill-card.skill-rotate-1 { transform: rotate(3.5deg); }
.skill-card.skill-rotate-2 { transform: rotate(-1.5deg); }
.skill-card.skill-rotate-3 { transform: rotate(5deg); }

.skill-card:hover {
  transform: rotate(0deg) scale(1.08) !important;
  box-shadow: 4px 8px 28px rgba(91,99,255,0.22);
  z-index: 10;
}

.skill-card-img {
  width: 100%;
  height: 110px;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  margin-bottom: 8px;
}

.skill-card-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.skill-card-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  letter-spacing: 0.03em;
}

.skill-card-cat {
  font-size: 10px;
  font-weight: 600;
  text-align: center;
  margin-top: 2px;
  padding: 2px 8px;
  border-radius: 20px;
  display: inline-block;
  width: 100%;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.skill-card:hover .skill-card-cat {
  transform: scale(1.12) translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Categorie colori */
.cat-adobe .skill-card-img { background: rgba(239,68,68,0.08); }
.cat-adobe .skill-card-cat  { background: rgba(239,68,68,0.12); color: #b91c1c; }
.cat-adobe:hover .skill-card-cat { background: rgba(239,68,68,0.25); }

.cat-3d    .skill-card-img  { background: rgba(168,85,247,0.08); }
.cat-3d    .skill-card-cat  { background: rgba(168,85,247,0.12); color: #7e22ce; }
.cat-3d:hover .skill-card-cat { background: rgba(168,85,247,0.25); }

.cat-video .skill-card-img  { background: rgba(234,179,8,0.08); }
.cat-video .skill-card-cat  { background: rgba(234,179,8,0.12); color: #854d0e; }
.cat-video:hover .skill-card-cat { background: rgba(234,179,8,0.25); }

.cat-audio .skill-card-img  { background: rgba(34,197,94,0.08); }
.cat-audio .skill-card-cat  { background: rgba(34,197,94,0.12); color: #166534; }
.cat-audio:hover .skill-card-cat { background: rgba(34,197,94,0.25); }

.cat-dev   .skill-card-img  { background: rgba(59,130,246,0.10); }
.cat-dev   .skill-card-cat  { background: rgba(59,130,246,0.12); color: #1d4ed8; }
.cat-dev:hover .skill-card-cat { background: rgba(59,130,246,0.25); }

.cat-db    .skill-card-img  { background: rgba(20,184,166,0.08); }
.cat-db    .skill-card-cat  { background: rgba(20,184,166,0.12); color: #0f766e; }
.cat-db:hover .skill-card-cat { background: rgba(20,184,166,0.25); }

@media (prefers-color-scheme: dark) {
  .skill-card {
    background: rgba(20,31,48,0.9);
    box-shadow: 3px 4px 16px rgba(0,0,0,0.35);
  }
  .cat-adobe .skill-card-cat { color: #fca5a5; }
  .cat-3d    .skill-card-cat { color: #d8b4fe; }
  .cat-video .skill-card-cat { color: #fde68a; }
  .cat-audio .skill-card-cat { color: #86efac; }
  .cat-dev   .skill-card-cat { color: #93c5fd; }
  .cat-db    .skill-card-cat { color: #99f6e4; }
}

/* ===== SEZIONE PROGETTI ===== */
#projects {
  background: transparent;
  padding: 3rem 0 !important;
}

#projects h2 {
  font-size: 2rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

#projects > p {
  color: var(--text-muted);
  font-size: var(--font-size-lg);
  margin-bottom: 2rem;
}

#projects .quick-overview {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

#projects .card-glass {
  background: rgba(255,255,255,0.7);
  border: 2px solid rgba(91,99,255,0.15);
  box-shadow: 0 10px 30px rgba(91,99,255,0.1);
}

#projects .card-glass:hover {
  border-color: rgba(91,99,255,0.5);
  background: rgba(255,255,255,0.85);
}

#projects .card-glass h3 {
  color: var(--primary);
  font-size: 1.25rem;
  margin-bottom: 0.8rem;
}

#projects .card-glass p {
  line-height: 1.6;
  color: var(--text-muted);
  font-size: var(--font-size-base);
}

/* ===== SEZIONE CONTATTI ===== */
#contact {
  background: linear-gradient(180deg, rgba(245,248,255,0.6) 0%, rgba(240,244,255,0.5) 100%);
  padding: 3rem 0 !important;
}

#contact h2 {
  font-size: 2rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

#contact > p {
  color: var(--text-muted);
  font-size: var(--font-size-lg);
  margin-bottom: 2rem;
  max-width: 600px;
}

#contact .card-glass[style*="max-width"] {
  background: rgba(255,255,255,0.8);
  border: 1px solid rgba(91,99,255,0.2);
  box-shadow: 0 12px 36px rgba(91,99,255,0.12);
  margin: 0 auto;
}

#contact form label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text);
  font-size: var(--font-size-base);
}

#contact form input,
#contact form textarea {
  background: rgba(255,255,255,0.9) !important;
  border: 1px solid rgba(91,99,255,0.2) !important;
  color: var(--text) !important;
  font-size: var(--font-size-base);
}

#contact form input:focus,
#contact form textarea:focus {
  outline: none;
  border-color: var(--primary) !important;
  box-shadow: 0 0 12px rgba(91,99,255,0.2);
  transform: scale(1.02);
}

#contact .quick-overview {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-top: 2rem;
}

#contact .quick-overview .card-glass {
  background: linear-gradient(135deg, rgba(91,99,255,0.05), rgba(107,114,255,0.03));
  border: 1px solid rgba(91,99,255,0.2);
  text-align: center;
}

#contact .quick-overview h3 {
  color: var(--primary);
  margin-bottom: 0.5rem;
  font-size: var(--font-size-xl);
}

/* Dark mode sections */
@media (prefers-color-scheme: dark) {
  #home ~ section:nth-of-type(2) {
    background: linear-gradient(180deg, rgba(20,31,48,0.4) 0%, rgba(14,23,34,0.3) 100%);
  }
  
  #home ~ section:nth-of-type(2) h2 {
    color: #60a5fa;
  }
  
  #home ~ section:nth-of-type(3) {
    background: linear-gradient(180deg, rgba(91,99,255,0.08) 0%, rgba(91,99,255,0.03) 50%, transparent 100%);
  }
  
  #home ~ section:nth-of-type(3) .card-glass {
    background: rgba(20, 31, 48, 0.65);
    border-color: rgba(91,99,255,0.3);
  }
  
  #about {
    background: linear-gradient(180deg, rgba(25,35,55,0.5) 0%, rgba(20,30,50,0.3) 100%);
  }
  
  #about h2 {
    color: #e2e8f0;
  }
  
  #about h2::after {
    background: linear-gradient(90deg, #60a5fa, #818cf8);
  }
  
  #about .card-glass {
    background: rgba(24,34,50,0.7);
    border-color: rgba(91,99,255,0.25);
  }
  
  #about .card-glass h3 {
    color: #93c5fd;
  }
  
  #skills {
    background: transparent;
  }
  
  #skills h2 {
    color: #e2e8f0;
  }
  
  .skill-orb {
    background: rgba(20, 31, 48, 0.88);
    border-color: rgba(91,99,255,0.3);
  }
  
  .skills-orbit {
    border-color: rgba(91,99,255,0.22);
  }
  
  #projects {
    background: transparent;
  }
  
  #projects h2 {
    color: #e2e8f0;
  }
  
  #projects .card-glass {
    background: rgba(20, 31, 48, 0.68);
    border-color: rgba(91,99,255,0.25);
  }
  
  #projects .card-glass h3 {
    color: #60a5fa;
  }
  
  #contact {
    background: transparent;
  }
  
  #contact h2 {
    background: linear-gradient(135deg, #60a5fa, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  
  #contact .card-glass[style*="max-width"] {
    background: rgba(20, 31, 48, 0.75);
    border-color: rgba(91,99,255,0.3);
  }
  
  #contact form input,
  #contact form textarea {
    background: rgba(20, 31, 48, 0.8) !important;
    border-color: rgba(91,99,255,0.25) !important;
    color: #e2e8f0 !important;
  }
  
  #contact .quick-overview .card-glass {
    background: rgba(20, 31, 48, 0.5);
    border-color: rgba(91,99,255,0.3);
  }
}

@media (max-width: 768px) {
  .skills-scene {
    width: 320px;
    height: 320px;
  }
  .orbit-1 { width: 140px; height: 140px; }
  .orbit-2 { width: 220px; height: 220px; }
  .orbit-3 { width: 300px; height: 300px; }
  
  .skill-orb { width: 48px; height: 48px; }
  .skill-icon { font-size: 1.1rem; }
  
  .skills-core { width: 60px; height: 60px; }
  .skills-core-text { font-size: 0.8rem; }
  
  /* Re-position orbs for smaller sizes */
  .orbit-1 .skill-orb:nth-child(1) { top: -24px; left: calc(50% - 24px); }
  .orbit-1 .skill-orb:nth-child(2) { top: calc(50% - 24px); right: -24px; left: auto; }
  .orbit-1 .skill-orb:nth-child(3) { bottom: -24px; top: auto; left: calc(50% - 24px); }
  .orbit-1 .skill-orb:nth-child(4) { top: calc(50% - 24px); left: -24px; }
  
  .orbit-2 .skill-orb:nth-child(1) { top: -24px; left: calc(50% - 24px); }
  .orbit-2 .skill-orb:nth-child(2) { bottom: 10px; top: auto; right: 10px; left: auto; }
  .orbit-2 .skill-orb:nth-child(3) { bottom: 10px; top: auto; left: 10px; }
  
  .orbit-3 .skill-orb:nth-child(1) { top: -24px; left: calc(50% - 24px); }
  .orbit-3 .skill-orb:nth-child(2) { top: 28px; right: 8px; left: auto; }
  .orbit-3 .skill-orb:nth-child(3) { bottom: 28px; top: auto; right: 16px; left: auto; }
  .orbit-3 .skill-orb:nth-child(4) { bottom: 28px; top: auto; left: 16px; }
  .orbit-3 .skill-orb:nth-child(5) { top: 28px; left: 8px; }
  
  .quick-overview {
    grid-template-columns: 1fr;
  }
}
