/* =========================================================
   CapoVerso APS — Stylesheet
   ========================================================= */

/* ---------- Design tokens ---------- */
:root {
  --blu: #1a3399;
  --blu-scuro: #0d1f6b;
  --azzurro: #4dc8e8;
  --azzurro-light: #d0f0f9;
  --bianco: #fff;
  --grigio: #f4f6fb;
  --grigio-medio: #e5e9f3;
  --testo: #1a1a2e;
  --testo-soft: #555;
  --testo-muto: #888;
  --rosso: #dc2626;
  --verde: #00c853;

  --font-serif: 'Cormorant Garamond', 'Georgia', serif;
  --font-sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --shadow-sm: 0 2px 8px rgba(26, 51, 153, .06);
  --shadow-md: 0 8px 24px rgba(26, 51, 153, .1);
  --shadow-lg: 0 16px 48px rgba(26, 51, 153, .14);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-pill: 50px;

  --container: 1100px;
  --container-wide: 1280px;
  --nav-height: 80px;
  --nav-height-mobile: 64px;
  --mobile-breakpoint: 900px;
}

/* Mobile nav height cascades into hero padding & menu positioning */
@media (max-width: 900px) {
  :root { --nav-height: 64px; }
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  color: var(--testo);
  background: var(--bianco);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg,
picture {
  display: block;
  max-width: 100%;
  height: auto;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input,
textarea,
select {
  font: inherit;
  color: inherit;
}

a {
  color: var(--blu);
  text-decoration: none;
}

a:hover {
  color: var(--azzurro);
}

ul,
ol {
  list-style: none;
}

/* ---------- Accessibility ---------- */
:focus-visible {
  outline: 3px solid var(--azzurro);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  z-index: 9999;
  background: var(--blu);
  color: var(--bianco);
  padding: 0.7rem 1.2rem;
  font-weight: 600;
  border-radius: 0 0 var(--radius-md) 0;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0;
  color: var(--bianco);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Typography helpers ---------- */
.section-tag {
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--azzurro);
  font-weight: 600;
  margin-bottom: 0.7rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--blu-scuro);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.section-lead {
  font-size: 1rem;
  color: var(--testo-soft);
  line-height: 1.8;
  max-width: 640px;
}

/* ---------- Layout ---------- */
section {
  padding: 5rem 1.5rem;
}

.section-inner {
  max-width: var(--container);
  margin: 0 auto;
}

.container-wide {
  max-width: var(--container-wide);
  margin: 0 auto;
}

main {
  min-height: 60vh;
}

/* ---------- Navigation ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 2rem;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(26, 51, 153, 0.08);
  transition: box-shadow 0.3s, padding 0.3s;
}

.navbar.scrolled {
  box-shadow: 0 4px 30px rgba(26, 51, 153, 0.1);
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: inherit;
}

.nav-logo img {
  height: 50px;
  width: auto;
  transition: height 0.3s;
}

.navbar.scrolled .nav-logo img {
  height: 40px;
}

.nav-brand {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--blu-scuro);
  letter-spacing: 0.04em;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.nav-toggle:hover {
  background: var(--grigio);
}

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--blu-scuro);
  position: relative;
  transition: background 0.2s;
}

.nav-toggle-bar::before,
.nav-toggle-bar::after {
  content: "";
  position: absolute;
  left: 0;
  width: 22px;
  height: 2px;
  background: var(--blu-scuro);
  transition: transform 0.25s;
}

.nav-toggle-bar::before {
  top: -7px;
}

.nav-toggle-bar::after {
  top: 7px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after {
  transform: rotate(-45deg) translate(5px, -5px);
}

.nav-links {
  display: flex;
  gap: 0.2rem;
  align-items: center;
}

.nav-links > li {
  position: relative;
}

.nav-links > li > a {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--blu-scuro);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: background 0.2s, color 0.2s;
}

.nav-links > li > a:hover,
.nav-links > li > a:focus-visible {
  background: var(--grigio);
  color: var(--blu);
}

.nav-links > li > a[aria-current="page"] {
  color: var(--blu);
  background: var(--grigio);
}

.chev {
  font-size: 0.55rem;
  transition: transform 0.25s;
  opacity: 0.6;
}

.nav-links > li:hover > a .chev,
.nav-links > li:focus-within > a .chev {
  transform: rotate(180deg);
}

.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: var(--bianco);
  border: 1px solid rgba(26, 51, 153, 0.1);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 240px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s, transform 0.22s;
  padding: 0.5rem;
  z-index: 300;
}

/* Invisible bridge: keeps :hover active while the cursor crosses the
   gap between the parent menu item and the dropdown panel. */
.dropdown::before {
  content: "";
  position: absolute;
  top: -14px;
  left: 0;
  right: 0;
  height: 14px;
  background: transparent;
}

/* Extra hover safety: enlarge the parent li hit-area downward. */
.nav-links > li:hover::after,
.nav-links > li:focus-within::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 14px;
}

.nav-links > li:hover .dropdown,
.nav-links > li:focus-within .dropdown {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
}

.dropdown li a {
  display: block;
  padding: 0.65rem 1rem;
  font-size: 0.84rem;
  color: var(--blu-scuro);
  border-radius: var(--radius-sm);
  transition: background 0.2s;
  text-transform: none;
  letter-spacing: 0;
}

.dropdown li a:hover,
.dropdown li a:focus-visible {
  background: var(--grigio);
  color: var(--blu);
}

.nav-cta {
  background: var(--blu);
  color: var(--bianco) !important;
  padding: 0.6rem 1.4rem !important;
  border-radius: var(--radius-pill) !important;
  font-weight: 600 !important;
  font-size: 0.82rem !important;
  transition: background 0.25s, transform 0.2s;
  margin-left: 0.5rem;
  text-transform: uppercase;
}

.nav-cta:hover {
  background: var(--azzurro) !important;
  color: var(--blu-scuro) !important;
  transform: translateY(-1px);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.85rem 2rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, background 0.25s, color 0.25s;
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background: var(--azzurro);
  color: var(--blu-scuro);
  box-shadow: 0 8px 24px rgba(77, 200, 232, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(77, 200, 232, 0.45);
  color: var(--blu-scuro);
}

.btn-secondary {
  background: var(--blu);
  color: var(--bianco);
}

.btn-secondary:hover {
  background: var(--azzurro);
  color: var(--blu-scuro);
  transform: translateY(-1px);
}

.btn-outline {
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  color: var(--bianco);
  padding: 0.85rem 2rem;
}

.btn-outline:hover {
  border-color: var(--bianco);
  background: rgba(255, 255, 255, 0.08);
  color: var(--bianco);
}

.btn-ghost {
  background: transparent;
  color: var(--blu);
  border: 1.5px solid var(--grigio-medio);
}

.btn-ghost:hover {
  background: var(--grigio);
  border-color: var(--blu);
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0d1f6b 0%, #1a3399 55%, #1a6fa8 100%);
  padding-top: var(--nav-height);
}

.hero-circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.hero-circle.c1 {
  width: 700px;
  height: 700px;
  top: -200px;
  right: -150px;
}

.hero-circle.c2 {
  width: 400px;
  height: 400px;
  bottom: -100px;
  left: -80px;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: var(--container);
  margin: 0 auto;
  padding: 4rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4rem;
  align-items: center;
  width: 100%;
}

.hero-logo-wrap img {
  width: 300px;
  max-width: 100%;
  filter: brightness(0) invert(1) drop-shadow(0 8px 32px rgba(255, 255, 255, 0.2));
  animation: floatLogo 5s ease-in-out infinite;
}

@keyframes floatLogo {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.hero-badge {
  display: inline-block;
  background: rgba(77, 200, 232, 0.18);
  border: 1px solid rgba(77, 200, 232, 0.4);
  color: var(--azzurro);
  font-size: 0.73rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-pill);
  margin-bottom: 1.6rem;
  animation: fadeUp 0.8s ease both;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 700;
  color: var(--bianco);
  line-height: 1.08;
  margin-bottom: 1.4rem;
  animation: fadeUp 0.9s 0.1s ease both;
}

.hero-title em {
  font-style: normal;
  color: var(--azzurro);
}

.hero-sub {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.78);
  max-width: 540px;
  line-height: 1.8;
  margin-bottom: 2.5rem;
  animation: fadeUp 1s 0.2s ease both;
}

.hero-btns {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  animation: fadeUp 1s 0.3s ease both;
}

.hero-stats {
  display: flex;
  gap: 3rem;
  margin-top: 3.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  animation: fadeUp 1s 0.4s ease both;
  flex-wrap: wrap;
}

.stat-num {
  font-family: var(--font-serif);
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--bianco);
  line-height: 1;
}

