/* Grandma · próximamente. The wall, the sticker bomb, the box logo and the abuelita are drawn in
   WebGL (motor.js). The only HTML on top is her pixel speech bubble. */

:root {
  --k: #1C1B19;
  --o: #E0561F;
  --pared: #8E8A83;
  --pixel: "Silkscreen", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--pared);
  color: var(--k);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

#lienzo {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: block;
  touch-action: none;
  cursor: copy;
}

.capa {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.solo-lector {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* the abuelita's pixel speech bubble, in the stickers' own language */
.globo {
  position: absolute;
  left: 0;
  top: 0;
  max-width: min(380px, 40vw);
  padding: 14px 18px 12px;
  background: #fff;
  color: #111;
  font: 700 clamp(13px, 1.45vw, 22px)/1.35 var(--pixel);
  letter-spacing: 0.02em;
  box-shadow:
    -4px 0 0 0 #111, 4px 0 0 0 #111, 0 -4px 0 0 #111, 0 4px 0 0 #111,
    8px 8px 0 0 rgba(28, 27, 25, 0.35);
  transform-origin: 100% 100%;
  will-change: transform;
}
.globo[hidden] { display: none; }
.globo::after {
  /* stepped tail, bottom right, pointing at her */
  content: "";
  position: absolute;
  right: -4px;
  bottom: -16px;
  width: 4px;
  height: 4px;
  background: #111;
  box-shadow:
    -4px 0 0 #fff, -8px 0 0 #fff, -12px 0 0 #111,
    0 4px 0 #111, -4px 4px 0 #fff, -8px 4px 0 #111,
    4px 8px 0 #111, 0 8px 0 #111, -4px 8px 0 #111,
    -16px -4px 0 #111, -12px -4px 0 #fff, -8px -4px 0 #fff, -4px -4px 0 #fff, 0 -4px 0 #fff;
}
.globo.arriba::after { right: auto; left: 40%; }
.globo .cursor {
  display: inline-block;
  width: 0.6em;
  height: 1em;
  margin-left: 2px;
  vertical-align: -0.12em;
  background: #111;
  animation: parpadeo 1s steps(1) infinite;
}
.globo.pop { animation: pop 0.32s steps(5, end); }
@keyframes pop {
  0% { scale: 0.2; }
  60% { scale: 1.08; }
  100% { scale: 1; }
}
@keyframes parpadeo { 50% { opacity: 0; } }

/* no WebGL: a still version */
.estatico { display: none; }
body.sin-gl .estatico { display: block; }
.caja-img {
  position: absolute;
  left: 50%; top: 32%;
  width: min(86vw, 820px);
  transform: translate(-50%, -50%) rotate(-4deg);
  box-shadow: 4px 8px 14px rgba(0, 0, 0, 0.35);
}
.abuela-img {
  position: absolute;
  right: 8vw; bottom: 2vh;
  height: 60vh;
  filter: drop-shadow(3px 6px 6px rgba(0, 0, 0, 0.35));
}

.cesar-img {
  position: absolute;
  right: 14px; bottom: 12px;
  width: min(22vh, 30vw);
  pointer-events: auto;
  transform: rotate(7deg);
  filter: drop-shadow(2px 5px 5px rgba(0, 0, 0, .35));
}
.cesar-img img { display: block; width: 100%; height: auto; }

.conejo-img {
  position: absolute;
  right: 14px; top: 12px;
  width: min(16vh, 22vw);
  pointer-events: auto;
  transform: rotate(6deg);
  filter: drop-shadow(2px 5px 5px rgba(0, 0, 0, .35));
}
.conejo-img img { display: block; width: 100%; height: auto; }

.cometa-img {
  position: absolute;
  left: 14px; top: 12px;
  width: min(16vh, 22vw);
  pointer-events: auto;
  transform: rotate(-6deg);
  filter: drop-shadow(2px 5px 5px rgba(0, 0, 0, .35));
}
.cometa-img img { display: block; width: 100%; height: auto; }

.pug-img {
  position: absolute;
  left: 14px; top: 55%;
  width: min(15vh, 21vw);
  pointer-events: auto;
  transform: translateY(-50%) rotate(5deg);
  filter: drop-shadow(2px 5px 5px rgba(0, 0, 0, .35));
}
.pug-img img { display: block; width: 100%; height: auto; }

@media (max-width: 760px), (max-aspect-ratio: 3/4) {
  .globo { font-size: 12px; padding: 10px 12px 8px; max-width: 58vw; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01s !important; animation-duration: 0.01s !important; }
}
