:root {
  --fondo: #ffffff;          /* the page around the reader */
  --carta: #fbfaf7;          /* the article paper */
  --inchiostro: #191817;     /* text and the button */
  --grigio: #8b8780;         /* small labels */
  --filo: rgba(25, 24, 23, .1); /* hairlines */
  --traccia: rgba(25, 24, 23, .12); /* the empty ring */
  --anello: #191817;         /* the ring while you read */
  --ruggine: #c4572e;        /* the one accent: the ring near the end */
  --ui: "Mona Sans Variable", system-ui, sans-serif;
  --testo: "Newsreader Variable", Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--fondo); }
body {
  color: var(--inchiostro);
  font-family: var(--ui);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(10px, 3vmin, 32px);
}

/* the reader: a window with its own scroll */
.reader {
  position: relative;
  width: min(560px, 94vw);
  height: min(400px, 86vh);
  background: var(--carta);
  border: 1px solid var(--filo);
  border-radius: clamp(14px, 2.4vmin, 20px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 24px 60px -32px rgba(25, 24, 23, .32), 0 2px 6px -2px rgba(25, 24, 23, .08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.reader__bar {
  flex: none;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: clamp(10px, 2.2vmin, 16px) clamp(14px, 3vmin, 24px);
  border-bottom: 1px solid var(--filo);
  font-size: clamp(10px, 1.6vmin, 12px);
  letter-spacing: .01em;
}
.reader__brand { font-weight: 640; font-stretch: 110%; }
.reader__meta { color: var(--grigio); }

.page {
  position: relative;
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  outline: none;
}
.page::-webkit-scrollbar { display: none; }

/* the text dissolves into the paper under the floating button */
.reader::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: clamp(36px, 9vmin, 64px);
  background: linear-gradient(rgba(251, 250, 247, 0), var(--carta) 85%);
  pointer-events: none;
  z-index: 1;
}
.top { z-index: 2; }

.article {
  max-width: 30em;
  margin: 0 auto;
  padding: clamp(18px, 4vmin, 34px) clamp(18px, 4vmin, 30px) clamp(60px, 12vmin, 90px);
  font-family: var(--testo);
  font-size: clamp(13px, 2.3vmin, 16px);
  line-height: 1.6;
  font-variation-settings: "opsz" 16;
}
.kicker {
  font-family: var(--ui);
  font-size: .72em;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--grigio);
  margin-bottom: .6em;
}
.article h1 {
  font-family: var(--testo);
  font-weight: 500;
  font-size: 2.3em;
  line-height: 1.02;
  letter-spacing: -.02em;
  font-variation-settings: "opsz" 72;
  margin-bottom: .45em;
}
.lede { font-size: 1.12em; color: #3c3936; margin-bottom: 1.6em; font-style: normal; }
.article h2 {
  font-family: var(--ui);
  font-weight: 620;
  font-size: .95em;
  letter-spacing: -.005em;
  margin: 1.9em 0 .55em;
}
.article p + p { margin-top: .8em; }
.sign { margin-top: 2.2em !important; color: var(--grigio); font-style: italic; }

/* the button: GSAP owns its size and visibility, the children own the look */
.top {
  position: absolute;
  right: clamp(12px, 2.6vmin, 20px);
  bottom: clamp(12px, 2.6vmin, 20px);
  height: 48px;
  width: 48px;
  border: 0;
  padding: 0;
  background: none;
  color: var(--inchiostro);
  cursor: pointer;
  visibility: hidden;
  opacity: 0;
  -webkit-tap-highlight-color: transparent;
  font: inherit;
}
.top:focus-visible { outline: none; }
.top:focus-visible .top__bg { box-shadow: 0 0 0 2px var(--fondo), 0 0 0 4px var(--ruggine); }
.top__bg {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--filo);
  box-shadow: 0 10px 24px -12px rgba(25, 24, 23, .45), 0 1px 2px rgba(25, 24, 23, .08);
}
.top__disc {
  position: absolute;
  right: 0;
  top: 0;
  width: 48px;
  height: 48px;
}
.top__svg { position: absolute; inset: 4px; width: 40px; height: 40px; overflow: visible; }
.ring__track, .ring__run { fill: none; stroke-width: 2; }
.ring__track { stroke: var(--traccia); }
.ring__run { stroke: var(--anello); stroke-linecap: round; stroke-dasharray: 1 1; }
.top__arrow {
  position: absolute;
  left: 13px;
  top: 13px;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.top__label {
  position: absolute;
  left: 0;
  top: 0;
  height: 48px;
  display: flex;
  align-items: center;
  padding-left: 18px;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--ruggine);
  white-space: nowrap;
  pointer-events: none;
}
.top__label span { display: block; opacity: 0; }

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