.stat-label {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 0.3rem;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Page hero (sub-pages) ---------- */
.page-hero {
  background: linear-gradient(135deg, #0d1f6b 0%, #1a3399 100%);
  color: var(--bianco);
  padding: calc(var(--nav-height) + 3rem) 1.5rem 3.5rem;
  position: relative;
  overflow: hidden;
}

.page-hero::after {
  content: "";
  position: absolute;
  top: -120px;
  right: -120px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: rgba(77, 200, 232, 0.12);
  pointer-events: none;
}

.page-hero-inner {
  max-width: var(--container);
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.page-hero .section-tag {
  color: var(--azzurro);
}

.page-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1rem;
  color: var(--bianco);
}

.page-hero p {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.8);
  max-width: 620px;
  line-height: 1.8;
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  background: var(--grigio);
  padding: 0.85rem 1.5rem;
  border-bottom: 1px solid var(--grigio-medio);
}

.breadcrumb ol {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--testo-muto);
}

.breadcrumb li:not(:last-child)::after {
  content: "›";
  margin-left: 0.4rem;
  color: var(--testo-muto);
}

.breadcrumb a {
  color: var(--blu);
}

.breadcrumb [aria-current="page"] {
  color: var(--testo);
}

/* ---------- Chi siamo section ---------- */
.chi-siamo {
  background: var(--grigio);
}

.chi-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 4rem;
  align-items: start;
  margin-top: 3rem;
}

.chi-logo-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.chi-logo-wrap img {
  width: 100%;
  max-width: 280px;
  filter: drop-shadow(0 12px 32px rgba(26, 51, 153, 0.16));
}

.runts-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: var(--bianco);
  border: 1.5px solid rgba(26, 51, 153, 0.15);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.2rem;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.runts-link:hover {
  border-color: var(--blu);
  box-shadow: 0 4px 16px rgba(26, 51, 153, 0.1);
}

.runts-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.runts-text strong {
  font-size: 0.82rem;
  color: var(--blu-scuro);
  font-weight: 600;
  display: block;
}

.runts-text span {
  font-size: 0.72rem;
  color: var(--testo-muto);
}

.chi-text p {
  font-size: 0.97rem;
  color: #444;
  line-height: 1.9;
  margin-bottom: 1.1rem;
}

.valori-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

