/* index_2: hero animata autonoma, senza dipendenze dal prototipo scroll-driven. */
.home-index-2 .he-hero-animation { display: block; height: auto; min-height: 0; overflow: hidden; color: var(--home-ink); background: var(--home-paper); }
/* Il viewport determina solo il minimo: il contenuto può allungare la hero senza tagli. */
.home-index-2 .he-hero-stage { position: relative; display: grid; height: auto; min-height: max(720px, calc(100svh - var(--fox-header-height) - 64px)); grid-template-columns: 46% 54%; grid-template-rows: minmax(min-content, 1fr) auto; overflow: hidden; color: var(--home-ink); background: var(--home-paper); }
.home-index-2 .he-hero-copy { display: flex; padding: clamp(58px, 7vw, 110px) clamp(40px, 6vw, 96px); justify-content: center; flex-direction: column; color: var(--home-ink); background: var(--home-paper); }
.home-index-2 .home-issue { display: flex; margin-bottom: clamp(56px, 9vh, 120px); justify-content: space-between; color: var(--home-muted); font-size: 10px; font-weight: 600; letter-spacing: .17em; text-transform: uppercase; }
.home-index-2 .he-hero-copy .home-kicker { color: var(--home-sage); }
.home-index-2 .he-hero h1 { max-width: 760px; margin-bottom: 28px; color: var(--home-ink); font-family: var(--home-display); font-size: clamp(56px, 6.4vw, 104px); line-height: .89; letter-spacing: -.05em; text-shadow: none; }
.home-index-2 .he-hero h1 em { color: var(--home-sage); font-weight: 700; }
.home-index-2 .he-hero-copy .home-lede { color: var(--home-ink); }
.home-index-2 .hd3-tardeo > img { object-position: center 62%; }

