@font-face {
  font-family: 'MenuFont';
  src: url('../fonts/BreakingKingdomeRegular.woff2') format('woff2'); /* Rimosso il duplicato */
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root{
  /* Colore */
  --color-ink:        #0b0d10;
  --color-text:        #f5f6f8;
  --color-text-muted:  rgba(245, 246, 248, 0.68);
  --color-accent:      #ffb020; 
  --color-accent-2:    #5eead4; 

  /* Vetro / liquid glass */
  --glass-fill:         rgba(255, 255, 255, 0.10);
  --glass-fill-strong:  rgba(255, 255, 255, 0.18);
  --glass-border:       rgba(255, 255, 255, 0.28);
  --glass-shadow:       0 8px 32px rgba(0, 0, 0, 0.35);
  --blur-strong:        blur(34px) saturate(180%);
  --blur-soft:          blur(18px) saturate(160%);

  /* Forme */
  --radius-lg: 28px;
  --radius-md: 18px;

  /* Tipografia */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body:    'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --font-menu:    'MenuFont', var(--font-body); 
}

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

/* FIX: Blocco totale dello scorrimento orizzontale */
html{
  /*scroll-behavior: smooth; */
  overflow-x: hidden; 
  width: 100%;
}

body{
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-ink);
  overflow-x: hidden; /* FIX: Doppia sicurezza per lo sfondo navigabile */
  width: 100%;
  position: relative;
}

img{
  max-width: 100%;
  display: block;
}

a{
  color: inherit;
}

ul{
  margin: 0;
  padding: 0;
}

a:focus-visible,
button:focus-visible{
  outline: 2px solid var(--color-accent-2);
  outline-offset: 3px;
}

/* ============================================================
   SCHERMATA DI CARICAMENTO — Liquid Glass
   ============================================================ */

.loading-screen{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background: rgba(11, 13, 16, 0.35);
  backdrop-filter: var(--blur-strong);
  -webkit-backdrop-filter: var(--blur-strong);
  transition: opacity 1.1s ease, visibility 1.1s ease;
}

