/* SidisTech · v2.css — capa v2: colores reales de producto, fila de logos, selector de herramienta, movimiento.
   Va DESPUÉS de components/products/producto. Solo tokens; sin degradados, sombras en reposo, líneas ni vidrio. Movimiento: transform/translate/scale/opacity. */

/* ---------- 0) colores de producto: ahora son los de sus logos reales (tokens.css: antes ámbar y oliva supuestos) ---------- */
html[data-product="atalaya"] { --pc-page: var(--p-atalaya); }
html[data-product="tessera"] { --pc-page: var(--p-tessera); }
html[data-product="villicus"] { --pc-page: var(--p-villicus); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* ---------- 1) fila de logos: sitios donde vive ---------- */
.hero__row { margin-top: var(--s-2); }
.hero__row .prow { flex-wrap: nowrap; }
.footer__products { margin-top: var(--s-5); }
@media (max-width: 560px) { .prow__state { display: none; } }

/* selector de herramienta arriba de cada página de producto; el mismo tono del héroe para que no haya costura */
.pr { --deep: color-mix(in srgb, var(--pc) 70%, #000); }
.pswitch { padding-block: var(--s-4) 0; }
main.pr > .pswitch { background: color-mix(in srgb, var(--pc) 9%, var(--surface)); }
.pr .pr-hero { background: color-mix(in srgb, var(--pc) 9%, var(--surface)); padding-top: clamp(1.5rem, 3.5vw, 3rem); }

/* las otras dos herramientas */
.pother__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1rem, 2vw, 1.5rem); margin: 0; padding: 0; list-style: none; }
.pother__card { position: relative; display: flex; align-items: center; gap: clamp(1rem, 2.5vw, 2rem); padding: clamp(1.25rem, 3vw, 2.5rem); border-radius: var(--r-xl); background: color-mix(in srgb, var(--pc) 14%, var(--surface));
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out), translate var(--dur-3) var(--ease-spring), background-color var(--dur-2); }
.pother__card[data-p="atalaya"] { --pc: var(--p-atalaya); }
.pother__card[data-p="tessera"] { --pc: var(--p-tessera); }
.pother__card[data-p="villicus"] { --pc: var(--p-villicus); }
.pother__card:hover, .pother__card:focus-within { translate: 0 -6px; background: color-mix(in srgb, var(--pc) 24%, var(--surface)); transition-delay: 0s; }
.pother__logo { --plogo-size: clamp(64px, 9vw, 104px); }
.pother__body { min-width: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.pother__body p { max-width: 28ch; }
.pother__card h3 a { color: var(--tx); text-decoration: none; }
.pother__card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.pother__card:hover h3 a { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .2em; }
.pother__card h3 a:focus-visible { outline: none; }
.pother__card:has(h3 a:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
@media (max-width: 760px) { .pother__grid { grid-template-columns: 1fr; } .pother__card { flex-direction: row; } }

/* ---------- 2) héroe vivo: los cinco arcos entran uno por uno y luego «respiran» ---------- */
@keyframes arcIn { from { opacity: 0; translate: var(--ax, 0px) var(--ay, 24px); } to { opacity: 1; translate: 0 0; } }
@keyframes arcBreath { 0%, 100% { scale: 1; } 50% { scale: 1.045; } }
@media (prefers-reduced-motion: no-preference) {
  .tile__sym .arc { transform-box: fill-box; transform-origin: center; animation: arcIn 1.1s var(--ease-spring) both, arcBreath 6.5s ease-in-out infinite;
    animation-delay: calc(var(--i, 0) * 110ms + 250ms), calc(var(--i, 0) * 700ms + 2.6s); }
  .tile__sym .arc[data-i="0"] { --i: 0; --ax: 18px; --ay: -26px; } .tile__sym .arc[data-i="1"] { --i: 1; --ax: -22px; --ay: -10px; }
  .tile__sym .arc[data-i="2"] { --i: 2; --ax: 0px; --ay: 0px; } .tile__sym .arc[data-i="3"] { --i: 3; --ax: 22px; --ay: 10px; }
  .tile__sym .arc[data-i="4"] { --i: 4; --ax: -18px; --ay: 26px; }
  html.pre-on:not(.pre-reveal) .tile__sym .arc { animation-play-state: paused; }
}

/* ---------- 3) barra de avance de lectura (solo donde hay animaciones atadas al scroll) ---------- */
html.v2::before { content: ""; position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 300; pointer-events: none; background: var(--pc-page, var(--brand)); transform: scaleX(0); transform-origin: 0 50%; display: none; }
@keyframes sprog { to { transform: scaleX(1); } }
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) { html.v2::before { display: block; animation: sprog linear both; animation-timeline: scroll(root block); } }
}

