:root {
  --accent-blue: #1e3a8a;
  --footer-blue: #2449ae;
  --cream: #e5e7eb;
  --dark: #212121;
  --white: #ffffff;
  --background: #f2f2f2;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Montserrat", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--dark);
  background: var(--background);
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Playfair Display", serif;
  letter-spacing: 0.5px;
}

/* HEADER */
.header-container {
  width: 100%;
  background-color: var(--white);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
}

.top-bar {
  background-color: #000;
  padding: 8px 0;
  color: var(--white);
  font-size: 14px;
}

.top-bar-container {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.top-bar a {
  color: var(--white);
  text-decoration: none;
  margin-left: 20px;
  font-weight: 500;
  transition: color 0.3s;
}

.top-bar a:hover {
  color: var(--cream);
}

.language-selector {
  position: relative;
  margin-left: 20px;
  cursor: pointer;
}

.language-selector .current-lang {
  display: flex;
  align-items: center;
}

.language-selector .current-lang i {
  margin-left: 5px;
  font-size: 12px;
}

.lang-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background-color: var(--white);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  padding: 10px 0;
  min-width: 120px;
  display: none;
  z-index: 1001;
}

.lang-dropdown a {
  display: block;
  padding: 5px 15px;
  color: var(--dark);
  margin: 0;
}

.lang-dropdown a:hover {
  background-color: var(--cream);
}

.language-selector:hover .lang-dropdown {
  display: block;
}

.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  background-color: var(--white);
}

.logo {
  display: flex;
  align-items: center;
}

.logo h1 {
  font-family: "Playfair Display", serif;
  font-weight: 700;
  font-size: 35px;
  margin-left: 10px;
  color: var(--accent-blue);
}

/* NAVIGATION */
.nav-menu {
  display: flex;
  list-style: none;
}

.nav-menu li {
  position: relative;
  margin-left: 30px;
}

.nav-menu a {
  text-decoration: none;
  color: var(--dark);
  font-weight: 600;
  font-size: 16px;
  position: relative;
  padding-bottom: 5px;
  transition: color 0.3s;
}

.nav-menu a:hover {
  color: var(--accent-blue);
}

.nav-menu a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent-blue);
  transition: width 0.3s;
}

.nav-menu a:hover::after {
  width: 100%;
}

.submenu {
  position: absolute;
  top: 130%;
  left: 0;
  background-color: var(--white);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  padding: 15px 0;
  min-width: 140px;
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(20px) scale(0.98);
  transition: opacity 0.35s cubic-bezier(.4,0,.2,1), transform 0.35s cubic-bezier(.4,0,.2,1), visibility 0.35s;
}

.submenu.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.submenu li {
  margin: 0;
}

.submenu a {
  display: block;
  padding: 8px 20px;
  font-weight: 500;
  font-size: 15px;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--dark);
}

/* CARD & CAROUSEL */
.main-flex {
  min-height: 50vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  margin-top: 150px;
}