.loading-screen.is-hidden{
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-orb {
  width: 100%; /* FIX: Reso fluido */
  max-width: 280px;
  height: 200px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-video{
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.loading-label{
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* ============================================================
   VIDEO DI SFONDO FISSO
   ============================================================ */

.bg-video{
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  filter: brightness(0.6);
}

.bg-video-overlay{
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    180deg,
    rgba(11, 13, 16, 0.35) 0%,
    rgba(11, 13, 16, 0.55) 55%,
    rgba(11, 13, 16, 0.88) 100%
  );
}

/* ============================================================
   HEADER
   ============================================================ */

.site-header{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0px clamp(20px, 5vw, 64px);
}

.header-logo img{
  height: 100px;
  width: auto;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

.main-nav ul{
  display: flex;
  gap: clamp(18px, 3vw, 40px);
  list-style: none;
}

.main-nav a{
  font-family: var(--font-menu);
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--color-text);
  text-decoration: none;
  position: relative;
  padding-bottom: 4px;
}

.main-nav a::after{
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--color-accent);
  transition: width 0.3s ease;
}

.main-nav a:hover::after,
.main-nav a:focus-visible::after{
  width: 100%;
}

/* ============================================================
   HERO
   ============================================================ */

.hero{
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hero-logo {
  position: relative;
  z-index: 10; 
  width: 100%;
  display: flex;
  justify-content: center;
}

.hero-logo img {
  width: 100%; /* FIX: Il logo si rimpicciolisce su schermi piccoli */
  max-width: 420px; /* FIX: Mantiene il limite su PC */
  height: auto; 
  padding: 0 20px; /* FIX: Spazio di sicurezza dai bordi del telefono */
  filter: drop-shadow(0 10px 40px rgba(0, 0, 0, 0.45));
}

.scroll-hint{
  position: absolute;
  bottom: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.scroll-hint span{
  width: 1px;
  height: 34px;
  background: linear-gradient(180deg, var(--color-text-muted), transparent);
  animation: scrollPulse 2s ease infinite;
}

@keyframes scrollPulse{
  0%, 100% { opacity: 0.2; }
  50%      { opacity: 1; }
}





/* ============================================================
   EVENT LEAD — il "biglietto" in evidenza
   ============================================================ */

.event-lead-section {
  height: 100dvh; 
  position: relative;
  width: 100%;
  z-index: 2;
}

.event-card-frame {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%); 
  /* FIX: Aggiunta transizione di opacità per un'uscita fluida */
  transition: top 0.8s cubic-bezier(0.25, 1, 0.5, 1), 
              transform 0.8s cubic-bezier(0.25, 1, 0.5, 1),
              opacity 0.6s ease; 
  cursor: pointer;
  
  width: 100%;
  max-width: 400px;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-lg);
  overflow: visible; /* FIX: Permette ai bottoni di uscire dal bordo */
  display: flex;
  
  background: var(--glass-fill);
  backdrop-filter: var(--blur-strong);
  -webkit-backdrop-filter: var(--blur-strong);
  
  border: 5px solid transparent;
  background-clip: padding-box, border-box;
  background-origin: padding-box, border-box;
  background-image: 
    linear-gradient(var(--glass-fill), var(--glass-fill)), 
    linear-gradient(to bottom, var(--glass-border), rgba(0, 0, 0, 0.5));
  
  box-shadow: 
    var(--glass-shadow),                               
    inset 0 1px 2px rgba(255, 255, 255, 0.4),         
    inset 0 -12px 24px rgba(0, 0, 0, 0.3);       
    
    will-change: transform, top, opacity;
}

.event-lead-section.peeking .main-card {
  top: -120px; 
  transform: translate(-50%, 0); 
}

/* ============================================================
   BOTTONI E CARD LATERALI
   ============================================================ */

.card-btn {
  position: absolute;
  bottom: -24px; 
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  
  background-color: var(--color-accent);
  color: var(--color-ink);
  border: none;
  border-radius: 30px;
  padding: 12px 28px;
  font-family: var(--font-menu);
  font-size: 0.95rem;
  font-weight: bold;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

.side-card {
  z-index: 1;
  max-width: 320px; 
  opacity: 0; 
  pointer-events: none; 
}

.main-card {
  z-index: 3;
}

/* --- DESKTOP: Effetto "Ventaglio" --- */
@media (min-width: 769px) {
  .event-lead-section.spread .left-card {
    transform: translate(calc(-50% - 350px), -50%);
    opacity: 1;
    pointer-events: auto;
  }
  .event-lead-section.spread .right-card {
    transform: translate(calc(-50% + 350px), -50%);
    opacity: 1;
    pointer-events: auto;
  }
}

/* --- MOBILE: Carousel a Swipe --- */
/* --- MOBILE: Carousel a Swipe 3D (Stile IG Stories) --- */
@media (max-width: 768px) {
  .event-lead-section {
    perspective: 1200px; /* Abilita l'ambiente 3D per le rotazioni */
  }
  
  .side-card, .main-card {
    max-width: 80vw;
    /* FIX: Reinserita la transizione 'top' per rendere l'uscita dalla Hero di nuovo morbidissima */
    transition: top 0.8s cubic-bezier(0.25, 1, 0.5, 1), 
                transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), 
                opacity 0.6s ease;
  }
  
  /* Carta Precedente (Ruota indietro verso sinistra) */
  .event-card-frame[data-pos="left"] {
    transform: translate(calc(-50% - 60vw), -50%) rotateY(60deg) scale(0.8);
    transform-origin: right center;
    opacity: 0;
    pointer-events: none;
  }
  
  /* Carta Attuale (Dritta al centro) */
  .event-card-frame[data-pos="center"] {
    transform: translate(-50%, -50%) rotateY(0deg) scale(1);
    transform-origin: center center;
    opacity: 1;
    pointer-events: auto;
  }
  
  /* Carta Successiva (Ruota indietro verso destra) */
  .event-card-frame[data-pos="right"] {
    transform: translate(calc(-50% + 60vw), -50%) rotateY(-60deg) scale(0.8);
    transform-origin: left center;
    opacity: 0;
    pointer-events: none;
  }

  .event-lead-section.peeking .side-card {
    opacity: 0;
  }

  /* --- ANIMAZIONE HINT: Sbirciatina della prossima card --- */
  .event-lead-section.show-hint .event-card-frame[data-pos="center"] {
    /* Sposta leggermente a sinistra e ruota la card centrale */
    transform: translate(-75%, -50%) rotateY(-15deg) scale(0.95);
  }
  .event-lead-section.show-hint .event-card-frame[data-pos="right"] {
    /* Fa sbucare e semi-ruotare la card di destra */
    transform: translate(calc(-50% + 40vw), -50%) rotateY(-30deg) scale(0.85);
    opacity: 0.7; 
  }
}

/* ============================================================
   L'IMMAGINE DENTRO LA CORNICE
   ============================================================ */

.event-poster {
  width: 100%;
  height: 100%;
  object-fit: cover; 
  position: relative;
  z-index: -1; 
  border-radius: var(--radius-lg); /* FIX: Arrotonda la foto al posto della cornice */
}

/* ============================================================
   FOOTER E ACCESSIBILITÀ
   ============================================================ */

.site-footer{
  position: relative;
  padding: 60px clamp(20px, 5vw, 64px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  background: rgba(11, 13, 16, 0.65);
  backdrop-filter: var(--blur-soft);
  -webkit-backdrop-filter: var(--blur-soft);
  border-top: 1px solid var(--glass-border);
}

.footer-logo img{
  height: 28px;
}

.site-footer p{
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin: 0;
}

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