/* The reading app year in review that builds itself as you scroll. Colours in :root (the Playground palette). */
:root {
  --fondo: #0c0b0f;
  --carta: #16141b;
  --carta-alta: #1e1b24;
  --inchiostro: #f5efe6;
  --secondario: #9c95a5;
  --spento: #3a3542;
  --bordo: rgba(255, 255, 255, 0.08);
  --accento: #f4a85c;
  --accento-caldo: #ff8a5c;
}

* { 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: 420vh; }
.palco {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100lvh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 2vh, 18px);
  padding: clamp(8px, 3vh, 36px) 12px;
  overflow: hidden;
}

/* the warm glow behind the card; its colour leans with the page of the year */
.alone {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(900px, 160vw, 150vh);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(244, 168, 92, 0.16), rgba(244, 168, 92, 0.05) 45%, transparent 72%);
  pointer-events: none;
}

.carta {
  position: relative;
  container-type: inline-size;
  width: min(380px, 90vw, calc(84vh * 0.62));
  aspect-ratio: 0.62;
  border-radius: 7cqw;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(244, 168, 92, 0.1), transparent 60%),
    linear-gradient(180deg, var(--carta-alta), var(--carta));
  border: 1px solid var(--bordo);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 1px 2px rgba(0, 0, 0, 0.5),
    0 22px 50px -18px rgba(0, 0, 0, 0.7),
    0 60px 120px -40px rgba(244, 138, 92, 0.18);
  overflow: hidden;
  isolation: isolate;
}
/* a fine grain over the card */
.carta::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='120' height='120' filter='url(%23n)' opacity='.5'/></svg>");
  opacity: 0.06;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 3;
}
/* the light that sweeps the card when a page is complete */
.luce {
  position: absolute;
  inset: -20% auto -20% 0;
  width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255, 236, 214, 0.1) 45%, rgba(255, 236, 214, 0.18) 50%, rgba(255, 236, 214, 0.1) 55%, transparent);
  transform: translateX(-140%) skewX(-12deg);
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}

.testa { position: relative; padding: 6.5cqw 8cqw 0; z-index: 1; }
.barre { display: flex; gap: 1.4cqw; }
.barra {
  position: relative;
  flex: 1;
  height: max(2px, 0.9cqw);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.barra i {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--inchiostro);
  transform-origin: 0 50%;
  transform: scaleX(0);
}
.marchio {
  display: flex;
  align-items: center;
  gap: 2cqw;
  margin-top: 4.5cqw;
  font-size: 4cqw;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.marchio svg { width: 5.4cqw; height: 5.4cqw; fill: none; stroke: var(--accento); stroke-width: 1.5; stroke-linejoin: round; }
.marchio em {
  margin-left: auto;
  font-style: normal;
  font-weight: 500;
  font-size: 3.2cqw;
  color: var(--secondario);
  padding: 1cqw 2.6cqw;
  border: 1px solid var(--bordo);
  border-radius: 99px;
}

.scene { position: absolute; inset: 22cqw 6cqw 6cqw; z-index: 1; }
.scena {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4cqw;
  text-align: center;
  visibility: hidden;
}
.etichetta {
  font-size: 3.4cqw;
  font-weight: 560;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--secondario);
}
.nota { font-size: 3.6cqw; color: var(--secondario); }
.nota b { color: var(--inchiostro); font-weight: 600; }
.cifra { font-variant-numeric: tabular-nums; }

/* the minutes, inside a ring */
.anello { position: relative; width: 66cqw; aspect-ratio: 1; }
.anello svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.anello circle { fill: none; stroke-width: 7; }
.anello__fondo { stroke: rgba(255, 255, 255, 0.07); }
.anello__tacca { stroke: rgba(255, 246, 232, 0.55); stroke-width: 9; stroke-linecap: round; }
.anello__arco { stroke: var(--accento); stroke-linecap: round; filter: drop-shadow(0 0 4px rgba(244, 168, 92, 0.55)); }
.anello__dentro {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5cqw;
}
.anello__dentro b { font-size: 12.5cqw; font-weight: 620; font-stretch: 108%; letter-spacing: -0.04em; line-height: 1; }
.anello__dentro span { font-size: 3.6cqw; color: var(--secondario); }