.valore-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.92rem;
  color: var(--blu-scuro);
  font-weight: 500;
}

.valore-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--azzurro);
  flex-shrink: 0;
}

/* ---------- Project cards ---------- */
.progetti-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.8rem;
  margin-top: 3rem;
}

.progetto-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bianco);
  border: 1px solid rgba(26, 51, 153, 0.07);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
  position: relative;
  text-decoration: none;
  color: inherit;
}

.progetto-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  color: inherit;
}

.card-media {
  height: 200px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--grigio);
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.progetto-card:hover .card-media img {
  transform: scale(1.04);
}

.card-header {
  padding: 1.4rem 1.6rem 1rem;
  background: linear-gradient(135deg, var(--blu-scuro), var(--blu));
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.card-header::after {
  content: "";
  position: absolute;
  top: -30px;
  right: -30px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
}

.card-num {
  font-family: var(--font-serif);
  font-size: 0.88rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.18em;
  margin-bottom: 0.25rem;
}

.card-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--bianco);
  margin-bottom: 0.2rem;
  line-height: 1.25;
}

.card-subtitle {
  font-size: 0.68rem;
  color: var(--azzurro);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.badge-active {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  background: linear-gradient(135deg, #00c853, #00e676);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 12px rgba(0, 200, 83, 0.35);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  z-index: 2;
}

.badge-active::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
  animation: pulse 1.4s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.card-body {
  padding: 1.4rem 1.6rem 1.6rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-body p {
  font-size: 0.9rem;
  color: var(--testo-soft);
  line-height: 1.8;
  margin-bottom: 0.8rem;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: auto;
  padding-top: 0.6rem;
}

.card-tag {
  display: inline-block;
  background: var(--azzurro-light);
  color: var(--blu);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.22rem 0.65rem;
  border-radius: var(--radius-pill);
}

.card-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--blu);
}

.progetto-card:hover .card-cta {
  color: var(--azzurro);
}

.progetti-cta-wrap {
  margin-top: 2.5rem;
  padding: 2rem 2.5rem;
  background: var(--grigio);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.progetti-cta-text {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--blu-scuro);
  line-height: 1.3;
}

.progetti-cta-text span {
  color: var(--azzurro);
}

/* ---------- Project detail page ---------- */
.project-detail {
  padding: 4rem 1.5rem;
}

.project-detail-inner {
  max-width: 880px;
  margin: 0 auto;
}

.project-cover {
  width: 100%;
  height: 380px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: 2.5rem;
  background: var(--grigio);
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem 0 2rem;
}

.project-detail h2 {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--blu-scuro);
  margin: 2.5rem 0 1rem;
}

.project-detail h3 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--blu);
  margin: 1.8rem 0 0.8rem;
}

.project-detail p {
  font-size: 1rem;
  color: var(--testo-soft);
  line-height: 1.85;
  margin-bottom: 1.1rem;
}

.project-detail strong {
  color: var(--testo);
}

.project-detail ul {
  margin: 1rem 0 1.5rem 1.2rem;
  list-style: disc;
}

.project-detail ul li {
  font-size: 0.97rem;
  color: var(--testo-soft);
  line-height: 1.75;
  margin-bottom: 0.4rem;
  padding-left: 0.4rem;
}

.project-callout {
  background: var(--grigio);
  border-left: 4px solid var(--azzurro);
  padding: 1.4rem 1.6rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 2rem 0;
}

.project-callout strong {
  display: block;
  color: var(--blu-scuro);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.project-callout p {
  margin: 0;
  font-size: 0.95rem;
}

.project-phases {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1.5rem 0;
}

.phase-row {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.phase-num-lg {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--blu);
  color: var(--bianco);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.phase-row strong {
  display: block;
  color: var(--blu-scuro);
  margin-bottom: 0.2rem;
}

.project-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--grigio-medio);
}

.project-nav a {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.85rem;
  color: var(--testo-muto);
  padding: 0.8rem 1.2rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--grigio-medio);
  transition: border-color 0.2s, background 0.2s;
}

.project-nav a:hover {
  border-color: var(--blu);
  background: var(--grigio);
}

.project-nav a strong {
  font-size: 0.95rem;
  color: var(--blu-scuro);
  font-weight: 600;
}

.project-nav .next {
  text-align: right;
  margin-left: auto;
}

/* ---------- Press / Rassegna stampa ---------- */
.parlano {
  background: var(--grigio);
}

.rassegna-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.2rem;
  margin-top: 2.5rem;
}

.rassegna-card {
  background: var(--bianco);
  border-radius: var(--radius-md);
  padding: 1.3rem;
  border: 1px solid rgba(26, 51, 153, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  transition: transform 0.25s, box-shadow 0.25s;
  text-decoration: none;
  color: inherit;
}

.rassegna-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 32px rgba(26, 51, 153, 0.12);
  color: inherit;
}

.rassegna-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.rassegna-source {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--azzurro);
  font-weight: 700;
}

.rassegna-type {
  background: var(--azzurro-light);
  color: var(--blu);
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
}

.rassegna-type.video {
  background: rgba(220, 38, 38, 0.1);
  color: var(--rosso);
}

.rassegna-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--blu-scuro);
  line-height: 1.35;
}

/* ---------- Unisciti ---------- */
.unisciti {
  background: var(--bianco);
}

.unisciti-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 4rem;
  align-items: center;
}

.unisciti-cards {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.unisciti-card {
  background: var(--grigio);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
  transition: transform 0.25s, box-shadow 0.25s;
  border: 1px solid transparent;
}

.unisciti-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--azzurro);
}