.card {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  max-width: 480px;
  padding: 40px 36px 36px 36px;
  text-align: left;
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card h1 {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 24px;
  color: #111;
  line-height: 1.15;
}

.card p {
  color: #222;
  font-size: 1.08rem;
  margin-bottom: 18px;
  line-height: 1.5;
}

.cta-btn {
  display: inline-block;
  margin-top: 10px;
  padding: 12px 0;
  width: 100%;
  border: 2px solid #111;
  border-radius: 30px;
  background: #fff;
  color: #111;
  font-weight: bold;
  font-size: 1.1rem;
  text-align: center;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
  cursor: pointer;
  box-shadow: none;
}

.cta-btn:hover {
  background: #111;
  color: #fff;
}

.cta-btn.project-btn {
  width: auto;
  min-width: 180px;
  max-width: 250px;
  padding: 12px 32px;
  margin: 0 auto;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  display: inline-block;
}

.cta-btn.project-btn:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.promo-img {
  max-width: 480px;
  width: 100%;
  border-radius: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  display: block;
  object-fit: cover;
  margin-top: 30px;
}

/* CAROUSEL */
.carousel-container {
  position: relative;
  max-width: 480px;
  width: 100%;
}

.carousel-slides {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  min-height: 420px;
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.5s cubic-bezier(.4,0,.2,1), transform 1s cubic-bezier(.4,0,.2,1);
  z-index: 1;
  pointer-events: none;
}

.carousel-slide.active {
  opacity: 1;
  transform: scale(1);
  z-index: 2;
  pointer-events: auto;
}

.carousel-slide.to-left {
  opacity: 0;
  transform: translateX(-100%);
  z-index: 1;
}

.carousel-slide.to-right {
  opacity: 0;
  transform: translateX(100%);
  z-index: 1;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  color: var(--dark);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
}

.carousel-arrow:hover {
  background: var(--accent-blue);
  color: white;
}

.prev-arrow {
  left: -20px;
}

.next-arrow {
  right: -20px;
}

@media (max-width: 520px) {
  .prev-arrow {
    left: 5px;
  }
  .next-arrow {
    right: 5px;
  }
}

/* SECTION DIVIDER */
.section-divider {
  max-width: 1200px;
  margin: 50px auto 20px;
  height: 2px;
  background: linear-gradient(
    to right,
    transparent,
    var(--accent-blue),
    transparent
  );
}

/* FEATURES */
.features-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 50px 20px;
}

.section-heading {
  text-align: center;
  font-size: 32px;
  margin-bottom: 40px;
  color: var(--dark);
  position: relative;
}

