/* The logo that finds the bubble: a warm white page, a thin beam with the name standing on it and a spirit level
   vial underneath. Minimal: one ink, one accent (the bubble). */
:root {
  --ground: #f3f0e8;        /* the background */
  --ink: #141414;           /* the name, the beam and the vial */
  --guide: #b8b2a6;         /* the ticks and the vial glass */
  --hint: #8c8679;          /* the small text */
  --accent: #e0462a;        /* the bubble and the level reading */
  --glass: #ebe6da;         /* the liquid in the vial */
  --elastic: cubic-bezier(0.34, 1.9, 0.45, 1);
  --screen: 100vh;
}
@supports (height: 100lvh) {
  :root { --screen: 100lvh; }
}

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

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

.scena {
  position: relative;
  height: var(--screen);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 4vh, 36px);
  padding: 56px 16px 84px;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.marca {
  position: absolute;
  top: 22px;
  left: 24px;
  right: 24px;
  margin: 0;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 640;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.marca span {
  color: var(--hint);
  font-weight: 460;
}

/* ---------------------------------------------------------------- the level */
.banco {
  --size: min(11vw, 15vh, 112px);
  width: min(84vw, 640px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(10px, 3vh, 26px);
  cursor: ew-resize;
}
.livella {
  position: relative;
  width: 100%;
  height: calc(var(--size) * 1.05 + 34px);
}
.parola {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 34px;
  height: calc(var(--size) * 1.05);
}
.lettera {
  position: absolute;
  left: 0;
  bottom: calc(var(--size) * -0.028);
  font-size: var(--size);
  line-height: 0.74;
  font-weight: 760;
  will-change: transform;
}
.lettera > span {
  display: block;
  transform-origin: 50% 100%;
}

.trave {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 33px;
  height: 1px;
  background: var(--ink);
  transform-origin: 50% 50%;
}
.trave__tacca {
  position: absolute;
  top: -5px;
  width: 1px;
  height: 11px;
  background: var(--ink);
}
.trave__tacca--a { left: 0; }
.trave__tacca--b { right: 0; }

.fiala {
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 76px;
  height: 16px;
  margin-left: -38px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--glass);
  overflow: hidden;
}
.fiala::after {
  content: '';
  position: absolute;
  left: 6px;
  right: 6px;
  top: 2px;
  height: 1px;
  background: #fff;
  opacity: 0.7;
}
.fiala__segno {
  position: absolute;
  top: 2px;
  bottom: 2px;
  width: 1px;
  background: var(--guide);
}
.fiala__segno--a { left: calc(50% - 13px); }
.fiala__segno--b { left: calc(50% + 12px); }
.bolla {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 20px;
  height: 9px;
  margin: -4.5px 0 0 -10px;
  border-radius: 999px;
  background: var(--accent);
}
.bolla__luce {
  position: absolute;
  left: 4px;
  top: 2px;
  width: 7px;
  height: 2px;
  border-radius: 2px;
  background: #fff;
  opacity: 0.55;
}

.lettura {
  margin: 0;
  font-size: 11px;
  font-weight: 560;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--hint);
  font-variant-numeric: tabular-nums;
}
.lettura__valore {
  display: inline-block;
  min-width: 5ch;
  color: var(--ink);
  text-align: right;
}
.lettura.a-bolla .lettura__valore { color: var(--accent); }

.motto {
  margin: 0;
  font-size: clamp(13px, 2.2vh, 16px);
  font-weight: 420;
  font-stretch: 92%;
  color: var(--hint);
}

/* ---------------------------------------------------------------- replay */
.pillola {
  position: absolute;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  translate: -50% 0;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--ground);
  font: 600 13px/1 'Archivo Variable', 'Helvetica Neue', Arial, sans-serif;
  cursor: pointer;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
}
.pillola::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--ink);
  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) and (pointer: fine) {
  .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(--accent);
  outline-offset: 4px;
}

@media (max-height: 520px) {
  .scena { gap: 10px; padding: 44px 16px 70px; }
  .marca { top: 14px; }
  .pillola { bottom: 14px; min-height: 34px; }
}