.unisciti-card-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.unisciti-card h4 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--blu-scuro);
  margin-bottom: 0.4rem;
}

.unisciti-card p {
  font-size: 0.92rem;
  color: var(--testo-soft);
  line-height: 1.7;
}

/* ---------- Sostienici ---------- */
.iban-box {
  background: linear-gradient(135deg, var(--blu-scuro), var(--blu));
  color: var(--bianco);
  padding: 2rem 2.5rem;
  border-radius: var(--radius-lg);
  margin: 2.5rem 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.iban-box-info span {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--azzurro);
  margin-bottom: 0.3rem;
}

.iban-box-info code {
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--bianco);
}

.iban-box-info small {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
}

.iban-copy {
  background: var(--azzurro);
  color: var(--blu-scuro);
  padding: 0.7rem 1.3rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.85rem;
  transition: background 0.2s;
}

.iban-copy:hover {
  background: var(--bianco);
}

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

.support-card {
  background: var(--bianco);
  padding: 1.8rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--grigio-medio);
}

.support-card h3 {
  font-family: var(--font-serif);
  color: var(--blu-scuro);
  margin-bottom: 0.6rem;
  font-size: 1.2rem;
}

.support-card p {
  font-size: 0.92rem;
  color: var(--testo-soft);
  line-height: 1.7;
}

/* ---------- Contatti ---------- */
.contatti-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 4rem;
  margin-top: 3rem;
  align-items: start;
}

.info-block {
  margin-bottom: 1.4rem;
  padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--grigio-medio);
}

.info-block:last-child {
  border: 0;
}

.info-block h4 {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--testo-muto);
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.info-block p,
.info-block a {
  font-size: 0.95rem;
  color: var(--blu-scuro);
  line-height: 1.6;
}

.info-block a:hover {
  color: var(--azzurro);
}

.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--grigio);
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.2s;
}

.social-btn:hover {
  background: var(--azzurro-light);
}

.contact-form {
  background: var(--grigio);
  padding: 2.2rem;
  border-radius: var(--radius-lg);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.field {
  margin-bottom: 1.1rem;
}

.field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--blu-scuro);
  margin-bottom: 0.4rem;
  letter-spacing: 0.04em;
}

.field label .required {
  color: var(--rosso);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--grigio-medio);
  border-radius: var(--radius-sm);
  background: var(--bianco);
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--testo);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: 0;
  border-color: var(--blu);
  box-shadow: 0 0 0 3px rgba(26, 51, 153, 0.1);
}

.field textarea {
  min-height: 130px;
  resize: vertical;
}

.field-error {
  display: none;
  font-size: 0.8rem;
  color: var(--rosso);
  margin-top: 0.3rem;
}

.field.has-error input,
.field.has-error textarea {
  border-color: var(--rosso);
}

.field.has-error .field-error {
  display: block;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  font-size: 0.85rem;
  color: var(--testo-soft);
  margin-bottom: 1.2rem;
  line-height: 1.5;
}

.checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 0.15rem;
  flex-shrink: 0;
  accent-color: var(--blu);
}

.checkbox-row a {
  color: var(--blu);
  text-decoration: underline;
}

.submit-btn {
  background: var(--blu);
  color: var(--bianco);
  padding: 0.85rem 2rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.25s, transform 0.2s;
  width: 100%;
}

.submit-btn:hover:not(:disabled) {
  background: var(--azzurro);
  color: var(--blu-scuro);
  transform: translateY(-1px);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-success,
.form-failure {
  padding: 1rem 1.2rem;
  border-radius: var(--radius-md);
  margin-top: 1rem;
  font-size: 0.9rem;
  display: none;
}

.form-success.visible,
.form-failure.visible {
  display: block;
}

.form-success {
  background: rgba(0, 200, 83, 0.1);
  color: #006d2c;
  border: 1px solid rgba(0, 200, 83, 0.3);
}

.form-failure {
  background: rgba(220, 38, 38, 0.08);
  color: #991b1b;
  border: 1px solid rgba(220, 38, 38, 0.2);
}

/* ---------- News ---------- */
.news-empty {
  text-align: center;
  padding: 4rem 1rem;
  background: var(--grigio);
  border-radius: var(--radius-lg);
  margin-top: 2rem;
}

.news-empty p {
  color: var(--testo-muto);
  font-size: 1rem;
}

.news-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.news-card {
  background: var(--bianco);
  border: 1px solid var(--grigio-medio);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s;
  display: flex;
  flex-direction: column;
}

.news-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.news-card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: var(--grigio);
}

.news-card-body {
  padding: 1.5rem;
}

.news-date {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--azzurro);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.news-card h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--blu-scuro);
  line-height: 1.3;
  margin-bottom: 0.6rem;
}

.news-card p {
  font-size: 0.9rem;
  color: var(--testo-soft);
  line-height: 1.7;
}

/* ---------- Footer ---------- */
.site-footer {
  background: linear-gradient(135deg, #0d1f6b 0%, #1a3399 100%);
  color: rgba(255, 255, 255, 0.78);
  padding: 4rem 1.5rem 2rem;
  position: relative;
}

.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 3rem;
}

.footer-brand img {
  width: 130px;
  margin-bottom: 1.2rem;
  filter: brightness(0) invert(1);
}

.footer-brand p {
  font-size: 0.85rem;
  line-height: 1.7;
  margin-bottom: 1rem;
}

.footer-meta {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.6;
}

.footer-col h5 {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--bianco);
  margin-bottom: 1rem;
  font-weight: 600;
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-col a {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.78);
  transition: color 0.2s;
}

