/* ─── Reset & Root ─────────────────────────────────────────── */

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

:root {
  --color-bg:          #000000;
  --color-text:        #FFFFFF;
  --color-text-muted:  #666666;
  --color-accent:      #00C9B7;
}

html {
  background: var(--color-bg);
  /* NO overflow-x: hidden — rompe lo scroll su iOS Safari */
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  cursor: default;
  /* NO overflow-x: hidden — rompe lo scroll su iOS Safari */
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

/* ─── Canvas ───────────────────────────────────────────────── */

#video-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  touch-action: pan-y;
  transition: opacity 0.5s ease;
  background: var(--color-bg);
}

/* ─── Loading bar ──────────────────────────────────────────── */

#loading-bar-container {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  z-index: 100;
  pointer-events: none;
}

#loading-bar {
  height: 100%;
  width: 0%;
  background: var(--color-accent);
  transition: width 0.2s linear, opacity 0.6s ease;
}

/* ─── Navbar ───────────────────────────────────────────────── */

#navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem 2.8rem;
  transition: background 0.5s ease, backdrop-filter 0.5s ease;
  pointer-events: none;
}

#navbar.scrolled {
  background: rgba(0, 0, 0, 0.50);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-logo {
  height: 24px;
  width: auto;
  display: block;
}

.nav-coming-soon {
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.80);
  letter-spacing: 0.22em;
}

/* ─── Hero overlay ─────────────────────────────────────────── */

#hero-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.hero-logo {
  width: min(520px, 68vw);
  height: auto;
  display: block;
  margin-bottom: 3.5rem;
}

/* Freccia animata: tre chevron sfasati */
.hero-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0px;
}

.hero-arrow span {
  display: block;
  width: 22px;
  height: 22px;
  border-right: 2px solid rgba(255, 255, 255, 0.75);
  border-bottom: 2px solid rgba(255, 255, 255, 0.75);
  transform: rotate(45deg);
  animation: chevronPulse 1.6s ease-in-out infinite;
}

.hero-arrow span:nth-child(1) { animation-delay: 0s;    opacity: 0.3; }
.hero-arrow span:nth-child(2) { animation-delay: 0.25s; opacity: 0.6; }
.hero-arrow span:nth-child(3) { animation-delay: 0.5s;  opacity: 0.9; }

@keyframes chevronPulse {
  0%   { opacity: 0;   transform: rotate(45deg) translate(-4px, -4px); }
  60%  { opacity: 1;   transform: rotate(45deg) translate(0, 0); }
  100% { opacity: 0;   transform: rotate(45deg) translate(4px, 4px); }
}

/* ─── Scroll container ─────────────────────────────────────── */

#scroll-container {
  position: relative;
  /* 400vh animation zone + 100vh final reveal */
  height: 500vh;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

/* ─── Text overlays ────────────────────────────────────────── */

#text-overlay-container {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.overlay-text {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  color: var(--color-text);
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: clamp(0.75rem, 1.6vw, 1.4rem);
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
  text-align: center;
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
  pointer-events: none;
  max-width: 72vw;
  line-height: 2;

  /* box bianco trasparente per contrasto */
  background: rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 1.4rem 2.8rem;
  border-radius: 3px;
}

.overlay-text.visible {
  opacity: 1;
}

/* ─── Final reveal ─────────────────────────────────────────── */

#final-reveal {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  position: relative;
  z-index: 5;
  padding: 4rem 2rem;
  user-select: text;
  -webkit-user-select: text;
}

#final-reveal .logo-img {
  width: min(560px, 75vw);
  height: auto;
  display: block;
  margin-bottom: 1.2rem;
  /* white PNG on black — no filter needed */
}

#final-reveal .subtitle {
  font-family: 'Jost', Arial, sans-serif;
  font-size: clamp(0.6rem, 1.4vw, 0.95rem);
  font-weight: 300;
  color: var(--color-text-muted);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  margin-bottom: 3.5rem;
}

#final-reveal .presto {
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: clamp(1.2rem, 3vw, 2rem);
  font-style: normal;
  font-weight: 600;
  color: var(--color-text);
  opacity: 0.8;
  letter-spacing: 0.15em;
}

/* ─── Noscript ─────────────────────────────────────────────── */

.noscript-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  z-index: 9999;
  text-align: center;
  padding: 2rem;
}

.noscript-logo {
  font-family: Georgia, serif;
  font-size: clamp(2.5rem, 10vw, 7rem);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: 0.05em;
}

.noscript-sub {
  font-family: Arial, sans-serif;
  font-size: clamp(0.6rem, 1.4vw, 0.9rem);
  font-weight: 300;
  color: var(--color-text-muted);
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.noscript-msg {
  font-family: Arial, sans-serif;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-top: 1rem;
}

.noscript-presto {
  font-family: Georgia, serif;
  font-size: 1.4rem;
  font-style: italic;
  color: var(--color-text);
  opacity: 0.75;
}

/* ─── prefers-reduced-motion ───────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  #video-canvas,
  #loading-bar-container,
  #scroll-indicator {
    display: none;
  }

  #scroll-container {
    height: auto;
    justify-content: flex-start;
  }

  #text-overlay-container {
    position: static;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4rem;
    padding: 6rem 2rem;
    min-height: 50vh;
  }

  .overlay-text {
    position: static;
    transform: none;
    opacity: 1;
    max-width: 80vw;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  #final-reveal {
    min-height: 80vh;
  }
}

/* ─── Mobile tweaks ────────────────────────────────────────── */

@media (max-width: 480px) {
  #final-reveal .logo-img {
    width: min(320px, 85vw);
  }

  #final-reveal .subtitle {
    letter-spacing: 0.18em;
  }
}
