/* The markdown note that lays itself out as you scroll. Colours in :root (the Playground palette). */
:root {
  --fondo: #faf8f4;
  --carta: #ffffff;
  --inchiostro: #17161a;
  --spento: #b9b4ab;
  --secondario: #75716a;
  --bordo: rgba(23, 22, 26, 0.08);
  --segno: #a19c93;
  --accento: #4b52d6;
  --accento-tenue: rgba(75, 82, 214, 0.08);
}

* { 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: 300vh; }
.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, 1.8vh, 16px);
  padding: clamp(10px, 3vh, 40px) clamp(12px, 5vw, 80px);
  overflow: hidden;
  text-align: center;
}

.occhiello {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px 5px 9px;
  border: 1px solid var(--bordo);
  border-radius: 999px;
  background: var(--carta);
  color: var(--secondario);
  font-size: clamp(10px, min(1.2vw, 2vh), 13px);
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(23, 22, 26, 0.04);
}
.occhiello svg { width: 1.1em; height: 1.1em; fill: none; stroke: var(--accento); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

.titolo {
  font-size: clamp(19px, min(4.2vw, 5.4vh), 50px);
  line-height: 1.04;
  font-weight: 620;
  font-stretch: 92%;
  letter-spacing: -0.025em;
}
.titolo__spento { color: var(--spento); }

.carta {
  position: relative;
  width: min(540px, 100%);
  background: var(--carta);
  border: 1px solid var(--bordo);
  border-radius: clamp(12px, 2vh, 18px);
  box-shadow: 0 1px 2px rgba(23, 22, 26, 0.04), 0 18px 48px -18px rgba(23, 22, 26, 0.18);
  text-align: left;
  overflow: hidden;
}
.carta__testa {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: clamp(6px, 1.4vh, 11px) clamp(8px, 1.8vh, 14px) clamp(6px, 1.4vh, 11px) clamp(10px, 2vh, 18px);
  border-bottom: 1px solid var(--bordo);
  font-size: clamp(10px, min(1.3vw, 2vh), 13px);
}
.carta__icona { width: 1.2em; height: 1.2em; flex: none; fill: none; stroke: var(--secondario); stroke-width: 1.2; stroke-linejoin: round; }
.carta__nome { font-family: 'JetBrains Mono Variable', ui-monospace, monospace; color: var(--secondario); font-size: 0.92em; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.segmenti {
  position: relative;
  display: inline-flex;
  padding: 2px;
  border-radius: 999px;
  background: #f2f0eb;
  box-shadow: inset 0 0 0 1px rgba(23, 22, 26, 0.05);
  flex: none;
}
.segmenti__pomo {
  position: absolute;
  top: 2px;
  left: 2px;
  height: calc(100% - 4px);
  border-radius: 999px;
  background: var(--carta);
  box-shadow: 0 1px 2px rgba(23, 22, 26, 0.12), 0 2px 6px -2px rgba(23, 22, 26, 0.12);
}
.segmenti__voce {
  position: relative;
  padding: 0.28em 0.75em;
  font-size: 0.86em;
  font-weight: 560;
  color: var(--secondario);
  white-space: nowrap;
}
.segmenti__voce.e-attiva { color: var(--inchiostro); }

.foglio { position: relative; padding: clamp(8px, 1.8vh, 16px) clamp(10px, 2vh, 18px) clamp(8px, 1.8vh, 16px) 0; }
.banda {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 0;
  background: var(--accento-tenue);
  border-left: 2px solid var(--accento);
  opacity: 0;
  pointer-events: none;
}

.cursore {
  position: absolute;
  left: 0;
  top: 0;
  width: 1.5px;
  height: 1.15em;
  border-radius: 1px;
  background: var(--accento);
  opacity: 0;
  pointer-events: none;
  font-size: clamp(11px, min(1.9vw, 2.9vh), 17px);
}
.cursore.e-acceso { animation: lampeggia 1.06s steps(1, end) infinite; }
@keyframes lampeggia { 0%, 55% { opacity: 1; } 56%, 100% { opacity: 0; } }

.righe { list-style: none; position: relative; font-size: clamp(11px, min(1.9vw, 2.9vh), 17px); }
.riga {
  display: flex;
  align-items: center;
  height: 1.95em;
  white-space: nowrap;
  line-height: 1;
}
.riga--h1 { height: 2.35em; }
.n {
  flex: none;
  width: 2.6em;
  padding-right: 0.9em;
  text-align: right;
  font-family: 'JetBrains Mono Variable', ui-monospace, monospace;
  font-size: 0.68em;
  color: var(--spento);
}
.t { position: relative; display: inline-flex; align-items: center; white-space: pre; letter-spacing: -0.005em; }

/* the markdown marks: an element for GSAP (width and opacity), the text inside for the CSS */
.m {
  display: inline-block;
  overflow: hidden;
  vertical-align: baseline;
  font-family: 'JetBrains Mono Variable', ui-monospace, monospace;
  font-size: 0.86em;
  color: var(--segno);
  white-space: pre;
}

.h1 { display: inline-block; font-weight: 500; transform-origin: left center; }
.g { font-weight: 400; display: inline-block; }
.c { display: inline-block; }
.cit { display: inline-block; }
.lk {
  display: inline-block;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  padding-bottom: 1px;
}
.barra {
  position: absolute;
  left: 0;
  top: -0.3em;
  bottom: -0.3em;
  width: 2px;
  border-radius: 2px;
  background: var(--accento);
  transform: scaleY(0);
  transform-origin: center top;
}

.box { display: inline-block; width: 0; overflow: hidden; flex: none; }
.box svg { display: block; width: 1em; height: 1em; margin-right: 0.45em; }
.box rect { fill: var(--carta); stroke: #cdc8bf; stroke-width: 1.2; }
.box--si rect { fill: var(--accento); stroke: var(--accento); }
.spunta { fill: none; stroke: #fff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.carta__piede {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: clamp(6px, 1.4vh, 11px) clamp(10px, 2vh, 18px);
  border-top: 1px solid var(--bordo);
  color: var(--secondario);
  font-size: clamp(9.5px, min(1.2vw, 1.9vh), 12.5px);
  background: #fcfbf9;
}
.stato { display: inline-flex; align-items: center; gap: 5px; }
.stato__spunta { width: 1.05em; height: 1.05em; fill: none; stroke: var(--accento); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.parole { font-family: 'JetBrains Mono Variable', ui-monospace, monospace; font-size: 0.9em; color: var(--spento); }

.chiusa {
  min-height: 1.3em;
  font-size: clamp(12px, min(1.9vw, 2.8vh), 21px);
  font-weight: 480;
  letter-spacing: -0.01em;
}
.chiusa .parola { display: inline-block; opacity: 0; }
.chiusa b { color: var(--accento); font-weight: 600; }

.piede {
  padding: 28px 16px 36px;
  text-align: center;
  font-size: 12px;
  color: var(--secondario);
}