.footer-col a:hover {
  color: var(--azzurro);
}

.footer-bottom {
  max-width: var(--container);
  margin: 3rem auto 0;
  padding-top: 1.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.55);
}

.footer-bottom a {
  color: rgba(255, 255, 255, 0.7);
}

.footer-bottom a:hover {
  color: var(--azzurro);
}

/* ---------- 404 ---------- */
.error-page {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8rem 1.5rem 4rem;
}

.error-page .number {
  font-family: var(--font-serif);
  font-size: clamp(6rem, 18vw, 12rem);
  font-weight: 700;
  color: var(--blu);
  line-height: 1;
  margin-bottom: 1rem;
}

.error-page h1 {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--blu-scuro);
  margin-bottom: 1rem;
}

.error-page p {
  color: var(--testo-soft);
  max-width: 460px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

/* ---------- Cookie banner ---------- */
.cookie-banner {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  right: 1.5rem;
  max-width: 460px;
  background: var(--bianco);
  border: 1px solid var(--grigio-medio);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.6rem;
  box-shadow: var(--shadow-lg);
  z-index: 500;
  display: none;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--testo-soft);
}

.cookie-banner.visible {
  display: block;
  animation: fadeUp 0.4s ease both;
}

.cookie-banner strong {
  color: var(--blu-scuro);
  display: block;
  margin-bottom: 0.5rem;
  font-family: var(--font-serif);
  font-size: 1.05rem;
}

.cookie-banner-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.cookie-banner-actions button {
  flex: 1;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.82rem;
  transition: background 0.2s;
}

.cookie-accept {
  background: var(--blu);
  color: var(--bianco);
}

.cookie-accept:hover {
  background: var(--azzurro);
  color: var(--blu-scuro);
}

.cookie-link {
  color: var(--blu);
  text-decoration: underline;
  font-size: 0.85rem;
}

/* ---------- Reveal-on-scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Long-form (privacy / cookie pages) ---------- */
.legal {
  padding: 3rem 1.5rem 5rem;
}

.legal-inner {
  max-width: 800px;
  margin: 0 auto;
}

.legal h2 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--blu-scuro);
  margin: 2.5rem 0 1rem;
}

.legal h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--blu);
  margin: 1.6rem 0 0.7rem;
}

.legal p {
  color: var(--testo-soft);
  line-height: 1.85;
  margin-bottom: 1rem;
}

.legal ul {
  margin: 1rem 0 1.5rem 1.4rem;
  list-style: disc;
}

.legal li {
  color: var(--testo-soft);
  line-height: 1.8;
  margin-bottom: 0.4rem;
}

.legal a {
  color: var(--blu);
  text-decoration: underline;
}

.legal table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2rem 0;
  font-size: 0.92rem;
}

.legal th,
.legal td {
  padding: 0.7rem 0.9rem;
  text-align: left;
  border: 1px solid var(--grigio-medio);
}

.legal th {
  background: var(--grigio);
  font-weight: 600;
  color: var(--blu-scuro);
}

.legal-meta {
  font-size: 0.85rem;
  color: var(--testo-muto);
  background: var(--grigio);
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 2rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .chi-grid,
  .unisciti-inner,
  .contatti-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .hero-content {
    grid-template-columns: 1fr;
    text-align: left;
    gap: 2.5rem;
  }

  .hero-logo-wrap {
    order: -1;
    text-align: center;
  }

  .hero-logo-wrap img {
    width: 180px;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }
}

/* =========================================================
   Mobile navigation — triggers below 900px because the 6 menu
   items + brand stop fitting in the bar around that width.
   ========================================================= */
