/* The eclipse that dims the page: the eclipse day of a made-up observatory, Halo, in the minimal style. A warm white
   page and black ink that swap places as the Sun goes out; one vermilion, the Sun and its ring. The Sun, the Moon and
   the timeline at the bottom are drawn by the script in one SVG; the word of the phase is plain HTML. */
:root {
  --giorno: #f3f0e8;       /* the page in daylight */
  --notte: #101010;        /* the page at totality */
  --inchiostro: #141414;   /* the text in daylight; at totality it turns the colour of the day */
  --tenue: #8d887e;        /* the small text and the labels of the timeline */
  --accento: #ff4f1f;      /* the Sun and the ring of totality */
  --fondo: var(--giorno);  /* the page now (the script mixes it) */
  --testo: var(--inchiostro);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

html,
body {
  background: var(--fondo);
}

body {
  color: var(--testo);
  font-family: 'Fraunces Variable', 'Fraunces', Georgia, serif;
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------------------ 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: 14px;
  font-variation-settings: 'wght' 480, 'opsz' 14, 'SOFT' 0;
  letter-spacing: 0.01em;
}

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

.titolo {
  margin: 0;
  font-size: clamp(44px, 8vw, 120px);
  font-variation-settings: 'wght' 340, 'opsz' 144, 'SOFT' 0;
  line-height: 0.96;
  letter-spacing: -0.035em;
}

.titolo--medio {
  font-size: clamp(36px, 5.6vw, 84px);
}

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

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

.cielo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.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: 19px;
  font-variation-settings: 'wght' 640, 'opsz' 24, 'SOFT' 100;
  letter-spacing: -0.01em;
}

.sole {
  fill: var(--accento);
}

.corona {
  fill: none;
  stroke: var(--accento);
  stroke-width: 1.5;
}

.corona--larga {
  stroke-width: 1;
  opacity: 0.45;
}

.luna {
  fill: none;
  stroke: var(--testo);
  stroke-width: 1;
  opacity: 0.32;
}

/* the timeline of the day, at the bottom */
.righello line {
  stroke: var(--testo);
  stroke-width: 1;
  shape-rendering: crispEdges;
}

.righello .righello__tenue {
  opacity: 0.3;
}

.righello .righello__totale {
  stroke: var(--accento);
  stroke-width: 3;
  shape-rendering: auto;
}

.righello .righello__segno {
  stroke: var(--accento);
  stroke-width: 1.5;
  shape-rendering: auto;
}

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

.righello .righello__ora {
  fill: var(--testo);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-variation-settings: 'wght' 520, 'opsz' 13;
}

/* the word of the phase: one word at a time, each one slides up out of a window */
.fase {
  position: absolute;
  z-index: 2;
  left: clamp(16px, 5vw, 72px);
  top: var(--fase-y, 60%);
}

.fase__finestra {
  display: grid;
  margin: 0;
  overflow: hidden;
  padding: 0.04em 0 0.26em;
  margin-bottom: -0.12em;
}

.fase__parola {
  grid-area: 1 / 1;
  font-size: clamp(46px, 7vw, 104px);
  font-variation-settings: 'wght' var(--peso, 640), 'opsz' 144, 'SOFT' var(--morbido, 0);
  line-height: 1;
  letter-spacing: -0.035em;
  white-space: nowrap;
}

.lettura {
  margin: 14px 0 0;
  color: var(--tenue);
  font-size: 14px;
  font-variation-settings: 'wght' 460, 'opsz' 14;
}

.lettura__cifra {
  color: var(--testo);
  font-variant-numeric: tabular-nums;
  font-variation-settings: 'wght' 600, 'opsz' 14;
}

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

  .lettura {
    margin-top: 10px;
    font-size: 13px;
  }
}
