/* ============================================
   APPLE-STYLE FULL-BLEED SCROLL
   Aggiunte al style.css principale
   ============================================ */

/* Removes padding on body for the cinematic feel */
body.cinematic { background: var(--ink); }

/* Override header su fondo scuro */
.site-header.over-dark {
  background: rgba(28, 26, 23, 0.5);
  backdrop-filter: blur(20px);
}

.site-header.over-dark .brand,
.site-header.over-dark .nav a {
  color: var(--bg);
}

.site-header.over-dark .lang-switch button.active {
  color: var(--bg);
}

.site-header.over-dark .lang-switch button.active::before {
  background: var(--bg);
}

.site-header.over-dark .nav a.active::after,
.site-header.over-dark .nav a:hover::after {
  background: var(--bg);
}

/* ---- Hero cinematic ---- */
.cinematic-hero {
  position: relative;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  background: var(--ink);
}

.cinematic-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.cinematic-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  /* Ken Burns lento e più ampio per la hero principale */
  animation: kenBurnsHero 30s ease-in-out infinite;
}

@keyframes kenBurnsHero {
  0% { transform: scale(1.02); }
  50% { transform: scale(1.10); }
  100% { transform: scale(1.02); }
}

@media (prefers-reduced-motion: reduce) {
  .cinematic-hero-bg img { animation: none; }
}

.cinematic-hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.1) 35%, rgba(0,0,0,0.1) 65%, rgba(0,0,0,0.6) 100%);
}

.cinematic-hero-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 var(--gutter) clamp(3rem, 8vw, 7rem);
  color: var(--bg);
}

.cinematic-hero-content .eyebrow {
  color: rgba(245, 243, 239, 0.9);
  margin-bottom: 1.75rem;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.cinematic-hero-content h1 {
  color: var(--bg);
  font-size: clamp(2.5rem, 6.5vw, 6rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  font-weight: 300;
  font-variation-settings: "opsz" 144, "SOFT" 30;
  max-width: 1100px;
  text-shadow: 0 2px 30px rgba(0,0,0,0.25);
}

.cinematic-hero-content .subline {
  font-family: var(--font-mono);
  font-size: clamp(0.75rem, 1vw, 0.9rem);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(245, 243, 239, 0.85);
  margin-top: 2rem;
  max-width: 600px;
}

/* ---- Cinematic sections (categorie full-bleed) ----
   v2: con cross-fade + parallax sottile.
   Ogni sezione è alta 100vh ma la sua immagine è "sticky" all'interno
   di un wrapper più alto, creando parallax. Il fade è gestito da IO. */
.cinematic-section {
  position: relative;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  background: var(--ink);
}

/* Wrapper opzionale per creare il "track" del parallax.
   Se la sezione ha la classe .with-parallax-track, lo applichiamo. */
.parallax-track {
  position: relative;
  height: 130vh; /* più alta del viewport per dare margine al parallax */
  width: 100%;
}

.parallax-track .cinematic-section {
  position: sticky;
  top: 0;
  height: 100vh;
}

/* L'immagine di sfondo ha una transform iniziale e si muove
   in modo molto sottile mentre scrolli (gestito via JS con
   custom property --scroll-progress 0..1) */
.cinematic-section .bg-image {
  position: absolute;
  inset: 0;
  z-index: 1;
  cursor: pointer;
  overflow: hidden;
  /* opacity di base + fade */
  opacity: 1;
  transition: opacity 0.8s var(--ease);
}

.cinematic-section .bg-image img {
  width: 100%;
  height: 110%; /* leggermente più alta per il parallax */
  object-fit: cover;
  object-position: center;
  transition: transform 1.2s var(--ease);
  /* parallax: l'immagine si muove di poco rispetto allo scroll */
  transform: translate3d(0, var(--parallax-y, 0px), 0) scale(1);
  /* Ken Burns: zoom in/out continuo per dare vita alle copertine */
  animation: kenBurns 24s ease-in-out infinite;
}

@keyframes kenBurns {
  0% { transform: translate3d(0, var(--parallax-y, 0px), 0) scale(1); }
  50% { transform: translate3d(0, var(--parallax-y, 0px), 0) scale(1.08); }
  100% { transform: translate3d(0, var(--parallax-y, 0px), 0) scale(1); }
}

/* Sfasamento dell'animazione per le sezioni successive — evita che tutte facciano zoom insieme */
.cinematic-section:nth-of-type(2) .bg-image img { animation-delay: -8s; }
.cinematic-section:nth-of-type(3) .bg-image img { animation-delay: -16s; }
.cinematic-section:nth-of-type(4) .bg-image img { animation-delay: -4s; }

/* Rispetto utenti che vogliono ridurre il movimento */
@media (prefers-reduced-motion: reduce) {
  .cinematic-section .bg-image img { animation: none; }
}

/* Hover effect: amplifica leggermente lo zoom corrente (non sostituisce il Ken Burns) */
.cinematic-section:hover .bg-image img {
  animation-play-state: paused;
  transform: translate3d(0, var(--parallax-y, 0px), 0) scale(1.10);
}

.cinematic-section .bg-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.1) 30%, rgba(0,0,0,0.1) 65%, rgba(0,0,0,0.65) 100%);
  transition: background var(--t-med) var(--ease);
  pointer-events: none;
}

