/* The sentence that fills with water: a made-up maker of glass carafes, Brimvale, in the minimal style. The stage
   sticks while you scroll; the water, its surface and the bubbles are drawn by the script, their colours come from the
   variables below. */
:root {
  --carta: #f4f0e7;          /* the page */
  --vetro: #1f1e1b;          /* the glass outlines of the letters and the gauge */
  --tenue: #8a857b;          /* the small text */
  --acqua: #2f5fd0;          /* the water: one colour only */
  --acqua-chiara: #5f86e2;   /* the top of the water, just under the surface */
  --pelo: #1d3f9a;           /* the line of the surface */
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

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

html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

/* ---------------------------------------------------------------- the stage */
.corsa {
  position: relative;
  height: 340lvh; /* the script sets the real height from RIDE */
}

.palco {
  position: sticky;
  top: 0;
  height: 100lvh;
  overflow: hidden;
  background: var(--carta);
}

.tela {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(92vw, 128vh, 1100px);
  height: auto;
  transform: translate(-50%, -50%);
  overflow: visible;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.riga {
  font-family: 'Fraunces Variable', Georgia, serif;
  font-size: 150px;
  font-variation-settings: 'wght' 520, 'opsz' 144, 'SOFT' 50;
  letter-spacing: -0.01em;
}

.contorni__bordo {
  fill: var(--vetro);
  stroke: var(--vetro);
  stroke-width: 3;
  stroke-linejoin: round;
}

.contorni__vetro {
  fill: var(--carta);
}

.acqua {
  fill: url(#acqua-grad);
}

.acqua__alto {
  stop-color: var(--acqua-chiara);
}

.acqua__basso {
  stop-color: var(--acqua);
}

.acqua__riflesso {
  fill: none;
  stroke: #ffffff;
  stroke-opacity: 0.35;
  stroke-width: 3;
  stroke-linecap: round;
}

.acqua__pelo {
  fill: none;
  stroke: var(--pelo);
  stroke-width: 2.4;
  stroke-linejoin: round;
}

.bolla {
  fill: none;
  stroke: #ffffff;
  stroke-opacity: 0.6;
  stroke-width: 1.2;
}

.goccia {
  fill: var(--acqua);
  opacity: 0;
}

.scala__asta,
.scala__tacca {
  stroke: var(--vetro);
  stroke-width: 1;
  fill: none;
}

.scala__tacca--corta {
  stroke-opacity: 0.45;
}

.scala__cifra {
  font-family: 'Archivo Variable', sans-serif;
  font-size: 15px;
  fill: var(--tenue);
}

.scala__indice path {
  stroke: var(--acqua);
  stroke-width: 2;
}

.scala__numero {
  font-family: 'Archivo Variable', sans-serif;
  font-size: 19px;
  font-variation-settings: 'wght' 560;
  fill: var(--acqua);
}

/* ---------------------------------------------------------------- the small text */
.testa {
  position: absolute;
  inset: clamp(14px, 4vh, 36px) clamp(16px, 4.5vw, 56px) auto;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

.marchio {
  color: var(--vetro);
  text-decoration: none;
  font-size: clamp(13px, 1.6vh, 15px);
  font-variation-settings: 'wght' 640;
}

.testa__nota,
.cenno,
.stato {
  margin: 0;
  color: var(--tenue);
  font-size: clamp(11px, 1.5vh, 13px);
}

.cenno,
.stato {
  position: absolute;
  bottom: clamp(14px, 4vh, 36px);
}

.cenno {
  left: clamp(16px, 4.5vw, 56px);
}

.stato {
  right: clamp(16px, 4.5vw, 56px);
}

.stato__parola {
  display: inline-block;
  color: var(--vetro);
}

.stato__parola.is-pieno {
  color: var(--acqua);
}

.piede {
  min-height: 60vh;
  display: grid;
  place-items: center;
  padding: 40px 24px;
  text-align: center;
  color: var(--tenue);
  font-size: 14px;
}

.piede p {
  max-width: 34ch;
  margin: 0;
}

/* on a phone the drawing is about a third of its size: thicker glass and bigger numbers, so they still read */
@media (max-width: 560px) {
  .testa__nota {
    display: none;
  }

  .contorni__bordo {
    stroke-width: 6;
  }

  .acqua__pelo {
    stroke-width: 4.5;
  }

  .scala__asta,
  .scala__tacca {
    stroke-width: 2.4;
  }

  .scala__cifra {
    font-size: 32px;
  }

  .scala__numero {
    font-size: 38px;
  }

  .scala__indice path {
    stroke-width: 4;
  }
}