@media (max-width: 900px) {
  .navbar {
    padding: 0 1rem;
    height: var(--nav-height);
    gap: 0.6rem;
  }

  .nav-logo img {
    height: 38px;
  }

  .navbar.scrolled .nav-logo img {
    height: 34px;
  }

  .nav-brand {
    font-size: 1.05rem;
  }

  /* Hamburger button — visible on mobile, 44×44 touch target */
  .nav-toggle {
    display: flex;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    z-index: 250;
    position: relative;
  }

  /* Slide-down full-screen menu — anchored to the actual nav height */
  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;                              /* fill remaining viewport */
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 1.2rem 1rem 2rem;
    background: var(--bianco);
    box-shadow: 0 6px 24px rgba(26, 51, 153, 0.1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(.22, .61, .36, 1);
    visibility: hidden;
    z-index: 199;
  }

  .nav-links.open {
    transform: translateX(0);
    visibility: visible;
  }

  /* Top-level items: big tap targets, soft divider */
  .nav-links > li {
    border-bottom: 1px solid var(--grigio-medio);
  }

  .nav-links > li:last-child {
    border-bottom: 0;
  }

  .nav-links > li > a {
    padding: 1rem 0.6rem;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: none;
    color: var(--blu-scuro);
    justify-content: space-between;
    min-height: 56px;
    border-radius: 0;
  }

  .nav-links > li > a:hover,
  .nav-links > li > a:focus-visible {
    background: var(--grigio);
  }

  .nav-links > li > a[aria-current="page"] {
    color: var(--blu);
  }

  .nav-links > li > a[aria-current="page"]::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 1.1em;
    background: var(--azzurro);
    margin-right: 0.6rem;
    border-radius: 2px;
  }

  /* Chevron larger and rotates smoothly */
  .nav-links > li > a .chev {
    font-size: 0.85rem;
    opacity: 0.6;
    transition: transform 0.25s;
  }

  .nav-links > li.open > a .chev {
    transform: rotate(180deg);
    opacity: 1;
    color: var(--blu);
  }

  /* Inline dropdown (sub-menu) — collapsed by default with smooth expand */
  .dropdown {
    position: static;
    transform: none;
    box-shadow: none;
    border: 0;
    background: var(--grigio);
    border-radius: var(--radius-md);
    margin: 0 0 0.7rem;
    padding: 0.3rem 0.4rem;
    min-width: 0;
    opacity: 1;
    pointer-events: all;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease, margin 0.3s ease;
  }

  .nav-links > li.open .dropdown {
    max-height: 600px;                      /* large enough for 8 items */
    padding: 0.5rem 0.4rem;
    margin: 0 0 0.7rem;
  }

  .nav-links > li.open .dropdown::before,
  .nav-links > li:hover .dropdown::before {
    display: none;                          /* no desktop bridge on mobile */
  }

  .dropdown li a {
    padding: 0.85rem 1rem;
    font-size: 0.92rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  /* CTA "Contattaci" becomes a full-width pill at the bottom of menu */
  .nav-cta {
    margin: 1rem 0.4rem 0 !important;
    text-align: center;
    padding: 0.95rem 1.4rem !important;
    font-size: 0.92rem !important;
    border-radius: var(--radius-pill) !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .nav-links > li:has(.nav-cta) {
    border-bottom: 0;
  }

  /* Disable the desktop hover-bridge & extra hover li::after on mobile */
  .nav-links > li:hover::after,
  .nav-links > li:focus-within::after {
    content: none;
  }

  /* Body scroll lock when menu open.
     JS uses position:fixed + top:-<scrollY>px to preserve scroll position
     across the lock/unlock cycle (iOS Safari needs this). */
  body.menu-open {
    position: fixed;
    width: 100%;
    overflow: hidden;
    overscroll-behavior: contain;
  }

  /* Backdrop element (created via JS, no-op on desktop) */
  .nav-backdrop {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(13, 31, 107, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
    z-index: 198;
  }

  .nav-backdrop.visible {
    opacity: 1;
    pointer-events: all;
  }
}

/* Hide backdrop entirely on desktop */
@media (min-width: 901px) {
  .nav-backdrop { display: none; }
}

/* General mobile layout tweaks */
@media (max-width: 768px) {
  section {
    padding: 3.5rem 1.1rem;
  }

  .section-inner {
    padding: 0;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .progetti-cta-wrap {
    padding: 1.5rem;
    text-align: center;
    flex-direction: column;
  }

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

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .iban-box {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem;
  }

  .iban-box-info {
    width: 100%;
  }

  .iban-copy {
    align-self: stretch;
    text-align: center;
  }

  .hero {
    min-height: auto;
    padding-bottom: 3rem;
  }

  .hero-content {
    padding: 2.5rem 1.1rem 1rem;
    gap: 2rem;
  }

  .hero-stats {
    gap: 1.4rem 2rem;
    margin-top: 2.5rem;
    padding-top: 2rem;
  }

  .hero-stats > div {
    flex: 1 1 calc(50% - 1rem);
  }

  .stat-num {
    font-size: 1.9rem;
  }

  .hero-btns {
    gap: 0.6rem;
  }

  .hero-btns .btn {
    flex: 1 1 100%;
    text-align: center;
  }

  .page-hero {
    padding: calc(var(--nav-height) + 2.2rem) 1.1rem 2.5rem;
  }

  .page-hero h1 {
    font-size: clamp(1.7rem, 7vw, 2.4rem);
  }

  .breadcrumb {
    padding: 0.7rem 1.1rem;
  }

  .breadcrumb ol {
    font-size: 0.78rem;
  }

  /* Chi siamo: timeline indents stack vertically OK */
  .fact-strip {
    padding: 2.5rem 1.1rem;
  }

  .fact-strip-inner {
    gap: 1.5rem;
  }

  .fact-num {
    font-size: 2.2rem;
  }

  .timeline {
    margin-top: 2rem;
  }

  .timeline-item {
    padding-left: 2.8rem;
  }

  .timeline-year {
    font-size: 1.4rem;
  }

  /* Project detail page */
  .project-cover {
    height: 240px;
  }

  .project-detail {
    padding: 3rem 1.1rem;
  }

  .project-detail h2 {
    font-size: 1.5rem;
  }

  .project-nav {
    flex-direction: column;
  }

  .project-nav .next {
    text-align: left;
    margin-left: 0;
  }

  /* Contact form */
  .contact-form {
    padding: 1.5rem 1.2rem;
  }

  /* Card hover effects on touch — disable transform to avoid stuck states */
  .progetto-card:hover,
  .valore-card:hover,
  .support-card:hover,
  .rassegna-card:hover,
  .news-card:hover {
    transform: none;
  }
}

/* =========================================================
   Small phones (≤480px) — iPhone SE, Android compatti
   ========================================================= */
@media (max-width: 480px) {
  .navbar {
    padding: 0 0.8rem;
  }

  .nav-logo img {
    height: 34px;
  }

  .nav-brand {
    font-size: 1rem;
  }

  .hero-content {
    padding: 2rem 1rem 1rem;
  }

  .hero-title {
    font-size: clamp(2.1rem, 9vw, 3.2rem);
  }

  .hero-sub {
    font-size: 0.95rem;
  }

  .hero-logo-wrap img {
    width: 140px;
  }

  .hero-stats {
    margin-top: 2rem;
    padding-top: 1.5rem;
  }

  .stat-num {
    font-size: 1.6rem;
  }

  .stat-label {
    font-size: 0.65rem;
  }

  .page-hero {
    padding: calc(var(--nav-height) + 1.8rem) 1rem 2.2rem;
  }

  .iban-box-info code {
    font-size: 0.92rem;
    word-break: break-all;
    line-height: 1.4;
  }
}

/* Hide brand text on screens narrower than 380px */
@media (max-width: 380px) {
  .nav-brand {
    display: none;
  }
}

@media print {
  .navbar,
  .site-footer,
  .cookie-banner,
  .nav-toggle,
  .form-row,
  .submit-btn {
    display: none !important;
  }

  body {
    background: var(--bianco);
    color: #000;
  }

  a {
    color: #000;
    text-decoration: underline;
  }
}

/* =========================================================
   Chi siamo — visual enhancements
   ========================================================= */

/* Stat strip — sintetic facts ribbon */
.fact-strip {
  background: linear-gradient(135deg, #0d1f6b 0%, #1a3399 60%, #1a6fa8 100%);
  padding: 3rem 1.5rem;
  position: relative;
  overflow: hidden;
}

.fact-strip::before,
.fact-strip::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(77, 200, 232, 0.1);
  pointer-events: none;
}

.fact-strip::before {
  width: 380px;
  height: 380px;
  top: -140px;
  left: -120px;
}

.fact-strip::after {
  width: 240px;
  height: 240px;
  bottom: -100px;
  right: -60px;
  background: rgba(255, 255, 255, 0.06);
}

.fact-strip-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2rem;
  position: relative;
  z-index: 2;
}

.fact {
  text-align: center;
  color: var(--bianco);
}

.fact-num {
  font-family: var(--font-serif);
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1;
  color: var(--bianco);
  margin-bottom: 0.5rem;
  display: inline-block;
  background: linear-gradient(135deg, #4dc8e8, #ffffff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.fact-label {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}

/* Logo-col halo + decorative gradient */
.chi-logo-col .chi-logo-wrap {
  position: relative;
  padding: 1.2rem;
}

.chi-logo-col .chi-logo-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(77, 200, 232, 0.18), transparent 65%);
  border-radius: 50%;
  z-index: 0;
  animation: chiPulse 6s ease-in-out infinite;
}

.chi-logo-col .chi-logo-wrap img {
  position: relative;
  z-index: 1;
}

@keyframes chiPulse {
  0%, 100% { transform: scale(0.95); opacity: 0.7; }
  50%      { transform: scale(1.05); opacity: 1; }
}

/* Decorative quote badge under the logo */
.chi-quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--blu-scuro);
  text-align: center;
  line-height: 1.5;
  position: relative;
  padding: 0.5rem 1rem 0;
}