.cinematic-section:hover .bg-image::after {
  background: linear-gradient(180deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.15) 30%, rgba(0,0,0,0.15) 65%, rgba(0,0,0,0.7) 100%);
}

/* Cross-fade: quando la sezione successiva entra in viewport,
   l'immagine corrente fa fade-out parziale (gestito da CSS variable) */
.cinematic-section[data-fade-out="true"] .bg-image {
  opacity: var(--fade-opacity, 1);
}

.cinematic-section-content {
  position: relative;
  z-index: 2;
  width: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: var(--gutter);
  color: var(--bg);
  pointer-events: none;
  /* Il contenuto entra con un piccolo fade-in al raggiungimento */
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}

.cinematic-section[data-in-view="true"] .cinematic-section-content {
  opacity: 1;
  transform: translateY(0);
}

.cinematic-section-content > * { pointer-events: auto; }

/* Hero parallax: la foto di sfondo della hero si muove anche lei */
.cinematic-hero-bg img {
  width: 100%;
  height: 115%;
  object-fit: cover;
  transform: translate3d(0, var(--hero-parallax, 0px), 0);
  will-change: transform;
}

/* Riduzione movimento: rispetta prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .cinematic-section .bg-image img,
  .cinematic-hero-bg img {
    transform: none !important;
  }
  .cinematic-section-content {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .cinematic-section[data-fade-out="true"] .bg-image {
    opacity: 1 !important;
  }
  .reveal-letter, .reveal-word, .reveal-line {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ============================================
   WOW SCROLL — animazioni di rivelazione
   ============================================ */

/* Smooth scroll più fluido / lento (CSS scroll-behavior + più momento) */
html.cinematic-page {
  scroll-behavior: smooth;
}

/* Letter-by-letter reveal sui titoli */
.reveal-letter {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.4em);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal-letter.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Word-by-word reveal (più leggero, per sottotitoli/descrizioni) */
.reveal-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.6em);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal-word.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Element reveal: testi/CTA/numeri entrano da sotto durante scroll */
.scroll-reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}

.scroll-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.scroll-reveal--from-left {
  transform: translateX(-40px);
}

.scroll-reveal--from-left.is-visible {
  transform: translateX(0);
}

.scroll-reveal--from-right {
  transform: translateX(40px);
}

.scroll-reveal--from-right.is-visible {
  transform: translateX(0);
}

/* Stagger: ritardo progressivo tra elementi della stessa sezione */
.scroll-reveal:nth-child(1) { transition-delay: 0ms; }
.scroll-reveal:nth-child(2) { transition-delay: 150ms; }
.scroll-reveal:nth-child(3) { transition-delay: 300ms; }
.scroll-reveal:nth-child(4) { transition-delay: 450ms; }
.scroll-reveal:nth-child(5) { transition-delay: 600ms; }

.cs-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.cs-number {
  font-family: var(--font-mono);
  font-size: clamp(0.85rem, 1vw, 1rem);
  line-height: 1;
  color: rgba(245, 243, 239, 0.8);
  font-weight: 400;
  letter-spacing: 0.1em;
}

.cs-meta {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(245, 243, 239, 0.75);
  line-height: 1.8;
}

.cs-bottom {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: end;
}

.cs-title h2 {
  color: var(--bg);
  font-weight: 300;
  font-variation-settings: "opsz" 144, "SOFT" 30;
  font-size: clamp(3rem, 8vw, 8rem);
  line-height: 0.92;
  letter-spacing: -0.035em;
  margin-bottom: 1rem;
}

.cs-title p {
  color: rgba(245, 243, 239, 0.85);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: clamp(1rem, 1.3vw, 1.2rem);
  max-width: 520px;
  line-height: 1.5;
}

.cs-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.05rem 1.85rem;
  border: 1px solid rgba(245, 243, 239, 0.5);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bg);
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all var(--t-fast) var(--ease);
  white-space: nowrap;
}

.cinematic-section:hover .cs-cta {
  background: var(--bg);
  color: var(--ink);
  border-color: var(--bg);
}

