@font-face {
  font-family: 'NHaasGroteskTXPro';
  src: url('fonts/NHaasGroteskTXPro-75Bd.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'NeueHaasGrotDisp';
  src: url('fonts/NeueHaasGrotDisp-75Bold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'NeueHaasGrotDispMedium';
  src: url('fonts/NeueHaasGrotDisp-65Medium.woff') format('woff');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'MessinaSansWeb';
  src: url('fonts/MessinaSansWeb-Regular.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Unica77LL';
  src: url('fonts/Unica77LL-Bold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'NHaasGroteskTXPro-Regular';
  src: url('fonts/NHaasGroteskTXPro-55Rg.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

html, body {
  height: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

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

body {
  font-family: 'NHaasGroteskTXPro', Arial, sans-serif;
  user-select: none;
  cursor: auto;
  color: black;
}

body.cursor-right {
  cursor: auto;
}

/* Nascondi cursori custom su dispositivi touch */
@media (hover: none) and (pointer: coarse) {
  body {
    cursor: auto !important;
  }
  body.cursor-right {
    cursor: auto !important;
  }
}

/* MainWrapper - MANTIENE DESKTOP ORIGINALE */
#mainWrapper {
  transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
  will-change: transform;
}

#mainWrapper.shift-up {
  transform: translateY(-100vh);
}

/* Slider e Info section - ora usa altezza fissa */
.slider-container, #infoSection {
  width: 100vw;
  height: var(--fixed-vh);
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* Fallback per browser che non supportano la variabile custom */
@supports not (height: var(--fixed-vh)) {
  .slider-container, #infoSection {
    height: 100vh;
  }
}

/* Background text - NERO NORMALE */
.background-text {
  position: fixed;
  top: 5vh;
  left: 1vw;
  width: 95vw;
  max-width: 85vw;
  line-height: 1.0;
  color: black;
  z-index: 1;
  pointer-events: none;
  text-align: left;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
  user-select: none;
  font-family: 'NeueHaasGrotDispMedium', Arial, sans-serif;
  font-weight: 500;
  max-height: 58vh;
  overflow: visible;
  padding-bottom: 0.2em;
}

/* Slider - transizione più fluida */
.slider {
  display: flex;
  transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  height: var(--fixed-vh);
  position: relative;
  z-index: 2;
  will-change: transform;
}

@supports not (height: var(--fixed-vh)) {
  .slider {
    height: 100vh;
  }
}

/* Slides - OPACITÀ NORMALE DI DEFAULT */
.slide {
  width: 100vw;
  height: var(--fixed-vh);
  background-repeat: no-repeat;
  background-position: center;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background-color: transparent;
  padding-top: 0;
  opacity: 1;
  transition: opacity 0.3s ease;
}

@supports not (height: var(--fixed-vh)) {
  .slide {
    height: 100vh;
  }
}

/* Slide di solo testo - NESSUNA IMMAGINE */
.slide.text-only {
  opacity: 1;
  background-image: none !important;
  background: none !important;
}

.slide.cover {
  background-size: cover;
  opacity: 1;
}

.slide.contain {
  background-size: contain;
  background-color: transparent;
  height: calc(var(--fixed-vh) - 140px);
  margin: 70px;
  background-repeat: no-repeat;
  background-position: center center;
  vertical-align: middle;
  display: block;
  max-width: calc(100vw - 140px);
  opacity: 1;
}

@supports not (height: var(--fixed-vh)) {
  .slide.contain {
    height: calc(100vh - 140px);
  }
}

.slide.tall {
  background-size: auto 100%;
  background-repeat: no-repeat;
  background-position: center center;
  opacity: 1;
}

/* Top Left - solo Spazio Studio - NERO NORMALE */
#topLeftLabel {
  position: fixed;
  top: 10px;
  left: 10px;
  font-size: 20px;
  font-weight: 700;
  color: black;
  z-index: 20;
  user-select: none;
  font-family: 'NHaasGroteskTXPro', Arial, sans-serif;
  line-height: 1.1;
  cursor: pointer;
  transition: color 0.3s ease;
}

/* Mobile/Desktop toggle */
.desktop { display: inline; }
.mobile { display: none; }
@media (max-width: 600px) {
  .desktop { display: none; }
  .mobile { display: inline; }
}

/* Top Right Info - ora Overview - NERO NORMALE */
#topRightInfo {
  position: fixed;
  top: 10px;
  right: 10px;
  font-size: 20px;
  font-weight: 700;
  color: black;
  text-decoration: none;
  user-select: none;
  font-family: 'NHaasGroteskTXPro', Arial, sans-serif;
  z-index: 20;
  line-height: 1.1;
  cursor: pointer;
  transition: opacity 0.3s ease, color 0.3s ease;
}

#topRightInfo:hover {
  opacity: 0.7;
}

/* Bottom Left - NERO NORMALE */
#bottomLeftContainer {
  position: absolute;
  bottom: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  z-index: 10;
  user-select: none;
  color: black;
  font-family: 'NHaasGroteskTXPro', Arial, sans-serif;
  transition: color 0.3s ease;
}

