/* The loader whose squares become the logo: a deep night blue, one pale blue for everything, small mono type. */
:root {
  --night: #020a19;         /* the background of the loader and of the page */
  --pale: #d5e0ff;          /* squares, letters and text */
  --deep: #052261;          /* the glow at the bottom of the page under the loader */
  --hint: rgba(213, 224, 255, 0.6); /* the secondary text */
  --hair: rgba(213, 224, 255, 0.12); /* the thin frame of the page */
  --elastic: cubic-bezier(0.34, 1.9, 0.45, 1);
  --row: min(70vw, 52vh, 400px); /* how wide the row of squares (and the logo) is */
  --screen: 100vh;
}
@supports (height: 100lvh) {
  :root { --screen: 100lvh; }
}

* { box-sizing: border-box; }
html,
body {
  margin: 0;
  height: 100%;
}
body {
  background: var(--night);
  color: var(--pale);
  font-family: 'Mona Sans Variable', 'Helvetica Neue', Arial, sans-serif;
  overflow: hidden;
}

/* ------------------------------------------------------------ the loader */
.caricamento {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  background: var(--night);
}
.centro {
  position: relative;
  width: var(--row);
}
.logo {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.logo .sq rect { fill: var(--pale); opacity: 0; }
.logo .cell,
.logo .wedge { fill: var(--pale); }
.logo .stroke {
  fill: none;
  stroke: var(--pale);
  stroke-width: 1;
  stroke-linecap: butt;
  stroke-linejoin: miter;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.logo .letters { opacity: 0; }

.numero,
.dicitura,
.pronto {
  position: absolute;
  font-family: 'JetBrains Mono Variable', ui-monospace, monospace;
  font-size: clamp(9px, calc(var(--row) * 0.03), 11px);
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.numero {
  left: 50%;
  bottom: 100%;
  margin-bottom: 0.9em;
  opacity: 0;
}
.dicitura {
  left: 50%;
  top: 100%;
  margin-top: 0.9em;
  opacity: 0;
}
.pronto {
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 2.4em;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75em;
}
.pronto span { min-height: 1em; }
.lampo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--row) * 8 / 248);
  height: calc(var(--row) * 8 / 248);
  translate: -50% -50%;
  background: var(--pale);
  opacity: 0;
}

/* ------------------------------------------------------------ the page under it */
.pagina {
  position: relative;
  height: var(--screen);
  max-height: 100vh;
  padding: clamp(16px, 4vmin, 40px);
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(120% 70% at 50% 120%, rgba(5, 34, 97, 0.85), transparent 70%),
    var(--night);
  overflow: hidden;
}
.testa {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.testa__marchio {
  width: clamp(64px, 12vmin, 104px);
  height: auto;
  overflow: visible;
}
.testa__marchio .cell,
.testa__marchio .wedge { fill: var(--pale); }
.testa__marchio .stroke { fill: none; stroke: var(--pale); stroke-width: 1; stroke-linejoin: miter; }
.testa__marchio .sq { display: none; }
.testa__voci {
  display: flex;
  gap: clamp(12px, 3vmin, 28px);
}
.testa__voci a {
  font-family: 'JetBrains Mono Variable', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--pale);
  text-decoration: none;
  opacity: 0.55;
  transition: opacity 0.3s linear;
}
@media (hover: hover) {
  .testa__voci a:hover { opacity: 1; }
}
.apertura {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-bottom: 8vh;
}
.etichetta {
  margin: 0 0 1.6em;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono Variable', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}
.etichetta__quadro {
  width: 6px;
  height: 6px;
  background: var(--pale);
}
.titolo {
  margin: 0 0 0.55em;
  font-size: clamp(24px, min(6.4vw, 8vh), 56px);
  font-weight: 760;
  font-stretch: 112%;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.riga {
  margin: 0;
  max-width: 34em;
  font-size: clamp(12px, 1.5vw, 15px);
  font-weight: 300;
  line-height: 1.6;
  color: var(--hint);
}
.cornice i {
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: var(--hair);
  border-style: solid;
  border-width: 0;
}
.cornice i:nth-child(1) { left: 10px; top: 10px; border-left-width: 1px; border-top-width: 1px; }
.cornice i:nth-child(2) { right: 10px; top: 10px; border-right-width: 1px; border-top-width: 1px; }
.cornice i:nth-child(3) { left: 10px; bottom: 10px; border-left-width: 1px; border-bottom-width: 1px; }
.cornice i:nth-child(4) { right: 10px; bottom: 10px; border-right-width: 1px; border-bottom-width: 1px; }

/* ------------------------------------------------------------ Replay */
.pillola {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  translate: -50% 0;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--night);
  font: 600 12px/1 'Mona Sans Variable', 'Helvetica Neue', Arial, sans-serif;
  cursor: pointer;
  isolation: isolate;
  opacity: 0;
  visibility: hidden;
  -webkit-tap-highlight-color: transparent;
}
.pillola::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--pale);
  transition: inset 0.6s var(--elastic);
}
.pillola__scritta {
  font-stretch: 86%;
  transition: font-stretch 0.6s var(--elastic);
}
.pillola__scritta::before {
  content: attr(data-testo);
  display: block;
  height: 0;
  overflow: hidden;
  visibility: hidden;
  font-stretch: 100%;
}
@media (hover: hover) {
  .pillola:hover::before { inset: -2px -7px; }
  .pillola:hover .pillola__scritta { font-stretch: 100%; }
}
.pillola:active::before { inset: 2px 3px; }
.pillola:focus-visible {
  outline: 2px solid var(--pale);
  outline-offset: 4px;
}
