/* Onboarding (not part of the Osmo resource): the guide that opens with the page, see onboarding.js */
.onboard {
  forced-color-adjust: none; /* the drawing is the message: keep it in High Contrast mode */
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 16px;
  position: fixed;
  inset: 0;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.onboard:focus {
  outline: none;
}

.onboard__veil {
  background-color: rgba(0, 0, 0, .45);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  opacity: 0;
  transition: opacity .6s ease;
  position: absolute;
  inset: 0;
}

/* no box: the line drawing and the close button sit right on the blurred page, and the empty space around them
   belongs to the page (a click there closes the guide) */
.onboard__card {
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 44px 34px;
  opacity: 0;
  transform: translateY(16px) scale(.94);
  transition: opacity .4s ease, transform .75s cubic-bezier(.2, 1.25, .35, 1);
  position: relative;
}

.onboard[data-state="in"] .onboard__veil,
.onboard[data-state="in"] .onboard__card {
  opacity: 1;
}

.onboard[data-state="in"] .onboard__card {
  transform: none;
}

.onboard[data-state="out"] .onboard__veil {
  transition-duration: .5s;
}

.onboard[data-state="out"] .onboard__card {
  transform: scale(1.04);
  transition: opacity .3s ease-in, transform .45s cubic-bezier(.4, 0, 1, 1);
}

/* while it fades out, a press where the drawing was belongs to the page too (the veil hands it on to the grid) */
.onboard[data-state="out"] .onboard__fit,
.onboard[data-state="out"] .onboard__close {
  pointer-events: none;
}

.onboard[data-mode="touch"] .onboard__card {
  padding: 12px 46px 40px;
}

/* the label on top, level with the close button: says in words what the drawing shows */
.onboard__hint {
  display: flex;
  justify-content: center;
  align-self: stretch;
  width: 0;
  min-width: 100%; /* as wide as the drawing and never wider, so it never changes the guide's size */
  margin: 0 0 16px;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  line-height: 17px;
  letter-spacing: .01em;
  text-align: center;
}

.onboard__hint[hidden] {
  display: none;
}

.onboard__pill {
  max-width: 100%;
  padding: 6px 13px;
  background-color: rgba(255, 255, 255, .12);
  border-radius: 15px;
}

.onboard__dot::before {
  content: "\00b7";
  margin: 0 .55em;
  opacity: .5;
}

.onboard[data-mode="touch"] .onboard__step {
  display: block;
}

.onboard[data-mode="touch"] .onboard__dot {
  display: none;
}

.onboard__close {
  pointer-events: auto;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  color: #fff;
  background-color: rgba(255, 255, 255, .12);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color .2s ease;
  position: absolute;
  top: 12px;
  right: 12px;
}

.onboard__close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.onboard__fit {
  pointer-events: auto;
  flex: none;
  position: relative;
}

.onboard__device {
  transform-origin: 0 0;
  position: absolute;
  top: 0;
  left: 0;
}

.onboard__screen {
  overflow: hidden;
  position: absolute;
}

.onboard[data-mode="desktop"] .onboard__screen {
  border-radius: 0 0 12px 12px;
}

.onboard[data-mode="touch"] .onboard__screen {
  border-radius: 22px;
}

.onboard__view {
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  position: absolute;
  inset: 0;
}

.onboard__grid {
  will-change: transform, opacity;
  position: absolute;
  top: 0;
  left: 0;
}

.onboard__cell {
  width: var(--card);
  height: var(--card);
  border: var(--edge) solid rgba(255, 255, 255, .6); /* same base as the opened card's border in onboarding.js */
  border-radius: var(--round);
  position: absolute;
}

.onboard__cap {
  height: 2.4%;
  background-color: rgba(255, 255, 255, .55);
  border-radius: 1px;
  position: absolute;
  bottom: 11%;
  left: 11%;
  width: 32%;
}

.onboard__cap + .onboard__cap {
  left: auto;
  right: 11%;
  width: 18%;
}

.onboard__pick,
.onboard__finger,
.onboard__pointer {
  pointer-events: none;
  position: absolute;
  top: 0;
  left: 0;
}

.onboard__pick {
  width: var(--box);
  height: var(--box);
  transform-origin: 0 0;
  visibility: hidden;
}

.onboard__panel,
.onboard__big {
  border-radius: var(--round-big);
  position: absolute;
  inset: 0;
}

.onboard__panel {
  background-color: #fff;
  opacity: 0;
}

.onboard__panel i {
  height: 2.6%;
  background-color: rgba(32, 29, 29, .4);
  border-radius: 4px;
  transform-origin: 0 50%;
  transform: scaleX(0);
  position: absolute;
  left: 19%;
}

.onboard__panel i:nth-child(1) {
  top: 36%;
  width: 44%;
  height: 5.6%;
  background-color: #201d1d;
}

.onboard__panel i:nth-child(2) {
  top: 50%;
  width: 64%;
}

.onboard__panel i:nth-child(3) {
  top: 57%;
  width: 56%;
}

.onboard__panel i:nth-child(4) {
  top: 64%;
  width: 34%;
}

/* the card covers the panel's left 13.2% on desktop (tuck in onboarding.js), so the lines start a little further in */
.onboard[data-mode="desktop"] .onboard__panel i {
  left: 22.2%;
}

.onboard[data-mode="touch"] .onboard__panel i {
  left: 15%;
}

/* on the phone the card covers the top 21.5% of the panel (tuck in onboarding.js), so the lines sit lower to stay in
   the middle of the white that shows */
.onboard[data-mode="touch"] .onboard__panel i:nth-child(1) {
  top: 41.8%;
}

.onboard[data-mode="touch"] .onboard__panel i:nth-child(2) {
  top: 55.8%;
}

.onboard[data-mode="touch"] .onboard__panel i:nth-child(3) {
  top: 62.8%;
}

.onboard[data-mode="touch"] .onboard__panel i:nth-child(4) {
  top: 69.8%;
}

.onboard__big {
  border: var(--edge-big) solid rgba(255, 255, 255, .6);
}

.onboard__paint {
  border-radius: inherit;
  clip-path: circle(0 at 50% 50%);
  position: absolute;
  inset: calc(var(--edge-big) * -1);
}

.onboard__finger {
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  background-color: rgba(255, 255, 255, .18);
  border: 1.5px solid #fff;
  border-radius: 50%;
  opacity: 0;
  will-change: transform, opacity;
}

.onboard__pointer {
  opacity: 0;
  will-change: transform;
}

.onboard__glyph {
  overflow: visible;
  position: absolute;
}

/* each glyph is drawn on a 24 grid; sizes and offsets put its hotspot on the pointer */
.onboard__glyph--arrow {
  width: 26px;
  height: 26px;
  transform-origin: 5.42px 2.71px;
  top: -2.71px;
  left: -5.42px;
}

.onboard__glyph--hand {
  width: 30px;
  height: 30px;
  transform-origin: 15px 18.75px;
  top: -18.75px;
  left: -15px;
}

.onboard__fingers {
  transform-origin: 12px 13px;
}

.onboard__fingers rect {
  vector-effect: non-scaling-stroke;
}

.onboard__frame {
  fill: none;
  stroke: #fff;
  overflow: visible;
  pointer-events: none;
  position: absolute;
  top: 0;
  left: 0;
}

.onboard__outline {
  stroke-width: 1.5;
  stroke-opacity: .9;
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
}

.onboard__rule {
  stroke-width: 1.1;
  stroke-opacity: .28;
}

.onboard__dot {
  fill: #fff;
  fill-opacity: .55;
  stroke: none;
}

.onboard__island {
  fill: #fff;
  fill-opacity: .9;
  stroke: none;
}

.onboard__home,
.onboard__keys {
  stroke-linecap: round;
  stroke-opacity: .55;
}

.onboard__home {
  stroke-width: 3;
}

.onboard__keys {
  stroke-width: 2;
}

.onboard__close:focus-visible {
  outline: 1.5px solid #fff;
  outline-offset: 2px;
}

@media (hover: hover) {
  .onboard__close:hover {
    background-color: rgba(255, 255, 255, .22);
  }
}

@media (forced-colors: active) {
  /* High Contrast can turn the page behind light, so the white drawing gets a darker backdrop */
  .onboard__veil {
    background-color: rgba(0, 0, 0, .82);
  }
}

@media (prefers-reduced-motion: reduce) {
  .onboard__card,
  .onboard[data-state="out"] .onboard__card {
    transform: none;
    transition: opacity .3s ease;
  }
}
