/* Wedding prints hung on a line with wooden pegs: the proofs wall of Ines Calder, a made-up wedding photographer.
   A warm plaster wall in the light of a window, a twine line across it, six real prints on wooden pegs. Every
   position on the wall is written by the script: the line, the pegs, the prints and their shadows. */
:root {
  --muro: #f1eadf;          /* the warm plaster wall */
  --luce: #fdf9f2;          /* the window light on the wall */
  --inchiostro: #1d1915;    /* the words */
  --tenue: #8d8478;         /* the small words */
  --carta: #fbf8f2;         /* the photo paper around each picture */
  --spago: #b89a74;         /* the twine */
  --spago-scuro: #8c6f4d;   /* the twist of the twine */
  --accento: #a4573a;       /* one terracotta accent */
  --ombra: 52, 38, 24;      /* the colour of the shadows on the wall */
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

body {
  background:
    radial-gradient(90% 70% at 14% 0%, var(--luce) 0%, rgba(253, 249, 242, 0) 64%),
    radial-gradient(70% 60% at 100% 100%, rgba(164, 87, 58, 0.07), rgba(164, 87, 58, 0) 70%),
    var(--muro);
  color: var(--inchiostro);
  font-family: 'Mona Sans Variable', 'Mona Sans', 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* the plaster grain, so the wall is never flat */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: 0.38;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.45 0 0 0 0 0.39 0 0 0 0 0.31 0 0 0 0.3 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.palco {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  overflow: hidden;
}

/* ------------------------------------------------------------ the words around the wall */
.testa,
.piede {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 6;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 0 clamp(14px, 4vw, 52px);
  pointer-events: none;
}

.testa { top: clamp(10px, 3.4vh, 30px); }
.piede { bottom: clamp(10px, 3.4vh, 28px); }

.testa p,
.piede p {
  margin: 0;
  font-size: clamp(10.5px, min(1.35vw, 2.1vh), 13.5px);
  letter-spacing: -0.005em;
  white-space: nowrap;
}

.marchio {
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-weight: 640;
  font-variation-settings: 'wdth' 106;
}

.marchio__segno {
  width: 1.25em;
  height: 1.25em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.marchio__tenue,
.piede__tenue,
.piede__aiuto {
  color: var(--tenue);
  font-weight: 460;
}

.testa__destra { color: var(--tenue); }
.accento { color: var(--accento); font-weight: 560; }

/* ------------------------------------------------------------ the wall: line, pegs, prints */
.banco {
  position: absolute;
  inset: 0;
}

.corde {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  z-index: 2;
  pointer-events: none;
}

.corda {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.corda--base { stroke: var(--spago); }
.corda--torta { stroke: var(--spago-scuro); stroke-opacity: 0.55; }
.corda--lume { stroke: #fff4e2; stroke-opacity: 0.55; }
.corda--ombra { stroke: rgb(var(--ombra)); stroke-opacity: 0.13; }

/* the two brass nails the line is tied to */
.chiodo { fill: url(#ottone); }

.ombre,
.stampe,
.mollette {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* (no z-index on the layers themselves, so the open print can rise above the veil) */
.ombra { z-index: 1; }
.stampa { z-index: 3; }
.molletta { z-index: 4; }
.ombra.in-alto,
.stampa.in-alto { z-index: 9; }

.ombra {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 2px;
  background: rgba(var(--ombra), 0.3);
  filter: blur(9px);
  transform-origin: 50% 0;
}

.stampa {
  position: absolute;
  left: 0;
  top: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: zoom-in;
  pointer-events: auto;
  transform-origin: 50% 0;
  -webkit-tap-highlight-color: transparent;
}

.stampa.is-aperta { cursor: zoom-out; }

.stampa:focus-visible { outline: none; }
.stampa:focus-visible .stampa__carta { box-shadow: 0 0 0 2px var(--muro), 0 0 0 3.5px var(--accento); }

/* the photo paper: a fine white border, a little warmer at the bottom, its edge catching the light */
.stampa__carta {
  position: absolute;
  inset: 0;
  display: block;
  padding: 5.5%;
  padding-bottom: 7%;
  background: linear-gradient(170deg, #fffdf8 0%, var(--carta) 55%, #f1ebdf 100%);
  border-radius: 1.5px;
  box-shadow:
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.9),
    0 0.5px 0.5px rgba(var(--ombra), 0.28),
    0 2px 4px rgba(var(--ombra), 0.12);
}

.stampa__foto {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #d9d0c3;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.12);
}

.stampa__foto img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(0.08) saturate(0.92) contrast(1.03);
}

/* the film grain, painted once by the script */
.stampa__foto::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: var(--grana, none);
  background-size: 140px 140px;
  mix-blend-mode: overlay;
  opacity: var(--grana-forza, 0.5);
}

/* the sheen of the paper: a soft band of window light that slides as the print turns */
.stampa__luce {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0) 30%, rgba(255, 252, 244, 0.32) 46%, rgba(255, 255, 255, 0) 60%);
  background-size: 260% 100%;
  background-position: var(--lume, 60%) 0;
  mix-blend-mode: soft-light;
}

.molletta {
  position: absolute;
  left: 0;
  top: 0;
  filter: drop-shadow(1px 2px 1.4px rgba(52, 38, 24, 0.3));
}

.molletta__disegno {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* ------------------------------------------------------------ the open print */
.velo {
  position: absolute;
  inset: 0;
  z-index: 8;
  background: radial-gradient(80% 80% at 50% 45%, rgba(246, 240, 230, 0.74), rgba(236, 228, 216, 0.84));
  opacity: 0;
  pointer-events: none;
}

.velo.is-acceso { pointer-events: auto; cursor: zoom-out; }

.didascalia {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 10;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25em;
  width: 100%;
  text-align: center;
  pointer-events: none;
  opacity: 0;
}

.didascalia__titolo {
  font-size: clamp(13px, min(1.9vw, 3vh), 20px);
  font-weight: 600;
  font-variation-settings: 'wdth' 104;
  letter-spacing: -0.015em;
}

.didascalia__luogo {
  font-size: clamp(10.5px, min(1.3vw, 2vh), 13px);
  color: var(--tenue);
}

/* the drawn pointer of the autopilot */
.fantasma {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 30;
  width: 22px;
  height: 22px;
  fill: #15120f;
  stroke: #fff;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
  pointer-events: none;
  opacity: 0;
}

@media (hover: hover) {
  .stampa:hover .stampa__carta {
    box-shadow:
      inset 0 0 0 0.5px rgba(255, 255, 255, 0.9),
      0 0.5px 0.5px rgba(var(--ombra), 0.3),
      0 3px 8px rgba(var(--ombra), 0.18);
  }
}

@media (max-width: 440px) {
  .piede__tenue { display: none; }
}
