:root {
  --blue-dark: #001f5c;
  --blue-main: #003cb3;
  --blue-hover: #002b80;
  --blue-soft: #eef3fc;
  --red-dark: #990000;
  --red-main: #cc0000;
  --red-hover: #a30000;
  --red-soft: #fef2f2;
  --bg-page: #f3f6fa;
  --bg-card: #ffffff;
  --text-main: #1a2433;
  --text-muted: #526075;
  --border: #d8e1ee;
  --shadow: 0 8px 24px rgba(0, 31, 92, 0.08);
  --radius: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.65;
  font-size: 16px;
}

a {
  color: var(--blue-main);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: var(--red-main);
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- TOPBAR ROSSO STORICO --- */
.topbar {
  background: var(--red-main);
  color: #ffffff;
  font-size: 0.9rem;
  padding: 8px 0;
  border-bottom: 2px solid var(--red-dark);
}

.topbar .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.topbar a {
  color: #ffffff;
  font-weight: 600;
}

.topbar a:hover {
  text-decoration: underline;
}

/* --- HEADER BLU STORICO --- */
.site-header {
  background: linear-gradient(90deg, var(--blue-dark) 0%, var(--blue-main) 100%);
  color: #ffffff;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.brand {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.brand-subtitle {
  font-size: 0.82rem;
  color: #bfdbfe;
  font-weight: 500;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 8px;
  align-items: center;
}

.nav-links > li {
  position: relative;
}

.nav-links > li > a {
  color: #ffffff;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 600;
  display: block;
}

.nav-links > li > a:hover,
.nav-links > li > a.active {
  background: rgba(255, 255, 255, 0.16);
}

/* Menu a tendina */
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #ffffff;
  min-width: 260px;
  border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(0, 31, 92, 0.18);
  border-top: 4px solid var(--red-main);
  padding: 8px;
  list-style: none;
  z-index: 1100;
  max-height: 75vh;
  overflow-y: auto;
}

.nav-links > li:hover .dropdown-menu {
  display: block;
}

.dropdown-menu li a {
  display: block;
  padding: 8px 12px;
  color: var(--text-main);
  font-size: 0.93rem;
  font-weight: 500;
  border-radius: 6px;
}

.dropdown-menu li a:hover {
  background: var(--blue-soft);
  color: var(--blue-main);
}

.nav-cta {
  background: var(--red-main) !important;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #ffffff !important;
}

.nav-cta:hover {
  background: var(--red-hover) !important;
}

.menu-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #ffffff;
  font-size: 1.4rem;
  padding: 4px 11px;
  border-radius: 6px;
  cursor: pointer;
}

/* --- HERO BLU & ROSSO --- */
.hero {
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue-main) 68%, var(--red-dark) 100%);
  color: #ffffff;
  padding: 58px 0;
  border-bottom: 4px solid var(--red-main);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.45fr 0.55fr;
  gap: 36px;
  align-items: center;
}

.badge-ctu {
  display: inline-block;
  background: var(--red-main);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: 2.35rem;
  line-height: 1.2;
  margin-bottom: 16px;
}

.hero p {
  font-size: 1.08rem;
  color: #eef3fc;
  margin-bottom: 26px;
  text-align: justify;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  border: none;
}

.btn-red {
  background: var(--red-main);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.btn-red:hover {
  background: var(--red-hover);
  color: #ffffff;
}

.btn-blue {
  background: var(--blue-main);
  color: #ffffff;
}

.btn-blue:hover {
  background: var(--blue-hover);
  color: #ffffff;
}

.btn-outline {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.65);
  color: #ffffff;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.24);
  color: #ffffff;
}

.hero-stemma {
  background: var(--red-main);
  padding: 16px;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.hero-stemma img {
  max-width: 210px;
  width: 100%;
  border-radius: 10px;
  display: block;
  margin: 0 auto;
}

/* --- SEZIONI & SCHEDE --- */
.section {
  padding: 52px 0;
}

.section-header {
  margin-bottom: 30px;
}

.section-header h2 {
  font-size: 1.85rem;
  color: var(--blue-dark);
  margin-bottom: 6px;
}

.section-header p {
  color: var(--text-muted);
  text-align: justify;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 4px solid var(--blue-main);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}

.card.card-red {
  border-top-color: var(--red-main);
}

.card:hover {
  transform: translateY(-4px);
}

.card h3 {
  color: var(--blue-dark);
  font-size: 1.22rem;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.card.card-red h3 {
  color: var(--red-main);
}

.card p {
  text-align: justify;
}

.service-list {
  list-style: none;
}

.service-list li {
  margin-bottom: 6px;
}

.service-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--text-main);
  font-weight: 500;
}

