/* The type scale: the specimen of a made-up type foundry, Norrow, in the minimal style. A warm white page, black ink,
   one vermilion for the measure. In a tall section the stage stays still while you scroll: the word, the guides and
   the ruler are drawn by the script in one SVG, the captions are plain HTML laid over it. */
:root {
  --carta: #f3f0e8;        /* the warm white of the page */
  --inchiostro: #141414;   /* the word and the text */
  --tenue: #8d887e;        /* the small text and the labels of the ruler */
  --sottile: #cfc9bd;      /* the guides: baseline, x-height, cap height */
  --accento: #e2432a;      /* the measure of the size being set */
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  background: var(--carta);
  color: var(--inchiostro);
  font-family: 'Roboto Flex Variable', 'Roboto Flex', 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.nascosto {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ------------------------------------------------------------ the opening and the end */
.apertura {
  display: grid;
  align-content: center;
  gap: 22px;
  min-height: 92vh;
  padding: 80px clamp(16px, 5vw, 72px);
}

.apertura--fine {
  min-height: 70vh;
}

.piccolo {
  margin: 0;
  font-size: 13px;
  font-variation-settings: 'wght' 500, 'opsz' 12;
  letter-spacing: 0.01em;
}

.piccolo--tenue {
  color: var(--tenue);
}

.titolo {
  margin: 0;
  font-size: clamp(46px, 8.4vw, 124px);
  font-variation-settings: 'wght' 300, 'opsz' 144;
  line-height: 0.94;
  letter-spacing: -0.03em;
}

.titolo--medio {
  font-size: clamp(38px, 6vw, 88px);
}

/* ------------------------------------------------------------ the stage */
.racconto {
  position: relative;
  height: 620lvh;
}

.palco {
  position: sticky;
  top: 0;
  height: 100lvh;
  overflow: hidden;
}

.tavola {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.testa {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 26px clamp(16px, 5vw, 72px);
}

.marchio {
  margin: 0;
  font-size: 17px;
  font-variation-settings: 'wght' 700, 'wdth' 112, 'opsz' 18;
  letter-spacing: -0.01em;
}

/* the drawing: the word, its guides, the ruler and the measure */
.parola {
  fill: var(--inchiostro);
  font-family: 'Roboto Flex Variable', 'Roboto Flex', 'Helvetica Neue', Arial, sans-serif;
}

.guida {
  stroke: var(--sottile);
  stroke-width: 1;
  shape-rendering: crispEdges;
}

.guida--base {
  stroke: var(--inchiostro);
}

.etichetta {
  fill: var(--tenue);
  font-size: 11px;
  font-variation-settings: 'wght' 450, 'opsz' 11;
  letter-spacing: 0.02em;
}

.righello {
  stroke: var(--inchiostro);
  stroke-width: 1;
  shape-rendering: crispEdges;
}

.tacca {
  stroke: var(--inchiostro);
  stroke-width: 1;
}

.tacca--fatta {
  stroke: var(--tenue);
}

.misura {
  stroke: var(--accento);
  stroke-width: 1;
  fill: none;
}

.lettura {
  fill: var(--accento);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

/* one line at a time, each one slides up out of a window */
.didascalia {
  position: absolute;
  left: clamp(16px, 5vw, 72px);
  bottom: 28px;
  z-index: 2;
  display: grid;
  margin: 0;
  overflow: hidden;
  padding: 3px 0;
}

.didascalia__riga {
  grid-area: 1 / 1;
  font-size: clamp(17px, 1.6vw, 23px);
  font-variation-settings: 'wght' 420, 'wdth' var(--wd, 100), 'opsz' 20;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

/* ------------------------------------------------------------ phone: the same, with smaller measures */
@media (max-width: 640px) {
  .etichetta {
    font-size: 10px;
  }

  .lettura {
    font-size: 12px;
  }

  .didascalia {
    bottom: 22px;
  }
}
