/* taller.ink · portada de proyectos */
:root {
  --papel: #f6f3ec;
  --tinta: #1d1a16;
  --tinta-2: #5f584e;
  --linea: #e2dccf;
  --sombra-1: 0 1px 2px rgba(60, 44, 24, .08), 0 10px 24px -10px rgba(60, 44, 24, .22);
  --sombra-2: 0 2px 4px rgba(60, 44, 24, .08), 0 22px 40px -14px rgba(60, 44, 24, .32);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font: 16px/1.5 "Bricolage Grotesque", system-ui, sans-serif;
}
a { color: inherit; }

/* Cabecera */
.acciones { position: absolute; top: 18px; right: 20px; display: flex; gap: 8px; }
.entrar, .ajustes-boton {
  padding: 7px 14px; border-radius: 4px;
  font-weight: 500; font-size: 15px; text-decoration: none;
  box-shadow: inset 0 0 0 2px var(--tinta);
  transition: background .2s, color .2s;
}
.entrar:hover, .entrar:focus-visible, .ajustes-boton:hover, .ajustes-boton:focus-visible { background: var(--tinta); color: var(--papel); outline: none; }
.ajustes-boton { display: grid; place-items: center; width: 37px; padding: 0; border: 0; background: none; color: var(--tinta); cursor: pointer; font: inherit; }
.ajustes-boton svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; transition: transform .4s cubic-bezier(.3, 1.4, .5, 1); }
.ajustes-boton:hover svg { transform: rotate(60deg); }
.ajustes {
  position: fixed; inset: auto; top: 64px; right: 20px; margin: 0;
  width: min(300px, calc(100vw - 32px)); padding: 16px 16px 14px;
  border: 0; border-radius: 6px; background: #fffdf8; color: var(--tinta); box-shadow: var(--sombra-2); text-align: left;
  font: 15px/1.4 "Bricolage Grotesque", system-ui, sans-serif;
}
.ajustes:popover-open { animation: aparecer .2s cubic-bezier(.3, 1.4, .5, 1); }
.ajustes h2 { margin: 0 0 10px; font-size: 18px; font-weight: 800; letter-spacing: -0.03em; }
.interruptor { display: flex; align-items: center; justify-content: space-between; gap: 14px; cursor: pointer; }
.interruptor input { appearance: none; flex: none; position: relative; width: 42px; height: 24px; margin: 0; border-radius: 12px; background: var(--linea); cursor: pointer; transition: background .2s; }
.interruptor input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(60, 44, 24, .3); transition: transform .22s cubic-bezier(.3, 1.4, .5, 1); }
.interruptor input:checked { background: var(--tinta); }
.interruptor input:checked::after { transform: translateX(18px); }
.interruptor input:focus-visible { outline: 2px solid var(--tinta); outline-offset: 3px; }
.top { max-width: 760px; margin: 0 auto; padding: 64px 20px 28px; text-align: center; }
.marca {
  margin: 0;
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(56px, 13vw, 112px);
  letter-spacing: -0.045em;
  line-height: .9;
  display: inline-flex;
  align-items: baseline;
}
.marca .gota { width: .26em; height: .34em; margin: 0 .04em 0 .06em; fill: var(--tinta); transform-origin: 50% 100%; animation: gota 4.5s ease-in-out infinite; }
@keyframes gota { 0%, 86%, 100% { transform: translateY(0) scaleY(1); } 90% { transform: translateY(.04em) scaleY(.86); } 94% { transform: translateY(-.05em) scaleY(1.08); } }
.bajada { margin: 22px auto 0; max-width: 34em; color: var(--tinta-2); font-size: 18px; }

main { max-width: 1160px; margin: 0 auto; padding: 0 20px 40px; }

.grupo {
  display: flex; align-items: center; gap: 14px;
  margin: 40px 4px 18px;
  font: 500 15px/1 "Bricolage Grotesque", sans-serif;
  color: var(--tinta-2);
}
.grupo::after { content: ""; flex: 1; border-top: 2px dashed var(--linea); }