.counter {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
}

.caption-fixed {
  font-size: 20px;
  white-space: nowrap;
  max-width: 300px;
  line-height: 1.1;
}

/* Bottom Right - NERO NORMALE */
#contactsTimeContainer {
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-end;
  z-index: 10;
  user-select: none;
  font-family: 'NHaasGroteskTXPro', Arial, sans-serif;
  transition: color 0.3s ease;
}

#contacts, #information {
  font-size: 20px;
  font-weight: 700;
  color: black;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  line-height: 1.1;
  transition: color 0.3s ease;
}

.info-text#clock {
  font-size: 20px;
  font-weight: 700;
  color: black;
  user-select: none;
  white-space: nowrap;
  line-height: 1.1;
  transition: color 0.3s ease;
}

/* Classe per testi bianchi - CONTROLLO MANUALE */
.white-text #topLeftLabel,
.white-text #topRightInfo,
.white-text #bottomLeftContainer,
.white-text #contactsTimeContainer,
.white-text #contacts,
.white-text #information,
.white-text .info-text#clock {
  color: white !important;
}

/* Info Section - versione desktop con margini allineati */
#infoSection {
  height: var(--fixed-vh);
  background-color: black;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0;
  box-sizing: border-box;
  z-index: 5;
  position: relative;
  width: 100vw;
  min-height: var(--fixed-vh);
}

@supports not (height: var(--fixed-vh)) {
  #infoSection {
    height: 100vh;
    min-height: 100vh;
  }
}

.info-block.top {
  max-width: 600px;
  font-family: 'NHaasGroteskTXPro', Arial, sans-serif;
  font-size: 20px;
  line-height: 22px;
  margin: 10px 0 0 10px;
  padding: 0;
}

.info-block.bottom {
  max-width: 600px;
  font-family: 'NHaasGroteskTXPro', Arial, sans-serif;
  font-size: 20px;
  line-height: 22px;
  margin: 0 0 10px 10px;
  padding: 0;
}

/* Transizioni fade */
.fade-transition {
  transition: opacity 0.5s ease;
}

.fade-out {
  opacity: 0;
  pointer-events: none;
}

.fade-in {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile Optimizations */
@media (max-width: 600px) {
  /* Background text mobile - NERO NORMALE */
  .background-text {
    font-size: 6vw;
    top: 8vh;
    left: 10px;
    right: 10px;
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    line-height: 1;
    font-family: 'NeueHaasGrotDispMedium', Arial, sans-serif;
    font-weight: 500;
    color: black;
  }

  /* Slide contain mobile */
  .slide.contain {
    height: calc(var(--fixed-vh) - 160px);
    margin: 80px;
    max-width: calc(100vw - 160px);
    opacity: 1;
  }
  
  @supports not (height: var(--fixed-vh)) {
    .slide.contain {
      height: calc(100vh - 160px);
    }
  }

  /* Caption mobile */
  .caption-fixed {
    max-width: 55vw;
    white-space: normal;
    line-height: 1.1;
  }

  /* Info section mobile - mantieni comportamento attuale */
  #infoSection {
    padding: 10px;
  }
  
  .info-block.top {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.1;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  .info-block.bottom {
    font-size: 20px;
    line-height: 1.1;
    margin: 0 !important;
    padding: 0 !important;
  }
}

/* Media queries per diverse dimensioni di schermo */
@media (min-width: 1400px) {
  .background-text {
    font-size: 4.5vw;
    max-width: 70vw;
  }
}

@media (max-width: 1200px) and (min-width: 601px) {
  .background-text {
    font-size: 5.2vw;
  }
}

@media (max-width: 900px) and (min-width: 601px) {
  .background-text {
    font-size: 5.5vw;
    max-width: 85vw;
  }
}

@media (min-width: 1440px) {
  .background-text {
    max-width: 1500px;
  }
}