/* ---------- 4) titulares que suben palabra por palabra, y revelado escalonado ---------- */
.js h2.is-split .w { display: inline-block; opacity: 0; transform: translateY(.5em); transition: opacity .7s var(--ease-out), transform .85s var(--ease-out); transition-delay: calc(var(--i, 0) * 55ms); }
.js h2.is-split.is-in .w { opacity: 1; transform: none; }
.js [data-r2] { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }
.js [data-r2].is-in { opacity: 1; transform: none; transition-delay: calc(var(--d, 0) * 90ms); }
html[data-static="1"] [data-r2], html[data-static="1"] h2.is-split .w { opacity: 1; transform: none; transition: none; }
@media (prefers-reduced-motion: reduce) {
  .js [data-r2] { opacity: 1; transform: none; transition: none; }
  .js h2.is-split .w { opacity: 1; transform: none; transition: none; }
}

/* ---------- 5) paralaje suave (CSS atado al scroll; sin JS) y microinteracciones ---------- */
@keyframes parA { from { translate: 0 var(--par, 26px); } to { translate: 0 calc(var(--par, 26px) * -1); } }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .pr-pair .pr-stage:nth-child(2) { --par: 38px; animation: parA linear both; animation-timeline: view(); animation-range: cover 0% cover 100%; }
    .pr-pair .pr-stage:nth-child(1) { --par: 14px; animation: parA linear both; animation-timeline: view(); animation-range: cover 0% cover 100%; }
    .pr-split__b .pr-stage, .pr-duo .pr-fig:nth-child(2) .pr-stage, .pr-rows .pr-stage { --par: 22px; animation: parA linear both; animation-timeline: view(); animation-range: cover 0% cover 100%; }
  }
}
.btn:focus-visible, .link:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.link { transition: text-decoration-thickness var(--dur-2) var(--ease-out), color var(--dur-2); }
.nav a { transition: text-decoration-color var(--dur-2); }
.card .plogo, .pother__card .plogo { transition: transform var(--dur-3) var(--ease-spring); }
.card:hover .plogo, .pother__card:hover .plogo { transform: scale(1.08) rotate(-3deg); }
@media (prefers-reduced-motion: reduce) { .card:hover .plogo, .pother__card:hover .plogo { transform: none; } }

/* ---------- 6) cambio de página sin parpadeo: la cabecera se queda, el contenido sale y entra suave ---------- */
@media (prefers-reduced-motion: no-preference) {
  .site-header { view-transition-name: site-header; }
  html:has(.portal) .site-header, html[data-portal] .site-header { view-transition-name: none; }   /* con el portal de color, la cabecera no se queda por encima */
  ::view-transition-group(site-header) { animation-duration: 0s; }
  ::view-transition-old(site-header), ::view-transition-new(site-header) { animation: none; mix-blend-mode: normal; }
  html:not([data-portal]):not([data-theme-vt])::view-transition-old(root) { animation: vtOut .2s var(--ease-io) both; }
  html:not([data-portal]):not([data-theme-vt])::view-transition-new(root) { animation: vtIn .38s var(--ease-out) .05s both; }
}
@keyframes vtOut { to { opacity: 0; transform: translateY(-8px); } }
@keyframes vtIn { from { opacity: 0; transform: translateY(14px); } }

/* ---------- laboratorio de la fila de logos (página Logos) ---------- */
.prlab { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1rem, 2vw, 1.5rem); }
.prlab__box { --ring: var(--card); display: flex; flex-direction: column; gap: var(--s-3); padding: clamp(1.25rem, 2.5vw, 2rem); border-radius: var(--r-xl); background: var(--card); min-width: 0; }
.prlab__box:first-child { grid-column: 1 / -1; }
.prlab__demo { min-height: 96px; display: flex; align-items: center; padding-top: var(--s-5); }
.prlab__demo > .prow { flex-wrap: nowrap; }
.prlab__box p { max-width: 34ch; }
.prlab__tbl { width: 100%; font-size: .875rem; }
.prlab__tbl td { text-align: right; } .prlab__tbl td .prow { justify-content: flex-end; }
.prlab__tbl th { text-align: left; font-weight: 400; color: var(--tx); }
.prlab__tbl tr + tr th, .prlab__tbl tr + tr td { border-top: 1px solid var(--line); }
.prlab__tbl th, .prlab__tbl td { padding: 6px 0; }
.prlab__demo[data-ui] { padding-top: 0; }
@media (max-width: 760px) { .prlab { grid-template-columns: 1fr; } .prlab__demo { min-height: 0; } .prlab__box { padding: 1rem; } }

.footer__products .prow { gap: 6px; }
.footer__products .prow__a { padding-right: 12px; }
@media (max-width: 1040px) { .footer__products .prow__a { font-size: .875rem; } }