.section-heading::after {
  content: "";
  display: block;
  width: 80px;
  height: 3px;
  background-color: var(--accent-blue);
  margin: 15px auto 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.feature-card {
  background: var(--white);
  border-radius: 10px;
  padding: 30px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.feature-icon {
  font-size: 36px;
  color: var(--accent-blue);
  margin-bottom: 20px;
}

.feature-title {
  font-size: 22px;
  margin-bottom: 15px;
  color: var(--dark);
}

.feature-description {
  color: #666;
  line-height: 1.6;
}

/* FOOTER */
footer {
  background-color: #1a1a1a;
  color: #fff;
  padding: 60px 0 30px;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
}

.footer-column h3 {
  color: var(--footer-blue);
  margin-bottom: 20px;
  font-size: 20px;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: #bbb;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-links a:hover {
  color: var(--cream);
}

.social-links {
  display: flex;
  gap: 15px;
  margin-top: 20px;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background-color: #333;
  color: #fff;
  border-radius: 50%;
  transition: background-color 0.3s;
}

.social-link:hover {
  background-color: var(--accent-blue);
}

.footer-bottom {
  border-top: 1px solid #333;
  margin-top: 40px;
  padding: 20px 0;
  text-align: center;
  font-size: 14px;
  color: #888;
}

.footer-bottom .footer-container {
  display: block;
  text-align: center;
  max-width: none;
  padding: 0;
}

.footer-bottom p {
  white-space: nowrap;
  margin: 0;
}

/* RESPONSIVE */
@media screen and (max-width: 992px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 768px) {
  .features-grid,
  .footer-container {
    grid-template-columns: 1fr;
  }
  .main-header {
    padding: 15px;
  }
  .logo h1 {
    font-size: 24px;
  }
  .top-bar-container {
    justify-content: center;
  }
}

/* SKILLS & EDUCATION */
.skills-section {
  padding-top: 20px;
}

.education-section {
  background-color: var(--cream);
  padding: 60px 0;
  margin-top: 60px;
}

.education-timeline {
  max-width: 800px;
  margin: 0 auto;
}

.education-item {
  display: flex;
  margin-bottom: 30px;
  position: relative;
}

.education-year {
  min-width: 120px;
  font-weight: 600;
  color: var(--accent-blue);
  padding-right: 20px;
  text-align: right;
}

.education-content {
  position: relative;
  padding-left: 30px;
  border-left: 2px solid var(--accent-blue);
}

.education-content:before {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-blue);
  left: -7px;
  top: 8px;
}

.education-content h3 {
  margin: 0 0 10px;
  font-size: 20px;
}

.education-content p {
  margin: 0 0 5px;
  color: #666;
}

[data-theme="dark"] .education-content p {
  color: #b6b6b6;
}

@media screen and (max-width: 768px) {
  .education-item {
    flex-direction: column;
  }
  .education-year {
    text-align: left;
    padding-left: 30px;
    margin-bottom: 5px;
  }
}

/* DARK MODE */
[data-theme="dark"] {
  --accent-blue: #fbbf24;
  --footer-blue: #fbbf24;
  --white: #1a1a1a;
  --dark: #e5e5e5;
  --background: #2a2a2a;
  --card-bg: #2a2a2a;
  --text-secondary: #b3b3b3;
  --footer-bg: #111111;
  --cream: #333333;
  --border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .top-bar {
  background-color: #000;
}

[data-theme="dark"] .lang-dropdown {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
}

[data-theme="dark"] .lang-dropdown a {
  color: var(--dark);
}

[data-theme="dark"] .feature-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
}

[data-theme="dark"] .education-section {
  background-color: var(--cream);
}

[data-theme="dark"] .carousel-arrow {
  background: rgba(42, 42, 42, 0.9);
  color: var(--dark);
}

[data-theme="dark"] .carousel-arrow:hover {
  background: var(--accent-blue);
  color: white;
}

/* Mantieni bianchi i tasti "Contattami" e "IT" con la freccia anche in dark mode */
[data-theme="dark"] .top-bar a,
[data-theme="dark"] .language-selector .current-lang {
  color: #fff !important;
}

/* Theme toggle button */
.theme-toggle {
  background: none;
  border: 2px solid #b39d48;
  border-radius: 50px;
  padding: 8px 16px;
  margin-left: 20px;
  cursor: pointer;
  color: #b39d48;
  font-size: 14px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle i {
  color: #b39d48;
  transition: color 0.3s;
}

.theme-toggle:hover {
  background: #b39d48;
  color: #222;
  border-color: #b39d48;
}

.theme-toggle:hover i {
  color: #222;
}

[data-theme="dark"] .theme-toggle {
  border-color: #ffe066;
  color: #ffe066;
}

[data-theme="dark"] .theme-toggle:hover {
  background: #ffe066;
  color: #222;
}

/* Ombre bianche in dark mode */
[data-theme="dark"] .card,
[data-theme="dark"] .promo-img,
[data-theme="dark"] .feature-card,
[data-theme="dark"] .carousel-arrow {
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.18) !important;
}

[data-theme="dark"] .feature-card:hover {
  box-shadow: 0 8px 16px rgba(255, 255, 255, 0.22) !important;
}

[data-theme="dark"] .card {
  background: #181818;
  color: #e5e5e5;
  border: 1px solid var(--border-color);
}

[data-theme="dark"] .card h1 {
  color: #fff;
}

[data-theme="dark"] .card p {
  color: #ccc;
}

[data-theme="dark"] .header-container {
  box-shadow: 0 2px 16px rgba(255, 255, 255, 0.1);
}

/* PAGINA CHI SONO */

.chi-sono .section-heading {
  text-align: left;
  padding-top: 18px;
  position: relative;
}

.chi-sono .section-heading::after {
  content: "";
  display: block;
  width: 140px;
  height: 3px;
  background-color: var(--accent-blue);
  margin: 0 0 15px 0;
  position: absolute;
  top: 0;
  left: 0;
}

/* Extra styles for dynamic and visual components */
.hero-chi {
  background: linear-gradient(120deg, #fbbf24 0%, #1e3a8a 100%);
  color: #fff;
  padding: 60px 0 40px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero-chi img {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 50%;
  border: 6px solid #fff;
  margin-bottom: 18px;
  box-shadow: 0 8px 32px rgba(30, 58, 138, 0.18);
  background: #fff;
}
.hero-chi h1 {
  font-size: 2.6rem;
  margin-bottom: 10px;
  font-family: "Playfair Display", serif;
  letter-spacing: 1px;
}
.hero-chi .animated-typing {
  font-size: 1.3rem;
  font-family: "Raleway", sans-serif;
  margin-bottom: 0;
  min-height: 32px;
  text-align: left;
  display: inline-block;
  border-right: 2px solid #fff;
  padding-right: 6px;
  animation: blink-caret 0.8s step-end infinite;
  position: relative;
}

.hero-chi .animated-typing::after {
  content: ""; /* la frase più lunga */
  visibility: hidden;
  pointer-events: none;
  display: inline-block;
  overflow: hidden;
}

@keyframes blink-caret {
  0%,
  100% {
    border-color: #fff;
  }
  50% {
    border-color: transparent;
  }
}
.section-img-row {
  display: flex;
  align-items: center;
  gap: 40px;
  max-width: 1100px;
  margin: 60px auto 0 auto;
  flex-wrap: wrap;
}
.section-img-row.reverse {
  flex-direction: row-reverse;
}
.section-img-row .img-col {
  flex: 1 1 320px;
  min-width: 260px;
  text-align: center;
}
.section-img-row .img-col img {
  width: 100%;
  max-width: 340px;
  border-radius: 18px;
  box-shadow: 0 4px 24px rgba(30, 58, 138, 0.1);
  margin-bottom: 12px;
}
.section-img-row .text-col {
  flex: 2 1 400px;
  min-width: 260px;
}
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
  margin-top: 30px;
}
.skill-card {
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(30, 58, 138, 0.08);
  padding: 24px 18px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.skill-card:hover {
  transform: translateY(-6px) scale(1.04);
  box-shadow: 0 8px 24px rgba(30, 58, 138, 0.13);
}
.skill-card i {
  font-size: 2.2rem;
  color: var(--accent-blue);
  margin-bottom: 10px;
}
.skill-card span {
  display: block;
  font-weight: 600;
  margin-top: 8px;
  color: var(--dark);
}
@media (max-width: 900px) {
  .section-img-row {
    flex-direction: column;
    gap: 24px;
  }
  .section-img-row.reverse {
    flex-direction: column;
  }
}

.section-img-row p {
  color: var(--dark);
  font-size: 1.08rem;
  margin-bottom: 18px;
  line-height: 1.5;
}

[data-theme="dark"] .skill-card {
  box-shadow: 0 2px 12px rgba(255, 255, 255, 0.13) !important;
}

[data-theme="dark"] .skill-card:hover {
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.18) !important;
}

[data-theme="dark"] .promo-img,
[data-theme="dark"] .section-img-row .img-col img {
  box-shadow: 0 4px 24px rgba(255, 255, 255, 0.13) !important;
}

/* Stile unico per la pagina Progetti */

.progetti-hero {
  background: linear-gradient(120deg, #fbbf24 0%, #1e3a8a 100%);
  color: #101010;
  padding: 70px 0 40px 0;
  text-align: left;
  position: relative;
  overflow: hidden;
  transition: background 0.7s cubic-bezier(.4,0,.2,1), color 0.7s cubic-bezier(.4,0,.2,1);
}
.progetti-hero-content {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
  padding-top: 40px;      /* aggiunto spazio sopra */
  padding-bottom: 20px;   /* aggiunto spazio sotto */
}
.progetti-hero-img {
  flex: 1 1 260px;
  min-width: 220px;
  text-align: center;
}
.progetti-hero-img img {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 18px;
  border: 5px solid #fff;
  box-shadow: 0 8px 32px rgba(30, 58, 138, 0.18);
  background: #fff;
}

.progetti-hero h1 {
  font-size: 2.4rem;
  font-family: "Playfair Display", serif;
  margin-bottom: 22px;    /* aumentato spazio sotto il titolo */
  margin-top: 15px;       /* aggiunto spazio sopra il titolo */
  letter-spacing: 1px;
}
.progetti-hero p {
  font-size: 1.10rem;     /* leggermente più grande */
  margin-bottom: 0;
  line-height: 1.7;       /* più spazio tra le righe */
  margin-top: 0;
}
.progetti-menu {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin: 40px 0 0 0;
  flex-wrap: wrap;
}
.progetti-menu a {
  background: #fff;
  color: #fbbf24;
  border: 2px solid #fbbf24;
  border-radius: 30px;
  padding: 12px 32px;
  font-weight: 600;
  font-size: 1.08rem;
  text-decoration: none;
  transition: background 0.4s cubic-bezier(.4,0,.2,1), color 0.4s cubic-bezier(.4,0,.2,1), border-color 0.4s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 2px 12px rgba(30, 58, 138, 0.08);
}
.progetti-menu a.active{
  background: #fbbf24;
  color: #222;
  border-color: #141414;
}

.progetti-menu a:hover {
  background: #fbbf24;
  color: #222;
}
/* Cards progetti */
.progetti-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 20px 30px 20px;
}

.section-subtitle {
  text-align: center;
  margin-bottom: 32px;
  color: #232323;
  font-size: 1.2rem;
}

.progetti-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 36px;
  margin-top: 30px;
}
.progetto-card {
  background: var(--white);
  border-radius: 18px;
  box-shadow: 0 4px 18px rgba(30, 58, 138, 0.08);
  padding: 0 0 24px 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.22s, box-shadow 0.22s;
  min-height: 260px;
  max-width: 500px;
  margin: 0 auto;
  padding: 0 0 18px 0;
}
.progetto-card:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: 0 8px 32px rgba(30, 58, 138, 0.13);
}
.progetto-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 18px 18px 0 0;
  margin-bottom: 0;
}
.progetto-card .progetto-content {
  padding: 22px 24px 0 24px;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.progetto-card .progetto-content p {
  margin-top: 5px;
}

.progetto-card h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
  color: var(--accent-blue);
  font-family: "Playfair Display", serif;
}
.progetto-card p {
  color: var(--dark);
  font-size: 1.05rem;
  margin-bottom: 16px;
  line-height: 1.5;
  flex: 1 1 auto;
}

