/* The prints that slide in from the pointer's side: four square prints on warm white, one accent. */
:root {
  --fondo: #f4f1ea;      /* warm white paper */
  --inchiostro: #1b1a17; /* the titles */
  --nota: #9a948a;       /* the caption */
  --filo: rgba(27, 26, 23, 0.08); /* the hairline around each print */
  /* the plain prints, in stone tones */
  --pietra-1: #ebe5da;
  --pietra-2: #dad1c2;
  --pietra-3: #c2b7a4;
  --pietra-4: #958a77;
  /* the colour takes, all in the one accent */
  --accento-1: #f7dccb;
  --accento-2: #f0a682;
  --accento-3: #e5733f;
  --accento: #d9542b;    /* the one accent */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.scena {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.palco {
  --lato: min(34vw, 31vh, 216px);   /* one print: measured on the width and on the height */
  --spazio: clamp(8px, 1.5vmin, 14px);
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 2.4vh, 20px);
}

.griglia {
  display: grid;
  grid-template-columns: repeat(2, var(--lato));
  grid-auto-rows: var(--lato);
  gap: var(--spazio);
  touch-action: none;
}

/* the cell is what the script measures; the print inside it is what moves */
.cella { position: relative; }

.tessera {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 3px;
  background: var(--pietra-1);
  box-shadow: 0 0 0 1px var(--filo), 0 10px 24px -14px rgba(27, 26, 23, 0.28);
  cursor: pointer;
  will-change: transform;
}

.foto {
  position: absolute;
  inset: 0;
  will-change: transform;
}
.foto > svg { display: block; width: 100%; height: 100%; }

/* the colour take: the script gives it a soft shadow on its edges only while it travels, so it reads as a sheet sliding over the plain one */

.titolo {
  position: absolute;
  left: 9%;
  top: 8%;
  display: flex;
  align-items: center;
  gap: 0.4em;
  font-size: clamp(10px, calc(var(--lato) * 0.075), 15px);
  font-weight: 560;
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--inchiostro);
  white-space: nowrap;
}
.freccia {
  width: 0.95em;
  height: 0.95em;
  flex: none;
}
.freccia path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.didascalia {
  display: flex;
  justify-content: space-between;
  font-size: clamp(10px, min(2.8vw, 2.2vh), 12px);
  letter-spacing: 0.02em;
  color: var(--nota);
}

@media (prefers-reduced-motion: reduce) {
  .tessera, .foto { will-change: auto; }
}