.home-index-2 .he-hero-media { --scene-progress: 0; --time-progress: 0; --dinner-clip: 100%; --night-clip: 100%; --wipe-x: 100%; --wipe-opacity: 0; --day-scale: 1; --dinner-scale: 1.06; --night-scale: 1.06; --foxy-light: 1; position: relative; display: block; min-width: 0; overflow: visible; background: #171915; }
.home-index-2 .he-hero-media .he-scene { position: absolute; inset: 0; margin: 0; overflow: hidden; }
.home-index-2 .he-hero-media .he-day { z-index: 1; }
.home-index-2 .he-hero-media .he-dinner { z-index: 2; clip-path: inset(0 0 0 var(--dinner-clip)); }
.home-index-2 .he-hero-media .he-night { z-index: 3; clip-path: inset(0 0 0 var(--night-clip)); }
.home-index-2 .he-hero-media .he-scene::after { position: absolute; inset: 0; z-index: 1; content: ''; pointer-events: none; }
.home-index-2 .he-day::after { background: linear-gradient(90deg, rgba(13,13,11,.03), rgba(13,13,11,.18)); }
.home-index-2 .he-dinner::after { background: linear-gradient(90deg, rgba(13,13,11,.1), rgba(66,53,56,.18)); }
.home-index-2 .he-night::after { background: linear-gradient(90deg, rgba(66,53,56,.22), rgba(13,13,11,.04)); }
.home-index-2 .he-hero-media .he-scene > img { width: 100%; height: 100%; object-fit: cover; transition: transform 80ms linear; }
.home-index-2 .he-day > img { transform: scale(var(--day-scale)); transform-origin: center; }
.home-index-2 .he-dinner > img { object-position: center 58%; transform: scale(var(--dinner-scale)); transform-origin: center; }
.home-index-2 .he-night > img { filter: brightness(.78) contrast(1.06); transform: scale(var(--night-scale)); transform-origin: center; }
.home-index-2 .he-hero-media figcaption { display: none; }

.home-index-2 .he-time-story { position: absolute; right: clamp(28px, 3.5vw, 68px); bottom: clamp(34px, 5vh, 68px); left: clamp(190px, 17vw, 330px); z-index: 9; min-width: 310px; color: #fff; pointer-events: none; }
.home-index-2 .he-time-rule { position: relative; height: 1px; margin-bottom: 18px; overflow: hidden; background: rgba(220,211,178,.3); }
.home-index-2 .he-time-rule i { position: absolute; inset: 0; background: var(--home-sand); transform: scaleX(var(--time-progress)); transform-origin: left center; }
.home-index-2 .he-time-window { position: relative; height: clamp(108px, 10vw, 152px); overflow: hidden; }
.home-index-2 .he-time-state { --state-opacity: 0; --state-y: 28px; position: absolute; inset: 0 auto auto 0; display: grid; align-items: end; grid-template-columns: auto 1fr; gap: 10px 22px; opacity: var(--state-opacity); transform: translateY(var(--state-y)); will-change: opacity, transform; }
.home-index-2 .he-time-state strong { color: var(--home-sand); font-family: var(--home-display); font-size: clamp(68px, 7vw, 118px); font-variant-numeric: lining-nums tabular-nums; font-weight: 700; letter-spacing: -.055em; line-height: .82; text-shadow: 0 8px 26px rgba(13,13,11,.42); white-space: nowrap; }
.home-index-2 .he-time-state span { padding-bottom: .38em; color: #fff; font-size: clamp(12px, 1vw, 16px); font-weight: 600; letter-spacing: .18em; line-height: 1.2; text-shadow: 0 3px 12px rgba(13,13,11,.65); text-transform: uppercase; white-space: nowrap; }
.home-index-2 .he-time-phases { display: grid; margin-top: 14px; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.home-index-2 .he-time-phases i { height: 3px; background: rgba(255,255,255,.24); transition: background-color 180ms ease; }
.home-index-2 .he-time-phases i.is-active { background: var(--home-sand); }

.home-index-2 .he-hero-media .he-foxy { position: absolute; bottom: 0; left: 0; z-index: 5; width: auto; height: 82%; max-width: none; max-height: none; object-fit: contain; object-position: left bottom; filter: brightness(var(--foxy-light)); transform: translateX(-50%); pointer-events: none; will-change: filter; }
/* Ritagli complementari: i PNG trasparenti non devono mostrare gli abiti precedenti. */
.home-index-2 .he-hero-media .he-foxy-day { z-index: 5; clip-path: inset(0 calc(100% - var(--dinner-clip)) 0 0); }
.home-index-2 .he-hero-media .he-foxy-dinner { z-index: 6; clip-path: inset(0 calc(100% - var(--night-clip)) 0 var(--dinner-clip)); }
.home-index-2 .he-hero-media .he-foxy-night { z-index: 7; clip-path: inset(0 0 0 var(--night-clip)); }
.home-index-2 .he-scene-wipe { position: absolute; top: 0; bottom: 0; left: var(--wipe-x); z-index: 8; width: 1px; background: var(--home-sand); box-shadow: none; opacity: var(--wipe-opacity); pointer-events: none; }

.home-index-2 .he-hero-strip { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(4, 1fr); color: #fff; background: #10100e; }
.home-index-2 .he-hero-strip span { padding: 20px clamp(20px, 3vw, 46px); border-right: 1px solid rgba(255,255,255,.14); color: #aaa99f; font-size: 12px; letter-spacing: .09em; text-transform: uppercase; }
.home-index-2 .he-hero-strip span:last-child { border-right: 0; }
.home-index-2 .he-hero-strip strong { margin-right: 8px; color: var(--home-sand); font-family: var(--home-display); font-size: 19px; text-transform: none; }

/* Mantiene il layout split anche su tablet; l'overlay scatta solo su vero mobile. */
@media (min-width: 761px) and (max-width: 1000px) {
  .home-index-2 .he-hero-stage { grid-template-columns: 46% 54%; color: var(--home-ink); background: var(--home-paper); }
  .home-index-2 .he-hero-copy { padding: 54px clamp(28px, 4vw, 48px); color: var(--home-ink); background: var(--home-paper); }
  .home-index-2 .he-hero-copy .home-issue { display: flex; margin-bottom: 54px; }
  .home-index-2 .he-hero-copy .home-kicker { color: var(--home-sage); }
  .home-index-2 .he-hero-copy h1 { color: var(--home-ink); font-size: clamp(46px, 5.4vw, 64px); text-shadow: none; }
  .home-index-2 .he-hero-copy h1 em { color: var(--home-sage); }
  .home-index-2 .he-hero-copy .home-lede { display: block; color: var(--home-ink); font-size: clamp(18px, 2vw, 22px); }
  .home-index-2 .he-time-story { right: clamp(24px, 3vw, 44px); bottom: clamp(28px, 4vh, 54px); left: clamp(150px, 17vw, 230px); }
}

/* Portatili: lascia spazio a header e sottomenu nella prima schermata.
   Sotto l'altezza necessaria al testo, la hero continua a crescere nel flusso. */
@media (min-width: 1001px) and (max-width: 1500px) and (max-height: 900px) {
  .home-index-2 .he-hero-stage {
    min-height: calc(100svh - var(--fox-header-height) - 64px);
  }
  .home-index-2 .he-hero-copy {
    padding: 32px clamp(40px, 4.5vw, 64px);
  }
  .home-index-2 .he-hero-copy h1 {
    font-size: clamp(54px, 5.1vw, 76px);
    margin-bottom: 20px;
  }
  .home-index-2 .he-hero-copy .home-kicker {
    margin-bottom: 18px;
  }
  .home-index-2 .he-hero-copy .home-lede {
    font-size: 20px;
  }
  .home-index-2 .he-hero-copy .home-actions {
    margin-top: 24px;
  }
}

@media (max-width: 760px) {
  .home-index-2 { overflow-x: clip; }
  .home-index-2 .he-hero-animation { background: #10100e; }
  .home-index-2 .he-hero-stage { height: auto; min-height: max(620px, calc(100svh - var(--fox-header-mobile-height) - 48px)); grid-template-areas: 'mobile-stage' 'mobile-strip'; grid-template-columns: 1fr; grid-template-rows: minmax(min-content, 1fr) auto; color: #fff; background: #10100e; }
  .home-index-2 .he-hero-copy,
  .home-index-2 .he-hero-media { grid-area: mobile-stage; }
  .home-index-2 .he-hero-copy { position: relative; z-index: 10; padding: clamp(180px, 31vh, 270px) clamp(24px, 6vw, 54px) clamp(28px, 5vh, 48px); justify-content: end; color: #fff; background: linear-gradient(180deg, rgba(13,13,11,.04) 22%, rgba(13,13,11,.18) 43%, rgba(13,13,11,.92) 79%, #0d0d0b 100%); pointer-events: none; }
  .home-index-2 .he-hero-copy .home-issue { display: none; }
  .home-index-2 .he-hero-copy .home-kicker { margin-bottom: 14px; color: var(--home-sand); }
  .home-index-2 .he-hero-copy h1 { max-width: 760px; margin-bottom: 18px; color: #fff; font-size: clamp(48px, 7.5vw, 70px); text-shadow: 0 5px 24px rgba(0,0,0,.54); }
  .home-index-2 .he-hero-copy h1 em { color: var(--home-sand); }
  .home-index-2 .he-hero-copy .home-lede { max-width: 620px; margin-bottom: 0; color: rgba(255,255,255,.82); font-size: 18px; }
  .home-index-2 .he-hero-copy .home-actions { margin-top: 22px; pointer-events: auto; }
  .home-index-2 .he-hero-media { min-height: 0; }
  .home-index-2 .he-hero-media .he-scene > img { object-position: center 42%; }
  .home-index-2 .he-hero-media .he-dinner,
  .home-index-2 .he-hero-media .he-night { clip-path: inset(var(--dinner-clip) 0 0 0); }
  .home-index-2 .he-hero-media .he-night { clip-path: inset(var(--night-clip) 0 0 0); }
  .home-index-2 .he-time-story { top: clamp(20px, 4vh, 38px); right: clamp(20px, 5vw, 44px); bottom: auto; left: clamp(20px, 5vw, 44px); min-width: 0; }
  .home-index-2 .he-time-rule { margin-bottom: 10px; }
  .home-index-2 .he-time-window { height: clamp(58px, 9vw, 78px); }
  .home-index-2 .he-time-state { gap: 8px 14px; }
  .home-index-2 .he-time-state strong { font-size: clamp(46px, 8vw, 66px); line-height: .86; }
  .home-index-2 .he-time-state span { padding-bottom: .25em; font-size: 10px; }
  .home-index-2 .he-time-phases { margin-top: 8px; gap: 5px; }
  .home-index-2 .he-hero-media .he-foxy { top: 14%; right: -3%; bottom: auto; left: auto; width: clamp(230px, 43vw, 390px); height: auto; max-height: 55%; transform: none; }
  .home-index-2 .he-hero-media .he-foxy-day { clip-path: inset(0 0 calc(100% - var(--dinner-clip)) 0); }
  .home-index-2 .he-hero-media .he-foxy-dinner { clip-path: inset(var(--dinner-clip) 0 calc(100% - var(--night-clip)) 0); }
  .home-index-2 .he-hero-media .he-foxy-night { clip-path: inset(var(--night-clip) 0 0 0); }
  .home-index-2 .he-scene-wipe { top: var(--wipe-x); right: 0; bottom: auto; left: 0; width: 100%; height: 1px; }
  .home-index-2 .he-hero-strip { position: relative; z-index: 12; grid-area: mobile-strip; }
}

@media (max-width: 680px) {
  .home-index-2 .he-hero-stage { min-height: max(600px, calc(100svh - var(--fox-header-mobile-height) - 48px)); }
  .home-index-2 .he-hero-copy { padding: 180px 20px 24px; }
  .home-index-2 .he-hero-copy h1 { font-size: clamp(39px, 11.2vw, 52px); line-height: .91; }
  .home-index-2 .he-hero-copy .home-lede { display: none; }
  .home-index-2 .he-hero-copy .home-actions { margin-top: 18px; }
  .home-index-2 .he-hero-copy .home-btn { width: auto; min-height: 46px; padding: 10px 16px; font-size: 11px; }
  .home-index-2 .he-time-story { top: 18px; right: 20px; left: 20px; }
  .home-index-2 .he-time-window { height: 54px; }
  .home-index-2 .he-time-state strong { font-size: 45px; }
  .home-index-2 .he-time-state span { font-size: 9px; }
  .home-index-2 .he-hero-media .he-foxy {
    top: clamp(210px, 37%, 290px);
    right: clamp(-68px, -16vw, -48px);
    width: clamp(288px, 90vw, 332px);
    height: auto;
    max-height: none;
  }
  .home-index-2 .he-hero-strip span { padding: 10px 12px; font-size: 9px; }
  .home-index-2 .he-hero-strip strong { display: inline; font-size: 15px; }
}

/* Prova 2: sfuma solo una fascia del 2% attorno al bordo della tendina.
   I ritagli sopra restano come fallback per browser senza maschere CSS. */
@supports (mask-image: linear-gradient(to right, #000, transparent)) {
  .home-index-2 .he-hero-media { --foxy-mask-direction: to right; --dinner-edge: 101%; --night-edge: 101%; }
  .home-index-2 .he-hero-media .he-foxy { clip-path: none; }
  .home-index-2 .he-hero-media .he-foxy-day {
    mask-image: linear-gradient(var(--foxy-mask-direction), #000 calc(var(--dinner-edge) - 1%), transparent calc(var(--dinner-edge) + 1%));
  }
  .home-index-2 .he-hero-media .he-foxy-dinner {
    mask-image: linear-gradient(var(--foxy-mask-direction), transparent calc(var(--dinner-edge) - 1%), #000 calc(var(--dinner-edge) + 1%), #000 calc(var(--night-edge) - 1%), transparent calc(var(--night-edge) + 1%));
  }
  .home-index-2 .he-hero-media .he-foxy-night {
    mask-image: linear-gradient(var(--foxy-mask-direction), transparent calc(var(--night-edge) - 1%), #000 calc(var(--night-edge) + 1%));
  }
  @media (max-width: 760px) {
    .home-index-2 .he-hero-media { --foxy-mask-direction: to bottom; }
  }
}

/* Ritorno tardeo → pranzo: dissolvenza coordinata di 300 ms, senza cloni. */
.home-index-2 .he-hero-media.is-returning .he-foxy { clip-path: none; mask-image: none; }
.home-index-2 .he-hero-media.is-returning .he-foxy-day { opacity: var(--return-fade); }
.home-index-2 .he-hero-media.is-returning .he-foxy-night { opacity: calc(1 - var(--return-fade)); }
.home-index-2 .he-hero-media.is-returning .he-foxy-dinner,
.home-index-2 .he-hero-media.is-returning .he-dinner { opacity: 0; }
.home-index-2 .he-hero-media.is-returning .he-night { clip-path: none; opacity: calc(1 - var(--return-fade)); }

@media (prefers-reduced-motion: reduce) {
  .home-index-2 .he-hero-media .he-day,
  .home-index-2 .he-hero-media .he-dinner,
  .home-index-2 .he-hero-media .he-foxy-day,
  .home-index-2 .he-hero-media .he-foxy-dinner { display: none; }
  .home-index-2 .he-hero-media .he-night,
  .home-index-2 .he-hero-media .he-foxy-night { clip-path: none !important; mask-image: none !important; }
  .home-index-2 .he-hero-media .he-scene > img { transition: none; }
  .home-index-2 .he-time-state { display: none; }
  .home-index-2 .he-time-state[data-time-state="night"] { display: grid; opacity: 1; transform: none; }
  .home-index-2 .he-time-rule i { transform: scaleX(1); }
  .home-index-2 .he-time-phases i { background: var(--home-sand); }
}

/* Orologio split-flap della hero: flip secco, carta nel verde istituzionale.
   Attivo solo dove c'è .he-time-window-flip; index_2/2B/2C restano sulle regole
   .he-time-state qui sopra. */
.home-index-2 .he-time-window-flip { display: flex; height: auto; align-items: flex-end; flex-wrap: wrap; gap: clamp(14px, 1.6vw, 26px); overflow: visible; }
.home-index-2 .he-flipclock { --cell-h: clamp(74px, 7.4vw, 112px); --cell-w: clamp(46px, 4.6vw, 70px); --digit-size: .66; --digit-nudge: -.072em; --flip-dur: 420ms; --home-flip: 'Oswald', 'Helvetica Neue', Arial, sans-serif; display: flex; align-items: stretch; gap: 6px; color: var(--home-sand); font-family: var(--home-flip); font-size: calc(var(--cell-h) * var(--digit-size)); filter: drop-shadow(0 14px 30px rgba(13,13,11,.42)); }
.home-index-2 .he-fc-sep { align-self: center; padding: 0 2px .06em; font-size: calc(var(--cell-h) * .5); font-weight: 500; line-height: 1; }
.home-index-2 .he-fc { position: relative; width: var(--cell-w); height: var(--cell-h); perspective: 420px; }
.home-index-2 .he-fc-half { position: absolute; left: 0; width: 100%; height: 50%; overflow: hidden; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(220,211,178,.14); backface-visibility: hidden; }
.home-index-2 .he-fc-half b { display: block; width: 100%; height: var(--cell-h); color: var(--home-sand); font-family: var(--home-flip); font-size: calc(var(--cell-h) * var(--digit-size)); font-variant-numeric: lining-nums tabular-nums; font-weight: 500; letter-spacing: .01em; line-height: var(--cell-h); text-align: center; transform: translateY(var(--digit-nudge)); }
.home-index-2 .he-fc-top { top: 0; border-bottom-right-radius: 0; border-bottom-left-radius: 0; background: linear-gradient(#4d6349, #3e5240); }
.home-index-2 .he-fc-bottom { bottom: 0; border-top-left-radius: 0; border-top-right-radius: 0; background: linear-gradient(#38493a, #455c43); }
.home-index-2 .he-fc-bottom b { margin-top: calc(var(--cell-h) / -2); }
.home-index-2 .he-fc::after { position: absolute; top: calc(50% - 1px); left: 0; z-index: 4; width: 100%; height: 2px; background: #1d2a1c; box-shadow: 0 1px 0 rgba(220,211,178,.14); content: ''; pointer-events: none; }
.home-index-2 .he-fc-fold { z-index: 3; }
.home-index-2 .he-fc-fold.he-fc-top { transform-origin: 50% 100%; }
.home-index-2 .he-fc-fold.he-fc-bottom { transform-origin: 50% 0; }
.home-index-2 .he-fc:not(.is-flipping) .he-fc-fold { opacity: 0; }
.home-index-2 .he-fc-fold.he-fc-top::after { position: absolute; inset: 0; background: linear-gradient(rgba(16,24,15,0), rgba(16,24,15,.5)); content: ''; }
.home-index-2 .he-fc-fold.he-fc-bottom::after { position: absolute; inset: 0; background: linear-gradient(rgba(16,24,15,.45), rgba(16,24,15,0)); content: ''; }
.home-index-2 .he-fc.is-flipping .he-fc-fold.he-fc-top { animation: heFoldTop var(--flip-dur) cubic-bezier(.42,.02,.58,.62) forwards; }
.home-index-2 .he-fc.is-flipping .he-fc-fold.he-fc-bottom { animation: heFoldBottom var(--flip-dur) cubic-bezier(.36,.66,.28,1.06) forwards; }
@keyframes heFoldTop { 0% { transform: rotateX(0); } 50%, 100% { transform: rotateX(-90deg); } }
@keyframes heFoldBottom { 0%, 50% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }
.home-index-2 .he-time-label { margin: 0; padding-bottom: .5em; color: #fff; font-size: clamp(12px, 1vw, 16px); font-weight: 600; letter-spacing: .18em; line-height: 1.2; text-shadow: 0 3px 12px rgba(13,13,11,.65); text-transform: uppercase; white-space: nowrap; transition: opacity 220ms ease; }
.home-index-2 .he-time-label.is-out { opacity: 0; }

@media (max-width: 760px) {
  .home-index-2 .he-time-window-flip { gap: 12px; }
  .home-index-2 .he-flipclock { --cell-h: clamp(52px, 11vw, 70px); --cell-w: clamp(34px, 7vw, 46px); }
}