.progetto-alert {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  border-radius: 8px;
  font-weight: 600;
  font-size: 1.02rem;
  padding: 8px 14px;
  margin: 10px 0 0 0;
}

.progetto-tags {
  margin-bottom: 12px;
}
.progetto-tags span {
  display: inline-block;
  background: #fbbf24;
  color: #1e3a8a;
  font-size: 0.92rem;
  border-radius: 12px;
  padding: 3px 12px;
  margin-right: 8px;
  margin-bottom: 4px;
}
.cta-btn {
  width: auto;
  min-width: 200px;
  margin-top: 15px;
  align-self: flex-start;
}

/* Pulsanti delle card progetti: centrati in basso e vicini */
.progetto-content .cta-btn-group {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: auto;
  margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 900px) {
  .progetti-hero-content {
    flex-direction: column;
    gap: 24px;
  }
  .progetti-grid {
    grid-template-columns: 1fr;
  }
}
/* Dark mode ombre bianche */
[data-theme="dark"] .progetto-card {
  box-shadow: 0 4px 18px rgba(255, 255, 255, 0.13) !important;
  background: #181818;
}
[data-theme="dark"] .progetto-card:hover {
  box-shadow: 0 8px 32px rgba(255, 255, 255, 0.18) !important;
}
[data-theme="dark"] .progetto-card h3 {
  color: #fbbf24;
}
[data-theme="dark"] .progetto-card p {
  color: #e5e5e5;
}

