/* The rule that lowers the page like a blind: two full pages and one thin rule. Minimal: a warm paper and an ink,
   which the pages swap between them, and one accent, the vermilion of the rule. */
:root {
  --paper: #f3f0e8;         /* the light page */
  --ink: #141414;           /* the dark page and the text on the light one */
  --accent: #d63b22;        /* the rule */
  --hint: #8f8a80;          /* the small text on the light page */
  --hint-dark: #8a867e;     /* the small text on the dark page */
  --screen: 100vh;
}
@supports (height: 100lvh) {
  :root { --screen: 100lvh; }
}

* { box-sizing: border-box; }
html,
body {
  margin: 0;
  height: 100%;
}
body {
  background: var(--paper);
  overflow: hidden;
  font-family: 'Roboto Flex Variable', 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.scena {
  position: relative;
  height: var(--screen);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

/* a page: the whole window, the title in the middle and two small lines */
.pagina {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: clamp(16px, 4vmin, 40px);
  background: var(--paper);
  color: var(--ink);
}
.pagina.scura {
  background: var(--ink);
  color: var(--paper);
}
.pagina[hidden] { display: none; }

.testa {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: clamp(11px, 1.6vmin, 14px);
  letter-spacing: 0.01em;
  font-variation-settings: 'wght' 520, 'wdth' 100;
}
.testa .fonte { color: var(--hint); font-variation-settings: 'wght' 420, 'wdth' 100; }
.scura .testa .fonte { color: var(--hint-dark); }

.centro {
  align-self: center;
  justify-self: center;
  text-align: center;
}
.titolo {
  margin: 0;
  font-size: clamp(38px, min(12.5vw, 17vh), 150px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  font-weight: normal;
  white-space: nowrap;
}
.titolo span {
  display: inline-block;
  font-variation-settings: 'wght' 640, 'wdth' 100;
}
.sotto {
  margin: clamp(18px, 4vmin, 34px) 0 0;
  font-size: clamp(12px, 1.9vmin, 16px);
  color: var(--hint);
  font-variation-settings: 'wght' 420, 'wdth' 100;
}
.scura .sotto { color: var(--hint-dark); }

/* the link to the next piece and the one back: plain text, the arrow is drawn */
.piede {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: clamp(12px, 1.8vmin, 15px);
}
.piede button {
  appearance: none;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  padding: 10px 0;
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  cursor: pointer;
  font-variation-settings: 'wght' 540, 'wdth' 100;
  transition: font-variation-settings 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.3);
}
.piede button[disabled] { visibility: hidden; }
.piede svg {
  width: 1.4em;
  height: 0.8em;
  overflow: visible;
  transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.3);
}
.piede svg path { fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) {
  .piede button:hover { font-variation-settings: 'wght' 540, 'wdth' 118; }
  .piede [data-next]:hover svg { transform: translateX(3px); }
  .piede [data-back]:hover svg { transform: translateX(-3px); }
}
.piede button:active svg { transform: scale(0.92); }
.piede button:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 4px; border-radius: 2px; }

/* the rule: the element GSAP moves, and inside it the line, which stretches */
.riga {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 3;
}
.riga i {
  position: absolute;
  left: 0;
  top: -1px;
  width: 100px;
  height: 2px;
  background: var(--accent);
  transform-origin: 0 50%;
  border-radius: 1px;
}
