:root {
  --bg: #0b1220;
  --bg-card: #111827;
  --accent: #f97316;
  --accent-soft: #fed7aa;
  --text-main: #e5e7eb;
  --text-soft: #9ca3af;
  --title: #f9fafb;
  --edge-red: #ef4444;
  --border: rgba(148,163,184,.25);
}

body.light {
  --bg: #ffffff;
  --bg-card: #ebeff6;
  --accent: #d25a00;
  --accent-soft: #d86a00;
  --text-main: #1b1b1b;
  --text-soft: #444444;
  --title: #111111;
  --edge-red: #d10000;
  --border: rgba(0,0,0,.15);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text-main);
  line-height: 1.7;
  transition: background 0.3s, color 0.3s;
}

html {
  scroll-behavior: smooth;
}

#top,
.section-card {
  scroll-margin-top: 80px;
}

/* NAVBAR MOBILE-FIRST */
nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1000;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

nav .logo {
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: var(--accent-soft);
  text-transform: uppercase;
  white-space: nowrap;
}

.nav-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-main);
  padding: 4px 8px;
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.nav-links {
  list-style: none;
  margin: 0;
  padding: 8px 0 0;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: none;
  flex-direction: column;
}

.nav-links li {
  border-top: 1px solid rgba(148,163,184,0.2);
}

nav a {
  color: var(--text-main);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 6px 10px;
  border-radius: 999px;
  transition: background 0.2s, color 0.2s;
}

.nav-links a {
  display: block;
  padding: 10px 18px;
}

nav a:hover {
  background: var(--accent);
  color: #ffffff;
}

nav.open .nav-links {
  display: flex;
}

.theme-toggle {
  cursor: pointer;
  font-size: 0.85rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-main);
  white-space: nowrap;
  margin-left: 8px;
}

/* NAV DESKTOP */
@media (min-width: 900px) {
  nav {
    padding: 12px 22px;
  }

  .nav-toggle {
    display: none;
  }

  .nav-links {
    position: static;
    display: flex !important;
    flex-direction: row;
    border: none;
    padding: 0;
    width: auto;
    background: transparent;
    gap: 10px;
    margin-left: 24px;
  }

  .nav-links li {
    border: none;
  }

  .nav-links a {
    padding: 6px 10px;
    font-size: 0.9rem;
  }
}

/* CONTENUTO PRINCIPALE */
.page {
  max-width: 900px;
  margin: 0 auto;
  padding: 90px 14px 120px;
}

.title-container {
  text-align: center;
  margin-bottom: 18px;
}

.title-large {
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin: 0 0 6px;
  color: var(--accent-soft);
}

.title-small {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-soft);
  margin: 3px 0;
}

.colore-rosso {
  color: var(--edge-red);
  font-weight: 800;
}

/* HERO: SEMPRE ORIZZONTALE, RESPONSIVO */
.hero-flex {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 26px;
  position: relative;
  flex-wrap: nowrap;
}

/* CONTENITORE SINISTRA (video dentro) */
.hero-img {
  flex: 1 1 0;
  max-width: 48%;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow:
    0 0 15px rgba(0,255,255,0.25),
    0 0 35px rgba(0,255,255,0.15),
    0 0 60px rgba(0,255,255,0.10);
  animation: glowPulse 2.8s infinite ease-in-out;
  overflow: hidden;
}

@keyframes glowPulse {
  0%   { box-shadow: 0 0 15px rgba(0,255,255,0.20), 0 0 30px rgba(0,255,255,0.10); }
  50%  { box-shadow: 0 0 30px rgba(0,255,255,0.50), 0 0 60px rgba(0,255,255,0.30); }
  100% { box-shadow: 0 0 15px rgba(0,255,255,0.20), 0 0 30px rgba(0,255,255,0.10); }
}

.hero-arrow {
  position: relative;
  font-size: 30px;
  font-weight: 900;
  color: var(--accent);
  flex: 0 0 auto;
  text-align: center;
  margin: 0 2px;
}

.hero-arrow::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  height: 6px;
  width: 150px;
  background: linear-gradient(90deg,
            rgba(0,255,255,0.0) 0%,
            rgba(0,255,255,0.9) 50%,
            rgba(0,255,255,0.0) 100%);
  filter: blur(2px);
  animation: dataFlow 1.2s linear infinite;
  pointer-events: none;
  mask-image: linear-gradient(to right, transparent, white, transparent);
}

@keyframes dataFlow {
  0%   { transform: translate(-160%, -50%); }
  100% { transform: translate(160%, -50%); }
}

/* STILE GENERALE PER TUTTI I VIDEO */
video {
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 14px 32px rgba(0,0,0,0.55);
}

/* VIDEO DI DESTRA (FIGLIO DIRETTO DI .hero-flex) */
.hero-flex > video {
  flex: 1 1 0;
  max-width: 48%;
  aspect-ratio: 16 / 9;
}

@media (min-width: 900px) {
  .title-large {
    font-size: 3rem;
  }

  .page {
    padding: 100px 16px 130px;
  }

  .hero-flex {
    gap: 40px;
    margin-top: 40px;
  }

  /* mantieni stessa larghezza per sinistra e destra anche su desktop */
  .hero-img,
  .hero-flex > video {
    max-width: 48%;
  }

  .hero-arrow {
    font-size: 60px;
  }

  .hero-arrow::after {
    width: 160px;
  }
}

/* SECTION CARD */
.section-card {
  background: #1f2933;
  border-radius: 16px;
  padding: 20px 18px 20px 24px;
  margin-top: 20px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  position: relative;
  overflow: hidden;
}

/* tema chiaro: grigio chiaro */
body.light .section-card {
  background: #f3f3f3;
}

.section-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 6px;
  background: var(--accent-soft);
  opacity: 0.9;
}

.section-card h2 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent-soft);
}

.section-card h3 {
  margin-top: 14px;
  margin-bottom: 8px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--title);
}

p, li {
  font-size: 0.95rem;
  color: var(--text-main);
}

.lead {
  font-size: 0.98rem;
}

/* Blockquote con sfondo grigio e testo rosso forte, valido per entrambi i temi */
blockquote {
  margin: 16px 0;
  padding: 10px 14px;
  border-left: 4px solid #b00000;
  background: #808080;
  border-radius: 10px;
  font-style: italic;
  color: #b00000;
}

ol, ul {
  padding-left: 20px;
}

ol li, ul li {
  margin-bottom: 6px;
}

/* FOOTER */
.footer-bar {
  background-color: #020617;
  color: #e5e7eb;
  padding: 10px 16px;
  text-align: center;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-family: "Inter", system-ui, sans-serif;
  z-index: 1000;
  border-top: 1px solid rgba(148, 163, 184, 0.4);
}

.footer-bar .update-text {
  font-size: 11px;
  opacity: 0.8;
}

.footer-bar a.button {
  background-color: var(--accent);
  color: #fff;
  padding: 6px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-family: "Inter", system-ui, sans-serif;
  transition: background-color 0.25s ease, transform 0.15s ease;
  font-size: 12px;
  white-space: nowrap;
}

.footer-bar a.button:hover {
  background-color: #ea580c;
  transform: translateY(-1px);
}

@media (max-width: 600px) {
  .footer-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