[data-theme="dark"] .progetto-tags span {
  background: #1e3a8a;
  color: #eac873;
}

[data-theme="dark"] .progetti-hero {
  background: linear-gradient(120deg, #1e3a8a 0%, #fbbf24 100%);
  color: #222;
}

[data-theme="dark"] .section-subtitle {
  color: #DCDCDC;
}

.progetti-hero h1, .progetti-hero p {
  transition: color 0.4s cubic-bezier(.4,0,.2,1);
}
[data-theme="dark"] .progetti-hero h1,
[data-theme="dark"] .progetti-hero p {
  color: #e2e2e2 !important;
}

/* Pulsanti menu progetti: light mode */
.progetti-menu a {
  background: #ffffff;
  color: #1e3a8a;
  border: 2px solid #fbbf24;
  border-radius: 30px;
  padding: 12px 32px;
  font-weight: 600;
  font-size: 1.08rem;
  text-decoration: none;
  transition: background 0.4s cubic-bezier(.4,0,.2,1), color 0.4s cubic-bezier(.4,0,.2,1), border-color 0.4s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 2px 12px rgba(30, 58, 138, 0.08);
}

/* Pulsanti menu progetti: dark mode, colori invertiti */
[data-theme="dark"] .progetti-menu a {
  box-shadow: 0 2px 12px rgba(251, 191, 36, 0.10);
  transition: background 0.4s cubic-bezier(.4,0,.2,1), color 0.4s cubic-bezier(.4,0,.2,1), border-color 0.4s cubic-bezier(.4,0,.2,1);
}

[data-theme="dark"] .progetti-menu a.active{
  background: #fbbf24;
  color: #222;
  border-color: #141414;
}

[data-theme="dark"] .progetti-menu a:hover {
  background: #fbbf24;
  color: #000000;
}

/* PAGINE PROGETTI */
.progetti-hero-content.hero-centered {
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-centered .progetti-hero-img {
  margin-bottom: 18px;
}

.hero-centered h1 {
  margin-top: 40px;
  margin-bottom: 0;
  text-align: center;
}

.hero-centered .progetto-tags {
  margin-bottom: 0;
  margin-top: 10px;
}

.hero-centered p {
  margin-top: 10px;
  margin-bottom: 0;
}

/* Immagine hero a larghezza piena sopra il titolo per pagine progetto */
.hero-full-img {
  width: 100%;
  max-width: 700px;
  border-radius: 22px;
  box-shadow: 0 8px 32px rgba(30,58,138,0.18);
  margin-bottom: 24px;
  display: block;
  margin-left: auto;
  margin-right: auto;
  margin-top: 60px;
}

.progetto-list {
  margin: 0 auto 32px auto;
  padding-left: 24px;
  max-width: 700px;
  color: #232323;
  font-size: 1.08rem;
  line-height: 1.7;
  list-style: disc inside;
}

.progetto-list li {
  margin-bottom: 10px;
  padding-left: 0;
}

.progetto-flex-details {
  display: flex;
  gap: 60px;
  justify-content: center;
  align-items: flex-start;
  margin-bottom: 40px;
  flex-wrap: wrap;
}
.progetto-details-col {
  flex: 1 1 340px;
  min-width: 280px;
  max-width: 500px;
}

.progetto-details-right .progetto-list {
  text-align: right;
  list-style-position: inside;
}
@media (max-width: 900px) {
  .progetto-flex-details {
    flex-direction: column;
    gap: 24px;
  }
  .progetto-details-right,
  .progetto-details-right .progetto-list {
    text-align: left;
  }
}

[data-theme="dark"] .progetto-list {
  color: #e5e5e5;
}

.progetto-details-right .section-heading {
  text-align: right;
  position: relative;
  padding-right: 0;
}

.progetto-details-right .section-heading::after {
  content: "";
  display: block;
  width: 90px;
  height: 3px;
  background-color: var(--accent-blue);
  margin: 10px 0 0 0;
  position: absolute;
  right: 0;
  top: 100%;
}

.progetto-details-right .progetto-list {
  text-align: right;
  list-style-position: inside;
  margin-left: auto;
  margin-right: 0;
}

/* Classe per centrare la sezione descrizione progetto */
.progetto-descrizione {
  max-width: 900px;
  margin: 0 auto 0px auto;
  text-align: center;
}

.progetto-descrizione p {
  font-size: 1.13rem;
  max-width: 700px;
  margin: 0 auto;
  color: #232323;
}

.progetto-screenshots {
  text-align: center;
  margin: 40px 0;
}

.progetto-screenshot-img {
  width: 100%;
  max-width: 580px;      /* aumentato da 340px a 480px */
  border-radius: 14px;
  box-shadow: 0 4px 18px rgba(30, 58, 138, 0.13);
  margin: 0 16px 24px 16px; /* aumentato margine per più respiro */
  display: inline-block;
  vertical-align: middle;
  object-fit: cover;
}

@media (max-width: 800px) {
  .progetto-screenshot-img {
    max-width: 98vw;
    margin: 0 0 18px 0;
    width: 98%;
  }
}

[data-theme="dark"] .progetto-descrizione p{
  color: #fff !important;
  background: transparent !important;
}

.social-features-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
  width: 100%;
}

.social-feature-card {
  background: var(--white);
  border-radius: 10px;
  padding: 30px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  flex: 1 1 320px;
  max-width: 340px;
  min-width: 260px;
  margin: 0 10px 30px 10px;
}

.social-feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.social-feature-card .feature-icon {
  font-size: 36px;
  color: var(--accent-blue);
  margin-bottom: 20px;
}

.social-feature-card .feature-title {
  font-size: 22px;
  margin-bottom: 15px;
  color: var(--dark);
}

.social-feature-card .feature-description {
  color: #666;
  line-height: 1.6;
}

/* Bottone fisso in basso alle social-feature-card, sempre visibile sotto il testo */
.social-feature-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 300px; /* assicura spazio per il bottone */
}

