/* The loader of Orvo, an invented travel app: warm paper, ink, one coral accent for the plane and the cities it reaches.
   The route between four cities closes into the O of the logo. */
:root {
  --ground: #f5f1ea;        /* the paper */
  --ink: #17181b;           /* the logo and the ring */
  --route: #8d877d;         /* the dashed route and the city names */
  --faint: rgba(23, 24, 27, 0.07); /* the lines of latitude */
  --accent: #ff5b3a;        /* the plane and the cities it has reached */
  --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: 'Mona Sans Variable', 'Helvetica Neue', Arial, sans-serif;
  overflow: hidden;
}

.stage {
  position: relative;
  display: grid;
  place-items: center;
  height: var(--screen);
  max-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(70% 55% at 50% 44%, rgba(255, 255, 255, 0.7), transparent 72%),
    var(--ground);
}

/* the mark is sized on the width and on the height: it always fits the box */
.mark {
  position: relative;
  width: min(92vw, 128vh, 760px);
  margin-top: -6vh;
}
.map {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.lat path {
  fill: none;
  stroke: var(--faint);
  stroke-width: 0.8;
  stroke-dasharray: 1 4;
  stroke-linecap: round;
}
.draw {
  fill: none;
  stroke: #fff;
  stroke-width: 14;
  stroke-linecap: butt;
  stroke-linejoin: round;
}
.route {
  fill: none;
  stroke: var(--route);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.shadow {
  fill: none;
  stroke: rgba(23, 24, 27, 0.08);
  stroke-width: 9;
  stroke-linecap: round;
  opacity: 0;
}
.trail {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-dasharray: 0.6 3.2;
  opacity: 0;
}

.city__dot {
  fill: var(--ground);
  stroke: var(--route);
  stroke-width: 1.3;
}
.city__pop {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1;
  opacity: 0;
}
.city__name {
  fill: var(--route);
  font-size: 8.4px;
  font-weight: 600;
  letter-spacing: 0.12em;
  font-stretch: 112%;
}

.word text {
  fill: var(--ink);
  font-family: 'Mona Sans Variable', 'Helvetica Neue', Arial, sans-serif;
  font-size: 96px;
  font-weight: 640;
  letter-spacing: -0.02em;
}

.plane path { fill: var(--accent); }
.plane__shade { fill: rgba(23, 24, 27, 0.16); }

.tagline {
  position: absolute;
  left: 0;
  right: 0;
  top: 70%;
  margin: 0;
  text-align: center;
  font-size: clamp(12px, min(2.4vw, 3.4vh), 19px);
  font-weight: 460;
  font-stretch: 108%;
  letter-spacing: 0.01em;
  color: var(--route);
}

/* the loading line at the bottom: a label, the percentage and a hairline */
.load {
  position: absolute;
  left: 50%;
  bottom: max(9vh, 46px);
  translate: -50% 0;
  display: grid;
  grid-template-columns: auto auto;
  gap: 7px 18px;
  width: min(64vw, 260px);
  font-size: 11px;
  font-weight: 560;
  letter-spacing: 0.04em;
  color: var(--route);
}
.load__label { white-space: nowrap; }
.load__num {
  justify-self: end;
  color: var(--ink);
  font-stretch: 90%;
}
.load__num i {
  font-style: normal;
  color: var(--route);
  margin-left: 1px;
}
.load__bar {
  grid-column: 1 / -1;
  position: relative;
  height: 1px;
  background: rgba(23, 24, 27, 0.1);
  overflow: hidden;
}
.load__bar span {
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

.pillola {
  position: absolute;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  translate: -50% 0;
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--ground);
  font: 600 13px/1 'Mona Sans Variable', 'Helvetica Neue', Arial, sans-serif;
  cursor: pointer;
  isolation: isolate;
  opacity: 0;
  visibility: hidden;
}
.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) {
  .load { bottom: max(7vh, 40px); font-size: 10px; }
  .pillola { bottom: 8px; min-height: 32px; }
}
