/* "Too many tabs" sticker: a stack of pixel error windows with a die-cut white edge.
   Click the X and the front window closes; close them all and you get a moment of peace. */
.tabs-sticker {
  --ink: #2d2a3e;
  position: absolute;
  left: 600px;
  top: 140px; /* top-left of the board, off the first screen */
  width: 290px;
  height: 252px;
  z-index: 2;
  transform: rotate(-4deg);
  /* the white sticker edge follows the shape of the windows, then a soft shadow */
  filter: drop-shadow(5px 0 0 #fff) drop-shadow(-5px 0 0 #fff) drop-shadow(0 5px 0 #fff) drop-shadow(0 -5px 0 #fff)
    drop-shadow(0 9px 14px rgba(28, 27, 25, 0.2));
  user-select: none;
  -webkit-user-select: none;
  transition: transform 260ms cubic-bezier(0.22, 1.2, 0.4, 1);
}

@media (hover: hover) and (pointer: fine) {
  .tabs-sticker:hover {
    transform: rotate(-2deg) scale(1.03);
  }
}

.tabs-win {
  position: absolute;
  left: calc(var(--i, 0) * 14px);
  top: calc(60px - var(--i, 0) * 11px);
  z-index: calc(20 - var(--i, 0));
  width: 200px;
  height: 190px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #dfe6f8 0%, #f4f6fd 100%);
  border: 3px solid var(--ink);
  font-family: "Pixelify Sans", "Press Start 2P", "Courier New", monospace;
  color: var(--ink);
  transition: left 240ms ease, top 240ms ease, opacity 240ms ease, transform 240ms ease;
}

.tabs-win[hidden] {
  display: none;
}

.tabs-win[data-front] {
  background: #fbfcff;
}

.tabs-win__bar {
  flex: none;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  height: 28px;
  padding-left: 8px;
  border-bottom: 3px solid var(--ink);
  background: #e6ebfa;
}

.tabs-win__title {
  align-self: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: none;
}

.tabs-win__x {
  position: relative;
  flex: none;
  width: 28px;
  padding: 0;
  border: 0;
  border-left: 3px solid var(--ink);
  background: transparent;
  cursor: pointer;
}

.tabs-win__x::before,
.tabs-win__x::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 15px;
  height: 2.5px;
  margin: -1.25px 0 0 -7.5px;
  background: var(--ink);
  transform: rotate(45deg);
}

.tabs-win__x::after {
  transform: rotate(-45deg);
}

.tabs-win__x:hover {
  background: #d5dcf3;
}

.tabs-win:not([data-front]) .tabs-win__x {
  pointer-events: none;
}

.tabs-win__body {
  flex: 1;
  margin: 0;
  padding: 8px 10px 0;
  font-size: 31px;
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.01em;
  overflow: hidden;
}

.tabs-win.is-closing {
  opacity: 0;
  transform: translate(-10px, 16px) rotate(-7deg) scale(0.82);
  pointer-events: none;
}

/* the moment of peace, once every window is closed */
.tabs-peace {
  --i: 0;
  background: #fbfcff;
  animation: tabs-pop 360ms cubic-bezier(0.22, 1.4, 0.4, 1);
}

.tabs-peace .tabs-win__body {
  font-size: 27px;
}

@keyframes tabs-pop {
  0% { opacity: 0; transform: scale(0.8) rotate(4deg); }
  100% { opacity: 1; transform: none; }
}

@media (hover: hover) and (pointer: fine) {
  /* the board hides the native cursor: over the close button a hand is used instead */
  body.home.has-figma-cursors .board-viewport .board .tabs-sticker .tabs-win__x {
    cursor: pointer;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tabs-sticker,
  .tabs-win {
    transition: none;
  }

  .tabs-peace {
    animation: none;
  }
}