.social-feature-card .cta-btn.project-btn {
  position: absolute;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  margin-top: 0;
  margin-bottom: 0;
  width: 90%;
  max-width: 290px;
}

@media (max-width: 900px) {
  .social-feature-card {
    min-height: 340px;
  }
  .social-feature-card .cta-btn.project-btn {
    width: 90%;
    max-width: 95vw;
    bottom: 20px;
  }
}

@media (max-width: 900px) {
  .social-features-grid {
    flex-direction: column;
    align-items: center;
  }
  .social-feature-card {
    max-width: 95vw;
    min-width: 0;
  }
}

/* Dark mode per social-feature-card */
[data-theme="dark"] .social-feature-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.18) !important;
}

[data-theme="dark"] .social-feature-card:hover {
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.22) !important;
}

[data-theme="dark"] .social-feature-card .feature-title {
  color: #fbbf24;
}

[data-theme="dark"] .feature-description {
  color: #b6b6b6;
}

.progetti-hero-content.hero-centered h1 {
  margin-top: 60px;
  text-align: center;
}

.hero-centered .progetto-tags {
  margin-top: -25px;
}

.hero-centered p {
  margin-top: -20px;
}

.useful-contacts{
  text-align: center;
  font-size: 1.2rem;
  margin-top: 30px;
}