.service-list a:hover {
  background: var(--blue-soft);
  color: var(--blue-main);
}

.service-list a.active-link {
  background: var(--red-main);
  color: #ffffff;
  font-weight: 600;
}

/* --- PAGINE INTERNE --- */
.page-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 30px;
  padding: 38px 0;
}

.sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 4px solid var(--red-main);
  border-radius: var(--radius);
  padding: 20px;
  height: fit-content;
  box-shadow: var(--shadow);
}

.sidebar h4 {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--red-main);
  margin-bottom: 12px;
}

.content-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 4px solid var(--blue-main);
  border-radius: var(--radius);
  padding: 34px;
  box-shadow: var(--shadow);
  text-align: justify;
}

.content-box h1,
.content-box h2,
.content-box h3 {
  text-align: left;
}

.content-box h1 {
  font-size: 1.95rem;
  color: var(--blue-dark);
  margin-bottom: 18px;
}

.content-box p {
  margin-bottom: 16px;
  text-align: justify;
}

.content-box ul {
  margin: 14px 0 20px 22px;
}

.content-box li {
  margin-bottom: 8px;
  text-align: justify;
}

/* --- GALLERIE & PAGINAZIONE --- */
.gallery-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--border);
  text-align: left;
}

.gallery-nav {
  display: flex;
  gap: 10px;
}

.hero-banner-img {
  width: 100%;
  max-height: 440px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 20px;
  border: 2px solid var(--blue-main);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.photo-grid img {
  width: 100%;
  height: 230px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  transition: transform 0.25s ease;
}

.photo-grid img:hover {
  transform: scale(1.02);
}

/* Prima / Dopo Restauro */
.before-after-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  background: var(--blue-soft);
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 22px;
}

.before-after-item {
  text-align: center;
}

.before-after-item img {
  max-width: 100%;
  max-height: 360px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.before-after-item span {
  display: block;
  margin-top: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--blue-dark);
}

/* Video HTML5 */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-top: 20px;
}

.video-card {
  background: var(--blue-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
}

.video-card h3 {
  color: var(--blue-dark);
  margin-bottom: 6px;
  text-align: center;
}

.video-card p {
  font-size: 0.9rem;
  color: var(--red-main);
  font-weight: 600;
  margin-bottom: 12px;
  text-align: center;
}

.video-card video {
  width: 100%;
  border-radius: 8px;
  background: #000000;
}

/* --- FOOTER BLU & ROSSO --- */
.site-footer {
  background: var(--blue-dark);
  color: #e2e8f0;
  padding: 46px 0 22px;
  margin-top: 44px;
  border-top: 5px solid var(--red-main);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 30px;
  margin-bottom: 30px;
}

.site-footer h4 {
  color: #ffffff;
  margin-bottom: 12px;
  font-size: 1.1rem;
  border-left: 4px solid var(--red-main);
  padding-left: 10px;
}

.site-footer a {
  color: #93c5fd;
}

.site-footer a:hover {
  color: #ffffff;
}

.map-frame {
  width: 100%;
  height: 200px;
  border: 2px solid var(--red-main);
  border-radius: 10px;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-top: 18px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  font-size: 0.88rem;
}

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 900px) {
  .hero-grid,
  .page-layout {
    grid-template-columns: 1fr;
  }

  .hero-stemma {
    order: -1;
    max-width: 200px;
    margin: 0 auto;
  }

  .menu-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    padding: 12px 0;
    align-items: stretch;
  }

  .nav-links.open {
    display: flex;
  }

  .navbar {
    flex-wrap: wrap;
  }

  .dropdown-menu {
    position: static;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.1);
    border-top: none;
  }

  .dropdown-menu li a {
    color: #ffffff;
  }

  .before-after-grid {
    grid-template-columns: 1fr;
  }
}