/* the genres, as bars */
.generi { list-style: none; width: 100%; display: flex; flex-direction: column; gap: 3.6cqw; }
.genere { display: grid; grid-template-columns: 1fr auto; row-gap: 1.6cqw; text-align: left; }
.genere__nome { font-size: 3.9cqw; font-weight: 540; }
.genere__quota { font-size: 3.9cqw; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--secondario); transition: color 0.3s; }
.genere__pista {
  grid-column: 1 / -1;
  position: relative;
  height: 2.6cqw;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.genere__barra {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(244, 168, 92, 0.55), var(--accento));
  transform-origin: 0 50%;
  transform: scaleX(0);
}
.genere:first-child .genere__barra { background: linear-gradient(90deg, var(--accento), var(--accento-caldo)); box-shadow: 0 0 12px rgba(255, 138, 92, 0.45); }
@media (hover: hover) {
  .genere:hover .genere__quota { color: var(--accento); }
}

/* the streak, in a grid of days */
.grande { display: flex; align-items: baseline; gap: 2cqw; }
.grande b { font-size: 15cqw; font-weight: 620; font-stretch: 108%; letter-spacing: -0.04em; line-height: 1; }
.grande span { font-size: 4cqw; color: var(--secondario); }
.giorni {
  display: grid;
  grid-template-columns: repeat(14, 1fr);
  gap: 1.2cqw;
  width: 100%;
}
.giorno {
  aspect-ratio: 1;
  border-radius: 1.3cqw;
  background: rgba(255, 255, 255, 0.05);
}
.giorno i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--accento);
  opacity: 0;
  transform: scale(0.4);
}
.giorno.serie i { background: linear-gradient(135deg, var(--accento), var(--accento-caldo)); box-shadow: 0 0 6px rgba(255, 138, 92, 0.5); }

/* the summary */
.riassunto { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.6cqw; width: 100%; }
.tessera {
  display: flex;
  flex-direction: column;
  gap: 1cqw;
  padding: 4cqw 2cqw 3.4cqw;
  border-radius: 4cqw;
  border: 1px solid var(--bordo);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.3s;
}
.tessera b { font-size: 8cqw; font-weight: 620; font-stretch: 106%; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.tessera span { font-size: 3cqw; color: var(--secondario); }
@media (hover: hover) {
  .tessera:hover { transform: translateY(-1.2cqw); border-color: rgba(244, 168, 92, 0.4); }
}
.frase { font-size: 4.2cqw; line-height: 1.35; max-width: 22em; color: var(--inchiostro); }
.condividi {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 2cqw;
  padding: 3.2cqw 5.4cqw;
  border: 0;
  border-radius: 99px;
  background: linear-gradient(180deg, #ffd3a3, var(--accento));
  color: #2a1606;
  font: inherit;
  font-size: 3.8cqw;
  font-weight: 640;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 8px 22px -8px rgba(255, 138, 92, 0.7);
}
.condividi svg { width: 4.4cqw; height: 4.4cqw; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.condividi__spunta { position: absolute; right: 5.4cqw; opacity: 0; }
.condividi:focus-visible { outline: 2px solid var(--inchiostro); outline-offset: 3px; }

.invito {
  font-size: clamp(10px, min(1.4vw, 2vh), 13px);
  color: var(--secondario);
  letter-spacing: 0.02em;
}
.piede {
  padding: 40px 20px 60px;
  text-align: center;
  font-size: 12px;
  color: var(--secondario);
}

/* reduced motion: the pages only fade into each other */
@media (prefers-reduced-motion: reduce) {
  .scena { visibility: visible; transition: opacity 0.5s ease; }
}
