/* Productos v2: "El taller" (prefijo t2-)
   Las herramientas que hacemos nosotros, cada una en el punto en que está. Un cuadro de pilotos: la luz baja por su cable y
   prueba cada herramienta; solo se queda encendida la que funciona, las demás quedan en brasa, en el taller.
   La honestidad es la historia: nada se presenta como terminado si no lo está */

.t2-cover { --cover-focus: 78% 62%; --cover-stack-pos: 75% 50%; }

/* La lámpara se enciende al llegar. Debajo, la foto del taller con la lámpara apagada; encima, la misma foto encendida (alineadas
   al píxel), invisible hasta que las dos están cargadas. Entonces entra con el parpadeo de una bombilla de contacto flojo:
   un chispazo, oscuridad, dos titubeos y el encendido que se asienta. Toda la sala cambia, porque la luz llega a toda la sala */
.t2-lamp {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
}

.t2-lamp.is-lit { animation: t2LampOn 1.7s linear both; }

@keyframes t2LampOn {
    0% { opacity: 0; }
    2% { opacity: .72; }
    5% { opacity: .08; }
    8% { opacity: 0; }
    26% { opacity: 0; }
    28% { opacity: .46; }
    30% { opacity: .14; }
    33% { opacity: .8; }
    36% { opacity: .3; }
    39% { opacity: 0; }
    49% { opacity: 0; }
    53% { opacity: .7; }
    58% { opacity: .58; animation-timing-function: cubic-bezier(.2, .7, .3, 1); }
    100% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .t2-lamp, .t2-lamp.is-lit { opacity: 1; animation: none; }
}

/* Con más ancho y algo menor, el titular queda en dos líneas, partidas donde se lee mejor */
.t2-cover .v3-cover__content { max-width: 56rem; }
.t2-cover .v3-cover__title { font-size: clamp(3.2rem, 6.2vw, 6.6rem); }

/* ---------- El cuadro de pilotos (escena fija) ---------- */

.t2-bench { position: relative; height: 520svh; background: var(--carbon-2); }

.t2-bench__stage {
    position: sticky;
    top: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 27rem);
    gap: clamp(3rem, 7vw, 7rem);
    align-items: center;
    height: 100svh;
    padding: 6rem max(var(--gutter), calc((100% - 82rem) / 2)) 4rem;
    overflow: hidden;
}

.t2-bench__text { position: relative; display: grid; align-content: center; }

.t2-say {
    grid-area: 1 / 1;
    max-width: 32rem;
    opacity: 0;
    transform: translateY(26px);
    transition: opacity .8s ease, transform 1s var(--ease-out);
    pointer-events: none;
}

.t2-say.is-on { opacity: 1; transform: none; transition-delay: .18s; pointer-events: auto; }
.t2-say.is-past { transform: translateY(-26px); }
.t2-say .v3-kicker { margin-bottom: 1.6rem; }

.t2-say__n { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .9rem; margin: 0 0 1.2rem; color: rgba(245, 244, 241, .6); font-size: .62rem; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; }
.t2-say__n b { color: rgba(245, 244, 241, .4); font-family: var(--serif); font-size: 1rem; font-style: italic; font-weight: 300; letter-spacing: 0; text-transform: none; }
.t2-say--on .t2-say__n span { color: rgb(var(--luz-core)); }
.t2-say--ember .t2-say__n span { color: rgba(var(--luz), .75); }

.t2-say__title {
    margin: 0;
    font-family: var(--serif);
    font-size: clamp(2.3rem, 4vw, 4rem);
    font-weight: 300;
    letter-spacing: -.025em;
    line-height: 1.04;
}

.t2-say__title em { color: var(--ciruela-luz); font-style: italic; font-weight: 300; }
.t2-say.is-on .v3-lit { --on: 1; --lit-dir: 270deg; }
.t2-say__role { margin: 1.1rem 0 0; color: rgba(245, 244, 241, .5); font-family: var(--serif); font-size: 1.05rem; font-style: italic; font-weight: 300; }
.t2-say__line { max-width: 29rem; margin: .9rem 0 0; color: rgba(245, 244, 241, .68); font-size: clamp(.98rem, 1.05vw, 1.08rem); font-weight: 300; line-height: 1.7; }
.t2-say__link { display: inline-block; margin-top: 1.6rem; }
.t2-say__soon { display: inline-block; margin-top: 1.6rem; color: rgba(245, 244, 241, .45); font-size: .78rem; font-weight: 500; }

/* El cuadro: los cuatro pilotos unidos por un cable por el que baja la luz */
.t2-board {
    position: relative;
    padding: 2.2rem 2.2rem 1.8rem 4.6rem;
    border: 1px solid rgba(245, 244, 241, .1);
    border-radius: 1.1rem;
    background: #17161b;
}

