/* ==========================================================================
   NAVIDAD 2026 · capa temporal (diciembre → 6 de enero)
   Todo lo navideño vive solo en este archivo; la web normal no se ha tocado.
   Para quitarla: node scripts/navidad.mjs off  (quita el <link> de todas las páginas).
   Para volver a ponerla el año que viene: node scripts/navidad.mjs on
   ========================================================================== */

/* Gorro de Papá Noel sobre el isotipo (nav, pie y toda la web; Consultoría no). */
html:not([data-area="consultoria"]) .tt-brand:not(.tt-brand--cons) { position: relative; }
html:not([data-area="consultoria"]) .tt-brand:not(.tt-brand--cons)::before {
  content: ""; position: absolute; z-index: 1; pointer-events: none;
  /* el isotipo mide 0,887·h de ancho; el gorro se centra en su vértice superior */
  left: calc(var(--h) * .06); top: calc(var(--h) * -.33);
  width: calc(var(--h) * .74); height: calc(var(--h) * .65);
  transform: rotate(-9deg); transform-origin: 45% 85%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 88'%3E%3Cdefs%3E%3ClinearGradient id='r' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23EF4444'/%3E%3Cstop offset='1' stop-color='%23B91C2C'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M16 68C19 40 40 13 63 13C79 13 89 25 92 43L83 46C79 36 74 32 68 34C71 47 77 58 84 68Z' fill='url(%23r)'/%3E%3Cpath d='M63 13C70 13 76 16 81 21C73 20 64 25 60 35C57 28 58 19 63 13Z' fill='%23fff' fill-opacity='.18'/%3E%3Crect x='8' y='61' width='84' height='19' rx='9.5' fill='%23fff' stroke='%23D9DEE8' stroke-width='2'/%3E%3Ccircle cx='89' cy='49' r='9' fill='%23fff' stroke='%23D9DEE8' stroke-width='2'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Intro de Inicio: el gorro cae sobre el logo justo cuando termina de montarse. */
.tt-build .tt-brand::before {
  animation: tt-xmas-hat .4s cubic-bezier(.3, .7, .35, 1.25) 2.2s both;
}
@keyframes tt-xmas-hat {
  from { opacity: 0; translate: 0 -2.4em; }
  60% { opacity: 1; }
  to { opacity: 1; translate: 0 0; }
}

/* Intro de Inicio: copos de nieve con los colores de la marca (el isotipo ya parece un copo). */
.tt-build__bg::after {
  content: ""; position: absolute; inset: -620px 0 0; pointer-events: none;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='170' height='170'%3E%3Cg stroke='%232F8FDB' stroke-opacity='0.45' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M25.0 40.0L35.0 40.0'/%3E%3Cpath d='M27.5 35.7L32.5 44.3'/%3E%3Cpath d='M32.5 35.7L27.5 44.3'/%3E%3C/g%3E%3Cg stroke='%2308BCD6' stroke-opacity='0.45' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M116.0 110.0L124.0 110.0'/%3E%3Cpath d='M118.0 106.5L122.0 113.5'/%3E%3Cpath d='M122.0 106.5L118.0 113.5'/%3E%3C/g%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='230' height='230'%3E%3Cg stroke='%236A4FD8' stroke-opacity='0.3' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M73.0 30.0L87.0 30.0'/%3E%3Cpath d='M76.5 23.9L83.5 36.1'/%3E%3Cpath d='M83.5 23.9L76.5 36.1'/%3E%3C/g%3E%3Cg stroke='%232F8FDB' stroke-opacity='0.35' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M184.5 160.0L195.5 160.0'/%3E%3Cpath d='M187.2 155.2L192.8 164.8'/%3E%3Cpath d='M192.7 155.2L187.3 164.8'/%3E%3C/g%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='310' height='310'%3E%3Cg stroke='%2308BCD6' stroke-opacity='0.35' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M211.0 70.0L229.0 70.0'/%3E%3Cpath d='M215.5 62.2L224.5 77.8'/%3E%3Cpath d='M224.5 62.2L215.5 77.8'/%3E%3C/g%3E%3Cg stroke='%236A4FD8' stroke-opacity='0.25' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M54.0 230.0L66.0 230.0'/%3E%3Cpath d='M57.0 224.8L63.0 235.2'/%3E%3Cpath d='M63.0 224.8L57.0 235.2'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 170px 170px, 230px 230px, 310px 310px;
  animation: tt-xmas-snow 3.1s linear both;
}
@keyframes tt-xmas-snow {
  from { background-position: 0 0, 40px 0, 90px 0; }
  to { background-position: 30px 340px, 80px 460px, 140px 620px; }
}

/* La intro espera a que carguen imagen y letra: los pseudoelementos también esperan. */
.tt-build:not(.is-go) .tt-brand::before,
.tt-build:not(.is-go) .tt-build__bg::after { animation-play-state: paused; }

@media (prefers-reduced-motion: reduce) {
  .tt-build .tt-brand::before, .tt-build__bg::after { animation: none; }
}
