/* The service cards with the ellipses that make a sphere on scroll. Colours in :root (the Playground palette): ink
   black, the warm white of the lines and one accent, the amber of the light. The panel is drawn at its own size and
   scaled to fit the stage (the scale goes on .cornice, GSAP never touches it). */
:root {
  --fondo: #0b0c0d;          /* the page */
  --fondo-alto: #16181a;     /* the soft light behind the panel */
  --carta: #121416;          /* the cards */
  --carta-alta: #181b1e;     /* the top of the cards, where the light falls */
  --linea: rgba(255, 255, 255, 0.075); /* hairlines and the resting edge */
  --tratto: #ece9e2;         /* the lines of the drawings and the words */
  --tenue: #8c8a84;          /* the small words */
  --spento: #55544f;         /* the labels */
  --accento: #ffb36b;        /* the light: the lit edge, the dashed ring, the square */
}

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

.corsa { position: relative; height: 420vh; }
.palco {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  isolation: isolate;
}
@supports (height: 100lvh) { .palco { height: 100lvh; } }
.alone {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 55% at 50% 38%, var(--fondo-alto), transparent 72%),
    radial-gradient(40% 30% at 50% 100%, rgba(255, 179, 107, 0.05), transparent 70%);
}
.grana {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

/* the panel, drawn at its own size and scaled by the script */
.cornice { position: relative; flex: none; width: 1082px; transform-origin: 50% 50%; }

.testa {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 0 4px 26px;
}
.marchio {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 560;
  font-stretch: 105%;
  letter-spacing: -0.01em;
}
.marchio__segno { width: 18px; height: 18px; fill: none; stroke: var(--tratto); stroke-width: 1.3; }
.marchio__ruolo {
  margin-left: 6px;
  padding-left: 10px;
  border-left: 1px solid var(--linea);
  font-family: 'Geist Mono Variable', ui-monospace, monospace;
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tenue);
}
.titolo {
  margin-top: 14px;
  font-size: 40px;
  line-height: 1;
  font-weight: 450;
  font-stretch: 96%;
  letter-spacing: -0.035em;
}

.parla {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px 0 18px;
  border-radius: 999px;
  color: var(--tratto);
  text-decoration: none;
  font-size: 13px;
  font-weight: 520;
  isolation: isolate;
  flex: none;
}
.parla__fondo {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(180deg, #1d2023, #141618);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 8px 22px -10px rgba(0, 0, 0, 0.8);
}
.parla__freccia { width: 14px; height: 14px; fill: none; stroke: var(--accento); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.pista { display: flex; gap: 14px; will-change: transform; }

.carta {
  --luce: 0;               /* the scroll light, 0 to 1 (the script) */
  --bordo: 0;              /* the lit edge, 0 to 1 (the script) */
  --mx: 50%;
  --my: 0%;
  position: relative;
  flex: none;
  width: 260px;
  height: 392px;
  padding: 18px 18px 16px;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--carta-alta), var(--carta) 46%);
  box-shadow:
    inset 0 0 0 1px var(--linea),
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 1px 1px rgba(0, 0, 0, 0.4),
    0 18px 40px -18px rgba(0, 0, 0, 0.85),
    0 40px 80px -40px rgba(0, 0, 0, 0.7);
  outline: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.carta__luce {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: calc(var(--luce) * 0.9 + var(--bordo) * 0.3);
  background:
    radial-gradient(70% 46% at 50% 36%, rgba(255, 179, 107, 0.09), transparent 70%),
    radial-gradient(120px circle at var(--mx) var(--my), rgba(255, 220, 180, 0.06), transparent 70%);
}
.carta__bordo {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  opacity: var(--bordo);
  background:
    radial-gradient(220px circle at var(--mx) var(--my), rgba(255, 196, 140, 0.95), rgba(255, 179, 107, 0.18) 45%, transparent 75%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 40%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.carta:focus-visible .carta__bordo { opacity: 1; }

.carta__riga { display: flex; align-items: center; justify-content: space-between; height: 16px; }
.carta__etichetta {
  font-family: 'Geist Mono Variable', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--spento);
}
.carta__freccia { width: 14px; height: 14px; fill: none; stroke: var(--tenue); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

.figura {
  position: relative;
  width: 176px;
  height: 176px;
  margin: 18px auto 20px;
}
.figura svg { display: block; width: 100%; height: 100%; overflow: visible; }
.figura__anello {
  fill: none;
  stroke: var(--tratto);
  stroke-width: 1.1;
  stroke-dasharray: 1.1 2.4;
  opacity: 0.55;
  transform-box: fill-box;
  transform-origin: center;
}
.figura [data-disegno] { fill: none; stroke: var(--tratto); stroke-linecap: round; }
.figura .fisso { opacity: 0.32; }
.figura .quadro { fill: var(--accento); stroke: none; }
.figura .anello-luce { fill: none; stroke: var(--accento); stroke-width: 1.1; stroke-dasharray: 1.1 2.4; transform-box: fill-box; transform-origin: center; }

.carta__nome {
  font-size: 21px;
  line-height: 1.05;
  font-weight: 480;
  font-stretch: 100%;
  letter-spacing: -0.025em;
}
.carta__frase {
  margin-top: 7px;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--tenue);
  max-width: 21em;
}
.dati { margin-top: auto; }
.dato {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 7px 0 0;
  margin-top: 7px;
  border-top: 1px solid var(--linea);
  font-size: 11.5px;
}
.dato dt { color: var(--tenue); }
.dato dd { font-variant-numeric: tabular-nums; font-weight: 520; }

/* narrow stages: the cards slide past in a row, the header stacks */
.cornice.is-pista .testa { flex-direction: column; align-items: flex-start; gap: 0; padding-bottom: 20px; }
.cornice.is-pista .titolo { font-size: 30px; }
.cornice.is-pista .parla { display: none; }

@media (hover: hover) {
  .parla:hover .parla__fondo { background: linear-gradient(180deg, #23272a, #181a1d); }
}
