/*!
 * yumetech-custom.css
 * Stili che Elementor non gestisce nativamente (animazioni continue, vetro sfocato,
 * pseudo-elementi, prefers-reduced-motion). Va caricato DOPO gli stili di Elementor.
 * Tutte le classi usano il prefisso ymt- e sono assegnate nella pagina Elementor
 * tramite le Global Classes omonime (vedi child-theme/README.md).
 *
 * Gli stati iniziali "nascosti" valgono solo con html.ymt-js (aggiunta dal file JS):
 * se il JS non parte la pagina resta completamente visibile.
 */

:root { --ymt-ease: cubic-bezier(.22, .8, .24, 1); }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body { overflow-x: hidden; }

/* ---------------------------------------------------------------
   1. HEADER con vetro sfocato (classe .ymt-header; .is-scrolled la aggiunge il JS)
   --------------------------------------------------------------- */
.ymt-header { transition: background-color .3s, backdrop-filter .3s, border-color .3s; }
.ymt-header.is-scrolled {
  background-color: rgba(11, 7, 32, .72) !important;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom-color: rgba(255, 255, 255, .09) !important;
}

/* ---------------------------------------------------------------
   2. SFONDO HERO: gradienti animati (.ymt-mesh contiene .ymt-mesh-1/2/3)
   --------------------------------------------------------------- */
.ymt-mesh { filter: blur(70px); opacity: .9; }
.ymt-mesh-1, .ymt-mesh-2, .ymt-mesh-3 { will-change: transform; }
.ymt-mesh-1 { animation: ymt-drift1 22s ease-in-out infinite alternate; }
.ymt-mesh-2 { animation: ymt-drift2 26s ease-in-out infinite alternate; }
.ymt-mesh-3 { animation: ymt-drift3 30s ease-in-out infinite alternate; }
@keyframes ymt-drift1 { to { transform: translate(12vw, 8vh) scale(1.15); } }
@keyframes ymt-drift2 { to { transform: translate(-10vw, 10vh) scale(.9); } }
@keyframes ymt-drift3 { to { transform: translate(-8vw, -8vh) scale(1.2); } }

/* ---------------------------------------------------------------
   3. TITOLO HERO parola per parola (.ymt-hero-title; il JS crea .ymt-word)
   --------------------------------------------------------------- */
.ymt-word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; }
.ymt-word > span { display: inline-block; }
html.ymt-js .ymt-word > span {
  transform: translateY(110%);
  animation: ymt-wordIn .9s var(--ymt-ease) forwards;
  animation-delay: calc(var(--i) * 70ms + 150ms);
}
@keyframes ymt-wordIn { to { transform: none; } }
.ymt-word--grad { color: var(--ymt-teal, #3DD6C3); }

/* Parole accentate nei titoli h2 (fallback se lo span inline perde il colore) */
.ymt-h2 span, .ymt-accent { color: var(--ymt-teal, #3DD6C3); }

/* ---------------------------------------------------------------
   4. DASHBOARD DI ESEMPIO (.ymt-app, .ymt-bar, .ymt-counter, .ymt-float)
   --------------------------------------------------------------- */
.ymt-app {
  transform: perspective(1400px) rotateY(-6deg) rotateX(3deg);
  transition: transform .8s var(--ymt-ease);
}
.ymt-app:hover { transform: perspective(1400px) rotateY(0) rotateX(0); }
@media (max-width: 1024px) { .ymt-app { transform: none; } }

/* barre: l'altezza finale e' impostata in Elementor; qui si anima solo la scala */
.ymt-bar { transform-origin: bottom; transition: transform 1.2s var(--ymt-ease); transition-delay: calc(var(--i, 0) * 70ms + 600ms); }
html.ymt-js .ymt-app:not(.ymt-in) .ymt-bar { transform: scaleY(0); }

/* linea teal sopra le barre: SVG inserito dal JS dentro .ymt-bars */
.ymt-bars { position: relative; }
.ymt-line { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.ymt-line path {
  fill: none; stroke: var(--ymt-teal, #3DD6C3); stroke-width: 2.5; stroke-linecap: round;
  stroke-dasharray: 600; stroke-dashoffset: 600;
  transition: stroke-dashoffset 2s var(--ymt-ease) .9s;
}
.ymt-app.ymt-in .ymt-line path { stroke-dashoffset: 0; }

/* etichette fluttuanti */
.ymt-float { animation: ymt-bob 6s ease-in-out infinite; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.ymt-float:nth-of-type(2) { animation-delay: -3s; }
@keyframes ymt-bob { 50% { transform: translateY(-8px); } }

/* ---------------------------------------------------------------
   5. CHI SIAMO: frase che si accende con lo scroll (.ymt-statement)
   --------------------------------------------------------------- */
.ymt-statement .ymt-sw { opacity: .16; transition: opacity .3s; }
.ymt-statement .ymt-sw.on { opacity: 1; }

/* ---------------------------------------------------------------
   6. ALONE CHE SEGUE IL MOUSE (.ymt-glow-card; il JS imposta --mx / --my)
   --------------------------------------------------------------- */
.ymt-glow-card:hover {
  background-image:
    radial-gradient(340px circle at var(--mx, 50%) var(--my, 0%), rgba(114, 89, 239, .28), transparent 65%),
    linear-gradient(180deg, #1A1440, #15103A) !important;
}

/* mini barre della card Dynamics (classe .ymt-minibar) */
.ymt-minibar { transform-origin: bottom; animation: ymt-pulseH 3.2s ease-in-out infinite; animation-delay: calc(var(--i, 0) * .25s); }
@keyframes ymt-pulseH { 50% { transform: scaleY(.55); } }

/* cursore lampeggiante nel blocco di codice (.ymt-cursor) */
.ymt-cursor::after { content: ""; display: inline-block; width: 8px; height: 15px; margin-left: 2px; background: var(--ymt-teal, #3DD6C3); vertical-align: -2px; animation: ymt-blink 1s steps(2) infinite; }
@keyframes ymt-blink { 50% { opacity: 0; } }

/* ---------------------------------------------------------------
   7. SCHEMA SVG con impulsi (.ymt-flow; il JS inserisce .ymt-flow-svg)
   --------------------------------------------------------------- */
.ymt-flow { position: relative; }
.ymt-flow-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; overflow: visible; }
.ymt-flow-svg .pipe { fill: none; stroke: rgba(255, 255, 255, .14); stroke-width: 2; }
.ymt-flow-svg .pulse { fill: var(--ymt-teal, #3DD6C3); }
.ymt-flow .ymt-node { position: relative; z-index: 1; }

/* ---------------------------------------------------------------
   8. PREFERS-REDUCED-MOTION: niente animazioni, tutto visibile
   --------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  html.ymt-js .ymt-word > span { transform: none !important; }
  html.ymt-js .ymt-app:not(.ymt-in) .ymt-bar { transform: none !important; }
  .ymt-line path { stroke-dashoffset: 0 !important; }
  .ymt-statement .ymt-sw { opacity: 1 !important; }
  .ymt-flow-svg .pulse { display: none; }
}
