:root {
  --fondo: #f6f6f4;
  --inchiostro: #141414;
  --grigio: #6b6b6b;
  --grigio-chiaro: #a3a3a3;
  --card: #ffffff;
  --bordo: rgba(20, 20, 20, 0.08);
  --tinta: #141414;
  --tinta-fondo: rgba(20, 20, 20, 0.04);
  --tinta-bordo: rgba(20, 20, 20, 0.16);
  --ombra: 0 1px 2px rgba(20, 20, 20, 0.04), 0 10px 30px -14px rgba(20, 20, 20, 0.18);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: hidden;
}

/* a faint glow in the colour of the chosen word, behind the headline */
.stage::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 38%;
  width: min(70vw, 620px);
  height: min(40vh, 300px);
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, var(--tinta-fondo), transparent);
  transition: background 0.6s ease;
  pointer-events: none;
}

.sezione {
  position: relative;
  width: min(100%, 860px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(10px, 2.4vh, 22px);
}

.occhiello {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px 5px 8px;
  border: 1px solid var(--bordo);
  border-radius: 999px;
  background: var(--card);
  font-size: 12.5px;
  font-weight: 560;
  color: var(--grigio);
  box-shadow: 0 1px 2px rgba(20, 20, 20, 0.04);
}

.occhiello__segno { width: 14px; height: 14px; fill: none; stroke: var(--inchiostro); stroke-width: 1.5; stroke-linecap: round; }

.titolo {
  font-size: clamp(26px, min(7.2vw, 9.4vh), 68px);
  line-height: 1.04;
  letter-spacing: -0.035em;
  font-weight: 640;
  font-stretch: 96%;
}

.riga { display: block; white-space: nowrap; }

.parola {
  position: relative;
  display: inline-block;
  height: 1.12em;
  vertical-align: bottom;
  overflow: hidden;
  color: var(--tinta);
  transition: color 0.5s ease;
}

.parola__dentro { position: absolute; left: 0; top: 0; white-space: nowrap; }

.lettera {
  display: inline-block;
  --w: 640;
  font-variation-settings: "wght" var(--w);
  will-change: transform;
}

.punto { color: var(--inchiostro); }

/* hidden twin of the headline: measures the next word */
.misura {
  position: absolute;
  visibility: hidden;
  pointer-events: none;
  white-space: nowrap;
  left: -9999px;
  top: 0;
}

.card {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  margin-top: clamp(4px, 1.4vh, 14px);
}

.c {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 14px 14px 13px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--bordo);
  box-shadow: var(--ombra);
  text-align: left;
  cursor: pointer;
  outline: none;
  --c: #141414;
  --c-fondo: rgba(20, 20, 20, 0.04);
  --c-bordo: rgba(20, 20, 20, 0.16);
}

/* the tint lives on a child, so GSAP can lift the card without fighting the CSS */
.c::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--c-fondo);
  border: 1px solid var(--c-bordo);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.c.is-on::before { opacity: 1; }

.c__icona {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--grigio);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  margin-bottom: 8px;
  transition: stroke 0.35s ease;
}

.c.is-on .c__icona { stroke: var(--c); }

.c__nome { font-size: 14px; font-weight: 620; letter-spacing: -0.01em; position: relative; }
.c__riga { font-size: 12px; color: var(--grigio); position: relative; line-height: 1.3; }

.c__freccia {
  position: absolute;
  right: 12px;
  top: 14px;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--c);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
}

.c:focus-visible { box-shadow: var(--ombra), 0 0 0 2px var(--c-bordo); }

.nota { font-size: 12.5px; color: var(--grigio-chiaro); }

.ghost {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  fill: #111;
  stroke: #fff;
  stroke-width: 1.2;
  stroke-linejoin: round;
  opacity: 0;
  pointer-events: none;
  z-index: 5;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2));
}

@media (max-width: 620px) {
  .card { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .c { padding: 10px 11px 10px; border-radius: 13px; }
  .c__icona { width: 18px; height: 18px; margin-bottom: 4px; }
  .c__nome { font-size: 12.5px; }
  .c__riga { font-size: 10.5px; }
  .c__freccia { right: 9px; top: 10px; width: 12px; height: 12px; }
  .nota { font-size: 11px; }
}

@media (max-height: 470px) {
  .c__riga { display: none; }
  .c__icona { margin-bottom: 2px; }
  .nota { display: none; }
}
