* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  width: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  background-color: #f9fbfc;
  color: #333;
}

:root {
  --azzurro: #cfe8e6;
  --lilla: #e6d9f2;
  --accent: #8aa6a3;
}

/* ── HEADER ── */
header {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 2rem);
  max-width: 1300px;
  height: 70px;
  background: white;
  border: 1px solid #eee;
  border-radius: 999px;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

header.header-scrolled {
  background: linear-gradient(135deg, var(--azzurro), var(--lilla));
  border-color: transparent;
  box-shadow: 0 4px 24px rgba(138, 166, 163, 0.15);
}

.nav {
  height: 70px;
  padding: 0 1.6rem;
  display: flex;
  align-items: center;
  position: relative;
  gap: 2rem;
}

.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-right: auto;
}

.logo img {
  width: 160px;
  height: auto;
  display: block;
}

nav {
  display: flex;
  align-items: center;
  margin-left: auto;
}

nav ul {
  display: flex;
  flex-direction: row;
  gap: 1.2rem;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}

nav ul li {
  display: block;
}

nav a {
  text-decoration: none;
  color: #333;
  font-size: 0.88rem;
  white-space: nowrap;
  display: inline-block;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

nav a:hover {
  transform: scale(1.12);
  color: #333;
}

/* ── HAMBURGER ── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  padding: 2px;
  margin-left: auto;
}

.hamburger span {
  display: block;
  height: 2px;
  width: 100%;
  background: #333;
  border-radius: 999px;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.25s ease;
  transform-origin: center;
}

.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── SECTIONS ── */
section {
  max-width: 1100px;
  margin: auto;
  padding: 6rem 1.5rem 4rem;
}

section:first-of-type {
  padding-top: 8rem;
}

h2 {
  margin-bottom: 1rem;
  font-weight: 500;
}

p {
  max-width: 700px;
}

/* ── HERO ── */
.hero-section {
  min-height: 100vh;
  min-width: 100vw;
  background: radial-gradient(circle at 50% 50%, var(--azzurro), var(--lilla));
  display: flex;
  align-items: center;
  transition: background 0.2s ease-out;
  position: relative;
  overflow: hidden;
}

.hero-content {
  max-width: 800px;
  padding: 64px;
}

.hero-content h1 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.hero-content p {
  font-size: 1.1rem;
  max-width: 600px;
  margin-bottom: 2rem;
}

.hero-anim {
  opacity: 0;
  transform: translateY(40px);
  animation: heroFade 1.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.delay-1 { animation-delay: 0.4s; }
.delay-2 { animation-delay: 0.8s; }

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

.hero-btn {
  display: inline-block;
  padding: 0.8rem 1.6rem;
  background: white;
  color: #333;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.9rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.hero-illustration {
  position: absolute;
  right: -2rem;
  top: 70%;
  transform: translateY(-50%);
  width: 55vw;
  max-width: 700px;
  opacity: 0.30;
  pointer-events: none;
}

.hero-illustration img {
  width: 100%;
  height: auto;
  display: block;
}

/* ── APPROCCIO ── */
.approach {
  padding: 10rem 1.5rem 5rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.approach-inner {
  max-width: 900px;
  margin: auto;
  width: 100%;
}

.approach-intro {
  margin: 1rem auto 3rem;
  font-size: 1.1rem;
  max-width: 100%;
}

.approach-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.approach-item {
  opacity: 0;
  transform: translateY(40px);
  transition: 1.8s ease;
}

.approach-item.show {
  opacity: 1;
  transform: translateY(0);
}

.circle {
  width: 70px;
  height: 70px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--azzurro), var(--lilla));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── TEAM ── */
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 2rem;
}

.card {
  perspective: 1000px;
  height: 340px;
  cursor: pointer;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  border-radius: 16px;
}

.card:hover .card-inner {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 16px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  text-align: center;
}

.card-front {
  background: var(--lilla);
}

.card-front img {
  width: 110px;
  height: 110px;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 1rem;
  border: 3px solid white;
}
/* Posizione viso per ogni foto — aggiusta i valori a piacere */
.card:nth-child(1) .card-front img {
  object-position: center 20%;
}

.card:nth-child(2) .card-front img {
  object-position: center 15%;
}

.card:nth-child(3) .card-front img {
  object-position: center 10%;
}

.card:nth-child(4) .card-front img {
  object-position: center 20%;
}

.card:nth-child(5) .card-front img {
  object-position: center 15%;
}

.card-front h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.card-front span {
  font-size: 0.82rem;
  color: #555;
}

/* Bottone sul fronte: nascosto su desktop, visibile su mobile */
.card-front .card-expand-btn {
  display: none;
}

.card-back {
  background: var(--azzurro);
  transform: rotateY(180deg);
  gap: 0.7rem;
}

.card-back h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.card-back p {
  font-size: 0.88rem;
  color: #444;
  line-height: 1.6;
  max-width: 100%;
}

.card-expand-btn {
  margin-top: 0.8rem;
  padding: 0.5rem 1.4rem;
  background: white;
  color: #444;
  border: none;
  border-radius: 999px;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
}

.card-expand-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

/* ── ACCORDION ── */
.accordion {
  margin-bottom: 1rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #ddd;
}

.accordion-btn {
  width: 100%;
  text-align: left;
  padding: 1rem 1.2rem;
  background: var(--azzurro);
  border: none;
  cursor: pointer;
  font-weight: 500;
  font-size: 1rem;
  transition: background 0.2s;
}

.accordion-btn:hover {
  background: var(--lilla);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: #f9f9f9;
  padding: 0 1.2rem;
}

.accordion-content p {
  padding: 1rem 0;
  margin: 0;
}

.accordion-content ul {
  padding: 1rem 0 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.accordion-content li {
  font-size: 0.95rem;
  color: #444;
  line-height: 1.5;
}

/* ── MAPPA ── */
.map {
  margin-top: 2rem;
  border-radius: 16px;
  overflow: hidden;
}

.map iframe {
  width: 100%;
  height: 350px;
  border: 0;
}

/* ── CONTATTI ── */
.contacts {
  text-align: center;
}

.contact-grid {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
}

.contact-card {
  background: white;
  padding: 2rem 1.5rem;
  border-radius: 16px;
  transition: 0.35s ease;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

.contact-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.08);
}

.contact-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--azzurro), var(--lilla));
  font-size: 1.4rem;
}

