/* The shattering frame: a gallery wall, one framed painting behind glass, a floor for the shards.
   Every colour is a variable here; the glass and the shards read --glass and --shine. */
:root {
  --wall: #1f2a27;          /* the gallery wall */
  --wall-light: #2f3d39;    /* the light from the spot on the wall */
  --floor: #2a1d16;         /* the oak floor */
  --floor-light: #4a3426;   /* the floor near the wall */
  --skirting: #11100e;      /* the skirting board */
  --frame: #1b1512;         /* the moulding of the frame */
  --frame-edge: #6b5340;    /* its gilded inner lip */
  --mat: #f1ece2;           /* the mat round the painting */
  --label: #f4efe6;         /* the label card */
  --ink: #1d1b18;           /* the writing on the label */
  --ink-soft: #6f675d;      /* the quieter lines */
  --text: #e9e4d8;          /* the writing on the wall */
  --glass: #cfe7e1;         /* the green tint of the glass */
  --shine: #ffffff;         /* reflections, glints and cracks */

  --floor-h: clamp(64px, 15svh, 160px);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--wall);
  overflow: hidden;
  color: var(--text);
  font-family: 'Instrument Sans Variable', 'Instrument Sans', system-ui, sans-serif;
}

.sala {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: radial-gradient(60% 55% at 50% 38%, var(--wall-light), var(--wall) 70%);
}

.linea { display: block; overflow: hidden; padding-bottom: 0.08em; }
.linea > span { display: block; will-change: transform; }

/* the name of the gallery, top left, and the show, top right */
.testata {
  position: absolute;
  inset: 0 0 auto 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: clamp(16px, 3.4svh, 34px) clamp(16px, 4vw, 48px) 0;
  z-index: 2;
}
.testata p { margin: 0; }
.testata__nome {
  font-family: 'Newsreader Variable', 'Newsreader', Georgia, serif;
  font-size: clamp(19px, 2.2vw, 26px);
  font-weight: 500;
  letter-spacing: -0.01em;
}
.testata__mostra {
  font-size: clamp(11px, 1.05vw, 13px);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.66;
  text-align: right;
}

/* the floor: the shards land here */
.pavimento {
  position: absolute;
  inset: auto 0 0 0;
  height: var(--floor-h);
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.18) 0 1px, transparent 1px 140px),
    linear-gradient(180deg, var(--floor-light), var(--floor) 70%);
  border-top: 8px solid var(--skirting);
}

.parete {
  position: absolute;
  inset: 0 0 var(--floor-h) 0;
  display: grid;
  place-items: center;
  padding: clamp(56px, 9svh, 96px) 16px 16px;
}

.appeso {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(14px, 2.4svh, 22px);
}

/* the frame is the button: moulding, gilded lip, then the opening the glass covers */
.cornice {
  display: block;
  margin: 0;
  border: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  width: min(76vw, 42svh);
  aspect-ratio: 4 / 5;
  padding: clamp(10px, 3.2%, 18px);
  border-radius: 2px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent 30%, transparent 70%, rgba(0, 0, 0, 0.4)),
    var(--frame);
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.06) inset,
    0 28px 50px -18px rgba(0, 0, 0, 0.7),
    0 10px 18px -8px rgba(0, 0, 0, 0.5);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.5s ease;
  -webkit-tap-highlight-color: transparent;
}
.cornice:focus-visible { outline: 2px solid var(--text); outline-offset: 6px; }
.cornice__luce {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  padding: 11%;
  background: var(--mat);
  box-shadow: 0 0 0 3px var(--frame-edge), 0 0 0 4px rgba(0, 0, 0, 0.5), inset 0 3px 8px rgba(0, 0, 0, 0.25);
}
.opere {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18), inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.opera { position: absolute; inset: 0; width: 100%; height: 100%; display: block; visibility: hidden; }
.opera:first-child { visibility: visible; }

@media (hover: hover) {
  .cornice:hover {
    transform: translateY(-4px);
    box-shadow:
      0 2px 0 rgba(255, 255, 255, 0.06) inset,
      0 40px 60px -20px rgba(0, 0, 0, 0.75),
      0 14px 22px -10px rgba(0, 0, 0, 0.5);
  }
}

/* the label card next to the painting */
.cartellino {
  width: min(76vw, 300px);
  padding: 12px 16px 13px;
  background: var(--label);
  color: var(--ink);
  border-radius: 2px;
  box-shadow: 0 10px 20px -12px rgba(0, 0, 0, 0.6);
  text-align: left;
}
.cartellino p { margin: 0; }
.cartellino__titolo {
  font-family: 'Newsreader Variable', 'Newsreader', Georgia, serif;
  font-style: italic;
  font-size: 19px;
  line-height: 1.15;
  font-weight: 500;
}
.cartellino__autore { font-size: 13px; font-weight: 600; margin-top: 4px !important; }
.cartellino__tecnica { font-size: 12.5px; color: var(--ink-soft); }
.cartellino__indizio {
  margin-top: 9px !important;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.su-dito { display: none; }
@media (hover: none) {
  .su-mouse { display: none; }
  .su-dito { display: inline; }
}

/* wide screens: the label hangs to the right of the frame, at its bottom */
@media (min-aspect-ratio: 5 / 4) {
  .cornice { width: auto; height: min(64svh, 720px); }
  .cartellino {
    position: absolute;
    left: calc(100% + clamp(24px, 3vw, 44px));
    bottom: 6px;
    width: clamp(170px, 17vw, 230px);
  }
  .cartellino__titolo { font-size: clamp(17px, 1.5vw, 21px); }
}

.vetro { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; }
