/* Styles for blog/scroll-animation */
.container {
  animation: bg-change;
  animation-timeline: scroll();
}

@keyframes bg-change {
  to {
    background-color: light-dark(white, #222);
  }
}
h2 {
  animation: wobble;
  animation-timeline: scroll();
}

@keyframes wobble {
  50% {
    translate: 1em 0;
  }
}
#overflow-notes {
  width: min(550px, 100%);
  border: none;
  padding: 2em;
  border-radius: 1em;
  position-anchor: --ofn-btn;
  position-area: right center;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3333333333);
  opacity: 1;
  transition: 0.5s ease-in-out;
  transition-behavior: allow-discrete;
}
#overflow-notes::backdrop {
  backdrop-filter: blur(5px);
  background-color: rgba(212, 164, 50, 0.333);
}

@starting-stylee {
  #overflow-notes[open] {
    opacity: 0;
  }
}
#overflow-notes[open] {
  opacity: 1;
}

#ofn-btn {
  anchor-name: --ofn-btn;
}

.scrollable {
  height: 200px;
  width: 400px;
  margin: 2em auto;
  overflow: auto;
  scroll-behavior: smooth;
  background-color: rgba(0, 0, 0, 0.2666666667);
  position: relative;
}

.p-bar {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  scale: 0 1;
  transform-origin: left;
  height: 5px;
  background-color: rgb(14, 179, 2);
  animation: progress forwards;
  animation-timeline: scroll();
}

.block {
  position: relative;
  height: 800px;
}

.square {
  position: sticky;
  top: calc(50% - 50px);
  left: calc(50% - 50px);
  width: 100px;
  height: 100px;
  background-color: hsl(282, 83%, 47%);
  animation: change forwards;
  animation-timeline: scroll(y);
}

@keyframes change {
  to {
    background-color: hsl(102, 100%, 23%);
  }
}
@keyframes progress {
  to {
    scale: 1 1;
  }
}