/* Intro YT Grupo · fondo claro · móvil y web
 * En el login dura 5 s (--yt7-dur). Los tiempos de abajo son de la versión de 7 s: se escalan × 5/7.
 *  0.0–0.7  fondo: resplandor central + grano y partículas
 *  0.7–1.8  Y revelada desde arriba; se asienta con un leve ajuste de escala
 *  1.5–2.3  barra superior entra desde la derecha
 *  2.0–3.5  curva: azul → morado → fucsia, con un brillo que la recorre
 *  2.8–3.8  tramo vertical derecho: se completa la T
 *  3.8–5.2  logo quieto · destello sobre el degradado · el resplandor pulsa una vez
 *  5.2–6.2  texto debajo (solo si hay texto)
 *  6.2–7.0  fundido final
 * Todas duran 7 s y arrancan juntas: % del keyframe = segundos ÷ 7 × 100.
 */
:root {
    --yt7-dur: 5s;
    --yt7-fondo: #f7f5f2;              /* blanco cálido */
    --yt7-tinta: #1e1614;              /* marrón casi negro */
    --yt7-s: min(50vw, 40dvh, 560px);  /* ancho del logo: 50 % en vertical, contenido en pantallas anchas */
    --yt7-out: cubic-bezier(.22, 1, .36, 1);
    --yt7-io: cubic-bezier(.65, 0, .35, 1);
}

.yt7 { position: fixed; inset: 0; z-index: 9999; overflow: hidden; pointer-events: none; visibility: hidden;
       background: var(--yt7-fondo); }
.yt7.play { visibility: visible; }

/* ---------- Fondo ---------- */
.yt7-fondo { position: absolute; inset: 0; opacity: 0; }
.yt7-halo { position: absolute; left: 50%; top: 50%; width: 150vmax; height: 150vmax; translate: -50% -50%;
            background: radial-gradient(closest-side, rgba(255,255,255,.95) 0%, rgba(255,255,255,.55) 30%,
                        rgba(165,60,162,.035) 52%, rgba(69,133,243,.02) 66%, transparent 80%); }
