/* ==========================================================================
   Opscadia — landing cinematica (HTML/CSS/JS statico)
   Tema scuro, sequenza video a tutta pagina con cross-fade allo scroll.
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --container: 1280px;
}

html,
body {
  margin: 0;
  padding: 0;
}

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

body {
  min-height: 100vh;
  background: #000;
  color: #fff;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
}

.ic {
  width: 1.15em;
  height: 1.15em;
  flex: none;
}

/* ----- Barra di avanzamento scroll ----- */
.progress-track {
  position: fixed;
  inset-inline: 0;
  top: 0;
  height: 2px;
  z-index: 60;
  background: rgba(255, 255, 255, 0.05);
}
.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(to right, #6366f1, #8b5cf6, #a855f7);
  transition: width 0.15s ease-out;
}

/* ----- Sfondo video cinematico fisso ----- */
.video-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #000;
  transition: filter 1s ease, transform 1s ease;
}
.video-stage--blur-out {
  filter: blur(32px) saturate(0.2);
  transform: scale(1.14);
}
.video-stage__fallback {
  position: absolute;
  inset: 0;
  background: radial-gradient(125% 120% at 50% 0%, #1b1038 0%, #0b0b14 55%, #000 100%);
}
.video-stage__clip {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.9s ease;
}
.video-stage__clip.is-active {
  opacity: 1;
}
.video-stage__scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.video-stage__scrim--linear {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.3) 50%, rgba(0, 0, 0, 0.6));
}
.video-stage__scrim--radial {
  background: radial-gradient(140% 90% at 50% 115%, rgba(0, 0, 0, 0.65), transparent 55%);
}

/* ----- Header / navigazione ----- */
.site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 50;
  padding: 0.875rem 1.25rem 0;
  pointer-events: none;
}
.site-header__inner {
  max-width: 62rem;
  margin: 0 auto;
  height: 3.25rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0 0.5rem 0 0.875rem;
  border-radius: 9999px;
  background: rgba(8, 8, 14, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
  backdrop-filter: blur(28px) saturate(1.4);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  pointer-events: all;
  transition: background-color 0.3s, box-shadow 0.3s;
}
.site-header.is-scrolled .site-header__inner {
  background: rgba(6, 6, 12, 0.62);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  background: none;
  border: none;
  cursor: pointer;
  color: #fff;
  padding: 0;
}
.brand__chip {
  display: grid;
  place-items: center;
}
.brand__mark {
  width: 1.5rem;
  height: 1.5rem;
  filter: drop-shadow(0 0 12px rgba(168, 85, 247, 0.55));
}
.brand__mark--sm {
  width: 1rem;
  height: 1rem;
  filter: none;
}
.brand__name {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.site-header__nav {
  display: none;
  margin-left: auto;
  align-items: center;
  gap: 0.125rem;
}
.nav-link {
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  padding: 0.4375rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
  transition: background-color 0.2s, color 0.2s;
  white-space: nowrap;
}
.nav-link:hover,
.nav-link--active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.site-header__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}
.site-header__actions .scada-link {
  display: none;
}

.search-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.55);
  transition: background-color 0.2s, color 0.2s;
  flex-shrink: 0;
}
.search-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.search-btn__search,
.search-btn__close {
  width: 1rem;
  height: 1rem;
  flex: none;
}
.search-btn__close { display: none; }
.search-btn.is-active .search-btn__search { display: none; }
.search-btn.is-active .search-btn__close  { display: block; }

/* ----- Header search bar ----- */
.header-search {
  display: none;
  flex: 1;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0.375rem;
  padding: 0 0.75rem 0 0.875rem;
  height: 2.125rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: border-color 0.2s;
  overflow: hidden;
}
.header-search.is-active {
  display: flex;
  animation: search-in 0.2s ease;
}
@keyframes search-in {
  from { opacity: 0; transform: scaleX(0.92); }
  to   { opacity: 1; transform: scaleX(1); }
}
.header-search:focus-within {
  border-color: rgba(139, 92, 246, 0.5);
  background: rgba(255, 255, 255, 0.1);
}
.header-search__ic {
  width: 0.9375rem;
  height: 0.9375rem;
  flex: none;
  color: rgba(255, 255, 255, 0.4);
}
.header-search__input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font: inherit;
  font-size: 0.875rem;
  color: #fff;
  min-width: 0;
}
.header-search__input::placeholder { color: rgba(255, 255, 255, 0.35); }
.header-search__input::-webkit-search-cancel-button { display: none; }
.header-search__close {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.375rem;
  height: 1.375rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.6);
  transition: background-color 0.2s, color 0.2s;
}
.header-search__close:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}
.header-search__close svg {
  width: 0.75rem;
  height: 0.75rem;
}

.btn--pill {
  border-radius: 9999px;
}

