/* El elenco (Cablín, Cajita LED y Carpi fuera de la pantalla), el punto LED que lee los títulos,
   la barra que dice dónde estás y el índice en tarjetas. Va después de landing.css. */

/* ---------- mascotas: tiras de 8 cuadros de 96 px, en píxeles duros ---------- */
.mascota {
  display: block; width: var(--t, 96px); aspect-ratio: 1; flex: none;
  background: no-repeat 0 0 / 800% 100%; image-rendering: pixelated; image-rendering: crisp-edges;
  pointer-events: none; user-select: none;
}
@supports (image-rendering: pixelated) { .mascota { image-rendering: pixelated; } }

/* portada: Cablín saluda al lado de la caja, parado sobre la cinta */
.portada .escenario { position: relative; }
.m-portada { position: absolute; z-index: 3; bottom: 0; left: max(2%, calc(50% - min(38vw, 470px))); --t: 144px; }
/* conexiones: Carpi al pie de la caja, reacciona a la conexión elegida */
.m-conexion { position: absolute; z-index: 2; right: -40%; bottom: 0; --t: 44%; width: 44%; scale: -1 1; }
/* pedíselo a tu agente: Cablín parado sobre el chat */
#prompt .demo { position: relative; }
.m-agente { position: absolute; z-index: 3; left: 26px; top: 0; translate: 0 calc(-100% + 9px); --t: 96px; }
/* panel: Cajita LED escribe al pie de la ventana */
.vp { position: relative; }
.m-panel { position: absolute; z-index: 3; left: -34px; bottom: -14px; --t: 120px; }
/* hardware: Carpi revisa con la lupa */
.m-hardware { margin: 18px 0 0 -10px; --t: 96px; }
/* comunidad: cada una arriba de su caja */
.vitrina .cajita { overflow: visible; }
.m-sobre { position: absolute; z-index: 2; left: 50%; bottom: 96.5%; translate: -50% 0; width: 42%; }
/* sentadas en el borde de la caja: la fila del asiento (de 96) queda sobre el canto de arriba */
.m-sobre.sentada { bottom: calc(96.5% - (96 - var(--asiento)) / 96 * 42% * 621 / 644 * 1.0); }
.vitrina { margin-top: max(70px, min(9vw, 120px)); }
/* cierre: Cajita LED arriba de la caja que reservás */
.cajita-cierre { overflow: visible; }
.m-cierre { position: absolute; z-index: 2; right: 6%; bottom: 96%; width: 36%; }
/* pie: Cablín se quedó dormido */
.pie-fin { display: inline-flex; align-items: center; gap: 8px; color: var(--gris); }
/* enlaces del pie con área cómoda para el dedo */
.pie-enlaces a { padding: 6px 0; }
.m-pie { --t: 48px; margin: -12px 0 -8px; }

@media (max-width: 980px) {
  .m-portada { --t: 112px; left: 3%; }
  .m-panel { --t: 96px; left: -6px; bottom: -22px; }
  .m-conexion { right: -36%; }
}
@media (max-width: 600px) {
  .m-portada { --t: 96px; left: 0; }
  .m-agente { --t: 72px; left: 16px; translate: 0 calc(-100% + 7px); }
  .m-panel { --t: 72px; left: -4px; bottom: -18px; }
  .m-hardware { --t: 72px; margin-top: 8px; }
  .m-conexion { right: -42%; width: 46%; }
  .vitrina { margin-top: 64px; }
}

