/* Intro: il capannone renderizzato in Blender (assets/js/gate-seq.js).
   La foto d'apertura è il primo fotogramma della sequenza, stessa inquadratura. */
.hero { height: 640vh; }
.hero__fallback { object-position: 50% 45%; transform: none; }
.hero__out { position: absolute; inset: 0; background: #080606; opacity: 0; pointer-events: none; }
@media (max-width: 760px) { .hero { height: 520vh; } .hero__fallback { object-position: 50% 45%; } }
@media (prefers-reduced-motion: reduce) { .hero { height: 100svh; } .hero__out { display: none; } }
html:not(.js) .hero { height: 100svh; }
/* la sezione dopo l'intro parte dallo stesso nero dell'uscita: niente riga netta */
.hh { background: linear-gradient(#080606, rgba(8, 6, 6, 0) 22%), radial-gradient(ellipse at 80% 16%, #310b0c 0, transparent 62%), #080606; }

/* Locandina di Morgan: i bordi sfumano nel nero della pagina invece di tagliare netto */
.morgan-panel {
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 14%, #000 86%, transparent), linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(180deg, transparent, #000 14%, #000 86%, transparent), linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-composite: intersect;
}

/* Video di lancio dentro la locandina: Morgan fa da copertina */
.morgan-panel { cursor: pointer; }
.morgan-panel::before, .morgan-panel__portrait { transition: opacity 1.4s cubic-bezier(.4, 0, .2, 1), transform 6s cubic-bezier(.2, 0, .1, 1), filter 1.4s; }
.morgan-panel:hover .morgan-panel__portrait { transform: scale(1.015); }
.morgan-panel__video { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; object-fit: cover; background: #050303; opacity: 0; pointer-events: none; transition: opacity 1.2s ease .35s; }
.morgan-panel.is-playing { cursor: default; }
.morgan-panel.is-playing::before, .morgan-panel.is-playing .morgan-panel__portrait { opacity: 0; transform: scale(1.06); filter: blur(6px) brightness(.4); }
.morgan-panel.is-playing .morgan-panel__video { opacity: 1; pointer-events: auto; }

/* play horror: doppio anello graffiato che gira piano, cuore che pulsa */
.morgan-play { position: absolute; z-index: 3; left: 50%; top: 50%; width: clamp(78px, 8vw, 116px); aspect-ratio: 1; margin: 0; padding: 0; border: 0; border-radius: 50%; background: radial-gradient(circle, #0b0506d9 52%, #0b050680 70%, transparent 72%); color: #f3e6d6; cursor: pointer; transform: translate(-50%, -50%); transition: transform .35s cubic-bezier(.3, 1.4, .5, 1), opacity .5s; -webkit-tap-highlight-color: transparent; }
.morgan-play::before { content: ""; position: absolute; inset: 14%; border-radius: 50%; box-shadow: 0 0 0 1px #ff243366, 0 0 26px 4px #ff243355, inset 0 0 18px #ff243344; animation: morgan-beat 1.6s ease-in-out infinite; }
.morgan-play__ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; animation: morgan-spin 18s linear infinite; }
.morgan-play__ring circle { fill: none; stroke: #ff2433; stroke-linecap: round; }
.morgan-play__ring circle:first-child { stroke-width: 1.6; stroke-dasharray: 22 3 9 2 31 4 6 2 14 7; opacity: .95; }
.morgan-play__ring circle:last-child { stroke: #f3e6d6; stroke-width: .8; stroke-dasharray: 2 5 1 9 3 4; opacity: .45; animation: morgan-spin 9s linear infinite reverse; transform-origin: 60px 60px; }
.morgan-play__tri { position: absolute; left: 50%; top: 50%; width: 30%; aspect-ratio: .87; background: currentColor; clip-path: polygon(8% 0, 100% 50%, 8% 100%, 0 92%, 0 8%); transform: translate(-38%, -50%); filter: drop-shadow(0 0 6px #ff243399); transition: background .25s; }
.morgan-play__label { position: absolute; left: 50%; top: calc(100% + 14px); white-space: nowrap; transform: translateX(-50%); font: 700 11px/1 var(--ui); letter-spacing: .24em; text-transform: uppercase; color: #f3e6d6; text-shadow: 0 1px 8px #000; }
.morgan-panel:hover .morgan-play, .morgan-play:focus-visible { transform: translate(-50%, -50%) scale(1.08); }
.morgan-panel:hover .morgan-play__tri { background: #ff2433; }
.morgan-play:active { transform: translate(-50%, -50%) scale(.96); }
.morgan-play:focus-visible { outline: 2px solid var(--red-hot); outline-offset: 6px; }
.morgan-panel.is-playing .morgan-play { opacity: 0; pointer-events: none; transform: translate(-50%, -50%) scale(1.5); }
.morgan-panel.is-playing.is-paused .morgan-play { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%); }
.morgan-panel.is-paused .morgan-play__label { display: none; }
@keyframes morgan-spin { to { transform: rotate(360deg); } }
@keyframes morgan-beat { 0%, 100% { transform: scale(1); opacity: .8; } 14% { transform: scale(1.07); opacity: 1; } 28% { transform: scale(1); } 42% { transform: scale(1.05); opacity: 1; } }

/* audio: solo l'icona */
.morgan-sound { position: absolute; z-index: 3; left: clamp(14px, 2.2vw, 30px); bottom: clamp(14px, 2.2vw, 30px); width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 1px solid #ffffff2e; border-radius: 50%; background: #0b0708a6; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: #f0e6da; cursor: pointer; opacity: 0; transition: opacity .6s .9s, background .25s, border-color .25s, transform .15s; }
.morgan-panel.is-playing .morgan-sound { opacity: 1; }
.morgan-sound:hover { background: #8e1018cc; border-color: #ff243399; }
.morgan-sound:active { transform: scale(.94); }
.morgan-sound:focus-visible { outline: 2px solid var(--red-hot); outline-offset: 3px; }
.morgan-sound__ico { position: relative; width: 18px; height: 14px; }
.morgan-sound__ico::before { content: ""; position: absolute; left: 0; top: 2px; width: 10px; height: 10px; background: currentColor; clip-path: polygon(0 30%, 35% 30%, 100% 0, 100% 100%, 35% 70%, 0 70%); }
.morgan-sound__ico::after { content: ""; position: absolute; right: 0; top: 6px; width: 8px; height: 2px; background: var(--red-hot); transform: rotate(-45deg); }
.morgan-sound[aria-pressed="true"] .morgan-sound__ico::after { right: 1px; top: 2px; width: 5px; height: 8px; border: 2px solid currentColor; border-left: 0; border-radius: 0 8px 8px 0; background: none; transform: none; }
@media (max-width: 1100px) {
  .morgan-panel { -webkit-mask-image: linear-gradient(180deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(180deg, transparent, #000 10%, #000 90%, transparent); }
  .morgan-panel__video { object-fit: contain; }
  .morgan-play__label { font-size: 10px; }
  .morgan-sound { width: 38px; height: 38px; }
}
@media (prefers-reduced-motion: reduce) { .morgan-play__ring, .morgan-play__ring circle, .morgan-play::before { animation: none; } }

/* social nel footer: niente quadrati, icone sottili in un cerchio appena accennato */
.foot__social { gap: 10px; }
.foot__social a { width: 46px; height: 46px; border: 1px solid #ffffff1f; border-radius: 50%; background: transparent; box-shadow: none; color: #cfc3b6; transition: color .25s, border-color .25s, background .25s, transform .2s; }
.foot__social svg { width: 19px; height: 19px; }
.foot__social a:hover { color: #fff; border-color: #ff243399; background: #ff24331a; transform: translateY(-2px); }
.foot__social a:focus-visible { outline: 2px solid var(--red-hot); outline-offset: 3px; }
@media (max-width: 1100px) { .foot__social a { width: 46px; height: 46px; } }

/* orologio: gli ingranaggi girano tra il fondo e il davanti (renderizzati a strati in Blender) */
.ck__back { filter: none !important; }
.ck__gear { position: absolute; display: block; filter: brightness(1.35); height: auto; aspect-ratio: 1; max-width: none; animation: ck-gear var(--spin, 20s) linear infinite; animation-play-state: paused; will-change: transform; }
.ck__gear--rev { animation-direction: reverse; }
.ck.is-turning .ck__gear { animation-play-state: running; }
@keyframes ck-gear { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ck__gear { animation: none; } }
/* sfere armillari: fotogrammi renderizzati in fila, sfumati uno nell'altro (assets/js/ingranaggi.js) */
.ck__orb { position: absolute; display: block; aspect-ratio: 1; pointer-events: none; }
/* schermo intero, a destra in basso, gemello del tasto audio */
.morgan-full { position: absolute; z-index: 3; right: clamp(14px, 2.2vw, 30px); bottom: clamp(14px, 2.2vw, 30px); width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 1px solid #ffffff2e; border-radius: 50%; background: #0b0708a6; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: #f0e6da; cursor: pointer; opacity: 0; transition: opacity .6s .9s, background .25s, border-color .25s, transform .15s; }
.morgan-panel.is-playing .morgan-full { opacity: 1; }
.morgan-full:hover { background: #8e1018cc; border-color: #ff243399; }
.morgan-full:active { transform: scale(.94); }
.morgan-full:focus-visible { outline: 2px solid var(--red-hot); outline-offset: 3px; }
.morgan-full svg { transition: transform .25s; }
.morgan-full:hover svg { transform: scale(1.12); }
@media (max-width: 1100px) { .morgan-full { width: 38px; height: 38px; } }
/* cielo vivo sopra la foto d'apertura (assets/js/cielo.js) */
.hero__sky { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; transition: opacity .3s; }
/* i tasti del video stanno dentro la parte piena, fuori dalla sfumatura dei bordi */
.morgan-sound { left: 8%; bottom: 15%; }
.morgan-full { right: 8%; bottom: 15%; }
@media (max-width: 1100px) { .morgan-sound { left: 14px; bottom: 12%; } .morgan-full { right: 14px; bottom: 12%; } }
/* a schermo intero il video si vede tutto nel suo formato (2,35:1), con le bande nere */
.morgan-panel__video:fullscreen { object-fit: contain; background: #000; }
.morgan-panel__video:-webkit-full-screen { object-fit: contain; background: #000; }
/* "Varca la soglia": sottile e spaziata, non un cartello; una linea rossa invita a scendere */
.hero__enter { bottom: 14vh; font-size: clamp(26px, 3.1vw, 54px); line-height: 1; letter-spacing: .32em; text-indent: .32em; color: #efe3d3; text-shadow: 0 0 18px rgba(255, 36, 51, .55), 0 2px 10px rgba(0, 0, 0, .9); }
.hero__enter span { display: inline-block; position: relative; padding-bottom: .55em; }
.hero__enter span::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 1px; height: 0; background: linear-gradient(#ff2433, transparent); transform: translate(calc(-50% - .16em), 100%); animation: enter-drip 2.4s cubic-bezier(.6, 0, .3, 1) infinite; }
@keyframes enter-drip { 0% { height: 0; opacity: 1; } 60% { height: 1.6em; opacity: 1; } 100% { height: 1.6em; opacity: 0; } }
@media (max-width: 760px) { .hero__enter { font-size: clamp(22px, 6.4vw, 30px); letter-spacing: .26em; text-indent: .26em; bottom: 16vh; } }
@media (prefers-reduced-motion: reduce) { .hero__enter span::after { animation: none; height: 1.2em; } }
/* senza il titolo doppio, Morgan arriva subito dopo le card con un po' di respiro */
.morgan-panel { margin-top: 0; }

/* caricamento: il sangue sale dentro il simbolo. Il bordo è un'onda che scorre,
   sul pelo del liquido una linea incandescente, qualche brace sale, e il simbolo
   batte come un cuore sempre più forte (--p arriva da main.js, da 0 a 1) */
.loader__mark { width: 136px; height: 136px; }
.loader__empty { filter: grayscale(1) brightness(.22) contrast(1.2); opacity: .7; }
.loader__full {
  clip-path: none;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 400' preserveAspectRatio='none'%3E%3Cpath d='M0 200 C30 176 70 176 100 200 S170 224 200 200 V400 H0Z' fill='%23fff'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 400' preserveAspectRatio='none'%3E%3Cpath d='M0 200 C30 176 70 176 100 200 S170 224 200 200 V400 H0Z' fill='%23fff'/%3E%3C/svg%3E");
  -webkit-mask-size: 55% 200%; mask-size: 55% 200%;
  -webkit-mask-repeat: repeat-x; mask-repeat: repeat-x;
  -webkit-mask-position-y: calc(var(--p) * 108% - 4%); mask-position-y: calc(var(--p) * 108% - 4%);
  animation: loader-wave 1.6s linear infinite, loader-beat 1.15s ease-in-out infinite;
  filter: saturate(1.15) brightness(calc(.85 + var(--p) * .35));
}
@keyframes loader-wave { from { -webkit-mask-position-x: 0; mask-position-x: 0; } to { -webkit-mask-position-x: 55%; mask-position-x: 55%; } }
@keyframes loader-beat { 0%, 100% { transform: scale(1); } 12% { transform: scale(calc(1 + var(--p) * .035)); } 24% { transform: scale(1); } 36% { transform: scale(calc(1 + var(--p) * .025)); } }
/* il pelo del liquido: la stessa onda, come linea incandescente, solo dentro il simbolo */
.loader__line {
  position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(closest-side, #ffd2b8, #ff5030 70%, transparent);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 400' preserveAspectRatio='none'%3E%3Cpath d='M0 200 C30 176 70 176 100 200 S170 224 200 200' fill='none' stroke='%23fff' stroke-width='9'/%3E%3C/svg%3E"), url(assets/img/logo-icon.webp);
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 400' preserveAspectRatio='none'%3E%3Cpath d='M0 200 C30 176 70 176 100 200 S170 224 200 200' fill='none' stroke='%23fff' stroke-width='9'/%3E%3C/svg%3E"), url(assets/img/logo-icon.webp);
  -webkit-mask-size: 55% 200%, contain; mask-size: 55% 200%, contain;
  -webkit-mask-repeat: repeat-x, no-repeat; mask-repeat: repeat-x, no-repeat;
  -webkit-mask-position: 0 calc(var(--p) * 108% - 4%), center; mask-position: 0 calc(var(--p) * 108% - 4%), center;
  -webkit-mask-composite: source-in; mask-composite: intersect;
  opacity: calc((1 - var(--p) * var(--p)) * .9);
  filter: blur(.6px) drop-shadow(0 0 4px #ff3a20);
  animation: loader-wave2 1.6s linear infinite;
}
@keyframes loader-wave2 { from { -webkit-mask-position: 0 calc(var(--p) * 108% - 4%), center; mask-position: 0 calc(var(--p) * 108% - 4%), center; } to { -webkit-mask-position: 55% calc(var(--p) * 108% - 4%), center; mask-position: 55% calc(var(--p) * 108% - 4%), center; } }
/* braci che salgono dal simbolo */
.loader__embers { position: absolute; inset: -30% -20%; pointer-events: none; }
.loader__embers i { position: absolute; bottom: 30%; width: 3px; height: 3px; border-radius: 50%; background: #ff5a3c; box-shadow: 0 0 6px 2px rgba(255, 60, 30, .7); opacity: 0; animation: loader-ember 2.6s ease-out infinite; }
.loader__embers i:nth-child(1) { left: 34%; animation-delay: .1s; }
.loader__embers i:nth-child(2) { left: 52%; animation-delay: .9s; animation-duration: 3.1s; }
.loader__embers i:nth-child(3) { left: 63%; animation-delay: 1.6s; }
.loader__embers i:nth-child(4) { left: 44%; animation-delay: 2.1s; animation-duration: 2.2s; }
.loader__embers i:nth-child(5) { left: 58%; animation-delay: .5s; animation-duration: 3.4s; width: 2px; height: 2px; }
.loader__embers i:nth-child(6) { left: 39%; animation-delay: 1.3s; animation-duration: 2.8s; width: 2px; height: 2px; }
@keyframes loader-ember { 0% { opacity: 0; transform: translate(0, 0) scale(1); } 15% { opacity: calc(.3 + var(--p) * .7); } 100% { opacity: 0; transform: translate(14px, -120px) scale(.3); } }
@media (prefers-reduced-motion: reduce) { .loader__full, .loader__line, .loader__embers i { animation: none; } }
/* su schermi larghi le locandine si allargano (circa +25%); titolo e Morgan seguono la stessa larghezza */
@media (min-width: 1200px) {
  .hh__head, .hh__carousel { max-width: 1780px; padding-inline: clamp(24px, 2.4vw, 56px); }
  .hh__track { gap: clamp(14px, 1.3vw, 26px); }
  .morgan-panel { width: calc(min(100%, 1780px) - 2 * clamp(24px, 2.4vw, 56px)); }
}
