.tooth-pattern-frame {
  position: relative;
  isolation: isolate;
}

.tooth-pattern {
  --mark-color: #116bac;
  --mark-opacity: .26;
  --edge: clamp(7px, 1vw, 14px);
  --side: max(0px, calc((100% - 1240px) / 4));
  --outline: path(evenodd, "M12 4C8.6 1.7 5.8 1.7 3.7 3.8C.8 6.6 1.5 11.2 3.2 15C4.4 17.7 4.7 21 5.8 24.2C6.8 27.2 9.1 27.4 9.9 24.2L11 19.3C11.3 18 12.7 18 13 19.3L14.1 24.2C14.9 27.4 17.2 27.2 18.2 24.2C19.3 21 19.6 17.7 20.8 15C22.5 11.2 23.2 6.6 20.3 3.8C18.2 1.7 15.4 1.7 12 4Z M12 5.8C9 3.6 6.8 3.4 5 5.2C2.8 7.4 3.5 11.5 5 14.8C6.2 17.6 6.5 20.8 7.5 23.7C7.7 24.4 8 24.5 8.2 23.7L9.2 18.9C9.9 15.9 14.1 15.9 14.8 18.9L15.8 23.7C16 24.5 16.3 24.4 16.5 23.7C17.5 20.8 17.8 17.6 19 14.8C20.5 11.5 21.2 7.4 19 5.2C17.2 3.4 15 3.6 12 5.8Z");
  --solid: path("M12 4C8.6 1.7 5.8 1.7 3.7 3.8C.8 6.6 1.5 11.2 3.2 15C4.4 17.7 4.7 21 5.8 24.2C6.8 27.2 9.1 27.4 9.9 24.2L11 19.3C11.3 18 12.7 18 13 19.3L14.1 24.2C14.9 27.4 17.2 27.2 18.2 24.2C19.3 21 19.6 17.7 20.8 15C22.5 11.2 23.2 6.6 20.3 3.8C18.2 1.7 15.4 1.7 12 4Z");
  position: absolute;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.admin-welcome > .tooth-pattern {
  --mark-color: #a9dfeb;
  --mark-opacity: .38;
  --edge: 1px;
  --side: 0px;
}

.tooth-pattern > span {
  position: absolute;
  width: 24px;
  height: 28px;
  opacity: var(--mark-opacity);
  transform: rotate(var(--angle)) scale(var(--size, .72));
  clip-path: var(--outline);
  background: var(--mark-color);
}

.tooth-pattern > :nth-child(4n + 2) {
  clip-path: var(--solid);
  opacity: calc(var(--mark-opacity) * .63);
}

/* Keep the design in the existing padding and the gap between the hero columns. */
.tooth-pattern > :nth-child(-n + 5) { top: var(--edge); }
.tooth-pattern > :nth-child(n + 6):nth-child(-n + 9) { bottom: var(--edge); }
.tooth-pattern > :nth-child(1) { left: 8%; --angle: -17deg; --size: .71; }
.tooth-pattern > :nth-child(2) { left: 25%; --angle: 12deg; --size: .52; }
.tooth-pattern > :nth-child(3) { left: 45%; --angle: -10deg; --size: .62; }
.tooth-pattern > :nth-child(4) { left: 70%; --angle: 17deg; --size: .79; }
.tooth-pattern > :nth-child(5) { left: 91%; --angle: -14deg; --size: .63; }
.tooth-pattern > :nth-child(6) { left: 15%; --angle: 8deg; --size: .6; }
.tooth-pattern > :nth-child(7) { left: 39%; --angle: -14deg; --size: .72; }
.tooth-pattern > :nth-child(8) { left: 63%; --angle: 20deg; --size: .62; }
.tooth-pattern > :nth-child(9) { left: 87%; --angle: -10deg; --size: .8; }
.tooth-pattern > :nth-child(10) { left: var(--side); top: 48%; --angle: -18deg; --size: .58; }
.tooth-pattern > :nth-child(11) { right: var(--side); top: 29%; --angle: 13deg; --size: .66; }
.tooth-pattern > :nth-child(12) { left: 46.8%; bottom: 27%; --angle: 12deg; --size: .58; }
.admin-welcome > .tooth-pattern > :last-child { display: none; }

@media (max-width: 900px) {
  .hero > .tooth-pattern > :last-child { display: none; }
}

@media (max-width: 520px) {
  .tooth-pattern { --edge: -3px; }
  .admin-welcome > .tooth-pattern { --edge: -4px; }
  .tooth-pattern > :nth-child(5) { left: 87%; }
  .tooth-pattern > :nth-child(10) { left: -5px; }
  .tooth-pattern > :nth-child(11) { right: -5px; }
}

@media (prefers-reduced-motion: no-preference) {
  @keyframes tooth-pattern-settle {
    from { translate: 0 -5px; scale: .88; }
    to { translate: 0 0; scale: 1; }
  }

  .tooth-pattern > span {
    animation: tooth-pattern-settle 2.4s cubic-bezier(.22, .72, .25, 1) backwards;
  }

  .tooth-pattern > :nth-child(3n + 2) { animation-delay: 120ms; }
  .tooth-pattern > :nth-child(3n + 3) { animation-delay: 220ms; }
}
