/* The quote that lights up: an interview in a magazine; in the middle a large serif quote stays on screen and,
   as you scroll, its words go from pale grey to full ink one after another. */
:root {
  --carta: #f7f4ee;
  --inchiostro: #16130f;
  --testo: #3b352e;
  --grigio: #8a8278;
  /* the colour of the words not yet lit */
  --spento: #d9d3c9;
  /* the colour of the lit words */
  --pieno: #16130f;
  /* the quotation marks and the kicker */
  --accento: #a4512d;
  --filetto: #cfc8bc;
  /* the weight of the words, unlit and lit (Newsreader goes from 200 to 800) */
  --peso-spento: 380;
  --peso-pieno: 460;
  --colonna: 640px;
  --lato: 22px;
}

@media (min-width: 48em) {
  :root {
    --lato: 48px;
  }
}

* {
  box-sizing: border-box;
}

html {
  background: var(--carta);
}

body {
  margin: 0;
  background: var(--carta);
  color: var(--testo);
  font-family: 'Newsreader Variable', Georgia, serif;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.testata,
.piede {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px var(--lato);
  border-bottom: 1px solid var(--filetto);
  font-family: 'Instrument Sans Variable', system-ui, sans-serif;
}

.testata__nome {
  margin: 0;
  font-family: 'Newsreader Variable', Georgia, serif;
  font-size: 21px;
  font-weight: 600;
  font-style: italic;
  letter-spacing: -0.01em;
  color: var(--inchiostro);
}

.testata__numero {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--grigio);
}

.articolo {
  padding: 0 var(--lato);
}

.apertura {
  max-width: 860px;
  margin: 0 auto;
  padding: clamp(56px, 11vh, 120px) 0 clamp(40px, 7vh, 72px);
  text-align: center;
}

.occhiello {
  margin: 0 0 22px;
  font-family: 'Instrument Sans Variable', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accento);
}

.occhiello span {
  margin: 0 0.5em;
  color: var(--filetto);
}

.titolo {
  margin: 0;
  font-size: clamp(38px, 6.4vw, 78px);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.025em;
  color: var(--inchiostro);
  text-wrap: balance;
}

.catenaccio {
  max-width: 560px;
  margin: 26px auto 0;
  font-size: clamp(18px, 2vw, 21px);
  font-style: italic;
  line-height: 1.45;
  color: var(--testo);
  text-wrap: pretty;
}

.firma-pezzo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 32px 0 0;
  font-family: 'Instrument Sans Variable', system-ui, sans-serif;
  font-size: 13px;
  color: var(--grigio);
}

.firma-pezzo strong {
  font-weight: 600;
  color: var(--inchiostro);
}

.firma-pezzo__sep {
  width: 1px;
  height: 14px;
  background: var(--filetto);
}

.testo {
  max-width: var(--colonna);
  margin: 0 auto;
  padding-top: 8px;
  border-top: 1px solid var(--filetto);
}

.testo p {
  margin: 0 0 1.25em;
  font-size: clamp(18px, 1.9vw, 20px);
  line-height: 1.62;
  text-wrap: pretty;
}

.testo .domanda {
  margin: 2.2em 0 0.7em;
  font-family: 'Instrument Sans Variable', system-ui, sans-serif;
  font-size: clamp(15px, 1.5vw, 16px);
  font-weight: 600;
  line-height: 1.45;
  color: var(--inchiostro);
}

.capolettera::first-letter {
  float: left;
  margin: 0.09em 0.09em 0 0;
  font-size: 3.6em;
  font-weight: 400;
  line-height: 0.82;
  color: var(--inchiostro);
}

/* ---- the run with the quote ---- */
.corsa {
  position: relative;
  height: 420lvh;
}

.palco {
  position: sticky;
  top: 0;
  height: 100lvh;
  display: grid;
  place-content: center;
  padding: 0 var(--lato);
  overflow: clip;
}

.citazione {
  position: relative;
  max-width: 1000px;
  margin: 0;
}

.virgolette {
  display: block;
  width: clamp(48px, 5.4vw, 74px);
  height: auto;
  margin: 0 0 clamp(14px, 2.4vh, 26px);
  overflow: visible;
}

.virgoletta {
  fill: var(--accento);
  stroke: var(--accento);
  stroke-width: 1.2;
  stroke-linejoin: round;
}

.frase {
  margin: 0;
}

.frase p {
  margin: 0;
  font-size: clamp(34px, 5.3vw, 74px);
  font-weight: var(--peso-spento);
  line-height: 1.1;
  letter-spacing: -0.018em;
  color: var(--pieno);
}

/* every word is a box as wide as its heaviest version, so the weight can change without moving the others */
.parola {
  --p: 1;
  display: inline-block;
  text-align: center;
  color: color-mix(in oklab, var(--pieno) calc(var(--p) * 100%), var(--spento));
  font-weight: calc(var(--peso-spento) + (var(--peso-pieno) - var(--peso-spento)) * var(--p));
  transform: translateY(calc((1 - var(--p)) * var(--salita, 0.1em)));
  will-change: transform;
}

.autrice {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: clamp(28px, 4.6vh, 48px) 0 0;
}

.ritratto {
  position: relative;
  flex: none;
  width: clamp(56px, 5.6vw, 72px);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background: #2a231e;
}

.ritratto svg {
  display: block;
  width: 100%;
  height: 100%;
}

.autrice__testo {
  display: grid;
  gap: 4px;
}

.autrice__riga {
  display: block;
  overflow: clip;
  padding-bottom: 0.08em;
}

.autrice__nome,
.autrice__ruolo {
  display: block;
}

.autrice__nome {
  font-size: clamp(20px, 2vw, 24px);
  font-style: italic;
  font-weight: 500;
  color: var(--inchiostro);
}

.autrice__ruolo {
  font-family: 'Instrument Sans Variable', system-ui, sans-serif;
  font-size: 13px;
  letter-spacing: 0.01em;
  color: var(--grigio);
}

.filetto {
  display: block;
  width: min(1000px, 100%);
  height: 1px;
  margin: clamp(28px, 4.6vh, 48px) auto 0;
  background: var(--inchiostro);
  transform-origin: left center;
}

.articolo--seguito .testo {
  border-top: 0;
  padding-top: 0;
}

.testo .nota {
  margin-top: 2.6em;
  padding-top: 1.2em;
  border-top: 1px solid var(--filetto);
  font-family: 'Instrument Sans Variable', system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.55;
  color: var(--grigio);
}

.piede {
  margin-top: clamp(56px, 10vh, 110px);
  border-top: 1px solid var(--filetto);
  border-bottom: 0;
  padding-bottom: 40px;
  flex-wrap: wrap;
}

.piede__riga {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--grigio);
}

.piede__titolo {
  margin-left: 10px;
  font-family: 'Newsreader Variable', Georgia, serif;
  font-size: 16px;
  font-style: italic;
  letter-spacing: 0;
  text-transform: none;
  color: var(--inchiostro);
}

@media (hover: hover) {
  .piede__titolo {
    transition: color 0.3s ease;
  }

  .piede__riga:hover .piede__titolo {
    color: var(--accento);
  }
}

@media (max-width: 47.99em) {
  .corsa {
    height: 380lvh;
  }

  .palco {
    place-content: center start;
  }

  .testata__numero {
    font-size: 11px;
  }
}