/* El cable llega 14 px más abajo que el último piloto para que la luz se funda bajo él; la línea apagada acaba en su centro */
.t2-board__wire { position: absolute; top: 0; left: 2.3rem; z-index: 1; width: 1px; background: linear-gradient(rgba(245, 244, 241, .08), rgba(245, 244, 241, .08)) 0 0 / 1px calc(100% - 14px) no-repeat; }

/* La luz entra por el borde de arriba del cuadro y baja hasta el piloto al que ha llegado (--head); por delante solo lleva
   una punta corta que se funde (--end), y al llegar se queda bajo el piloto: nunca se ve pasar de largo */
.t2-board__wire .v3-beam {
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 min(24px, calc(var(--head, 0px) * .5)), #000 var(--head, 0px), transparent var(--end, 0px));
    mask-image: linear-gradient(180deg, transparent 0, #000 min(24px, calc(var(--head, 0px) * .5)), #000 var(--head, 0px), transparent var(--end, 0px));
}
.t2-board__list { display: grid; gap: clamp(1.6rem, 5vh, 2.6rem); margin: 0; padding: 0; list-style: none; }

/* Solo el texto se atenúa: el piloto es opaco y tapa el cable, que pasa por debajo */
.t2-pilot { position: relative; display: grid; gap: .35rem; }
.t2-pilot__name, .t2-pilot__state { opacity: .42; transition: opacity var(--glow-dur) var(--glow-ease); }
.t2-pilot.is-active .t2-pilot__name, .t2-pilot.is-active .t2-pilot__state { opacity: 1; }
.t2-pilot__name { font-family: var(--serif); font-size: clamp(1.4rem, 1.9vw, 1.8rem); font-weight: 300; letter-spacing: -.015em; line-height: 1.1; }
.t2-pilot__state { color: rgba(245, 244, 241, .45); font-size: .58rem; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; }
.t2-pilot.is-tested.t2-pilot--on .t2-pilot__state { color: rgb(var(--luz-core)); }
.t2-pilot.is-tested.t2-pilot--ember .t2-pilot__state { color: rgba(var(--luz), .75); }

/* El piloto: apagado hasta que la luz llega; entonces destella y se queda en su estado real */
.t2-pilot__lamp,
.t2-dot {
    display: block;
    border-radius: 50%;
}

.t2-pilot__lamp {
    position: absolute;
    top: .55rem;
    left: calc(-4.6rem + 2.3rem - 8px);
    width: 16px;
    height: 16px;
    z-index: 2;
    border: 1px solid #3b3a3f;
    background: #0f0f12;
    transition: background-color 1s ease, border-color 1s ease, box-shadow 1s ease;
}

.t2-dot { display: inline-block; width: 8px; height: 8px; margin-right: .55rem; vertical-align: .05em; }

.t2-pilot--on.is-tested .t2-pilot__lamp,
.t2-dot--on {
    border-color: rgba(var(--luz-core), .9);
    background: rgb(var(--luz-core));
    box-shadow: 0 0 10px 2px rgba(var(--luz), .6), 0 0 28px 8px rgba(190, 128, 64, .25);
}

.t2-pilot--ember.is-tested .t2-pilot__lamp,
.t2-dot--ember {
    border-color: color-mix(in srgb, rgb(var(--luz)) 50%, #0f0f12);
    background: color-mix(in srgb, rgb(var(--luz)) 42%, #0f0f12);
    box-shadow: 0 0 8px 1px rgba(var(--luz), .2);
    animation: t2Ember 4.2s ease-in-out infinite;
}

.t2-pilot.is-testing .t2-pilot__lamp { animation: t2Test .9s ease-out both; }

@keyframes t2Test {
    0% { background: rgb(var(--luz-core)); box-shadow: 0 0 16px 5px rgba(var(--luz), .8), 0 0 40px 12px rgba(190, 128, 64, .35); }
    100% { }
}

@keyframes t2Ember { 50% { background: color-mix(in srgb, rgb(var(--luz)) 28%, #0f0f12); box-shadow: 0 0 5px 1px rgba(var(--luz), .12); } }

.t2-board__legend { display: flex; flex-wrap: wrap; gap: .6rem 1.6rem; margin: 2rem 0 0; padding-top: 1.2rem; border-top: 1px solid rgba(245, 244, 241, .08); color: rgba(245, 244, 241, .45); font-size: .6rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; }

/* ---------- Lo que ya funciona ---------- */

.t2-ready { padding: clamp(6rem, 14vh, 9rem) max(var(--gutter), calc((100% - 82rem) / 2)); background: var(--carbon); }

.t2-ready__link {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: clamp(2.5rem, 6vw, 6rem);
    align-items: center;
}

.t2-ready__media { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; }
.t2-ready__media img { width: 100%; height: 100%; object-fit: cover; object-position: 66% 50%; filter: brightness(.85); transition: filter var(--glow-dur) var(--glow-ease), transform 1.6s var(--ease-out); }
html:not(.is-touch) .t2-ready__link:hover .t2-ready__media img,
.t2-ready__link.is-focus .t2-ready__media img,
.t2-ready__link:focus-visible .t2-ready__media img { filter: none; transform: scale(1.03); }

.t2-ready__body { display: grid; gap: 1rem; justify-items: start; }
.t2-ready__body .v3-kicker { margin: 0 0 .4rem; }
.t2-ready__state { display: inline-flex; align-items: center; color: rgb(var(--luz-core)); font-size: .6rem; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; }
.t2-ready__name { font-family: var(--serif); font-size: clamp(2.4rem, 4vw, 4rem); font-weight: 300; letter-spacing: -.025em; line-height: 1; }
.t2-ready__phrase { color: rgba(245, 244, 241, .7); font-family: var(--serif); font-size: 1.3rem; font-weight: 300; }
.t2-ready__phrase em { color: var(--ciruela-luz); font-style: italic; }
.t2-ready__line { max-width: 30rem; color: rgba(245, 244, 241, .64); font-size: .98rem; font-weight: 300; line-height: 1.7; }
.t2-ready__go { display: inline-flex; align-items: center; gap: .7rem; margin-top: .6rem; color: var(--hueso); font-size: .84rem; font-weight: 500; }
.t2-ready__go svg { width: 1rem; height: 1rem; transition: transform var(--glow-dur) var(--glow-ease); }
html:not(.is-touch) .t2-ready__link:hover .t2-ready__go svg,
.t2-ready__link.is-focus .t2-ready__go svg,
.t2-ready__link:focus-visible .t2-ready__go svg { transform: translateX(.4rem); }
.t2-ready__link:focus-visible { outline: 1px solid rgba(var(--luz), .6); outline-offset: 6px; }

/* ---------- Reglas del taller (sección clara) ---------- */

.t2-rules__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.t2-rule__n { display: block; margin-bottom: 1.4rem; color: var(--ciruela); font-family: var(--serif); font-size: 1.4rem; font-style: italic; font-weight: 300; }

/* ---------- Cierre ---------- */

.t2-cta { display: grid; justify-items: start; gap: 1.6rem; padding: clamp(6rem, 14vh, 9rem) max(var(--gutter), calc((100% - 82rem) / 2)); background: var(--carbon); }
.t2-cta .v3-title { max-width: 17em; }

/* ---------- Responsive ---------- */

/* Pantallas grandes y altas: el cuadro con una escala (sus medidas en px no cambian) y el texto algo mayor */
@media (min-width: 1600px) and (min-height: 1100px) {
    .t2-board { transform: scale(1.3); transform-origin: 100% 50%; }
    .t2-say { max-width: 38rem; }
    .t2-say__title { font-size: clamp(4rem, 3.4vw, 5rem); }
    .t2-say__line { max-width: 33rem; font-size: 1.2rem; }
}

@media (max-width: 1180px) {
    .t2-rules__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .t2-ready__link { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .t2-bench { height: 600svh; }
    /* El cuadro arriba, compacto, y el texto debajo */
    .t2-bench__stage { grid-template-columns: 1fr; grid-template-rows: auto 1fr; gap: 1.6rem; align-items: start; padding: 5rem 1.5rem 1.6rem; }
    .t2-board { grid-row: 1; padding: 1.2rem 1.2rem 1rem 3.2rem; }
    .t2-board__wire { left: 1.6rem; }
    .t2-board__list { gap: .9rem; }
    .t2-pilot { gap: .15rem; }
    .t2-pilot__lamp { top: .35rem; left: calc(-3.2rem + 1.6rem - 7px); width: 14px; height: 14px; }
    .t2-pilot__name { font-size: 1.12rem; }
    .t2-pilot__state { font-size: .52rem; letter-spacing: .18em; }
    .t2-board__legend { display: none; }
    .t2-bench__text { grid-row: 2; align-content: start; }
    .t2-say__title { font-size: clamp(1.9rem, 8.4vw, 2.6rem); }
    .t2-say__line { margin-top: .7rem; font-size: .94rem; line-height: 1.6; }
    .t2-say__role { margin-top: .7rem; font-size: .98rem; }
    .t2-say__link, .t2-say__soon { margin-top: 1rem; }
}

@media (max-width: 820px) {
    .t2-rules__grid { grid-template-columns: 1fr; }
    .t2-ready, .t2-cta { padding: 5.5rem 1.5rem; }
    .t2-cta .v3-button { width: 100%; justify-content: center; }
}

/* Sin movimiento: el cuadro con cada piloto en su estado y los textos, uno detrás de otro */
@media (prefers-reduced-motion: reduce) {
    .t2-bench { height: auto; }
    .t2-bench__stage { position: static; height: auto; padding-block: 6rem; align-items: start; }
    .t2-bench__text { display: grid; gap: 2.6rem; }
    .t2-say, .t2-say.is-past { grid-area: auto; opacity: 1; transform: none; }
    .t2-pilot__name, .t2-pilot__state { opacity: 1; }
    .t2-pilot--ember.is-tested .t2-pilot__lamp, .t2-dot--ember { animation: none; }
}
