/* The logo in the rangefinder: a warm white page, a viewfinder with four thin corners, the name and the patch of
   the rangefinder where a second image of it slides until the two meet. Under it, the distance scale of the
   focusing ring. Minimal: one ink, one accent. */
:root {
  --ground: #f3f0e8;        /* the background */
  --ink: #141414;           /* the name and the corners */
  --guide: #b8b2a6;         /* the patch and the ticks */
  --hint: #8c8679;          /* the small text */
  --accent: #df4527;        /* the second image and the index */
  --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;
}

.scena {
  position: relative;
  height: var(--screen);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 5vh, 44px);
  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 viewfinder */
.mirino {
  position: relative;
  padding: clamp(14px, 3vh, 30px) clamp(18px, 4vw, 44px);
  cursor: ew-resize;
}
.angolo {
  position: absolute;
  width: clamp(12px, 2.4vw, 22px);
  height: clamp(12px, 2.4vw, 22px);
  border: 0 solid var(--ink);
}
.angolo--a { top: 0; left: 0; border-top-width: 1px; border-left-width: 1px; }
.angolo--b { top: 0; right: 0; border-top-width: 1px; border-right-width: 1px; }
.angolo--c { bottom: 0; left: 0; border-bottom-width: 1px; border-left-width: 1px; }
.angolo--d { bottom: 0; right: 0; border-bottom-width: 1px; border-right-width: 1px; }

.nome {
  position: relative;
  margin: 0;
  font-size: clamp(54px, min(19vw, 24vh), 210px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.035em;
  white-space: nowrap;
}
.nome__base {
  display: block;
  font-variation-settings: 'wght' 700, 'wdth' 92;
}
/* the patch: a small window in the middle of the name, the only place where the second image shows */
.finestra {
  position: absolute;
  overflow: hidden;
  outline: 1px solid var(--guide);
  outline-offset: 0;
}
.nome__fantasma {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  color: var(--accent);
  mix-blend-mode: multiply;
  font-variation-settings: 'wght' 700, 'wdth' 92;
}

/* ---------------------------------------------------------------- the focusing ring */
.ghiera {
  position: relative;
  width: min(420px, 82vw);
  height: 44px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
}
.ghiera__nastro {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
}
.tacca {
  position: absolute;
  top: 0;
  width: 1px;
  height: 9px;
  background: var(--guide);
}
.tacca--lunga { height: 15px; background: var(--hint); }
.cifra {
  position: absolute;
  top: 20px;
  translate: -50% 0;
  font-size: 11px;
  font-weight: 520;
  color: var(--hint);
  font-variant-numeric: tabular-nums;
}
.ghiera__indice {
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: 17px;
  background: var(--accent);
}

.motto {
  margin: calc(clamp(18px, 5vh, 44px) * -0.5) 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--hint);
  letter-spacing: 0.02em;
}

/* ---------------------------------------------------------------- the elastic pill */
.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: 12px; padding: 44px 16px 70px; }
  .marca { top: 14px; }
  .pillola { bottom: 14px; min-height: 34px; }
}