.useful-contacts a{
  color: var(--accent-blue);
  text-decoration: underline;
}

.contact-form {
  max-width: 420px;
  margin: 0 auto;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.07);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.contact-form .form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contact-form label {
  font-weight: 600;
  color: var(--accent-blue);
  margin-bottom: 2px;
}

.contact-form input,
.contact-form textarea {
  padding: 10px 12px;
  border: 1.5px solid #d1d5db;
  border-radius: 7px;
  font-size: 1rem;
  font-family: inherit;
  background: #f9fafb;
  transition: border-color 0.2s;
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--accent-blue);
  outline: none;
}

.contact-form button[type="submit"] {
  margin-top: 10px;
  width: 100%;
  font-size: 1.1rem;
}

.searchbar{
  display: flex;
  justify-content: center;
  margin: 36px 0 0 0;
}

.searchbar input{
  padding: 12px 18px;
  font-size: 1.08rem;
  border-radius: 24px;
  border: 1.5px solid #1e3a8a;
  min-width: 260px;
  max-width: 340px;
  width: 100%;
  outline: none;
  box-shadow: 0 2px 8px rgba(30, 58, 138, 0.07);
}

.searchbar button{
  margin-left: 10px;
  padding: 12px 22px;
  border-radius: 24px;
  border: none;
  background: #1e3a8a;
  color: #fff;
  font-weight: 600;
  font-size: 1.08rem;
  cursor: pointer;
  transition: background 0.2s;
}