:root {
  --carta: #efeeed;          /* the warm paper of the waiting screen and of the page */
  --carta-scura: #e5e5e5;    /* the slightly darker paper of the thin rules */
  --inchiostro: #22201d;     /* the warm black of the brush and of the words */
  --grigio: #474747;         /* the grey of the small text */
  --oro: #b8a88a;            /* the one accent: the gold of the lines, the numbers and the rule */
  --oro-scuro: #8f7c64;      /* the darker gold of the title on the waiting screen */
  --oro-chiaro: #dccab3;     /* the light that runs over the title */
  --bianco: #ffffff;         /* the title inside the ink */
  --mezzo: clamp(46px, 12vh, 92px); /* half the height left free around the title */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }
html { background: var(--carta); }
body {
  background: var(--carta);
  color: var(--inchiostro);
  font-family: 'Mulish Variable', system-ui, sans-serif;
  overflow: hidden;
}

/* a very fine paper grain over everything */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.45  0 0 0 0 0.42  0 0 0 0 0.38  0 0 0 0.2 0'/></filter><rect width='100%' height='100%' filter='url(%23g)'/></svg>");
}

.palco {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

/* ---- the waiting screen ---- */
.cancello {
  position: absolute;
  inset: 0;
}

.filo {
  position: absolute;
  left: 50%;
  width: 1px;
  height: calc(50% - var(--mezzo) - 6px);
}
.filo--su { top: 0; }
.filo--giu { bottom: 0; }

.filo__linea {
  position: absolute;
  inset: 0;
  background: var(--oro);
  transform: scaleY(0);
}
.filo--su .filo__linea { transform-origin: 50% 0; }
.filo--giu .filo__linea { transform-origin: 50% 100%; }

.filo__cifra {
  position: absolute;
  left: 7px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  color: var(--oro);
  line-height: 1;
  white-space: nowrap;
}
.filo--su .filo__cifra { top: 0; margin-top: -11px; }
.filo--giu .filo__cifra { bottom: 0; margin-bottom: -11px; }

.marchio {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  text-align: center;
  white-space: nowrap;
}

.marchio__sopra,
.marchio__sotto {
  font-size: clamp(8px, min(1.3vw, 2vh), 11px);
  font-weight: 500;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--oro-scuro);
  margin-right: -0.42em;
}

.marchio__nome {
  margin: clamp(4px, 1.2vh, 10px) 0;
  font-family: 'Fraunces Variable', Georgia, serif;
  font-size: var(--nome, clamp(30px, min(9.6vw, 11vh), 78px));
  font-weight: 640;
  font-variation-settings: 'opsz' 144, 'SOFT' 60, 'WONK' 0;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
  color: transparent;
  background: linear-gradient(100deg, var(--oro-scuro) 0%, var(--oro-scuro) 40%, var(--oro-chiaro) 50%, var(--oro-scuro) 60%, var(--oro-scuro) 100%);
  background-size: 300% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
}

/* the Discover button: two drawn ornaments and a dark label that opens downwards */
.scopri {
  position: absolute;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: max-content;
  top: calc(50% + var(--mezzo) + 4px);
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.scopri__orn {
  width: 30px;
  height: 14px;
  overflow: visible;
  transition: translate 0.35s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.scopri__orn path {
  fill: none;
  stroke: var(--oro);
  stroke-width: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1 2;
  stroke-dashoffset: 1;
}

.scopri__corpo {
  display: block;
  padding: 11px 20px 10px;
  border-radius: 2px;
  background: var(--inchiostro);
  color: var(--carta);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset, 0 6px 14px -8px rgba(34, 32, 29, 0.55);
  clip-path: inset(0 0 100% 0);
  transition: background-color 0.3s ease;
}
.scopri__etichetta {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1;
  transition: letter-spacing 0.4s cubic-bezier(0.34, 1.4, 0.64, 1);
}

@media (hover: hover) {
  .scopri.is-pronto:hover .scopri__orn--sx { translate: -4px 0; }
  .scopri.is-pronto:hover .scopri__orn--dx { translate: 4px 0; }
  .scopri.is-pronto:hover .scopri__etichetta { letter-spacing: 0.2em; }
}
.scopri:focus-visible { outline: 1px solid var(--oro); outline-offset: 6px; }

/* ---- the page under the ink ---- */
.pagina {
  position: absolute;
  inset: 0;
  visibility: hidden;
}
.pagina.is-qui { visibility: visible; }

.pagina__dentro {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(14px, 4vh, 34px) clamp(16px, 5vw, 48px);
}

.pagina__testa,
.pagina__piede {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: clamp(9px, min(1.4vw, 2.2vh), 12px);
  letter-spacing: 0.08em;
  color: var(--grigio);
}
.pagina__testa { border-bottom: 1px solid var(--carta-scura); padding-bottom: 10px; }
.pagina__piede { border-top: 1px solid var(--carta-scura); padding-top: 10px; text-transform: uppercase; letter-spacing: 0.18em; font-size: clamp(8px, min(1.1vw, 1.8vh), 10px); }
.pagina__marchio {
  font-family: 'Fraunces Variable', Georgia, serif;
  font-size: clamp(13px, min(2vw, 3vh), 18px);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--inchiostro);
}

.pagina__centro {
  text-align: center;
}

.libro {
  display: inline-block;
  font-size: clamp(8px, min(1.2vw, 1.9vh), 11px);
  font-weight: 700;
  letter-spacing: 0.32em;
  margin-right: -0.32em;
  text-transform: uppercase;
  color: var(--oro-scuro);
}

.titolo {
  margin: clamp(6px, 1.6vh, 14px) 0 clamp(10px, 2.4vh, 20px);
  font-family: 'Fraunces Variable', Georgia, serif;
  font-size: clamp(34px, min(11vw, 14vh), 112px);
  font-weight: 380;
  font-variation-settings: 'opsz' 144, 'SOFT' 100, 'WONK' 1;
  letter-spacing: -0.02em;
  line-height: 1;
  overflow: clip;
  padding: 0.12em 0;
  margin-top: calc(clamp(6px, 1.6vh, 14px) - 0.12em);
}
.titolo__dentro { display: inline-block; }

.regola {
  display: block;
  width: min(36vw, 24vh, 220px);
  height: 1px;
  margin: 0 auto;
  background: var(--oro);
}

.riga {
  margin-top: clamp(10px, 2.4vh, 20px);
  font-size: clamp(11px, min(1.8vw, 2.8vh), 16px);
  line-height: 1.5;
  color: var(--grigio);
  overflow: clip;
  padding: 0 12px;
}
.riga__dentro { display: inline-block; }

/* ---- the ink ---- */
.pennello {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}
.pennello__vuoto { fill: #000; }
.pennello__nero { fill: var(--inchiostro); }
.pennello__sopra {
  font-family: 'Mulish Variable', system-ui, sans-serif;
  font-weight: 500;
  fill: var(--bianco);
  opacity: 0.72;
}
.pennello__nome {
  font-family: 'Fraunces Variable', Georgia, serif;
  font-weight: 640;
  font-variation-settings: 'opsz' 144, 'SOFT' 60, 'WONK' 0;
  fill: var(--bianco);
}
.pennello__regola { stroke: var(--oro); stroke-width: 1; }

@media (prefers-reduced-motion: reduce) {
  .scopri__orn, .scopri__etichetta { transition: none; }
}