.grilla {
  --cols: 4; --gap: 26px;
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap;
  gap: var(--gap);
}
/* Cuántas columnas y qué alto de dibujo lo calcula repartirGrilla() para que las filas queden parejas;
   las cards de la última fila se estiran para llenarla, como en el celular. */
.grilla > li { flex: 1 1 calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols)); min-width: 0; }
.grilla[style*="--art-h"] .art { aspect-ratio: auto; height: var(--art-h); }

/* Card base: cada tema rellena estas variables */
.card {
  --fondo: #fff; --arte: #eee; --texto: #111; --suave: #555; --acento: #333;
  --letra: "Bricolage Grotesque", sans-serif; --titulo: var(--letra); --radio: 4px;
  position: relative;
  display: flex; flex-direction: column;
  background: var(--fondo);
  color: var(--texto);
  border-radius: var(--radio);
  box-shadow: var(--sombra-1);
  overflow: hidden;
  font-family: var(--letra);
  transition: transform .22s cubic-bezier(.3, 1.6, .5, 1), box-shadow .22s;
}
.card:nth-child(odd):hover, .card:nth-child(odd):focus-within { transform: translateY(-6px) rotate(-1.2deg); }
.card:nth-child(even):hover, .card:nth-child(even):focus-within { transform: translateY(-6px) rotate(1.2deg); }
.card:hover, .card:focus-within { box-shadow: var(--sombra-2); }
.card:nth-child(n):not(:has(h3 a)):hover, .card:nth-child(n):not(:has(h3 a)):focus-within { transform: none; box-shadow: var(--sombra-1); }
.card:has(h3 a):active { transform: translateY(1px); box-shadow: var(--sombra-1); transition-duration: .06s; }

