/* App screens that fan out as you scroll. Colours in :root (the Playground palette). */
:root {
  --fondo: #f5f2ec;
  --inchiostro: #1d1c1a;
  --tenue: #8a8780;
  --linea: #e6e2da;
  --schermo: #ffffff;
  --accento: #3a5bff;
  --ombra: 24, 20, 14;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--fondo); }
body {
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: 'Mona Sans Variable', 'Mona Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.corsa { position: relative; height: 500vh; }
.palco {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100lvh;
  max-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(4px, 1.4vh, 14px);
  padding: clamp(12px, 3vh, 30px) clamp(14px, 3vw, 40px);
  overflow: hidden;
}

.testa { display: flex; justify-content: space-between; align-items: center; font-size: clamp(11px, 1.8vh, 14px); }
.marchio { display: flex; align-items: center; gap: 7px; font-weight: 640; font-stretch: 108%; letter-spacing: -.01em; }
.marchio svg { width: 1.5em; height: 1.5em; fill: none; stroke: var(--accento); stroke-width: 2; stroke-linecap: round; }
.testa__lato { color: var(--tenue); }

/* the stage: the pile sits in the middle, the screens are positioned by GSAP from its centre */
.scena { position: relative; min-height: 0; }
.pila { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }

.schermo {
  --d: 0;
  --spento: 0;
  position: absolute;
  left: calc(var(--w, 150px) / -2);
  top: calc(var(--h, 300px) / -2);
  width: var(--w, 150px);
  height: var(--h, 300px);
  border-radius: calc(var(--w, 150px) * .13);
  background: var(--schermo);
  border: 1px solid rgba(var(--ombra), .08);
  /* the shadow grows with the depth --d (0 lying in the pile, 1 lifted to the front) */
  box-shadow:
    0 calc(1px + var(--d) * 2px) calc(2px + var(--d) * 4px) rgba(var(--ombra), calc(.05 + var(--d) * .04)),
    0 calc(6px + var(--d) * 22px) calc(14px + var(--d) * 40px) rgba(var(--ombra), calc(.07 + var(--d) * .11));
  overflow: hidden;
  container-type: inline-size;
  will-change: transform;
}
/* a light sheen across the glass, a little stronger at the front */
.schermo::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(125deg, rgba(255, 255, 255, calc(.0 + var(--d) * .35)) 0%, rgba(255, 255, 255, 0) 38%);
}
/* the screens behind are dimmed by a veil of the background colour, never made see-through */
.schermo::before {
  content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none; border-radius: inherit;
  background: var(--fondo); opacity: var(--spento, 0);
}
.schermo__dentro {
  height: 100%;
  padding: 7cqw 8cqw;
  display: flex; flex-direction: column; gap: 3.2cqw;
  font-size: 6.4cqw;
}

.barra { display: flex; justify-content: space-between; align-items: center; font-size: 5.2cqw; font-weight: 600; margin-bottom: 1.5cqw; }
.barra__icone { width: 14cqw; height: 3.4cqw; border-radius: 2cqw; background: linear-gradient(90deg, var(--inchiostro) 0 62%, transparent 62% 70%, var(--inchiostro) 70% 100%); opacity: .8; }
.piccolo { font-size: 5.4cqw; color: var(--inchiostro); }
.chiaro { color: var(--tenue); }
.titolo { font-size: 10cqw; font-weight: 640; letter-spacing: -.02em; font-stretch: 104%; }

.saldo { background: var(--inchiostro); color: #fff; border-radius: 6cqw; padding: 5cqw 6cqw 3cqw; display: grid; gap: 1cqw; }
.saldo .chiaro { color: rgba(255, 255, 255, .6); }
.saldo__cifra { font-size: 11cqw; font-weight: 620; letter-spacing: -.02em; }
.saldo__cifra.scuro { color: var(--inchiostro); }
.linea { width: 100%; height: 11cqw; overflow: visible; }
.linea path { fill: none; stroke: var(--accento); stroke-width: 2.2; stroke-linecap: round; vector-effect: non-scaling-stroke; }

.azioni { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5cqw; }
.azione { display: grid; justify-items: center; gap: 1.4cqw; font-size: 4.8cqw; color: var(--tenue); }
.azione svg { width: 11cqw; height: 11cqw; padding: 2.4cqw; border-radius: 50%; background: #f1eee8; fill: none; stroke: var(--inchiostro); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.riga { display: flex; align-items: center; gap: 3cqw; padding: 2.2cqw 0; border-bottom: 1px solid var(--linea); font-size: 5.6cqw; }
.riga__icona { display: grid; place-items: center; width: 9.5cqw; height: 9.5cqw; border-radius: 2.6cqw; background: #f1eee8; flex: none; }
.riga__icona svg { width: 62%; height: 62%; fill: none; stroke: var(--inchiostro); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.riga__icona.accento { background: color-mix(in srgb, var(--accento) 14%, #fff); }
.riga__icona.accento svg { stroke: var(--accento); }
.riga__nome { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.riga__cifra { font-weight: 600; white-space: nowrap; }
.riga__cifra.piu { color: var(--accento); }

.filtri { display: flex; gap: 2cqw; }
.filtro { font-size: 5cqw; padding: 1.4cqw 4cqw; border-radius: 9cqw; border: 1px solid var(--linea); color: var(--tenue); }
.filtro.attivo { background: var(--inchiostro); border-color: var(--inchiostro); color: #fff; }

.barre { width: 100%; height: auto; overflow: visible; }
.barre rect { fill: #e3ded4; transform-box: fill-box; transform-origin: 50% 100%; }
.barre .barra-alta { fill: var(--accento); }
.barre__base { stroke: var(--linea); stroke-width: 1; }
.giorni { display: grid; grid-template-columns: repeat(7, 1fr); font-size: 4.6cqw; color: var(--tenue); text-align: center; margin-top: -2cqw; }

.profilo { display: flex; align-items: center; gap: 3.5cqw; padding: 2cqw 0 3cqw; }
.profilo__foto { display: grid; place-items: center; width: 14cqw; height: 14cqw; border-radius: 50%; background: color-mix(in srgb, var(--accento) 16%, #fff); color: var(--accento); font-size: 5.4cqw; font-weight: 650; }
.profilo b { display: block; font-size: 6cqw; font-weight: 620; }
.profilo i { display: block; font-style: normal; font-size: 4.8cqw; color: var(--tenue); }
.leva { position: relative; width: 14cqw; height: 8cqw; border-radius: 8cqw; background: #e3ded4; flex: none; transition: background .3s; }
.leva i { position: absolute; top: 1cqw; left: 1cqw; width: 6cqw; height: 6cqw; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .18); }
.leva.acceso { background: var(--accento); }
.leva.acceso i { left: 7cqw; }

/* the caption: the app name, then one line that rolls like a drum */
.didascalia { display: grid; justify-items: center; gap: 2px; text-align: center; padding-bottom: clamp(2px, 1vh, 10px); }
.didascalia__nome { font-size: clamp(10px, 1.6vh, 13px); color: var(--tenue); }
.didascalia__rullo { position: relative; display: block; height: 1.25em; overflow: hidden; font-size: clamp(17px, min(4.4vh, 5.6vw), 34px); font-weight: 600; font-stretch: 104%; letter-spacing: -.02em; line-height: 1.25em;
  -webkit-mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent); mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent); }
.didascalia__righe { display: flex; flex-direction: column; }
.didascalia__righe span { display: block; height: 1.25em; white-space: nowrap; }