.cs-cta:hover { opacity: 1; }

.cs-cta::after {
  content: '\2192';
  font-size: 1.1rem;
  letter-spacing: 0;
  transition: transform var(--t-fast) var(--ease);
}

.cinematic-section:hover .cs-cta::after {
  transform: translateX(4px);
}

/* ---- Quote / interlude section ---- */
.cinematic-quote {
  background: var(--bg);
  padding: clamp(6rem, 14vw, 12rem) var(--gutter);
  text-align: center;
}

.cinematic-quote .quote-text {
  font-family: var(--font-display);
  font-weight: 300;
  font-variation-settings: "opsz" 144, "SOFT" 30;
  font-size: clamp(1.85rem, 4.2vw, 3.75rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  max-width: 1100px;
  margin: 0 auto;
  color: var(--ink);
}

.cinematic-quote .quote-text em {
  font-style: normal;
  color: var(--accent);
  font-weight: 400;
}

.cinematic-quote .quote-attribution {
  margin-top: 3rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* Trust badge sotto la quote */
.quote-trust {
  margin-top: clamp(3rem, 5vw, 5rem);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--line);
}
.quote-trust .qt-stars {
  font-size: 1.1rem;
  letter-spacing: 0.15em;
  color: var(--accent);
}
.quote-trust .qt-rating {
  font-family: var(--font-display);
  font-weight: 400;
  font-variation-settings: "opsz" 144;
  font-size: 2.5rem;
  line-height: 1;
  letter-spacing: -0.02em;
  margin-top: 0.5rem;
}
.quote-trust .qt-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 0.5rem;
}
.quote-trust .qt-link {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
  margin-top: 1.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--ink);
  transition: opacity var(--t-fast) var(--ease);
}
.quote-trust .qt-link:hover { opacity: 0.65; }

/* ---- About strip (cinematic about preview) ---- */
.cinematic-about {
  background: var(--bg);
  padding: clamp(6rem, 12vw, 10rem) 0;
}

.cinematic-about-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(3rem, 8vw, 8rem);
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  align-items: center;
}

.cinematic-about-image img {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
}

.cinematic-about-text .eyebrow { margin-bottom: 1.5rem; }
.cinematic-about-text h2 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 400;
  font-variation-settings: "opsz" 144, "SOFT" 30;
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: 2rem;
}
.cinematic-about-text p {
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1.65;
  margin-bottom: 1.25rem;
}
.cinematic-about-text .signature {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--accent);
  margin-top: 1.5rem;
}

/* ---- Final CTA ---- */
.cinematic-cta {
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--ink);
  color: var(--bg);
  overflow: hidden;
}

.cinematic-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(138, 111, 76, 0.25), transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(138, 111, 76, 0.15), transparent 50%);
}

.cinematic-cta-inner {
  position: relative;
  z-index: 2;
  padding: var(--gutter);
  max-width: 900px;
}

.cinematic-cta .eyebrow {
  color: rgba(250, 247, 242, 0.7);
  margin-bottom: 1.5rem;
}

.cinematic-cta h2 {
  color: var(--bg);
  font-weight: 300;
  font-variation-settings: "opsz" 144, "SOFT" 30;
  font-size: clamp(3rem, 7vw, 6rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin-bottom: 2rem;
}

.cinematic-cta p {
  color: rgba(245, 243, 239, 0.85);
  font-family: var(--font-body);
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  font-weight: 300;
  margin-bottom: 3rem;
  line-height: 1.5;
}

.cinematic-cta .button {
  background: var(--bg);
  color: var(--ink);
  border-color: var(--bg);
  padding: 1.25rem 3.5rem;
}

.cinematic-cta .button:hover {
  background: transparent;
  color: var(--bg);
  border-color: var(--bg);
}

/* ---- Live info ticker — solo dentro l'hero della home, sparisce con lo scroll ---- */
.live-info {
  position: absolute;
  bottom: 1.5rem;
  left: var(--gutter);
  z-index: 5;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.7;
  color: rgba(245, 243, 239, 0.7);
  pointer-events: none;
  text-shadow: 0 1px 6px rgba(0,0,0,0.4);
}

.live-info div { display: block; }

/* Smooth scroll override per cinematica */
html.cinematic-page {
  scroll-behavior: smooth;
}

/* ---- Responsive cinematic ---- */
@media (max-width: 768px) {
  .cs-bottom { grid-template-columns: 1fr; gap: 1.5rem; }
  .cs-cta { align-self: flex-start; }
  .cinematic-about-grid { grid-template-columns: 1fr; gap: 2rem; }
  .live-info { display: none; }
}