.art { position: relative; aspect-ratio: 4 / 3; background: var(--arte); overflow: hidden; }
.art svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.cuerpo { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.card h3 { margin: 0 0 4px; font-family: var(--titulo); font-size: 22px; line-height: 1.15; }
.card h3 a { text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.card h3 a:focus-visible { outline: none; }
.card:focus-within { outline: 3px solid var(--acento); outline-offset: 4px; }
.card p { margin: 0 0 14px; color: var(--suave); font-size: 14.5px; line-height: 1.45; }
.pie { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-size: 12.5px; }
.tag { padding: 3px 9px; border-radius: 999px; background: var(--acento); color: var(--sobre-acento, #fff); font-weight: 600; white-space: nowrap; }
.dom { color: var(--suave); }
.extra { position: relative; z-index: 2; font-weight: 600; color: var(--acento); text-underline-offset: 3px; }
.extra:hover { text-decoration-thickness: 2px; }

/* ---------- Temas ---------- */

/* Tiempos: papel cálido, IBM Plex, naranja "corriendo" */
.t-tiempos { --fondo: #fbfaf7; --arte: #f3f2ee; --texto: #191917; --suave: #4a4843; --acento: #b5461a; --letra: "IBM Plex Sans", sans-serif; }
.t-tiempos .aguja { transform-origin: 95px 64px; transform-box: view-box; transform: rotate(150deg); transition: transform 1.2s cubic-bezier(.2, .8, .2, 1); }
.t-tiempos:hover .aguja { transform: rotate(510deg); }

/* Trazo: la ventana de Paint, azul de Windows */
.t-trazo { --fondo: #fbfbfb; --arte: #e6e7ea; --texto: #1b1b1b; --suave: #5d5d5d; --acento: #005fb8; --letra: "Segoe UI Variable Text", "Segoe UI", "Noto Sans", system-ui, sans-serif; }
.t-trazo h3 { font-weight: 600; }
.t-trazo .trazo { stroke-dasharray: 160; stroke-dashoffset: 0; }
.t-trazo:hover .trazo { animation: dibujar 1s ease-out; }
@keyframes dibujar { from { stroke-dashoffset: 160; } }

/* Pendientes: tablero perforado verde y amarillo de seguridad, Barlow */
.t-pendientes { --fondo: #e7ebe4; --arte: #2f5a48; --texto: #17201b; --suave: #4b544d; --acento: #2f5a48; --sobre-acento: #f1efe4; --letra: "Barlow", sans-serif; --radio: 12px; }
.t-pendientes h3 { font-weight: 700; }
.t-pendientes .relleno { transform-box: fill-box; transform-origin: center; transform: scale(.4); opacity: 0; transition: transform .35s cubic-bezier(.3, 1.5, .5, 1), opacity .2s; }
.t-pendientes .check { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .3s ease-out .2s; }
.t-pendientes:hover .relleno { transform: scale(1); opacity: 1; }
.t-pendientes:hover .check { stroke-dashoffset: 0; }

/* Reproductor: la pantalla oscura de Butaca, azul de reproducción, Inter */
.t-reproductor { --fondo: #0b1222; --arte: #03070f; --texto: #e9eef7; --suave: #93a4c2; --acento: #2563eb; --sobre-acento: #fff; --letra: "Inter", sans-serif; --radio: 12px; }
.t-reproductor h3 { font-weight: 700; letter-spacing: -.01em; }
.t-reproductor .avance { transform-box: view-box; transform-origin: 14px 0; transform: scaleX(.364); transition: transform 1.4s cubic-bezier(.2, .8, .2, 1); }
.t-reproductor .cabezal { transition: transform 1.4s cubic-bezier(.2, .8, .2, 1); }
.t-reproductor:hover .avance { transform: scaleX(.85); }
.t-reproductor:hover .cabezal { transform: translateX(64px); }

/* Cat Printer: papel térmico y máquina de escribir */
.t-gato { --fondo: #fffdf6; --arte: #ebe5d6; --texto: #2a2723; --suave: #5b544a; --acento: #2a2723; --letra: "Courier Prime", monospace; }
.t-gato h3 { font-weight: 700; letter-spacing: -.02em; }
.t-gato .art { border-bottom: 2px dashed #2a2723; }
.t-gato .papel { transition: transform .5s cubic-bezier(.3, 1.4, .5, 1); }
.t-gato:hover .papel { transform: translateY(-8px); }

/* Cabina de fotos: tira impresa, negro y rojo */
.t-cabina { --fondo: #161616; --arte: #222; --texto: #f4f1ea; --suave: #b5b0a6; --acento: #c8211c; --titulo: "Bebas Neue", sans-serif; --letra: "Archivo Narrow", sans-serif; }
.t-cabina .extra { color: #ff6b5e; }
.t-cabina h3 { font-size: 30px; font-weight: 400; letter-spacing: .02em; line-height: 1; }
.t-cabina .tira { transform-box: view-box; transform-origin: 98px 60px; transform: rotate(6deg); transition: transform .35s; }
.t-cabina:hover .tira { transform: rotate(1deg) translateY(-3px); }

/* Luces aRGB: placa oscura, Chakra Petch */
.t-luces { --fondo: #1e1e1e; --arte: #141414; --texto: #e0e0e0; --suave: #a7a7a7; --acento: #1E90FF; --sobre-acento: #0a0a0a; --letra: "Chakra Petch", sans-serif; }
.t-luces h3 { font-weight: 600; }
.t-luces:hover .led { animation: ronda 1.1s ease-in-out infinite; animation-delay: calc(var(--i) * .08s); }
@keyframes ronda { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* Casa Control: la pantalla oscura de la app, naranjo RF y morado IR, letra del sistema */
.t-casa { --fondo: #0e1117; --arte: #1a1f2b; --texto: #e8eaf0; --suave: #8a93a6; --acento: #ff8a3d; --sobre-acento: #101010; --letra: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.t-casa h3 { font-weight: 700; letter-spacing: -.01em; }
.t-casa:hover .onda { animation: emitir 1.2s ease-in-out infinite; animation-delay: calc(var(--i) * .15s); }
@keyframes emitir { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }
@media (prefers-reduced-motion: reduce) { .t-casa:hover .onda { animation: none; } }

/* Captura de streams: celeste y rojo de grabación, Manrope */
.t-captura { --fondo: #f1fcfd; --arte: #c5f0f5; --texto: #0e2a2e; --suave: #3f5d61; --acento: #b60808; --letra: "Manrope", sans-serif; }
.t-captura h3 { font-weight: 800; letter-spacing: -.02em; }
.t-captura:hover .cadena { animation: correr .8s linear infinite; }
@keyframes correr { to { stroke-dashoffset: -18; } }

/* Nosotros: rosa de la app, letra del sistema */
.t-nosotros { --fondo: #fff1f2; --arte: #ffe4e6; --texto: #2a1519; --suave: #7c5a60; --acento: #be123c; --sobre-acento: #fff; --letra: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.t-nosotros h3 { font-weight: 800; letter-spacing: -.01em; }
.t-nosotros .latido { transform-box: fill-box; transform-origin: center; }
.t-nosotros:hover .latido { animation: latido .9s ease-in-out infinite; }
@keyframes latido { 0%, 100% { transform: scale(1); } 20% { transform: scale(1.18); } 40% { transform: scale(1); } 60% { transform: scale(1.1); } }

/* Cuadro de descarga: toma el tema de la card que lo abre */
:where(.dialogo) { --fondo: #fff; --arte: #eee; --texto: #111; --suave: #555; --acento: #333; --letra: "Bricolage Grotesque", sans-serif;  --titulo: var(--letra); --radio: 4px; }
.dialogo {
  width: min(380px, calc(100vw - 32px)); padding: 0; border: 0;
  background: var(--fondo); color: var(--texto); font-family: var(--letra);
  border-radius: var(--radio); box-shadow: var(--sombra-2);
}
.dialogo[open] { animation: aparecer .24s cubic-bezier(.3, 1.4, .5, 1); }
.dialogo::backdrop { background: rgba(29, 26, 22, .38); }
@keyframes aparecer { from { opacity: 0; transform: translateY(12px) scale(.96); } }
.dialogo-caja { position: relative; padding: 20px 20px 18px; }
.dialogo-sobre { margin: 0; font-size: 13px; color: var(--suave); }
.dialogo h2 { margin: 2px 40px 14px 0; font-family: var(--titulo); font-size: 26px; line-height: 1.1; }
.archivos { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.archivos a {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 12px;
  padding: 11px 14px; border-radius: min(var(--radio), 12px);
  background: var(--arte); color: var(--texto); text-decoration: none;
  transition: transform .15s;
}
.archivos a:hover, .archivos a:focus-visible { transform: translateX(3px); outline: 2px solid var(--acento); outline-offset: 0; }
.archivos .nombre { font-weight: 700; font-size: 15px; overflow-wrap: anywhere; }
.archivos .que { grid-column: 1; font-size: 13px; color: var(--suave); }
.archivos .peso { grid-column: 1; font-size: 12px; color: var(--suave); }
.archivos svg { grid-column: 2; grid-row: 1 / span 3; width: 22px; height: 22px; fill: none; stroke: var(--acento); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.cerrar { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--texto); cursor: pointer; }
.cerrar:hover, .cerrar:focus-visible { background: var(--arte); outline: none; }
.cerrar svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.dialogo.t-cabina h2 { font-size: 34px; font-weight: 400; }
.dialogo.t-cabina .archivos svg, .dialogo.t-cabina .archivos a:hover { stroke: #ff6b5e; outline-color: #ff6b5e; }
.dialogo.t-luces .archivos svg { stroke: #4aa8ff; }

/* Pie */
.pie-sitio { max-width: 760px; margin: 0 auto; padding: 24px 20px 56px; text-align: center; color: var(--tinta-2); font-size: 14px; }
.pie-sitio .gota { width: 16px; height: 20px; fill: var(--tinta); }
.pie-sitio p { margin: 8px 0 0; }

/* Celular: dos columnas compactas */
@media (max-width: 600px) {
  .top { padding: 70px 16px 12px; }
  .acciones { top: 14px; right: 14px; }
  .bajada { font-size: 15.5px; }
  main { padding: 0 14px 28px; }
  .grupo { margin: 30px 2px 14px; font-size: 14px; }
  .grilla { --cols: 2; --gap: 14px; }
  .card { border-radius: min(var(--radio), 12px); }
  .cuerpo { padding: 10px 11px 12px; }
  .card h3 { font-size: 17px; }
  .t-cabina h3 { color: #fff; }
  .card p { font-size: 12.5px; line-height: 1.4; margin-bottom: 10px; }
  .pie { font-size: 11px; gap: 6px; }
  .tag { padding: 2px 7px; white-space: normal; }
  .dom { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Al tintero: la gota del logo abre un minijuego */
.gota-boton {
  all: unset; display: inline-block; cursor: pointer; line-height: 0;
  position: relative; border-radius: 6px; -webkit-tap-highlight-color: transparent;
}
.gota-boton::after { content: ""; position: absolute; inset: -16px -10px -6px; } /* área de toque cómoda en el celular */
.gota-boton:focus-visible { outline: 3px solid var(--tinta); outline-offset: 4px; }
.gota-boton:hover .gota { animation-duration: 1.1s; }
.gota-boton.cae .gota { animation: caer .3s cubic-bezier(.5, 0, .9, .4) forwards; }
@keyframes caer { to { transform: translateY(.5em) scaleY(1.2); opacity: 0; } }

.juego {
  width: min(400px, calc(100vw - 24px)); max-height: calc(100dvh - 24px);
  padding: 0; border: 0; border-radius: 6px; overflow: hidden;
  background: var(--papel); color: var(--tinta); box-shadow: var(--sombra-2);
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
}
.juego[open] { animation: aparecer .24s cubic-bezier(.3, 1.4, .5, 1); }
.juego::backdrop { background: rgba(29, 26, 22, .5); }
.juego-caja { position: relative; padding: 16px 16px 16px; }
.marcador { display: flex; align-items: baseline; gap: 6px 16px; flex-wrap: wrap; padding-right: 40px; margin-bottom: 12px; }
.marcador h2 { margin: 0 auto 0 0; font-size: 26px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; width: 100%; }
.marcador p { margin: 0; font-size: 14px; color: var(--tinta-2); }
.marcador b { color: var(--tinta); font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.doble { display: inline-block; margin-left: 2px; padding: 1px 6px; border-radius: 3px; background: var(--tinta); color: var(--papel); font-weight: 800; font-size: 12px; transform: rotate(-4deg); }
.doble[hidden] { display: none; }
.vidas { display: flex; gap: 5px; margin-left: auto !important; align-self: center; }
.vidas svg { width: 12px; height: 15px; fill: var(--tinta); transition: opacity .2s, transform .3s; }
.vidas svg.gastada { opacity: .18; transform: scale(.8); }
.juego .cerrar { top: 10px; right: 10px; color: var(--tinta); }
.juego .cerrar:hover, .juego .cerrar:focus-visible { background: var(--linea); }
.tablero { position: relative; border-radius: 4px; overflow: hidden; box-shadow: 0 0 0 2px var(--tinta); }
.tablero canvas { display: block; width: 100%; height: auto; max-height: calc(100dvh - 140px); aspect-ratio: 3 / 4; object-fit: contain; touch-action: none; cursor: none; background: #fffdf8; }
.tablero canvas:focus-visible { outline: none; }
.aviso {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; text-align: center; background: rgba(255, 253, 248, .86);
}
.aviso[hidden] { display: none; }
.aviso h3 { margin: 0; font-size: 34px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.aviso p { margin: 10px 0 0; max-width: 24em; color: var(--tinta-2); font-size: 15.5px; text-wrap: pretty; }
.aviso button {
  margin-top: 20px; padding: 11px 22px; border: 0; border-radius: 4px; cursor: pointer;
  background: var(--tinta); color: var(--papel); box-shadow: var(--sombra-1);
  font: 500 16px "Bricolage Grotesque", system-ui, sans-serif;
  transition: transform .22s cubic-bezier(.3, 1.6, .5, 1), box-shadow .22s;
}
.aviso button:hover, .aviso button:focus-visible { transform: translateY(-2px) rotate(-1.2deg); box-shadow: var(--sombra-2); outline: none; }