.yt7-arcos { position: absolute; width: 95vmin; height: 95vmin; overflow: visible; }
.yt7-arcos-a { left: 0; top: 0; }
.yt7-arcos-b { right: 0; bottom: 0; }
.yt7-arcos circle { fill: none; stroke: rgba(30,22,20,.07); vector-effect: non-scaling-stroke; }
.yt7-arcos circle { stroke-width: 1px; }
.yt7-arcos circle.fino { stroke: rgba(30,22,20,.05); stroke-dasharray: 2 6; }
.yt7-arcos .color { fill: none; stroke: url(#yt7-arco-color); stroke-width: 1.5px; vector-effect: non-scaling-stroke; opacity: .22; }
.yt7-arcos .linea { stroke: rgba(30,22,20,.10); stroke-width: 1px; vector-effect: non-scaling-stroke; }
.yt7-particulas { position: absolute; inset: 0; width: 100%; height: 100%; }
.yt7-grano { position: absolute; inset: -50%; opacity: .045; mix-blend-mode: multiply;
             background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* ---------- Logo ---------- */
.yt7-centro { position: absolute; inset: 0; display: grid; place-items: center; place-content: center; }
.yt7-logo { width: var(--yt7-s); height: auto; overflow: visible; color: var(--yt7-tinta);
            filter: drop-shadow(0 calc(var(--yt7-s) * .035) calc(var(--yt7-s) * .05) rgba(30,22,20,.10)); }
.yt7-y, .yt7-barra { transform-box: fill-box; }
.yt7-y { transform-origin: 50% 100%; }
.yt7-cortina { transform-box: fill-box; transform-origin: 50% 0; }
.yt7-trazo { stroke-dasharray: 1; }
.yt7-brillo { stroke-dasharray: .1 2; stroke-dashoffset: -.9; opacity: 0; }
.yt7-destello { transform-box: fill-box; opacity: 0; }

.yt7-texto { position: absolute; top: calc(50% + var(--yt7-s) * .40); left: 0; right: 0; margin: 0; text-align: center;
             font: 500 calc(var(--yt7-s) * .065)/1.3 "Hanken Grotesk", system-ui, sans-serif; letter-spacing: .14em;
             text-transform: uppercase; color: rgba(30,22,20,.72); opacity: 0; padding: 0 24px; }
.yt7-texto:empty { display: none; }

/* ---------- Animación ---------- */
.play                    { animation: yt7-salida   var(--yt7-dur) linear both; }
.play .yt7-fondo         { animation: yt7-fondo    var(--yt7-dur) linear both; }
.play .yt7-halo          { animation: yt7-halo     var(--yt7-dur) linear both; }
.play .yt7-arcos-a       { animation: yt7-deriva-a var(--yt7-dur) linear both; }
.play .yt7-arcos-b       { animation: yt7-deriva-b var(--yt7-dur) linear both; }
.play .yt7-grano         { animation: yt7-grano    var(--yt7-dur) linear both; }
.play .yt7-cortina-y     { animation: yt7-cort-y   var(--yt7-dur) linear both; }
.play .yt7-y             { animation: yt7-asentar  var(--yt7-dur) linear both; }
.play .yt7-barra         { animation: yt7-barra    var(--yt7-dur) linear both; }
.play .yt7-trazo         { animation: yt7-curva    var(--yt7-dur) linear both; }
.play .yt7-brillo        { animation: yt7-brillo   var(--yt7-dur) linear both; }
.play .yt7-cortina-palo  { animation: yt7-cort-p   var(--yt7-dur) linear both; }
.play .yt7-destello      { animation: yt7-destello var(--yt7-dur) linear both; }
.play .yt7-centro        { animation: yt7-logo-fin var(--yt7-dur) linear both; }
.play .yt7-texto         { animation: yt7-texto    var(--yt7-dur) linear both; }

@keyframes yt7-fondo   { 0% { opacity: 0; animation-timing-function: ease-out; } 10%, 100% { opacity: 1; } }
@keyframes yt7-halo    {   /* aparece y pulsa una sola vez (3.9–5.1 s) */
    0%      { opacity: 0; scale: .9; animation-timing-function: ease-out; }
    10%     { opacity: 1; scale: 1; }
    55.71%  { opacity: 1; scale: 1; animation-timing-function: ease-in-out; }
    64.29%  { opacity: 1; scale: 1.07; animation-timing-function: ease-in-out; }
    72.86%, 100% { opacity: 1; scale: 1; }
}
@keyframes yt7-deriva-a { from { transform: rotate(-2deg) translate(-1.5%, -1%); } to { transform: rotate(3deg) translate(0, 0); } }
@keyframes yt7-deriva-b { from { transform: rotate(2deg) translate(1.5%, 1%); }  to { transform: rotate(-3deg) translate(0, 0); } }
@keyframes yt7-grano   { from { transform: translate(0, 0); } to { transform: translate(-3%, 2%); } }

@keyframes yt7-cort-y  { 0%, 10% { transform: scaleY(0); animation-timing-function: var(--yt7-io); } 25.71%, 100% { transform: scaleY(1); } }
@keyframes yt7-asentar {
    0%, 21.43% { transform: scale(1.045); animation-timing-function: var(--yt7-out); }
    28.57%, 100% { transform: none; }
}
@keyframes yt7-barra {
    0%, 21.43% { opacity: 0; transform: translateX(38%); animation-timing-function: var(--yt7-out); }
    32.86%, 100% { opacity: 1; transform: none; }
}
@keyframes yt7-curva   { 0%, 28.57% { stroke-dashoffset: 1; animation-timing-function: var(--yt7-io); } 50%, 100% { stroke-dashoffset: 0; } }
@keyframes yt7-brillo  {   /* viaja con la punta del trazo: offset = .1 − avance */
    0%, 28.57% { stroke-dashoffset: .1; opacity: 0; animation-timing-function: var(--yt7-io); }
    32%        { opacity: .55; }
    46%        { opacity: .55; }
    50%        { stroke-dashoffset: -.9; opacity: 0; }
    100%       { stroke-dashoffset: -.9; opacity: 0; }
}
@keyframes yt7-cort-p  { 0%, 40% { transform: scaleY(0); animation-timing-function: var(--yt7-io); } 54.29%, 100% { transform: scaleY(1); } }
@keyframes yt7-destello {  /* 4.0–4.9 s: barre la curva de izquierda a derecha */
    0%, 57.14% { opacity: 0; transform: translateX(-60%); animation-timing-function: var(--yt7-io); }
    60%        { opacity: 1; }
    67%        { opacity: 1; }
    70%, 100%  { opacity: 0; transform: translateX(260%); }
}
@keyframes yt7-texto {
    0%, 74.29% { opacity: 0; transform: translateY(10px); letter-spacing: .22em; animation-timing-function: var(--yt7-out); }
    88.57%, 100% { opacity: 1; transform: none; letter-spacing: .14em; }
}
@keyframes yt7-logo-fin {  /* el logo y el texto se funden; luego se va el fondo */
    0%, 90%  { opacity: 1; animation-timing-function: ease-in-out; }
    97%, 100% { opacity: 0; }
}
@keyframes yt7-salida {
    0%, 93%  { opacity: 1; animation-timing-function: ease-out; }
    100%     { opacity: 0; visibility: hidden; }
}

@media (prefers-reduced-motion: reduce) { .yt7 { display: none; } }