/* ── FOOTER ── */
footer {
  background: linear-gradient(135deg, var(--azzurro), var(--lilla));
  margin-top: 4rem;
}

.footer-inner {
  max-width: 1100px;
  margin: auto;
  padding: 4rem 2rem 2rem;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
}

.footer-logo {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.8rem;
}

.footer-brand p {
  font-size: 0.9rem;
  color: #444;
  line-height: 1.7;
  max-width: 280px;
}

.footer-links h4,
.footer-contacts h4 {
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #555;
  margin-bottom: 1rem;
}

.footer-links ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a {
  text-decoration: none;
  color: #333;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-contacts p {
  font-size: 0.9rem;
  color: #444;
  margin-bottom: 0.5rem;
  max-width: none;
}

.footer-bottom {
  max-width: 1100px;
  margin: auto;
  padding: 1.2rem 2rem;
  border-top: 1px solid rgba(0,0,0,0.08);
  font-size: 0.78rem;
  color: #666;
}

.footer-bottom a {
  color: #666;
  text-decoration: underline;
}

/* ── MODALE TEAM ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal-overlay.open {
  display: flex;
  animation: fadeIn 0.3s ease forwards;
}

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

.modal-box {
  background: white;
  border-radius: 24px;
  padding: 2.5rem;
  max-width: 700px;
  width: 100%;
  position: relative;
  animation: modalSlideUp 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-close {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--lilla), var(--azzurro));
  color: #444;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.modal-close:hover {
  transform: scale(1.1);
}

.modal-inner {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.modal-inner img {
  width: 130px;
  height: 130px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--lilla);
  flex-shrink: 0;
}

.modal-text h3 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.modal-role {
  display: block;
  font-size: 0.83rem;
  color: var(--accent);
  margin-bottom: 1.2rem;
}

.modal-text p {
  font-size: 0.92rem;
  color: #555;
  line-height: 1.75;
  max-width: 100%;
  margin-bottom: 0.8rem;
}

.modal-info {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 1.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid #eee;
}

.modal-info span {
  font-size: 0.83rem;
  color: #777;
}

/* ── RESPONSIVE TABLET ── */
@media (max-width: 1024px) {
  nav ul {
    display: none;
    flex-direction: column;
    background: white;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    left: auto;
    width: 220px;
    padding: 0.8rem;
    border-radius: 20px;
    border: 1px solid #eee;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    gap: 0;
  }

  nav ul.open {
    display: flex;
  }

  nav ul li a {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    transition: background 0.2s ease;
    color: #333;
  }

  nav ul li a:hover {
    background: var(--lilla);
    color: #333;
  }

  .hamburger {
    display: flex;
  }

  /* Card su tablet: disabilita flip, mostra bottone sul fronte */
  .card:hover .card-inner {
    transform: none;
  }

  .card-inner {
    transform: none !important;
  }

  .card-back {
    display: none;
  }

  .card-front {
    position: relative;
    backface-visibility: visible;
    -webkit-backface-visibility: visible;
  }

  .card-front .card-expand-btn {
    display: inline-block;
  }
}

/* ── RESPONSIVE MOBILE ── */
@media (max-width: 768px) {

  /* Hero */
  .hero-content {
    padding: 2rem 1.5rem;
  }

  .hero-illustration {
    display: none;
  }

  /* Sections */
  section {
    padding: 5rem 1.5rem 3rem;
  }

  /* Testo */
  p {
    max-width: 100%;
  }

  /* Approccio */
  .approach {
    padding: 6rem 1.5rem 3rem;
  }

  .approach-intro {
    max-width: 100%;
  }

  .approach-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  /* Team */
  .team-grid {
    grid-template-columns: 1fr;
  }

  .card {
    height: auto;
    min-height: 280px;
  }

  .card-front {
    position: relative;
    height: auto;
    padding: 2rem 1.5rem;
  }

  /* Footer */
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  /* Modale */
  .modal-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .modal-box {
    padding: 2rem 1.5rem;
  }
}

@media (max-width: 900px) {
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}