/* ---------- la palabra marcada de cada título ---------- */
/* la palabra marcada: un trazo lima por detrás, que se pinta cuando llega el punto */
.cabeza h2 em {
  font-style: normal; position: relative; z-index: 0; white-space: nowrap;
  background: linear-gradient(var(--lima), var(--lima)) 0 86% / 0% 34% no-repeat;
  transition: background-size .55s cubic-bezier(.65, 0, .25, 1);
}
.cabeza h2 em.marcada { background-size: 100% 34%; }
.oscura .cabeza h2 em { background: none; color: var(--claro); transition: color .5s; }
.oscura .cabeza h2 em.marcada { color: var(--lima); }
section.precio .cabeza h2 em { background-image: linear-gradient(#fbfcfb, #fbfcfb); color: #0b100f; }
:root[data-tema="oscuro"] .cabeza h2 em { background-image: linear-gradient(rgba(195, 250, 108, .34), rgba(195, 250, 108, .34)); }
:root[data-tema="oscuro"] section.precio .cabeza h2 em { background-image: linear-gradient(#fbfcfb, #fbfcfb); }
@media (prefers-reduced-motion: reduce) { .cabeza h2 em { transition: none; } }

/* ---------- la barra dice dónde estás (cuando no entra el menú) ---------- */
.donde { display: none; align-items: center; gap: 7px; margin-right: auto; margin-left: 14px; font: 500 13px/1 var(--mono); color: var(--gris); overflow: hidden; }
.donde i { width: 7px; height: 7px; border-radius: 50%; background: var(--lima); box-shadow: 0 0 0 1.5px var(--tinta); flex: none; opacity: 0; transition: opacity .3s; }
.donde.hay i { opacity: 1; }
.donde-txt { display: inline-block; white-space: nowrap; }
@media (max-width: 980px) { .donde { display: inline-flex; } }

/* ---------- índice ---------- */
.indice-boton {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 13px 0 11px; border-radius: 999px;
  border: 1px solid var(--linea); background: transparent; color: var(--tinta); font: 500 14px/1 var(--sans); cursor: pointer;
  transition: background-color .2s, border-color .2s;
}
.indice-boton svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }
.indice-boton:hover { background: color-mix(in srgb, var(--tinta) 6%, transparent); }
.indice-boton:focus-visible { outline: 2px solid var(--tinta); outline-offset: 2px; }
@media (max-width: 600px) { .indice-boton span { display: none; } .indice-boton { width: 36px; padding: 0; justify-content: center; } }
html.con-indice { overflow: hidden; }
.indice {
  position: fixed; inset: 0; z-index: 80; overflow-y: auto; overscroll-behavior: contain;
  padding: 20px max(20px, calc((100% - 1180px) / 2)) 40px;
  background: color-mix(in srgb, var(--fondo) 88%, transparent); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  opacity: 0; transition: opacity .3s;
}
.indice.desplegado { opacity: 1; }
.indice-cab { display: flex; align-items: center; justify-content: space-between; height: 44px; margin-bottom: 18px; }
.indice-cab b { font: 600 15px/1 var(--sans); letter-spacing: -.01em; }
.indice-cerrar { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--linea); background: var(--blanco); color: var(--tinta); display: grid; place-items: center; cursor: pointer; }
.indice-cerrar svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.indice-cartas { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(14px, 2vw, 26px); }
.indice-cartas li { rotate: var(--g); translate: 0 26px; opacity: 0; transition: rotate .35s cubic-bezier(.2, .7, .2, 1), translate .5s cubic-bezier(.2, .7, .2, 1), opacity .4s; }
.indice.desplegado .indice-cartas li { translate: 0 0; opacity: 1; }
.indice.desplegado .indice-cartas li:nth-child(2) { transition-delay: 30ms; } .indice.desplegado .indice-cartas li:nth-child(3) { transition-delay: 60ms; }
.indice.desplegado .indice-cartas li:nth-child(4) { transition-delay: 90ms; } .indice.desplegado .indice-cartas li:nth-child(5) { transition-delay: 120ms; }
.indice.desplegado .indice-cartas li:nth-child(6) { transition-delay: 150ms; } .indice.desplegado .indice-cartas li:nth-child(7) { transition-delay: 180ms; }
.indice.desplegado .indice-cartas li:nth-child(8) { transition-delay: 210ms; }
.indice-cartas li:hover, .indice-cartas li:focus-within { rotate: 0deg; }
.indice-cartas a {
  display: grid; gap: 4px; padding: 10px 10px 14px; border-radius: 14px; background: var(--blanco);
  box-shadow: 0 1px 0 rgba(11, 16, 15, .06), 0 18px 34px -22px rgba(11, 16, 15, .45); outline: none;
}
.indice-cartas a:focus-visible { box-shadow: 0 0 0 2px var(--tinta), 0 18px 34px -22px rgba(11, 16, 15, .45); }
.carta-foto { position: relative; display: block; aspect-ratio: 1; border-radius: 9px; overflow: hidden; background: var(--pantalla); margin-bottom: 8px; }
.carta-foto canvas, .carta-foto img { display: block; width: 100%; height: 100%; object-fit: cover; }
.carta-foto img { background: var(--fondo); }
.carta-foto .mascota { position: absolute; right: 4px; bottom: 0; --t: 34%; width: 34%; }
.carta-num { font: 500 12px/1 var(--mono); color: var(--lima-texto); }
.carta-t { font: 560 16px/1.2 var(--sans); letter-spacing: -.015em; color: var(--tinta); }
:root[data-tema="oscuro"] .indice-cartas a { background: #141a18; }
:root[data-tema="oscuro"] .indice-cerrar { background: #141a18; }
:root[data-tema="oscuro"] .carta-num { color: var(--lima); }
@media (max-width: 980px) { .indice-cartas { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .indice-cartas { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } .carta-t { font-size: 14px; } }
@media (prefers-reduced-motion: reduce) { .indice, .indice-cartas li { transition: none; } }

/* ---------- celular: que nadie tape botones ni se salga de la pantalla ---------- */
@media (max-width: 600px) {
  .donde { display: none; }
  .barra .acciones-barra { gap: 6px; }
  .barra .boton.lima { padding: 0 12px; }
  .m-conexion { right: -29%; width: 30%; }
  .m-agente { left: auto; right: 0; top: 150px; translate: none; --t: 64px; }
  .m-cierre { bottom: 0; right: -32%; width: 30%; }
}

/* ---------- comunidad como un cuarto: pared crema con grano y un estante de madera ---------- */
#comunidad { background-color: #f1eedf; }
#comunidad::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .48 0 0 0 0 .42 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
#comunidad > * { position: relative; }
.vitrina { position: relative; isolation: isolate; }
.vitrina::after {
  content: ""; position: absolute; z-index: -1; left: -7%; right: -7%; bottom: calc(34px + 1.2vw - clamp(16px, 2.4vw, 30px)); height: clamp(16px, 2.4vw, 30px);
  border-radius: 6px; background: url(/assets/img/dia/mesa.webp) 50% 100% / 140% auto, #c79a68;
  box-shadow: 0 18px 30px -16px rgba(60, 40, 20, .45);
}
.vitrina figure:nth-child(2) { translate: 0 0; } .vitrina figure:nth-child(2):hover { translate: 0 -6px; }
:root[data-tema="oscuro"] #comunidad { background-color: #121613; }
:root[data-tema="oscuro"] #comunidad::before { mix-blend-mode: screen; opacity: .12; }
:root[data-tema="oscuro"] .vitrina::after { filter: brightness(.55); }