/* --- SEZIONE SPECIALE QUANTUM VIDEO & LIBRI --- */
.quantum-showcase {
  padding: 46px 0 10px;
}

.quantum-banner {
  background: radial-gradient(circle at top right, #0b2e7a 0%, #051336 58%, #020817 100%);
  border-radius: 18px;
  border: 2px solid #1d4ed8;
  border-left: 6px solid var(--red-main);
  box-shadow: 0 18px 40px rgba(2, 8, 23, 0.22);
  padding: 38px;
  display: grid;
  grid-template-columns: 1.4fr 0.6fr;
  gap: 32px;
  align-items: center;
  color: #ffffff;
  position: relative;
  overflow: hidden;
}

.quantum-badge {
  display: inline-block;
  background: rgba(204, 0, 0, 0.22);
  border: 1px solid #ff4d4d;
  color: #ffd166;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: 14px;
}

.quantum-content h2 {
  font-size: 2rem;
  color: #ffffff;
  margin-bottom: 12px;
}

.quantum-content p {
  color: #dbeafe;
  font-size: 1.03rem;
  margin-bottom: 22px;
  text-align: justify;
}

.quantum-highlights {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.q-pill {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(147, 197, 253, 0.28);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.q-pill strong {
  color: #ffd166;
  font-size: 0.98rem;
}

.q-pill span {
  color: #cbd5e1;
  font-size: 0.86rem;
}

.quantum-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.quantum-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.quantum-orbit-card {
  width: 220px;
  height: 220px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orbit-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px dashed rgba(96, 165, 250, 0.55);
  animation: spinOrbit 18s linear infinite;
}

.orbit-ring.orbit-2 {
  inset: 18px;
  border: 2px solid rgba(239, 68, 68, 0.65);
  border-top-color: #ffd166;
  animation: spinOrbitReverse 12s linear infinite;
}

.orbit-core {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--blue-main), var(--red-dark));
  box-shadow: 0 0 28px rgba(59, 130, 246, 0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 2px solid rgba(255, 255, 255, 0.45);
  z-index: 2;
}

.q-symbol {
  font-size: 2rem;
  font-weight: 800;
  color: #ffd166;
  line-height: 1;
}

.orbit-core strong {
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  margin-top: 4px;
}

.orbit-core small {
  font-size: 0.75rem;
  color: #dbeafe;
}

@keyframes spinOrbit {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes spinOrbitReverse {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

@media (max-width: 900px) {
  .quantum-banner {
    grid-template-columns: 1fr;
    padding: 26px 20px;
  }

  .quantum-highlights {
    grid-template-columns: 1fr;
  }

  .quantum-visual {
    order: -1;
  }
}



/* --- IMMAGINE QUANTUM & VETRINA IPAD / PSP --- */
.quantum-cover-link {
  display: block;
  border-radius: 14px;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.quantum-cover-link:hover {
  transform: scale(1.03);
  border-color: #ffd166;
}

.quantum-cover-img {
  width: 100%;
  max-width: 280px;
  height: auto;
  display: block;
}

.devices-showcase {
  padding: 26px 0 0;
}

.devices-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.device-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 5px solid var(--blue-main);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--text-main);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.device-card.device-card-red {
  border-left-color: var(--red-main);
}

.device-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0, 31, 92, 0.14);
  color: var(--text-main);
}

.device-card img {
  width: 115px;
  height: 115px;
  object-fit: contain;
  flex-shrink: 0;
}

.device-tag {
  display: inline-block;
  background: var(--blue-soft);
  color: var(--blue-main);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.device-tag.device-tag-red {
  background: var(--red-soft);
  color: var(--red-main);
}

.device-card h3 {
  font-size: 1.12rem;
  color: var(--blue-dark);
  margin-bottom: 6px;
}

.device-card.device-card-red h3 {
  color: var(--red-main);
}

.device-card p {
  font-size: 0.92rem;
  color: var(--text-muted);
  text-align: justify;
  margin: 0;
}

@media (max-width: 900px) {
  .devices-grid {
    grid-template-columns: 1fr;
  }

  .device-card {
    flex-direction: column;
    text-align: center;
  }
}