.chi-quote::before {
  content: "\201C";
  font-size: 3.5rem;
  color: var(--azzurro);
  position: absolute;
  top: -1rem;
  left: 0.5rem;
  line-height: 1;
  opacity: 0.4;
}

/* Timeline ("Storia / Tappe") */
.timeline {
  position: relative;
  padding: 1rem 0;
  margin-top: 3rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 19px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--azzurro), var(--blu) 50%, transparent);
}

.timeline-item {
  position: relative;
  padding: 0.4rem 0 2rem 3.5rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 0.6rem;
  width: 20px;
  height: 20px;
  background: var(--bianco);
  border: 3px solid var(--azzurro);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(77, 200, 232, 0.15);
  z-index: 2;
}

.timeline-item.is-current::before {
  background: var(--azzurro);
  animation: pulse 1.6s infinite;
}

.timeline-year {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--blu);
  line-height: 1;
  margin-bottom: 0.4rem;
}

.timeline-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--blu-scuro);
  margin-bottom: 0.3rem;
}

.timeline-desc {
  font-size: 0.92rem;
  color: var(--testo-soft);
  line-height: 1.7;
}

/* Valore-card with circular icon */
.valori-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.4rem;
  margin-top: 2.8rem;
}

.valore-card {
  background: var(--bianco);
  padding: 1.8rem 1.6rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(26, 51, 153, 0.08);
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  position: relative;
  overflow: hidden;
}

.valore-card::after {
  content: "";
  position: absolute;
  top: -50px;
  right: -50px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(77, 200, 232, 0.08), transparent 70%);
  pointer-events: none;
  transition: transform 0.4s;
}

.valore-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 40px rgba(26, 51, 153, 0.12);
  border-color: rgba(77, 200, 232, 0.4);
}

.valore-card:hover::after {
  transform: scale(1.4);
}

.valore-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--azzurro), var(--azzurro-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 1.1rem;
  color: var(--blu-scuro);
  box-shadow: 0 6px 18px rgba(77, 200, 232, 0.3);
  transition: transform 0.3s;
}

.valore-card:hover .valore-icon {
  transform: rotate(-8deg) scale(1.08);
}

.valore-card h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--blu-scuro);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.valore-card p {
  font-size: 0.92rem;
  color: var(--testo-soft);
  line-height: 1.7;
}

/* Mission box (call-out under intro) */
.mission-box {
  margin-top: 2rem;
  padding: 1.6rem 1.8rem;
  background: linear-gradient(135deg, rgba(77, 200, 232, 0.1), rgba(26, 51, 153, 0.05));
  border-left: 4px solid var(--azzurro);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  position: relative;
}

.mission-box::before {
  content: "★";
  position: absolute;
  top: -14px;
  left: -14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--blu);
  color: var(--bianco);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: 0 4px 12px rgba(26, 51, 153, 0.3);
}