.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: background-color 0.2s;
  padding: 0;
}
.menu-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}
.menu-toggle__bar {
  display: block;
  width: 1.25rem;
  height: 2px;
  border-radius: 9999px;
  background: #fff;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.2s ease;
  transform-origin: center;
}
.menu-toggle.is-open .menu-toggle__bar:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.menu-toggle.is-open .menu-toggle__bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.menu-toggle.is-open .menu-toggle__bar:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

.mobile-menu {
  max-width: 62rem;
  margin: 0.375rem auto 0;
  border-radius: 1.5rem;
  background: rgba(8, 8, 14, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  padding: 0.625rem;
  pointer-events: all;
}
.mobile-menu[hidden] {
  display: none;
}
.mobile-menu__link {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  padding: 0.75rem 1rem;
  border-radius: 0.875rem;
  font-size: 1rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  transition: background-color 0.2s, color 0.2s;
}
.mobile-menu__link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.mobile-menu__cta {
  width: 100%;
  justify-content: center;
  margin-top: 0.5rem;
}

/* ----- Navigazione laterale a punti (desktop) ----- */
.scene-dots {
  position: fixed;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
.scene-dot {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
}
.scene-dot__bar {
  display: block;
  height: 0.5rem;
  width: 0.5rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.3);
  transition: width 0.3s, background-color 0.3s;
}
.scene-dot:hover .scene-dot__bar {
  background: rgba(255, 255, 255, 0.6);
}
.scene-dot.is-active .scene-dot__bar {
  width: 1.5rem;
  background: var(--dot, #fff);
}

/* ----- Colori per scena (--accent) ----- */
[data-index="0"]  { --accent: #8b5cf6; }
[data-index="1"]  { --accent: #6366f1; }
[data-index="2"]  { --accent: #8b5cf6; }
[data-index="3"]  { --accent: #3b82f6; }
[data-index="4"]  { --accent: #3b82f6; }
[data-index="5"]  { --accent: #6366f1; }
[data-index="6"]  { --accent: #8b5cf6; }
[data-index="7"]  { --accent: #a855f7; }
[data-index="8"]  { --accent: #ef4444; }
[data-index="9"]  { --accent: #f59e0b; }
[data-index="10"] { --accent: #8b5cf6; }

/* ----- Colori chip (--chip) ----- */
.chip--green { --chip: #22c55e; }
.chip--red   { --chip: #ef4444; }
.chip--blue  { --chip: #3b82f6; }
.chip--amber { --chip: #f59e0b; }

/* ----- Sezioni scena ----- */
.scenes {
  position: relative;
  z-index: 10;
}
.scene {
  position: relative;
  display: flex;
  align-items: flex-start;
  min-height: 100vh;
  min-height: 100svh;
}
.scene__container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: max(8rem, 45vh) 1.25rem 3rem;
}
.scene__container--center {
  text-align: center;
  padding-top: 0;
  padding-bottom: 0;
  align-self: center;
}
.scene__content {
  position: relative;
  max-width: 42rem;
}
.scene__container--center .scene__content {
  max-width: 48rem;
  margin-inline: auto;
}

/* Reveal allo scroll: attivo solo quando JS è disponibile. */
.js .scene__content {
  opacity: 0;
  transform: translateY(2rem);
  filter: blur(3px);
  transition: opacity 0.7s ease, transform 0.7s ease, filter 0.7s ease;
}
.scene--active .scene__content {
  opacity: 1;
  transform: none;
  filter: none;
}

.scene__halo {
  position: absolute;
  top: -6rem;
  left: -4rem;
  z-index: -1;
  width: 20rem;
  height: 20rem;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.4;
  filter: blur(90px);
  pointer-events: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
  color: rgba(216, 180, 254, 0.9);
  background: rgba(139, 92, 246, 0.18);
  border: 1px solid rgba(139, 92, 246, 0.4);
}
@supports (color: color-mix(in srgb, red 50%, blue)) {
  .badge {
    color: color-mix(in srgb, var(--accent) 55%, white);
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  }
}

.scene__title {
  margin: 1.25rem 0 0;
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  text-wrap: balance;
}
.scene__hero-title {
  margin: 1.5rem 0 0;
  font-size: clamp(3.5rem, 11vw, 6rem);
  font-weight: 800;
  font-style: italic;
  letter-spacing: -0.03em;
  line-height: 0.95;
  text-transform: uppercase;
}
.gradient-text {
  background: linear-gradient(135deg, #ffffff, #ddd6fe 45%, #a855f7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 24px rgba(139, 92, 246, 0.35));
}
.scene__subtitle {
  margin: 1rem 0 0;
  font-size: clamp(1.4rem, 3vw, 1.875rem);
  font-weight: 600;
  color: #fff;
}
.scene__body {
  margin: 1.25rem 0 0;
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.72);
  text-wrap: pretty;
}

.chips {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.scene__container--center .chips {
  justify-content: center;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
  color: #fff;
  color: color-mix(in srgb, var(--chip) 60%, white);
  background: color-mix(in srgb, var(--chip) 16%, transparent);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-color: color-mix(in srgb, var(--chip) 35%, transparent);
}
.chip__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--chip);
}

.scene__cta {
  margin-top: 2.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.scene__container--center .scene__cta {
  justify-content: center;
}

.scene__signature {
  margin-top: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.45);
}

/* ----- Final scene — light theme ----- */
.scene--final {
  background-color: #f5f3ff;
  background-image:
    linear-gradient(to bottom, transparent 0%, rgba(245, 243, 255, 0.55) 28%, #f5f3ff 55%),
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(139, 92, 246, 0.14) 0%, transparent 60%),
    radial-gradient(ellipse 50% 30% at 80% 110%, rgba(99, 102, 241, 0.08) 0%, transparent 55%);
  color: #0f0e1a;
}
.scene--final .scene__title,
.scene--final .scene__body {
  color: #0f0e1a;
}
.scene--final .scene__signature {
  color: rgba(15, 14, 26, 0.45);
}
.scene--final .badge {
  color: #6d28d9;
  background: rgba(109, 40, 217, 0.1);
  border-color: rgba(109, 40, 217, 0.3);
}
.scene--final .scene__halo {
  display: none;
}

/* Search bar in light header */
.site-header--light .header-search {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(109, 40, 217, 0.35);
}
.site-header--light .header-search:focus-within {
  border-color: rgba(109, 40, 217, 0.65);
  background: rgba(0, 0, 0, 0.07);
}
.site-header--light .header-search__ic {
  color: rgba(15, 14, 26, 0.4);
}
.site-header--light .header-search__input {
  color: #0f0e1a;
}
.site-header--light .header-search__input::placeholder {
  color: rgba(15, 14, 26, 0.38);
}

/* Header light mode (active on final scene) */
.site-header--light .site-header__inner {
  background: rgba(245, 243, 255, 0.88) !important;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.09) !important;
}
.site-header--light .brand__name,
.site-header--light .nav-link {
  color: #0f0e1a;
}
.site-header--light .nav-link:hover,
.site-header--light .nav-link--active {
  background: rgba(0, 0, 0, 0.06);
  color: #0f0e1a;
}
.site-header--light .search-btn {
  color: #0f0e1a;
}

/* btn--pill must win over btn--xl border-radius */
.btn.btn--pill { border-radius: 9999px; }

/* ----- Final scene feature grid ----- */
.final-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.875rem;
  margin: 2rem 0 2.25rem;
  text-align: left;
}
.final-card {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding: 1.125rem 1.25rem;
  background: rgba(109, 40, 217, 0.06);
  border: 1px solid rgba(109, 40, 217, 0.14);
  border-radius: 1rem;
}
.final-card .ic {
  width: 1.5rem;
  height: 1.5rem;
  color: #7c3aed;
  margin-bottom: 0.25rem;
}
.final-card strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 650;
  color: #0f0e1a;
  line-height: 1.3;
}
.final-card span {
  font-size: 0.8rem;
  color: rgba(15, 14, 26, 0.52);
  line-height: 1.4;
}

/* ----- Final scene footer ----- */
.final-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  padding: 1rem 2rem;
  border-top: 1px solid rgba(109, 40, 217, 0.1);
  font-size: 0.8125rem;
  color: rgba(15, 14, 26, 0.4);
}
.final-footer__sep {
  opacity: 0.5;
}

/* space so content doesn't overlap the footer */
.scene--final .scene__container--center {
  padding-bottom: 4rem;
}

/* Hide scene dots on final scene */
.scene-dots--hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
}

/* ----- Hint di scroll sull'hero ----- */
.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.5s, color 0.3s;
}
.scene--active .scroll-hint {
  opacity: 1;
}
.scroll-hint:hover {
  color: #fff;
}
.scroll-hint .ic {
  width: 1.25rem;
  height: 1.25rem;
  animation: hint-bounce 1.4s infinite;
}
@keyframes hint-bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(25%);
  }
}

/* ----- Pulsanti ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  border-radius: 0.625rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: filter 0.2s, background-color 0.2s, border-color 0.2s, transform 0.1s;
}
.btn:active {
  transform: translateY(1px);
}
.btn--sm {
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
}
.btn--md {
  padding: 0.625rem 1rem;
  font-size: 0.9375rem;
}
.btn--xl {
  padding: 0.875rem 1.375rem;
  font-size: 1.0625rem;
  border-radius: 0.75rem;
}
.btn--primary {
  color: #fff;
  background-image: linear-gradient(135deg, #7c3aed, #a855f7);
  box-shadow: 0 8px 30px rgba(139, 92, 246, 0.35);
}
.btn--primary:hover {
  filter: brightness(1.08);
}
.btn--secondary {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.btn--secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}
.btn--white {
  color: #0f0e1a;
  background: #ffffff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.btn--white:hover {
  background: #f0ecff;
}

/* Breakpoints e mobile overrides → mobile.css */