.mission-box strong {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--blu-scuro);
  display: block;
  margin-bottom: 0.4rem;
}

.mission-box p {
  margin: 0;
  font-size: 0.97rem;
  color: var(--testo-soft);
  line-height: 1.7;
}

/* Anti-spam captcha field */
.captcha-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.2rem;
  background: var(--bianco);
  border: 1.5px solid var(--grigio-medio);
  border-radius: var(--radius-md);
  margin-bottom: 1.1rem;
}

.captcha-question {
  font-size: 0.92rem;
  color: var(--blu-scuro);
  font-weight: 500;
  flex-shrink: 0;
}

.captcha-question strong {
  font-family: var(--font-serif);
  color: var(--blu);
  font-size: 1.1rem;
  font-weight: 700;
}

.captcha-row input {
  flex: 1;
  padding: 0.55rem 0.8rem;
  border: 1.5px solid var(--grigio-medio);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  max-width: 90px;
  text-align: center;
}

.captcha-row input:focus {
  outline: 0;
  border-color: var(--blu);
  box-shadow: 0 0 0 3px rgba(26, 51, 153, 0.1);
}

.captcha-refresh {
  background: none;
  border: 0;
  color: var(--testo-muto);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 50%;
  transition: color 0.2s, transform 0.4s;
  line-height: 1;
}

.captcha-refresh:hover {
  color: var(--blu);
  transform: rotate(180deg);
}

.field.has-error .captcha-row {
  border-color: var(--rosso);
}

@media (max-width: 480px) {
  .captcha-row {
    flex-wrap: wrap;
  }
  .captcha-row input {
    max-width: 100%;
    flex: 1 1 100%;
  }
}

/* =========================================================
   Mobile UX polish — touch-action, tap-highlight, smooth nav,
   lazy image fade-in, scroll-to-top FAB
   ========================================================= */

/* Remove gray tap-highlight on iOS / Android.
   Set `transparent` on the whole document; restore an explicit one
   on interactive elements so feedback is still there but custom-styled. */
html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Prevent the 300ms tap delay & avoid accidental double-tap zoom
   on real interactive elements. */
a,
button,
.btn,
.nav-toggle,
.captcha-refresh,
.iban-copy,
.nav-cta,
.submit-btn,
input[type="checkbox"],
input[type="radio"],
[role="button"] {
  touch-action: manipulation;
}

/* Stronger focus states for keyboard navigation — invisible to mouse users,
   but a clear blue ring for anyone using Tab. */
@media (any-pointer: fine) {
  :focus-visible {
    outline: 3px solid var(--azzurro);
    outline-offset: 3px;
  }
}

/* Smooth slide-in transition for the mobile menu: combine transform + opacity
   so it feels lighter and avoids any visual "snap" on iOS. */
@media (max-width: 900px) {
  .nav-links {
    opacity: 0;
    transition:
      transform 0.34s cubic-bezier(.22, .61, .36, 1),
      opacity 0.24s ease,
      visibility 0s linear 0.34s;
  }
  .nav-links.open {
    opacity: 1;
    transition:
      transform 0.34s cubic-bezier(.22, .61, .36, 1),
      opacity 0.24s ease,
      visibility 0s linear 0s;
  }

  /* Hamburger: improved X transform — geometrically centered. */
  .nav-toggle-bar,
  .nav-toggle-bar::before,
  .nav-toggle-bar::after {
    transition: transform 0.28s cubic-bezier(.65, 0, .35, 1), background 0.2s;
  }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar::before {
    transform: translateY(7px) rotate(45deg);
  }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar::after {
    transform: translateY(-7px) rotate(-45deg);
  }
}

/* Lazy-loaded images fade in once decoded. Default to invisible only when
   we know JS is running and ready (class added on body), so users with JS
   disabled still see images normally. */
.js-ready img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.45s ease;
}
.js-ready img[loading="lazy"].is-loaded,
.js-ready img[loading="lazy"][data-instant] {
  opacity: 1;
}

/* "Scroll to top" floating action button — appears after scrolling 600px. */
.scroll-top {
  position: fixed;
  right: 1.2rem;
  bottom: 1.4rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--blu);
  color: var(--bianco);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(13, 31, 107, 0.32);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.25s, transform 0.25s, visibility 0s linear 0.25s, background 0.2s;
  z-index: 180;
  border: 0;
}
.scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.25s, transform 0.25s, visibility 0s linear 0s, background 0.2s;
}
.scroll-top:hover,
.scroll-top:focus-visible {
  background: var(--azzurro);
  color: var(--blu-scuro);
  outline: none;
}
.scroll-top svg {
  width: 18px;
  height: 18px;
}

/* Hide scroll-top when the mobile menu is open to avoid layering issues. */
body.menu-open .scroll-top {
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
}

@media (max-width: 480px) {
  .scroll-top {
    right: 1rem;
    bottom: 1rem;
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
  }
}

/* Smoother active state on cards for touch devices — short flash on tap. */
@media (hover: none) {
  .progetto-card:active,
  .valore-card:active,
  .support-card:active,
  .news-card:active,
  .rassegna-card:active,
  .unisciti-card:active {
    transform: scale(0.985);
    transition: transform 0.1s ease;
  }
}

/* Reduce content-shift while images load: reserve aspect-ratio. */
.card-media img,
.news-card-img {
  aspect-ratio: 16 / 10;
  object-fit: cover;
}
.project-cover {
  aspect-ratio: 16 / 8;
  object-fit: cover;
}

